diff --git a/lib/reportgraph.py b/lib/reportgraph.py index 24c94fe5..c357aecc 100644 --- a/lib/reportgraph.py +++ b/lib/reportgraph.py @@ -22,74 +22,79 @@ try: self.scattercountips = [] self.scattercountshodans = [] self.scattercountvhosts = [] - def drawlatestscangraph(self,domain,latestscandata): - 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 = "Last scan - number of targets identified for "+ domain +" on "+str(latestscandata["latestdate"]), - 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 + try: + 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 = "Last scan - number of targets identified for "+ domain +" on "+str(latestscandata["latestdate"]), + 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)) def drawscattergraphscanhistory(self,domain,scanhistorydomain): - scandata = scanhistorydomain - for i in scandata: - self.scatterxdata.append(datetime.date(datetime.strptime(i['date'],'%Y-%m-%d'))) - self.scattercountemails.append(int(i['email'])) - self.scattercounthosts.append(int(i['hosts'])) - self.scattercountips.append(int(i['ip'])) - self.scattercountshodans.append(int(i['shodan'])) - self.scattercountvhosts.append(int(i['vhost'])) + try: + scandata = scanhistorydomain + for i in scandata: + self.scatterxdata.append(datetime.date(datetime.strptime(i['date'],'%Y-%m-%d'))) + self.scattercountemails.append(int(i['email'])) + self.scattercounthosts.append(int(i['hosts'])) + self.scattercountips.append(int(i['ip'])) + self.scattercountshodans.append(int(i['shodan'])) + self.scattercountvhosts.append(int(i['vhost'])) - trace0 = go.Scatter( - x=self.scatterxdata, - y=self.scattercounthosts, - mode = 'lines+markers', - name = 'hosts') + trace0 = go.Scatter( + x=self.scatterxdata, + y=self.scattercounthosts, + mode = 'lines+markers', + name = 'hosts') - trace1 = go.Scatter( - x=self.scatterxdata, - y=self.scattercountips, - mode = 'lines+markers', - name = 'IP address') + trace1 = go.Scatter( + x=self.scatterxdata, + y=self.scattercountips, + mode = 'lines+markers', + name = 'IP address') - trace2 = go.Scatter( - x=self.scatterxdata, - y=self.scattercountvhosts, - mode = 'lines+markers', - name = 'vhost') + trace2 = go.Scatter( + x=self.scatterxdata, + y=self.scattercountvhosts, + mode = 'lines+markers', + name = 'vhost') - trace3 = go.Scatter( - x=self.scatterxdata, - y=self.scattercountshodans, - mode = 'lines+markers', - name = 'shodan') + trace3 = go.Scatter( + x=self.scatterxdata, + y=self.scattercountshodans, + mode = 'lines+markers', + name = 'shodan') - trace4 = go.Scatter( - x=self.scatterxdata, - y=self.scattercountemails, - mode = 'lines+markers', - name = 'email') + trace4 = go.Scatter( + x=self.scatterxdata, + y=self.scattercountemails, + mode = 'lines+markers', + name = 'email') - data = [trace0, trace1, trace2, trace3, trace4] - 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 + data = [trace0, trace1, trace2, trace3, trace4] + 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)) except Exception as e: - print(e) + print("Error in the reportgraph module: " + str(e)) diff --git a/lib/statichtmlgenerator.py b/lib/statichtmlgenerator.py index d22c6e22..d43f8dbe 100644 --- a/lib/statichtmlgenerator.py +++ b/lib/statichtmlgenerator.py @@ -3,89 +3,129 @@ class htmlgenerator: self.domain = word def generatedashboardcode(self, scanboarddata): - totalnumberofdomains = scanboarddata['domains'] - totalnumberofhosts = scanboarddata['host'] - totalnumberofip = scanboarddata['ip'] - totalnumberofvhost= scanboarddata['vhost'] - totalnumberofemail= scanboarddata['email'] - totalnumberofshodan= scanboarddata['shodan'] - html=''' - - - -

theHarvester Scan Report

-

TheHarvester scanning dashboard

- - - - - - - - - - - - - - - - - - - -

Domains

Hosts

IP Addresses

Vhosts

Emails

Shodan

'''+str(totalnumberofdomains)+'''

'''+str(totalnumberofhosts)+'''

'''+str(totalnumberofip)+'''

'''+str(totalnumberofvhost)+'''

'''+str(totalnumberofemail)+'''

'''+str(totalnumberofshodan)+'''

-

 

-

 

-

 

-

 

- ''' - return html + try: + totalnumberofdomains = scanboarddata['domains'] + totalnumberofhosts = scanboarddata['host'] + totalnumberofip = scanboarddata['ip'] + totalnumberofvhost= scanboarddata['vhost'] + totalnumberofemail= scanboarddata['email'] + totalnumberofshodan= scanboarddata['shodan'] + html=''' + + + +

theHarvester Scan Report

+

TheHarvester scanning dashboard

+ + + + + + + + + + + + + + + + + + + +

Domains

Hosts

IP Addresses

Vhosts

Emails

Shodan

'''+str(totalnumberofdomains)+'''

'''+str(totalnumberofhosts)+'''

'''+str(totalnumberofip)+'''

'''+str(totalnumberofvhost)+'''

'''+str(totalnumberofemail)+'''

'''+str(totalnumberofshodan)+'''

+

 

+

 

+

 

+

 

+''' + return html + except Exception as e: + print("Error generating dashboard HTML code: " + str(e)) + + def generatescanstatistics(self, scanhistorystatistics): + try: + html=''' +

theHarvester scan statistics

+

 

+ + + + + + + + + + +''' + for i in scanhistorystatistics: + html += '" + html += '" + html += '" + html += '" + html += '" + html +='' + html +=''' + +
DomainDateRecordtypeSourceTotal results
' + str(i[0]) + "' + str(i[1]) + "' + str(i[2]) + "' + str(i[3]) + "' + str(i[4]) + "
+

 

