mirror of
https://github.com/laramies/theHarvester.git
synced 2024-11-10 09:02:37 +08:00
API key fix plus a few other fixes
This commit is contained in:
parent
807ceb4bad
commit
a6b215e40a
4 changed files with 71 additions and 39 deletions
23
.travis.yml
23
.travis.yml
|
@ -2,29 +2,26 @@ dist: bionic
|
|||
language: python
|
||||
cache: pip
|
||||
matrix:
|
||||
include:
|
||||
- python: '3.7'
|
||||
env: TEST_SUITE=suite_3_7
|
||||
- python: '3.8'
|
||||
env: TEST_SUITE=suite_3_8
|
||||
# - python: '3.9-dev'
|
||||
# env: TEST_SUITE=suite_3_9_dev
|
||||
include:
|
||||
- python: '3.7'
|
||||
env: TEST_SUITE=suite_3_7
|
||||
- python: '3.8'
|
||||
env: TEST_SUITE=suite_3_8
|
||||
before_install:
|
||||
- pip install pipenv
|
||||
- pipenv install --dev
|
||||
- pip install pipenv
|
||||
- pipenv install --dev
|
||||
install:
|
||||
- python setup.py test
|
||||
script:
|
||||
- python theHarvester.py -d metasploit.com -b baidu,bing,certspotter,crtsh,dnsdumpster,dogpile,duckduckgo,exalead,linkedin,netcraft,otx,intelx,threatcrowd,trello,twitter,virustotal,yahoo -l 200
|
||||
- python theHarvester.py -d metasploit.com -b baidu,bing,certspotter,crtsh,dnsdumpster,dogpile,duckduckgo,exalead,linkedin,netcraft,otx,intelx,threatcrowd,trello,twitter,virustotal,yahoo
|
||||
-l 200
|
||||
- pytest
|
||||
- flake8 . --count --show-source --statistics
|
||||
- mypy --pretty theHarvester/discovery/*.py
|
||||
|
||||
notifications:
|
||||
email: false
|
||||
slack:
|
||||
rooms:
|
||||
secure: "CAdDTjl1+X4Yc6hEw2um/KFjKkwhkIMQUAZXEa0KJGQtNORIE48eQw8spOvvWZCd8Ft4Z3leDDXIy0iGqU40H6zVTd01bxRxJwrZLxbpwdZvzXdlWBNf75JsqpXA3evrHfchAsQvYWxtcC0QU5baUnsq2oz5z9v3/920HNBOgtA2YPY0chWedl6JjIidmHBDkPxqKcaR9f9i7kC7BBVYjUm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ApXacsl6WBAndLdYF+MyHJMLgzewdAJ4y4qvVMb/VkTJ8Q6PicjwlqyEP5PRLZk7fech4kuTVUqyuTibd5t8D5k=
|
||||
on_success: always
|
||||
on_failure: always
|
||||
template:
|
||||
|
|
5
setup.py
5
setup.py
|
@ -28,12 +28,13 @@
|
|||
"Operating System :: OS Independent",
|
||||
],
|
||||
data_files=[
|
||||
('share/dict/theHarvester', [
|
||||
('/etc/theHarvester', [
|
||||
'wordlists/general/common.txt',
|
||||
'wordlists/dns-big.txt',
|
||||
'wordlists/dns-names.txt',
|
||||
'wordlists/dorks.txt',
|
||||
'wordlists/names_small.txt'
|
||||
'wordlists/names_small.txt',
|
||||
'api-keys.yaml'
|
||||
]
|
||||
)
|
||||
],
|
||||
|
|
|
@ -3,9 +3,8 @@
|
|||
# Note: This script runs theHarvester
|
||||
from platform import python_version
|
||||
import sys
|
||||
if python_version()[0:3] < '3.6':
|
||||
print('\033[93m[!] Make sure you have Python 3.6+ installed, quitting.\n\n \033[0m')
|
||||
if python_version()[0:3] < '3.7':
|
||||
print('\033[93m[!] Make sure you have Python 3.7+ installed, quitting.\n\n \033[0m')
|
||||
sys.exit(1)
|
||||
|
||||
from theHarvester import __main__
|
||||
__main__.entry_point()
|
||||
|
|
|
@ -8,49 +8,84 @@
|
|||
class Core:
|
||||
@staticmethod
|
||||
def version() -> str:
|
||||
return '3.1.1-dev2'
|
||||
return '3.1.1-dev3'
|
||||
|
||||
@staticmethod
|
||||
def bing_key() -> str:
|
||||
with open('api-keys.yaml', 'r') as api_keys:
|
||||
keys = yaml.safe_load(api_keys)
|
||||
return keys['apikeys']['bing']['key']
|
||||
try:
|
||||
with open('api-keys.yaml', 'r') as api_keys:
|
||||
keys = yaml.safe_load(api_keys)
|
||||
except FileNotFoundError:
|
||||
with open('/etc/theHarvester/api-keys.yaml', 'r') as api_keys:
|
||||
keys = yaml.safe_load(api_keys)
|
||||
return keys['apikeys']['bing']['key']
|
||||
return keys['apikeys']['bing']['key']
|
||||
|
||||
@staticmethod
|
||||
def github_key() -> str:
|
||||
with open('api-keys.yaml', 'r') as api_keys:
|
||||
keys = yaml.safe_load(api_keys)
|
||||
return keys['apikeys']['github']['key']
|
||||
try:
|
||||
with open('api-keys.yaml', 'r') as api_keys:
|
||||
keys = yaml.safe_load(api_keys)
|
||||
except FileNotFoundError:
|
||||
with open('/etc/theHarvester/api-keys.yaml', 'r') as api_keys:
|
||||
keys = yaml.safe_load(api_keys)
|
||||
return keys['apikeys']['github']['key']
|
||||
return keys['apikeys']['github']['key']
|
||||
|
||||
@staticmethod
|
||||
def hunter_key() -> str:
|
||||
with open('api-keys.yaml', 'r') as api_keys:
|
||||
keys = yaml.safe_load(api_keys)
|
||||
try:
|
||||
with open('api-keys.yaml', 'r') as api_keys:
|
||||
keys = yaml.safe_load(api_keys)
|
||||
except FileNotFoundError:
|
||||
with open('/etc/theHarvester/api-keys.yaml', 'r') as api_keys:
|
||||
keys = yaml.safe_load(api_keys)
|
||||
return keys['apikeys']['hunter']['key']
|
||||
return keys['apikeys']['hunter']['key']
|
||||
|
||||
@staticmethod
|
||||
def intelx_key() -> str:
|
||||
with open('api-keys.yaml', 'r') as api_keys:
|
||||
keys = yaml.safe_load(api_keys)
|
||||
return keys['apikeys']['intelx']['key']
|
||||
try:
|
||||
with open('api-keys.yaml', 'r') as api_keys:
|
||||
keys = yaml.safe_load(api_keys)
|
||||
except FileNotFoundError:
|
||||
with open('/etc/theHarvester/api-keys.yaml', 'r') as api_keys:
|
||||
keys = yaml.safe_load(api_keys)
|
||||
return keys['apikeys']['intelx']['key']
|
||||
return keys['apikeys']['intelx']['key']
|
||||
|
||||
@staticmethod
|
||||
def security_trails_key() -> str:
|
||||
with open('api-keys.yaml', 'r') as api_keys:
|
||||
keys = yaml.safe_load(api_keys)
|
||||
return keys['apikeys']['securityTrails']['key']
|
||||
try:
|
||||
with open('api-keys.yaml', 'r') as api_keys:
|
||||
keys = yaml.safe_load(api_keys)
|
||||
except FileNotFoundError:
|
||||
with open('/etc/theHarvester/api-keys.yaml', 'r') as api_keys:
|
||||
keys = yaml.safe_load(api_keys)
|
||||
return keys['apikeys']['securityTrails']['key']
|
||||
return keys['apikeys']['securityTrails']['key']
|
||||
|
||||
@staticmethod
|
||||
def shodan_key() -> str:
|
||||
with open('api-keys.yaml', 'r') as api_keys:
|
||||
keys = yaml.safe_load(api_keys)
|
||||
return keys['apikeys']['shodan']['key']
|
||||
try:
|
||||
with open('api-keys.yaml', 'r') as api_keys:
|
||||
keys = yaml.safe_load(api_keys)
|
||||
except FileNotFoundError:
|
||||
with open('/etc/theHarvester/api-keys.yaml', 'r') as api_keys:
|
||||
keys = yaml.safe_load(api_keys)
|
||||
return keys['apikeys']['shodan']['key']
|
||||
return keys['apikeys']['shodan']['key']
|
||||
|
||||
@staticmethod
|
||||
def spyse_key() -> str:
|
||||
with open('api-keys.yaml', 'r') as api_keys:
|
||||
keys = yaml.safe_load(api_keys)
|
||||
return keys['apikeys']['spyse']['key']
|
||||
try:
|
||||
with open('api-keys.yaml', 'r') as api_keys:
|
||||
keys = yaml.safe_load(api_keys)
|
||||
except FileNotFoundError:
|
||||
with open('/etc/theHarvester/api-keys.yaml', 'r') as api_keys:
|
||||
keys = yaml.safe_load(api_keys)
|
||||
return keys['apikeys']['spyse']['key']
|
||||
return keys['apikeys']['spyse']['key']
|
||||
|
||||
@staticmethod
|
||||
def banner() -> None:
|
||||
|
|
Loading…
Reference in a new issue