コード例 #1
0
def hackertarget(target):
    ''' Find subdomains from hackertarget api '''
    try:
        result = http_get(
            f"https://api.hackertarget.com/hostsearch/?q={target}")
        return result.text
    except:
        return 0
コード例 #2
0
 def check_header():
     ''' check for X-Frame-Option '''
     proto = "http://"
     ''' Checking if X-Frame-Options is missing '''
     headers = http_get(str(proto + target)).headers
     if 'X-Frame-Options' not in headers:
         return 1
     else:
         return 0
コード例 #3
0
ファイル: pwned.py プロジェクト: lychhayly/PyExploit
def pwned(domain):
    ''' Checking whether domain is pwned
    using have i been pwned; api '''
    try:
        data = http_get(
            f"https://haveibeenpwned.com/api/breaches?domain={domain}").text
        return data
    except:
        return 0
コード例 #4
0
ファイル: geoip.py プロジェクト: lychhayly/PyExploit
def geoip(ip_address):
    ''' IP to Geographic Location with HackerTarget api '''
    try:
        ip_address = gethostbyname(ip_address)
        data = http_get(
            f"https://api.hackertarget.com/geoip/?q={ip_address}").text
        return data
    except gaierror:
        return 0
コード例 #5
0
def whois(target):
    ''' doing whois query '''
    try:
        data = http_get(f"https://api.hackertarget.com/whois/?q={target}")
        if data == 0:
            return 0
        else:
            return str(data.text)
    except:
        return 0