+

 

+''' + print("END") + return html + except Exception as e: + print("Error generating scan statistics HTML code: " + str(e)) def generatescandetailsdomain(self, word, latestscandomain): - emails = latestscandomain['scandetailsemail'] - hosts = latestscandomain['scandetailshost'] - ips = latestscandomain['scandetailsip'] - vhosts = latestscandomain['scandetailsvhost'] - shodans = latestscandomain['scandetailsshodan'] - html=''' -

 

-

 

-

Latest scan details for '''+ word + ''' on: '''+str(latestscandomain['latestdate'])+'''

-

Emails found:

- -

Hosts found:

- -

IP found:

- -

vhosts found:

- -

Shodan results:

- - ''' - return html \ No newline at end of file + try: + emails = latestscandomain['scandetailsemail'] + hosts = latestscandomain['scandetailshost'] + ips = latestscandomain['scandetailsip'] + vhosts = latestscandomain['scandetailsvhost'] + shodans = latestscandomain['scandetailsshodan'] + html=''' +

 

+

 

+

Latest scan details for '''+ word + ''' on: '''+str(latestscandomain['latestdate'])+'''

+

Emails found:

+ +

Hosts found:

+ +

IP found:

+ +

vhosts found:

+ +

Shodan results:

+ + ''' + return html + except Exception as e: + print("Error generating scan details HTML code: " + str(e)) \ No newline at end of file diff --git a/report.html b/report.html index 256fef67..f7613dd8 100644 --- a/report.html +++ b/report.html @@ -1,58 +1,76 @@ - - - -

theHarvester Scan Report

-

TheHarvester scanning dashboard

- - - - - - - - - - - - - - - - - - - -

Domains

Hosts

IP Addresses

Vhosts

Emails

Shodan

2

534

380

0

25

0

-

 

-

 

-

 

-

 

- -

 

-

 

-

Latest scan details for google.com on: 2018-12-16

-

Emails found:

- -

Hosts found:

- -

IP found:

- -

vhosts found:

- -

Shodan results:

- -

Report generated on 2018-12-16 16:35:19.594086

+ + + +

theHarvester Scan Report

+

TheHarvester scanning dashboard

+ + + + + + + + + + + + + + + + + + + +

Domains

Hosts

IP Addresses

Vhosts

Emails

Shodan

2

781

592

0

28

1

+

 

+

 

+

 

+

 

+ +

 

+

 

+

Latest scan details for google.com on: 2018-12-17

+

Emails found:

+ +

Hosts found:

+ +

IP found:

+ +

vhosts found:

+ +

Shodan results:

+ +
+

theHarvester scan statistics

+

 

+ + + + + + + + + + + + +
DomainDateRecordtypeSourceTotal results
google.com2018-12-12hostemail1
google.com2018-12-12hostgoogle1
google.com2018-12-12ipDNS-resolver1
google.com2018-12-14hostgoogle21
google.com2018-12-14hostshodan1
google.com2018-12-14ipDNS-resolver17
google.com2018-12-14ipshodan2
google.com2018-12-15hostemail1
google.com2018-12-15hostgoogle285
google.com2018-12-15hostshodan2
google.com2018-12-15ipDNS-resolver212
google.com2018-12-16emailgoogle10
google.com2018-12-16hostgoogle210
google.com2018-12-16ipDNS-resolver140
google.com2018-12-17emailgoogle3
google.com2018-12-17hostgoogle247
google.com2018-12-17ipDNS-resolver213
lch.com2018-12-14emailgoogle15
lch.com2018-12-14hostgoogle12
lch.com2018-12-14ipDNS-resolver7
lch.com2018-12-14shodanDNS-resolver1
+

 

+

 

+

Report generated on 2018-12-17 20:25:10.207693

\ No newline at end of file diff --git a/stash.py b/stash.py index ab2476d9..eda27a6a 100644 --- a/stash.py +++ b/stash.py @@ -11,6 +11,7 @@ class stash_manager: self.latestscandomain = {} self.domainscanhistory = [] self.scanboarddata = {} + self.scanstats = [] def do_init(self): conn = sqlite3.connect(self.db) @@ -99,32 +100,32 @@ class stash_manager: conn.close() def getscanboarddata(self): - try: - conn = sqlite3.connect(self.db) - c = conn.cursor() - c.execute('''SELECT COUNT(*) from results WHERE type="host"''') - data = c.fetchone() - self.scanboarddata["host"] = data[0] - c.execute('''SELECT COUNT(*) from results WHERE type="email"''') - data = c.fetchone() - self.scanboarddata["email"] = data[0] - c.execute('''SELECT COUNT(*) from results WHERE type="ip"''') - data = c.fetchone() - self.scanboarddata["ip"] = data[0] - c.execute('''SELECT COUNT(*) from results WHERE type="vhost"''') - data = c.fetchone() - self.scanboarddata["vhost"] = data[0] - c.execute('''SELECT COUNT(*) from results WHERE type="shodan"''') - data = c.fetchone() - self.scanboarddata["shodan"] = data[0] - c.execute('''SELECT COUNT(DISTINCT(domain)) FROM results ''') - data = c.fetchone() - self.scanboarddata["domains"] = data[0] - return self.scanboarddata - except Exception as e: - print(e) - finally: - conn.close() + try: + conn = sqlite3.connect(self.db) + c = conn.cursor() + c.execute('''SELECT COUNT(*) from results WHERE type="host"''') + data = c.fetchone() + self.scanboarddata["host"] = data[0] + c.execute('''SELECT COUNT(*) from results WHERE type="email"''') + data = c.fetchone() + self.scanboarddata["email"] = data[0] + c.execute('''SELECT COUNT(*) from results WHERE type="ip"''') + data = c.fetchone() + self.scanboarddata["ip"] = data[0] + c.execute('''SELECT COUNT(*) from results WHERE type="vhost"''') + data = c.fetchone() + self.scanboarddata["vhost"] = data[0] + c.execute('''SELECT COUNT(*) from results WHERE type="shodan"''') + data = c.fetchone() + self.scanboarddata["shodan"] = data[0] + c.execute('''SELECT COUNT(DISTINCT(domain)) FROM results ''') + data = c.fetchone() + self.scanboarddata["domains"] = data[0] + return self.scanboarddata + except Exception as e: + print(e) + finally: + conn.close() def getscanhistorydomain(self,domain): try: @@ -161,4 +162,24 @@ class stash_manager: except Exception as e: print(e) finally: - conn.close() \ No newline at end of file + conn.close() + + def getscanstatistics(self): + try: + conn = sqlite3.connect(self.db) + c = conn.cursor() + c.execute(''' + SELECT domain,find_date, type, source, count(*) + FROM results + GROUP BY domain,find_date, type, source + ''') + results = c.fetchall() + self.scanstats = results + return self.scanstats + except Exception as e: + print(e) + finally: + conn.close() + + + \ No newline at end of file diff --git a/testreport.py b/testreport.py deleted file mode 100644 index 4e7628e5..00000000 --- a/testreport.py +++ /dev/null @@ -1,188 +0,0 @@ -try: - import plotly - import plotly.graph_objs as go - import plotly.plotly as py - import datetime - scanneddomain='google.com' - totalnumberofdomains = 4 - totalnumberofhosts = 14 - totalnumberofip = 10 - totalnumberofvhost=3 - totalnumberofemail=15 - totalnumberofshodan=7 - date1=datetime.date(2018,12,1) - date2=datetime.date(2018,12,3) - date3=datetime.date(2018,12,5) - date4=datetime.date(2018,12,8) - date5=datetime.date(2018,12,10) - HTML=''' - - - -

