WIP: Adding github-code search

This commit is contained in:
Cameron Ruatta
2019-06-09 10:05:26 -07:00
parent 165d691847
commit 006cb148c2
3 changed files with 25 additions and 2 deletions
+4 -1
View File
@@ -12,4 +12,7 @@ apikeys:
key:
shodan:
key: oCiMsgM6rQWqiTvPxFHYcExlZgg7wvTt
key: oCiMsgM6rQWqiTvPxFHYcExlZgg7wvTt
github:
key: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+14 -1
View File
@@ -54,7 +54,7 @@ def start():
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='''baidu, bing, bingapi, censys, crtsh, cymon, dnsdumpster,
dogpile, duckduckgo, google,
dogpile, duckduckgo, github-code, google,
google-certificates, hunter, intelx,
linkedin, netcraft, securityTrails, threatcrowd,
trello, twitter, vhost, virustotal, yahoo, all''')
@@ -204,6 +204,19 @@ def start():
db.store_all(word, all_hosts, 'email', 'duckduckgo')
db.store_all(word, all_hosts, 'host', 'duckduckgo')
elif engineitem == 'github-code':
print('\033[94m[*] Searching Github (code). \033[0m')
from theHarvester.discovery import githubcode
search = githubcode.SearchGithubCode(word, limit)
search.process()
emails = filter(search.get_emails())
all_emails.extend(emails)
hosts = filter(search.get_hostnames())
all_hosts.extend(hosts)
db = stash.stash_manager()
db.store_all(word, all_hosts, 'host', 'github-code')
db.store_all(word, all_emails, 'email', 'github-code')
elif engineitem == 'google':
print('\033[94m[*] Searching Google. \033[0m')
search = googlesearch.search_google(word, limit, start)
+7
View File
@@ -15,6 +15,12 @@ class Core:
keys = yaml.safe_load(api_keys)
return keys['apikeys']['bing']['key']
@staticmethod
def github_key():
with open('api-keys.yaml', 'r') as api_keys:
keys = yaml.safe_load(api_keys)
return keys['apikeys']['github']['key']
@staticmethod
def hunter_key():
with open('api-keys.yaml', 'r') as api_keys:
@@ -66,6 +72,7 @@ class Core:
'dnsdumpster',
'dogpile',
'duckduckgo',
'github-code',
'google',
'google-certificates',
'hunter',