Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BeVigil Source Added #1180

Merged
merged 4 commits into from
Aug 13, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ dist/
theHarvester.egg-info
api-keys.yaml
.DS_Store
.venv
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ Passive:
--------
* anubis: Anubis-DB - https://github.com/jonluca/anubis

* bevigil: CloudSEK BeVigil scans mobile application for OSINT assets and makes them available through an API - https://bevigil.com/osint-api

* baidu: Baidu search engine - www.baidu.com

* binaryedge: List of known subdomains from www.binaryedge.io
Expand Down Expand Up @@ -90,6 +92,7 @@ Modules that require an API key:
--------------------------------
Documentation to setup API keys can be found at - https://github.com/laramies/theHarvester/wiki/Installation#api-keys

* bevigil - Free upto 50 queries. Pricing can be found here: https://bevigil.com/pricing/osint
* binaryedge - $10/month
* bing
* censys - API keys are required and can be retrieved from your [Censys account](https://search.censys.io/account/api).
Expand Down
3 changes: 3 additions & 0 deletions api-keys.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
apikeys:
bevigil:
key: Mt5RxVGu7GDzqwB1

binaryedge:
key:

Expand Down
10 changes: 9 additions & 1 deletion theHarvester/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ async def start(rest_args=None):
parser.add_argument('-n', '--dns-lookup', help='Enable DNS server lookup, default False.', default=False, action='store_true')
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 XML and JSON file.', default='', type=str)
parser.add_argument('-b', '--source', help='''anubis, baidu, binaryedge, bing, bingapi, bufferoverun, censys, certspotter, crtsh,
parser.add_argument('-b', '--source', help='''anubis, baidu, bevigil, binaryedge, bing, bingapi, bufferoverun, censys, certspotter, crtsh,
dnsdumpster, duckduckgo, fullhunt, github-code, hackertarget, hunter, intelx,
omnisint, otx, pentesttools, projectdiscovery,
qwant, rapiddns, rocketreach, securityTrails, sublist3r, threatcrowd, threatminer,
Expand Down Expand Up @@ -197,6 +197,14 @@ async def store(search_engine: Any, source: str, process_param: Any = None, stor
except Exception as e:
print(e)

elif engineitem == 'bevigil':
from theHarvester.discovery import bevigil
try:
bevigil_search = bevigil.SearchBeVigil(word)
stor_lst.append(store(bevigil_search, engineitem, store_host=True, store_interestingurls=True))
except Exception as e:
print(e)

elif engineitem == 'binaryedge':
from theHarvester.discovery import binaryedgesearch
try:
Expand Down
37 changes: 37 additions & 0 deletions theHarvester/discovery/bevigil.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
from theHarvester.lib.core import *

class SearchBeVigil:

def __init__(self, word):
self.word = word
self.totalhosts = set()
self.interestingurls = set()
self.key = Core.bevigil_key()
self.proxy = False

async def do_search(self):
subdomainEndpoint = f"https://osint.bevigil.com/api/{self.word}/subdomains/"
urlEndpoint = f"https://osint.bevigil.com/api/{self.word}/urls/"
headers = {
'X-Access-Token': self.key
}
alt-glitch marked this conversation as resolved.
Show resolved Hide resolved

responses = await AsyncFetcher.fetch_all([subdomainEndpoint], json=True, proxy=self.proxy, headers=headers)
response = responses[0]
for subdomain in response["subdomains"]:
self.totalhosts.add(subdomain)

responses = await AsyncFetcher.fetch_all([urlEndpoint], json=True, proxy=self.proxy, headers=headers)
response = responses[0]
for url in response["urls"]:
self.interestingurls.add(url)

async def get_hostnames(self) -> set:
return self.totalhosts

async def get_interestingurls(self) -> set:
return self.interestingurls

async def process(self, proxy=False):
self.proxy = proxy
await self.do_search()
alt-glitch marked this conversation as resolved.
Show resolved Hide resolved
5 changes: 5 additions & 0 deletions theHarvester/lib/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ def api_keys() -> dict:
keys = yaml.safe_load(api_keys)
return keys['apikeys']

@staticmethod
def bevigil_key() -> str:
return Core.api_keys()['bevigil']['key']

@staticmethod
def binaryedge_key() -> str:
return Core.api_keys()['binaryedge']['key']
Expand Down Expand Up @@ -120,6 +124,7 @@ def banner() -> None:
def get_supportedengines() -> list[str | Any]:
supportedengines = ['anubis',
'baidu',
'bevigil',
'binaryedge',
'bing',
'bingapi',
Expand Down