mirror of
https://github.com/laramies/theHarvester.git
synced 2025-02-25 06:53:05 +08:00
WIP for the restAPI
This commit is contained in:
parent
76ba71a208
commit
acd4ed8f7c
5 changed files with 43 additions and 0 deletions
2
Pipfile
2
Pipfile
|
@ -9,6 +9,7 @@ aiohttp = "==3.6.2"
|
|||
aiosqlite = "==0.13.0"
|
||||
beautifulsoup4 = "==4.9.1"
|
||||
dnspython = "==1.16.0"
|
||||
fastapi = "==0.55.1"
|
||||
netaddr = "==0.7.19"
|
||||
plotly = "==4.8.1"
|
||||
PyYAML = "==5.3.1"
|
||||
|
@ -17,6 +18,7 @@ retrying = "==1.3.3"
|
|||
shodan = "==1.23.0"
|
||||
texttable = "==1.6.2"
|
||||
lxml = "==4.5.1"
|
||||
uvicorn = "==0.11.5"
|
||||
uvloop = "==0.14.0"
|
||||
certifi = "==2020.4.5.1"
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@ aiohttp==3.6.2
|
|||
aiosqlite==0.13.0
|
||||
beautifulsoup4==4.9.1
|
||||
dnspython==1.16.0
|
||||
fastapi==0.55.1
|
||||
netaddr==0.7.19
|
||||
plotly==4.8.1
|
||||
PyYAML==5.3.1
|
||||
|
@ -11,5 +12,6 @@ retrying==1.3.3
|
|||
shodan==1.23.0
|
||||
texttable==1.6.2
|
||||
lxml==4.5.1
|
||||
uvicorn==0.11.5
|
||||
uvloop==0.14.0
|
||||
certifi==2020.4.5.1
|
6
restfulHarvest.py
Executable file
6
restfulHarvest.py
Executable file
|
@ -0,0 +1,6 @@
|
|||
#!/usr/bin/python3
|
||||
|
||||
import uvicorn
|
||||
from theHarvester.lib.web import api
|
||||
|
||||
uvicorn.run(app=api.app)
|
0
theHarvester/lib/web/__init__.py
Normal file
0
theHarvester/lib/web/__init__.py
Normal file
33
theHarvester/lib/web/api.py
Normal file
33
theHarvester/lib/web/api.py
Normal file
|
@ -0,0 +1,33 @@
|
|||
from fastapi import FastAPI
|
||||
from argparse import Namespace
|
||||
from theHarvester import __main__
|
||||
app = FastAPI()
|
||||
|
||||
|
||||
@app.get("/")
|
||||
async def read_root():
|
||||
return {"Hello": "World"}
|
||||
|
||||
|
||||
@app.get("/test")
|
||||
async def read_item():
|
||||
try:
|
||||
emails, ips, urls = await __main__.start(Namespace(dns_brute=False,
|
||||
dns_lookup=False,
|
||||
dns_server=None,
|
||||
dns_tld=False,
|
||||
domain='yale.edu',
|
||||
filename='',
|
||||
google_dork=False,
|
||||
limit=250,
|
||||
proxies=False,
|
||||
shodan=False,
|
||||
source='bing,intelx',
|
||||
start=0,
|
||||
take_over=False,
|
||||
virtual_host=False))
|
||||
return {'emails': emails, 'ips': ips, 'urls': urls}
|
||||
except Exception as e:
|
||||
return {'exception': f'{e}'}
|
||||
if __name__ == '__main__':
|
||||
print(__name__)
|
Loading…
Reference in a new issue