WIP for the restAPI

This commit is contained in:
L1ghtn1ng 2020-06-02 01:28:35 +01:00
parent 76ba71a208
commit acd4ed8f7c
5 changed files with 43 additions and 0 deletions

View file

@ -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"

View file

@ -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
View file

@ -0,0 +1,6 @@
#!/usr/bin/python3
import uvicorn
from theHarvester.lib.web import api
uvicorn.run(app=api.app)

View file

View 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__)