mirror of
https://github.com/laramies/theHarvester.git
synced 2025-02-24 14:32:57 +08:00
WIP pentest-tools module
This commit is contained in:
parent
5f816485ef
commit
f8dd0dcb4c
5 changed files with 52 additions and 1 deletions
|
@ -11,6 +11,9 @@ apikeys:
|
|||
intelx:
|
||||
key: 9df61df0-84f7-4dc7-b34c-8ccfb8646ace
|
||||
|
||||
pentestTools:
|
||||
key:
|
||||
|
||||
securityTrails:
|
||||
key:
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ async def start():
|
|||
parser.add_argument('-b', '--source', help='''baidu, bing, bingapi, bufferoverun, certspotter, crtsh, dnsdumpster,
|
||||
dogpile, duckduckgo, exalead, github-code, google,
|
||||
hunter, intelx,
|
||||
linkedin, linkedin_links, netcraft, otx, securityTrails, spyse, threatcrowd,
|
||||
linkedin, linkedin_links, netcraft, otx, pentesttools, securityTrails, spyse, threatcrowd,
|
||||
trello, twitter, vhost, virustotal, yahoo, all''')
|
||||
|
||||
args = parser.parse_args()
|
||||
|
@ -295,6 +295,14 @@ async def store(search_engine: Any, source: str, process_param: Any = None, stor
|
|||
except Exception as e:
|
||||
print(e)
|
||||
|
||||
elif engineitem == 'pentesttools':
|
||||
from theHarvester.discovery import pentesttoolssearch
|
||||
try:
|
||||
pentestools_search = pentestools_search.SearchPentestTools(word)
|
||||
stor_lst.append(store(pentestools_search, engineitem, store_host=True))
|
||||
except Exception as e:
|
||||
print(e)
|
||||
|
||||
elif engineitem == 'securityTrails':
|
||||
from theHarvester.discovery import securitytrailssearch
|
||||
try:
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
'linkedinsearch',
|
||||
'netcraft',
|
||||
'otxsearch',
|
||||
'pentesttools',
|
||||
'securitytrailssearch',
|
||||
'shodansearch',
|
||||
'spyse',
|
||||
|
|
27
theHarvester/discovery/pentesttools.py
Normal file
27
theHarvester/discovery/pentesttools.py
Normal file
|
@ -0,0 +1,27 @@
|
|||
from theHarvester.discovery.constants import *
|
||||
from theHarvester.lib.core import *
|
||||
|
||||
|
||||
class SearchPentestTools:
|
||||
|
||||
def __init__(self, word):
|
||||
self.word = word
|
||||
self.key = Core.pentest_tools_key()
|
||||
if self.key is None:
|
||||
raise MissingKey(True)
|
||||
self.total_results = ""
|
||||
self.api = f'https://pentest-tools.com/api?key={self.key}'
|
||||
self.proxy = False
|
||||
|
||||
async def do_search(self):
|
||||
url = f'https://dns.bufferover.run/dns?q={self.word}'
|
||||
responses = await AsyncFetcher.fetch_all(urls=[url],, json=True, proxy=self.proxy)
|
||||
responses = responses[0]
|
||||
dct = responses
|
||||
|
||||
|
||||
|
||||
async def process(self, proxy=False):
|
||||
self.proxy = proxy
|
||||
await self.do_search() # Only need to do it once.
|
||||
|
|
@ -56,6 +56,17 @@ def intelx_key() -> str:
|
|||
return keys['apikeys']['intelx']['key']
|
||||
return keys['apikeys']['intelx']['key']
|
||||
|
||||
@staticmethod
|
||||
def pentest_tools_key() -> str:
|
||||
try:
|
||||
with open('/etc/theHarvester/api-keys.yaml', 'r') as api_keys:
|
||||
keys = yaml.safe_load(api_keys)
|
||||
except FileNotFoundError:
|
||||
with open('api-keys.yaml', 'r') as api_keys:
|
||||
keys = yaml.safe_load(api_keys)
|
||||
return keys['apikeys']['pentestTools']['key']
|
||||
return keys['apikeys']['pentestTools']['key']
|
||||
|
||||
@staticmethod
|
||||
def security_trails_key() -> str:
|
||||
try:
|
||||
|
@ -138,6 +149,7 @@ def get_supportedengines() -> Set[Union[str, Any]]:
|
|||
'linkedin_links',
|
||||
'netcraft',
|
||||
'otx',
|
||||
'pentesttools',
|
||||
'securityTrails',
|
||||
'suip',
|
||||
'spyse',
|
||||
|
|
Loading…
Reference in a new issue