theHarvester Scan Report

-

TheHarvester scanning dashboard

- - - - - - - - - - - '''+''' - - - - - - - '''+''' - - -

Domains

Hosts

IP Addresses

Vhosts

Emails

Shodan

'''+str(totalnumberofdomains)+'''

'''+str(totalnumberofhosts)+'''

'''+str(totalnumberofip)+'''

'''+str(totalnumberofvhost)+'''

'''+str(totalnumberofemail)+'''

'''+str(totalnumberofshodan)+'''

-

 

-

 

-

 

-

 

-

Latest scan summary for '''+scanneddomain+'''

-

Emails found:

- -

Hosts found:

- -

IP addresses found:

- -

Shodan results:

- - ''' - barcolumns = ["host","ip","vhost","shodan","email"] - bardata = [totalnumberofhosts,totalnumberofip,totalnumberofvhost,totalnumberofshodan,totalnumberofemail] - layout = dict(title = "Last scan - number of targets identified for "+scanneddomain+" on "+str(date5), - xaxis = dict(title = 'Targets'), - yaxis = dict(title = 'Hits'), - ) - - barchart=plotly.offline.plot({ - "data": [go.Bar(x=barcolumns,y=bardata)], - "layout": layout, - }, auto_open=False,include_plotlyjs=False,filename='report.html', output_type='div') - HTML+=barchart - - - trace0 = go.Scatter( - x=[date1,date2,date3,date4,date5], - y=[3, 10, 9, 17,10], - mode = 'lines+markers', - name = 'hosts') - - trace1 = go.Scatter( - x=[date1,date2,date3,date4,date5], - y=[2, 6, 9, 10, 5], - mode = 'lines+markers', - name = 'IP address') - - trace2 = go.Scatter( - x=[date1,date2,date3,date4,date5], - y=[1, 2, 4, 6, 2], - mode = 'lines+markers', - name = 'vhost') - - trace3 = go.Scatter( - x=[date1,date2,date3,date4,date5], - y=[2, 3, 2, 5, 7], - mode = 'lines+markers', - name = 'shodan') - - trace4 = go.Scatter( - x=[date1,date2,date3,date4,date5], - y=[12, 14, 20, 24, 20], - mode = 'lines+markers', - name = 'email') - - - data = [trace0, trace1, trace2, trace3, trace4] - layout = dict(title = "Scanning history for "+scanneddomain, - xaxis = dict(title = 'Date'), - yaxis = dict(title = 'Results'), - ) - - scatterchart = plotly.offline.plot({ - "data": data, - "layout": layout}, auto_open=False,include_plotlyjs=False,filename='report.html', output_type='div') - HTML+=scatterchart - - trace1 = go.Bar( - x=[date1,date2,date3,date4,date5], - y=[20, 21, 23, 20, 17], - text=['domain1.com', 'domain2.com', 'domain3.com', 'domain4.com', 'domain5.com'], - name='hosts' - ) - trace2 = go.Bar( - x=[date1,date2,date3,date4,date5], - y=[24, 23, 29, 30, 25], - text=['domain1.com', 'domain2.com', 'domain3.com', 'domain4.com', 'domain5.com'], - name='IP addresses' - ) - - trace3 = go.Bar( - x=[date1,date2,date3,date4,date5], - y=[3, 5, 2, 1, 3], - text=['domain1.com', 'domain2.com', 'domain3.com', 'domain4.com', 'domain5.com'], - name='vhosts' - ) - - trace4 = go.Bar( - x=[date1,date2,date3,date4,date5], - y=[13, 10, 12, 13, 12], - text=['domain1.com', 'domain2.com', 'domain3.com', 'domain4.com', 'domain5.com'], - name='shodan' - ) - - trace5 = go.Bar( - x=[date1,date2,date3,date4,date5], - y=[30, 34, 35, 41, 31], - text=['domain1.com', 'domain2.com', 'domain3.com', 'domain4.com', 'domain5.com'], - name='email' - ) - - data = [trace1, trace2, trace3, trace4, trace5] - layout = go.Layout( - barmode='stack' - ) - - layout = dict(title = "theHarvester scan history", - xaxis = dict(title = 'Date'), - yaxis = dict(title = 'Hits'), - ) - - barchart=plotly.offline.plot({ - "data": data, - "layout": layout, - }, auto_open=False,include_plotlyjs=False,filename='report.html', output_type='div') - HTML+=barchart - HTML+='

Report generated on '+ str(datetime.datetime.now())+'

' - HTML+=''' - - - ''' - - Html_file= open("report.html","w") - Html_file.write(HTML) - Html_file.close() -except Exception as e: - print("ERROR: "+str(e)) diff --git a/testreportstack.py b/testreportstack.py deleted file mode 100644 index bf1ec979..00000000 --- a/testreportstack.py +++ /dev/null @@ -1,186 +0,0 @@ -try: - import plotly - import plotly.graph_objs as go - import plotly.plotly as py - import datetime - scanneddomain='google.com' - totalnumberofdomains = 4 - totalnumberofhosts = 14 - totalnumberofip = 10 - totalnumberofvhost=3 - totalnumberofemail=15 - totalnumberofshodan=7 - date1=datetime.date(2018,12,1) - date2=datetime.date(2018,12,3) - date3=datetime.date(2018,12,5) - date4=datetime.date(2018,12,8) - date5=datetime.date(2018,12,10) - HTML=''' - - - -

theHarvester Scan Report

-

TheHarvester scanning dashboard

- - - - - - - - - - - '''+''' - - - - - - - '''+''' - - -

Domains

Hosts

IP Addresses

Vhosts

Emails

Shodan

'''+str(totalnumberofdomains)+'''

'''+str(totalnumberofhosts)+'''

'''+str(totalnumberofip)+'''

'''+str(totalnumberofvhost)+'''

'''+str(totalnumberofemail)+'''

'''+str(totalnumberofshodan)+'''

-

 

-

 

-

 

-

 

-

Latest scan summary for '''+scanneddomain+'''

-

Emails found:

- -

Hosts found:

- -

IP addresses found:

- -

Shodan results:

- - ''' - barcolumns = ["host","ip","vhost","shodan","email"] - bardata = [totalnumberofhosts,totalnumberofip,totalnumberofvhost,totalnumberofshodan,totalnumberofemail] - layout = dict(title = "Last scan - number of targets identified for "+scanneddomain+" on "+str(date5), - xaxis = dict(title = 'Targets'), - yaxis = dict(title = 'Hits'), - ) - - barchart=plotly.offline.plot({ - "data": [go.Bar(x=barcolumns,y=bardata)], - "layout": layout, - }, auto_open=False,include_plotlyjs=False,filename='report.html', output_type='div') - HTML+=barchart - - - trace0 = go.Scatter( - x=[date1,date2,date3,date4,date5], - y=[3, 10, 9, 17,10], - mode = 'lines+markers', - name = 'hosts') - - trace1 = go.Scatter( - x=[date1,date2,date3,date4,date5], - y=[2, 6, 9, 10, 5], - mode = 'lines+markers', - name = 'IP address') - - trace2 = go.Scatter( - x=[date1,date2,date3,date4,date5], - y=[1, 2, 4, 6, 2], - mode = 'lines+markers', - name = 'vhost') - - trace3 = go.Scatter( - x=[date1,date2,date3,date4,date5], - y=[2, 3, 2, 5, 7], - mode = 'lines+markers', - name = 'shodan') - - trace4 = go.Scatter( - x=[date1,date2,date3,date4,date5], - y=[12, 14, 20, 24, 20], - mode = 'lines+markers', - name = 'email') - - - data = [trace0, trace1, trace2, trace3, trace4] - layout = dict(title = "Scanning history for "+scanneddomain, - xaxis = dict(title = 'Date'), - yaxis = dict(title = 'Results'), - ) - - scatterchart = plotly.offline.plot({ - "data": data, - "layout": layout}, auto_open=False,include_plotlyjs=False,filename='report.html', output_type='div') - HTML+=scatterchart - - trace1 = go.Bar( - x=[date1,date2,date3,date4,date5], - y=[20, 21, 23, 20, 17], - text=['domain1.com', 'domain1.com', 'domain1.com', 'domain1.com', 'domain1.com'], - name='hosts' - ) - trace2 = go.Bar( - x=[date1,date2,date3,date4,date5], - y=[24, 23, 29, 30, 25], - text=['domain2.com', 'domain2.com', 'domain2.com', 'domain2.com', 'domain2.com'], - name='IP addresses' - ) - - trace3 = go.Bar( - x=[date1,date2,date3,date4,date5], - y=[3, 5, 2, 1, 3], - text=['domain3.com', 'domain3.com', 'domain3.com', 'domain3.com', 'domain3.com'], - name='vhosts' - ) - - trace4 = go.Bar( - x=[date1,date2,date3,date4,date5], - y=[13, 10, 12, 13, 12], - text=['domain4.com', 'domain4.com', 'domain4.com', 'domain4.com', 'domain4.com'], - name='shodan' - ) - - trace5 = go.Bar( - x=[date1,date2,date3,date4,date5], - y=[30, 34, 35, 41, 31], - text=['domain5.com', 'domain5.com', 'domain5.com', 'domain5.com', 'domain5.com'], - name='email' - ) - - data = [trace1, trace2, trace3, trace4, trace5] - - layout = dict(title = "theHarvester scan history", - xaxis = dict(title = 'Date'), - yaxis = dict(title = 'Hits'), - barmode='stack' - ) - - barchart=plotly.offline.plot({ - "data": data, - "layout": layout, - }, auto_open=False,include_plotlyjs=False,filename='report.html', output_type='div') - HTML+=barchart - HTML+='

Report generated on '+ str(datetime.datetime.now())+'

' - HTML+=''' - - - ''' - - Html_file= open("report.html","w") - Html_file.write(HTML) - Html_file.close() -except Exception as e: - print("ERROR: "+str(e)) diff --git a/theHarvester.py b/theHarvester.py index 84ae38f8..bc6bf93c 100755 --- a/theHarvester.py +++ b/theHarvester.py @@ -690,12 +690,12 @@ def start(argv): #Reporting####################################################### if filename != "": try: - #NEW REPORT BEGINS print("NEW REPORTING BEGINS:") db = stash.stash_manager() scanboarddata = db.getscanboarddata() latestscandomain = db.getlatestscandomain(word) scanhistorydomain = db.getscanhistorydomain(word) + scanstatistics = db.getscanstatistics() from lib import statichtmlgenerator generator = statichtmlgenerator.htmlgenerator(word) HTMLcode = generator.generatedashboardcode(scanboarddata) @@ -705,6 +705,7 @@ def start(argv): graph = reportgraph.graphgenerator(word) HTMLcode += graph.drawlatestscangraph(word, latestscandomain) HTMLcode += graph.drawscattergraphscanhistory(word, scanhistorydomain) + HTMLcode += generator.generatescanstatistics(scanstatistics) HTMLcode += '

Report generated on '+ str(datetime.datetime.now())+'

' HTMLcode +=''' @@ -713,8 +714,7 @@ def start(argv): Html_file= open("report.html","w") Html_file.write(HTMLcode) Html_file.close() - print("NEW REPORTING FINISHED:") - #NEW REPORT FINISHED + print("NEW REPORTING FINISHED!") print("[+] Saving files...") html = htmlExport.htmlExport(