diff --git a/tests/discovery/githubcode.py b/tests/discovery/githubcode.py index df8b6d28..248e3038 100644 --- a/tests/discovery/githubcode.py +++ b/tests/discovery/githubcode.py @@ -1,5 +1,4 @@ from theHarvester.discovery import githubcode -from theHarvester.discovery.githubcode import RetryResult, ErrorResult, SuccessResult from theHarvester.discovery.constants import MissingKey from theHarvester.lib.core import Core from unittest.mock import MagicMock diff --git a/theHarvester/discovery/bufferoverun.py b/theHarvester/discovery/bufferoverun.py index d2e07d6d..90068b95 100644 --- a/theHarvester/discovery/bufferoverun.py +++ b/theHarvester/discovery/bufferoverun.py @@ -16,11 +16,13 @@ async def do_search(self): dct = responses self.totalhosts: set = { - host.split(',')[0].replace('www','') if ',' in host and self.word.replace('www.', '') in host.split(',')[0] in host else + host.split(',')[0].replace('www', '') if ',' in host and self.word.replace('www.', '') in host.split(',')[ + 0] in host else host.split(',')[1] for host in dct['FDNS_A']} - self.totalips: set = {ip.split(',')[0]for ip in dct['FDNS_A'] if + self.totalips: set = {ip.split(',')[0] for ip in dct['FDNS_A'] if re.match(r"^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$", ip.split(',')[0])} + async def get_hostnames(self) -> set: return self.totalhosts diff --git a/theHarvester/discovery/certspottersearch.py b/theHarvester/discovery/certspottersearch.py index 70cc9385..1aa49a5a 100644 --- a/theHarvester/discovery/certspottersearch.py +++ b/theHarvester/discovery/certspottersearch.py @@ -35,3 +35,13 @@ async def process(self, proxy=False): self.proxy = proxy await self.do_search() print('\tSearching results.') + +async def main(): + x = SearchCertspoter(word='arrow.com') + await x.do_search() + hosts = await x.get_hostnames() + print(hosts) + +if __name__ == '__main__': + import asyncio + asyncio.run(main()) \ No newline at end of file diff --git a/theHarvester/discovery/crtsh.py b/theHarvester/discovery/crtsh.py index 71700276..671e9f94 100644 --- a/theHarvester/discovery/crtsh.py +++ b/theHarvester/discovery/crtsh.py @@ -1,5 +1,6 @@ from theHarvester.lib.core import * import aiohttp +from typing import Set class SearchCrtsh: