diff --git a/api-keys.yaml b/api-keys.yaml index 739d0f95..810ac2ee 100644 --- a/api-keys.yaml +++ b/api-keys.yaml @@ -11,6 +11,9 @@ apikeys: intelx: key: 9df61df0-84f7-4dc7-b34c-8ccfb8646ace + pentestTools: + key: + securityTrails: key: diff --git a/theHarvester/__main__.py b/theHarvester/__main__.py index 7867fe54..36ee641a 100644 --- a/theHarvester/__main__.py +++ b/theHarvester/__main__.py @@ -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: diff --git a/theHarvester/discovery/__init__.py b/theHarvester/discovery/__init__.py index 539ab694..5240b2c1 100644 --- a/theHarvester/discovery/__init__.py +++ b/theHarvester/discovery/__init__.py @@ -14,6 +14,7 @@ 'linkedinsearch', 'netcraft', 'otxsearch', + 'pentesttools', 'securitytrailssearch', 'shodansearch', 'spyse', diff --git a/theHarvester/discovery/pentesttools.py b/theHarvester/discovery/pentesttools.py new file mode 100644 index 00000000..d5cf2f51 --- /dev/null +++ b/theHarvester/discovery/pentesttools.py @@ -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. + diff --git a/theHarvester/lib/core.py b/theHarvester/lib/core.py index 5d8fbc1e..b025e3ac 100644 --- a/theHarvester/lib/core.py +++ b/theHarvester/lib/core.py @@ -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',