Fix formating and add vhost as an engine

This commit is contained in:
L1ghtn1ng 2019-01-26 23:53:02 +00:00
parent 5fe84db11f
commit 578630d9fb

View file

@ -32,28 +32,18 @@
def start():
parser = argparse.ArgumentParser(
description='theHarvester is a open source intelligence gathering tool(OSINT) that is used for recon')
parser = argparse.ArgumentParser(description='theHarvester is a open source intelligence gathering tool(OSINT) that is used for recon')
parser.add_argument('-d', '--domain', help='company name or domain to search', required=True)
parser.add_argument('-l', '--limit', help='limit the number of search results, default=500', default=500, type=int)
parser.add_argument('-S', '--start', help='start with result number X, default=0', default=0, type=int)
parser.add_argument('-g', '--google-dork', help='use Google Dorks for google search', default=False,
action='store_true')
parser.add_argument('-p', '--port-scan',
help='scan the detected hosts and check for Takeovers (21,22,80,443,8080) default=False, params=True',
default=False)
# parser.add_argument('-s', '--shodan', help='use Shodan to query discovered hosts, default=False, params=True', default=False, type=bool)
parser.add_argument('-s', '--shodan', help='use Shodan to query discovered hosts', default=False,
action='store_true')
parser.add_argument('-v', '--virtual-host',
help='verify host name via DNS resolution and search for virtual hosts params=basic, default=False',
default=False)
parser.add_argument('-g', '--google-dork', help='use Google Dorks for google search', default=False, action='store_true')
parser.add_argument('-p', '--port-scan', help='scan the detected hosts and check for Takeovers (21,22,80,443,8080) default=False, params=True', default=False)
parser.add_argument('-s', '--shodan', help='use Shodan to query discovered hosts', default=False, action='store_true')
parser.add_argument('-v', '--virtual-host', help='verify host name via DNS resolution and search for virtual hosts params=basic, default=False', default=False)
parser.add_argument('-e', '--dns-server', help='DNS server to use for lookup')
parser.add_argument('-t', '--dns-tld', help='perform a DNS TLD expansion discovery, default False', default=False)
parser.add_argument('-n', '--dns-lookup', help='enable DNS server lookup, default=False, params=True',
default=False)
parser.add_argument('-c', '--dns-brute', help='perform a DNS brute force on the domain', default=False,
action='store_true')
parser.add_argument('-n', '--dns-lookup', help='enable DNS server lookup, default=False, params=True', default=False)
parser.add_argument('-c', '--dns-brute', help='perform a DNS brute force on the domain', default=False, action='store_true')
parser.add_argument('-f', '--filename', help='save the results to an HTML and/or XML file', default='', type=str)
parser.add_argument('-b', '--source', help='''source: baidu, bing, bingapi, censys, crtsh, cymon, dogpile,
google, googleCSE, google-certificates, google-profiles,
@ -368,9 +358,22 @@ def start():
print('---------------------')
for user in sorted(list(set(people))):
print(user)
sys.exit(0)
# vhost
elif engineitem == 'vhost':
print('\n[*] Virtual hosts:')
print('------------------')
for l in host_ip:
search = bingsearch.SearchBing(l, limit, start)
search.process_vhost()
res = search.get_allhostnames()
for x in res:
x = re.sub(r'[[\<\/?]*[\w]*>]*', '', x)
x = re.sub('<', '', x)
x = re.sub('>', '', x)
print((l + '\t' + x))
vhost.append(l + ':' + x)
full.append(l + ':' + x)
vhost = sorted(set(vhost))
elif engineitem == 'virustotal':
print('\033[94m[*] Searching VirusTotal. \033[0m')