Add python version check and fix bug due to moving the stash lib into lib

This commit is contained in:
L1ghtn1ng 2019-01-20 03:02:29 +00:00
parent 9d23a733b5
commit d95097f6dd
4 changed files with 51 additions and 47 deletions

View file

@ -6,7 +6,7 @@
* | |_| | | | __/ / __ / (_| | | \ V / __/\__ \ || __/ | *
* \__|_| |_|\___| \/ /_/ \__,_|_| \_/ \___||___/\__\___|_| *
* *
* theHarvester 3.0.6 v183 *
* theHarvester 3.0.6 v184 *
* Coded by Christian Martorella *
* Edge-Security Research *
* cmartorella@edge-security.com *

View file

@ -18,7 +18,7 @@ def banner():
print("* | |_| | | | __/ / __ / (_| | | \ V / __/\__ \ || __/ | *")
print("* \__|_| |_|\___| \/ /_/ \__,_|_| \_/ \___||___/\__\___|_| *")
print('* *')
print('* theHarvester 3.0.6 v183 *')
print('* theHarvester 3.0.6 v184 *')
print('* Coded by Christian Martorella *')
print('* Edge-Security Research *')
print('* cmartorella@edge-security.com *')
@ -27,31 +27,31 @@ def banner():
@staticmethod
def get_supportedengines():
supportedengines = set(['baidu',
'bing',
'bingapi',
'censys',
'crtsh',
'cymon',
'dogpile',
'duckduckgo',
'google',
'googleCSE',
'google-certificates',
'google-profiles',
'hunter',
'linkedin',
'netcraft',
'pgp',
'securityTrails',
'threatcrowd',
'trello',
'twitter',
'vhost',
'virustotal',
'yahoo',
'all'
])
supportedengines = {'baidu',
'bing',
'bingapi',
'censys',
'crtsh',
'cymon',
'dogpile',
'duckduckgo',
'google',
'googleCSE',
'google-certificates',
'google-profiles',
'hunter',
'linkedin',
'netcraft',
'pgp',
'securityTrails',
'threatcrowd',
'trello',
'twitter',
'vhost',
'virustotal',
'yahoo',
'all'
}
return supportedengines
@staticmethod

View file

@ -3,7 +3,7 @@
import plotly.graph_objs as go
import plotly.plotly as py
import plotly
import stash
from lib import stash
try:
db = stash.stash_manager()
db.do_init()
@ -23,26 +23,26 @@ def __init__(self, domain):
self.scattercountshodans = []
self.scattercountvhosts = []
def drawlatestscangraph(self,domain,latestscandata):
def drawlatestscangraph(self, domain, latestscandata):
try:
self.barcolumns= ['email', 'host', 'ip', 'shodan', 'vhost']
self.barcolumns = ['email', 'host', 'ip', 'shodan', 'vhost']
self.bardata.append(latestscandata['email'])
self.bardata.append(latestscandata['host'])
self.bardata.append(latestscandata['ip'])
self.bardata.append(latestscandata['shodan'])
self.bardata.append(latestscandata['vhost'])
layout = dict(title = 'Latest scan - number of targets identified for ' + domain,
xaxis = dict(title = 'Targets'),
yaxis = dict(title = 'Hits'),)
layout = dict(title='Latest scan - number of targets identified for ' + domain,
xaxis = dict(title='Targets'),
yaxis = dict(title='Hits'),)
barchartcode = plotly.offline.plot({
'data': [go.Bar(x=self.barcolumns, y=self.bardata)],
'layout': layout,
}, auto_open=False, include_plotlyjs=False, filename='report.html', output_type='div')
return barchartcode
except Exception as e:
print('Error generating HTML bar graph code for domain: ' + str(e))
print(f'Error generating HTML bar graph code for domain: {e}')
def drawscattergraphscanhistory(self,domain,scanhistorydomain):
def drawscattergraphscanhistory(self, domain, scanhistorydomain):
try:
scandata = scanhistorydomain
for i in scandata:
@ -56,20 +56,20 @@ def drawscattergraphscanhistory(self,domain,scanhistorydomain):
trace0 = go.Scatter(
x=self.scatterxdata,
y=self.scattercounthosts,
mode = 'lines+markers',
name = 'hosts')
mode='lines+markers',
name='hosts')
trace1 = go.Scatter(
x=self.scatterxdata,
y=self.scattercountips,
mode = 'lines+markers',
name = 'IP address')
mode='lines+markers',
name='IP address')
trace2 = go.Scatter(
x=self.scatterxdata,
y=self.scattercountvhosts,
mode = 'lines+markers',
name = 'vhost')
mode='lines+markers',
name='vhost')
trace3 = go.Scatter(
x=self.scatterxdata,
@ -84,16 +84,16 @@ def drawscattergraphscanhistory(self,domain,scanhistorydomain):
name='email')
data = [trace0, trace1, trace2, trace3, trace4]
layout = dict(title = 'Scanning history for ' + domain,
xaxis = dict(title = 'Date'),
yaxis = dict(title = 'Results'),
)
layout = dict(title='Scanning history for ' + domain,
xaxis=dict(title='Date'),
yaxis=dict(title='Results'),
)
scatterchartcode = plotly.offline.plot({
'data': data,
'layout': layout}, auto_open=False, include_plotlyjs=False, filename='report.html', output_type='div')
return scatterchartcode
except Exception as e:
print('Error generating HTML for the historical graph for domain: ' + str(e))
print(f'Error generating HTML for the historical graph for domain: {e}')
except Exception as e:
print('Error in the reportgraph module: ' + str(e))
print(f'Error in the reportgraph module: {e}')

View file

@ -12,6 +12,7 @@
import datetime
import ipaddress
import re
from platform import python_version
import time
try:
@ -938,6 +939,9 @@ def start():
if __name__ == '__main__':
if python_version()[0:3] < '3.6':
print('\033[93m[!] Please make sure you have python 3.6+ installed, quitting.\033[0m')
sys.exit(1)
try:
start()
except KeyboardInterrupt: