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
+
+
+
+
+| Domain |
+Date |
+Recordtype |
+Source |
+Total results |
+
+
+'''
+ for i in scanhistorystatistics:
+ html += '| ' + str(i[0]) + " | "
+ html += '' + str(i[1]) + " | "
+ html += '' + str(i[2]) + " | "
+ html += '' + str(i[3]) + " | "
+ html += '' + str(i[4]) + " | "
+ html +='
'
+ html +='''
+
+
+
+
+'''
+ 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:
-
- '''
- for email in emails:
- html += '- '+ str(email[1]) + "
"
- html +='''
-
- Hosts found:
-
- '''
- for host in hosts:
- html += '- '+ str(host[1]) + "
"
- html +='''
-
- IP found:
-
- '''
- for ip in ips:
- html += '- '+str(ip[1])+"
"
- html +='''
-
- vhosts found:
-
- '''
- for vhost in vhosts:
- html +='- '+str(vhost[1])+"
"
- html +='''
-
- Shodan results:
-
- '''
- for shodan in shodans:
- html +='- '+str(shodan[1])+"
"
- html +='''
-
- '''
- 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:
+
+ '''
+ for email in emails:
+ html += '- '+ str(email[1]) + "
"
+ html +='''
+
+Hosts found:
+
+ '''
+ for host in hosts:
+ html += '- '+ str(host[1]) + "
"
+ html +='''
+
+IP found:
+
+ '''
+ for ip in ips:
+ html += '- '+str(ip[1])+"
"
+ html +='''
+
+vhosts found:
+
+ '''
+ for vhost in vhosts:
+ html +='- '+str(vhost[1])+"
"
+ html +='''
+
+Shodan results:
+
+ '''
+ for shodan in shodans:
+ html +='- '+str(shodan[1])+"
"
+ html +='''
+
+ '''
+ 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:
-
- - generationgoogle@google.com
- nicksauer@google.com
- generationgoogle@google.com
- nicksauer@google.com
- sroz@google.com
- winsonc@google.com
- android-build@google.com
- sroz@google.com
- winsonc@google.com
- android-build@google.com
-
- Hosts found:
-
- - play.google.com
- mail.google.com
- drive.google.com
- accounts.google.com
- www.google.com
- maps.google.com
- translate.google.com
- adssettings.google.com
- account.google.com
- images.google.com
- santatracker.google.com
- ns2.google.com
- code.google.com
- books.google.com
- news.google.com
- play.google.com
- mail.google.com
- drive.google.com
- accounts.google.com
- www.google.com
- maps.google.com
- translate.google.com
- adssettings.google.com
- account.google.com
- images.google.com
- hangouts.google.com
- books.google.com
- mx.google.com
- .google.com
- sites.google.com
- support.google.com
- play.google.com
- mail.google.com
- drive.google.com
- accounts.google.com
- www.google.com
- maps.google.com
- translate.google.com
- adssettings.google.com
- account.google.com
- images.google.com
- santatracker.google.com
- ns2.google.com
- code.google.com
- books.google.com
- news.google.com
- play.google.com
- mail.google.com
- drive.google.com
- accounts.google.com
- www.google.com
- maps.google.com
- translate.google.com
- adssettings.google.com
- account.google.com
- images.google.com
- hangouts.google.com
- books.google.com
- mx.google.com
- .google.com
- sites.google.com
- support.google.com
- www.google.com
- support.google.com
- www.google.com
- support.google.com
- www.google.com
- support.google.com
- www.google.com
- support.google.com
- www.google.com
- support.google.com
- www.google.com
- support.google.com
- www.google.com
- support.google.com
- www.google.com
- support.google.com
- www.google.com
- support.google.com
- play.google.com
- mail.google.com
- drive.google.com
- accounts.google.com
- www.google.com
- maps.google.com
- translate.google.com
- news.google.com
- Mail.google.com
- adssettings.google.com
- account.google.com
- hangouts.google.com
- docs.google.com
- books.google.com
- developers.google.com
- support.google.com
- tools.google.com
- sites.google.com
- .google.com
- play.google.com
- mail.google.com
- drive.google.com
- accounts.google.com
- www.google.com
- maps.google.com
- translate.google.com
- news.google.com
- adssettings.google.com
- Mail.google.com
- account.google.com
- hangouts.google.com
- docs.google.com
- books.google.com
- developers.google.com
- support.google.com
- tools.google.com
- sites.google.com
- .google.com
- play.google.com
- mail.google.com
- drive.google.com
- accounts.google.com
- www.google.com
- maps.google.com
- translate.google.com
- news.google.com
- adssettings.google.com
- Mail.google.com
- account.google.com
- hangouts.google.com
- books.google.com
- developers.google.com
- aspmx.l.google.com
- alt1.aspmx.l.google.com
- checkout.google.com
- .checkout.google.com
- plus.google.com
- play.google.com
- mail.google.com
- drive.google.com
- accounts.google.com
- www.google.com
- maps.google.com
- translate.google.com
- news.google.com
- adssettings.google.com
- Mail.google.com
- account.google.com
- hangouts.google.com
- books.google.com
- developers.google.com
- aspmx.l.google.com
- alt1.aspmx.l.google.com
- checkout.google.com
- .checkout.google.com
- plus.google.com
- play.google.com
- mail.google.com
- drive.google.com
- accounts.google.com
- www.google.com
- maps.google.com
- translate.google.com
- news.google.com
- adssettings.google.com
- Mail.google.com
- account.google.com
- hangouts.google.com
- books.google.com
- developers.google.com
- aspmx.l.google.com
- alt1.aspmx.l.google.com
- checkout.google.com
- .checkout.google.com
- plus.google.com
- play.google.com
- mail.google.com
- drive.google.com
- accounts.google.com
- www.google.com
- maps.google.com
- translate.google.com
- news.google.com
- adssettings.google.com
- Mail.google.com
- account.google.com
- hangouts.google.com
- books.google.com
- developers.google.com
- aspmx.l.google.com
- alt1.aspmx.l.google.com
- checkout.google.com
- .checkout.google.com
- plus.google.com
- www.google.com
- support.google.com
- www.google.com
- support.google.com
- www.google.com
- support.google.com
- www.google.com
- support.google.com
- www.google.com
- support.google.com
- www.google.com
- support.google.com
- www.google.com
- support.google.com
- www.google.com
- support.google.com
-
- IP found:
-
- - 216.58.206.78
- 216.58.206.45
- 216.58.214.14
- 216.58.208.142
- 216.58.206.110
- 216.58.201.5
- 216.58.198.174
- 172.217.23.14
- 216.239.34.10
- 216.58.206.46
- 216.58.204.4
- 216.58.206.78
- 216.58.206.45
- 216.58.208.142
- 216.58.206.110
- 216.58.201.5
- 216.58.198.174
- 216.58.206.46
- 216.58.198.238
- 216.58.204.4
- 216.58.206.78
- 216.58.206.45
- 216.58.214.14
- 216.58.198.110
- 216.58.206.110
- 216.58.201.5
- 216.58.198.174
- 172.217.23.14
- 216.239.34.10
- 216.58.206.46
- 216.58.204.4
- 216.58.206.78
- 216.58.206.45
- 216.58.198.110
- 216.58.206.110
- 216.58.201.5
- 216.58.198.174
- 216.58.206.46
- 216.58.198.238
- 216.58.204.4
- 216.58.198.238
- 216.58.204.4
- 216.58.198.238
- 216.58.204.4
- 216.58.198.238
- 216.58.204.4
- 216.58.198.238
- 216.58.204.4
- 216.58.198.238
- 216.58.204.4
- 216.58.198.238
- 216.58.204.4
- 216.58.198.238
- 216.58.204.4
- 216.58.198.238
- 216.58.204.4
- 216.58.198.238
- 216.58.204.4
- 216.58.201.5
- 216.58.206.78
- 216.58.206.45
- 216.58.213.110
- 216.58.198.110
- 216.58.198.174
- 172.217.23.14
- 216.58.206.46
- 216.58.198.238
- 216.58.214.14
- 216.58.204.4
- 216.58.201.5
- 216.58.206.78
- 216.58.206.45
- 216.58.213.78
- 216.58.198.110
- 216.58.198.174
- 172.217.23.14
- 216.58.206.46
- 216.58.198.238
- 216.58.214.14
- 216.58.204.4
- 216.58.201.5
- 216.58.206.78
- 216.58.206.45
- 108.177.14.26
- 64.233.167.26
- 216.58.198.110
- 216.58.198.174
- 172.217.23.14
- 216.58.206.46
- 216.58.213.78
- 216.58.204.4
- 216.58.201.5
- 216.58.206.78
- 216.58.206.45
- 108.177.14.26
- 64.233.167.26
- 216.58.198.110
- 216.58.198.174
- 172.217.23.14
- 216.58.206.46
- 216.58.213.78
- 216.58.204.4
- 216.58.201.5
- 216.58.206.78
- 216.58.206.45
- 108.177.14.26
- 64.233.167.26
- 216.58.198.110
- 216.58.198.174
- 172.217.23.14
- 216.58.206.46
- 216.58.213.78
- 216.58.204.4
- 216.58.201.5
- 216.58.206.78
- 216.58.206.45
- 108.177.14.27
- 108.177.15.27
- 216.58.198.110
- 216.58.198.174
- 172.217.23.14
- 216.58.206.46
- 216.58.213.78
- 216.58.204.4
- 216.58.198.238
- 216.58.204.4
- 216.58.198.238
- 216.58.204.4
- 216.58.198.238
- 216.58.204.4
- 216.58.198.238
- 216.58.204.4
- 216.58.198.238
- 216.58.204.4
- 216.58.198.238
- 216.58.204.4
- 216.58.198.238
- 216.58.204.4
- 216.58.198.238
- 216.58.204.4
-
- 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:
+
+ - press@google.com
- press@google.com
- generationgoogle@google.com
+
+Hosts found:
+
+ - play.google.com
- mail.google.com
- drive.google.com
- accounts.google.com
- www.google.com
- maps.google.com
- translate.google.com
- edu.google.com
- news.google.com
- classroom.google.com
- images.google.com
- play.google.com
- mail.google.com
- drive.google.com
- accounts.google.com
- www.google.com
- maps.google.com
- translate.google.com
- news.google.com
- edu.google.com
- images.google.com
- 40group.v.calendar.google.com
- plus.google.com
- play.google.com
- mail.google.com
- drive.google.com
- accounts.google.com
- www.google.com
- maps.google.com
- translate.google.com
- edu.google.com
- news.google.com
- classroom.google.com
- images.google.com
- ns2.google.com
- books.google.com
- play.google.com
- mail.google.com
- drive.google.com
- accounts.google.com
- www.google.com
- maps.google.com
- translate.google.com
- edu.google.com
- news.google.com
- classroom.google.com
- images.google.com
- 40group.v.calendar.google.com
- plus.google.com
- play.google.com
- mail.google.com
- drive.google.com
- accounts.google.com
- www.google.com
- maps.google.com
- translate.google.com
- edu.google.com
- news.google.com
- classroom.google.com
- images.google.com
- dl.google.com
- books.google.com
- plus.google.com
- play.google.com
- mail.google.com
- drive.google.com
- accounts.google.com
- www.google.com
- maps.google.com
- translate.google.com
- edu.google.com
- news.google.com
- classroom.google.com
- images.google.com
- plus.google.com
- play.google.com
- mail.google.com
- drive.google.com
- accounts.google.com
- www.google.com
- maps.google.com
- translate.google.com
- edu.google.com
- news.google.com
- classroom.google.com
- images.google.com
- ns2.google.com
- docs.google.com
- plus.google.com
- support.google.com
- partnerpage.google.com
- .partnerpage.google.com
- play.google.com
- mail.google.com
- drive.google.com
- accounts.google.com
- www.google.com
- maps.google.com
- translate.google.com
- edu.google.com
- news.google.com
- classroom.google.com
- images.google.com
- plus.google.com
- play.google.com
- mail.google.com
- drive.google.com
- accounts.google.com
- www.google.com
- maps.google.com
- translate.google.com
- edu.google.com
- news.google.com
- classroom.google.com
- images.google.com
- plus.google.com
- play.google.com
- mail.google.com
- drive.google.com
- accounts.google.com
- www.google.com
- maps.google.com
- translate.google.com
- edu.google.com
- news.google.com
- classroom.google.com
- images.google.com
- ns2.google.com
- docs.google.com
- www.google.com
- support.google.com
- www.google.com
- support.google.com
- www.google.com
- support.google.com
- www.google.com
- support.google.com
- www.google.com
- support.google.com
- www.google.com
- support.google.com
- www.google.com
- support.google.com
- play.google.com
- mail.google.com
- drive.google.com
- accounts.google.com
- www.google.com
- maps.google.com
- translate.google.com
- news.google.com
- edu.google.com
- classroom.google.com
- images.google.com
- santatracker.google.com
- 253Awww.google.com
- ...google.com
- scoutcamp.bounces.google.com
- books.google.com
- docs.google.com
- merchants.google.com
- Www.google.com
- play.google.com
- mail.google.com
- drive.google.com
- accounts.google.com
- www.google.com
- maps.google.com
- translate.google.com
- news.google.com
- edu.google.com
- classroom.google.com
- images.google.com
- santatracker.google.com
- 253Awww.google.com
- ...google.com
- scoutcamp.bounces.google.com
- books.google.com
- docs.google.com
- merchants.google.com
- Www.google.com
- play.google.com
- mail.google.com
- drive.google.com
- accounts.google.com
- www.google.com
- maps.google.com
- translate.google.com
- account.google.com
- news.google.com
- edu.google.com
- images.google.com
- books.google.com
- plus.google.com
- play.google.com
- mail.google.com
- drive.google.com
- accounts.google.com
- www.google.com
- maps.google.com
- translate.google.com
- account.google.com
- news.google.com
- edu.google.com
- images.google.com
- descriptioncolab.research.google.com
- books.google.com
- plus.google.com
- play.google.com
- mail.google.com
- drive.google.com
- accounts.google.com
- www.google.com
- maps.google.com
- translate.google.com
- account.google.com
- news.google.com
- edu.google.com
- images.google.com
- descriptioncolab.research.google.com
- books.google.com
- plus.google.com
- play.google.com
- mail.google.com
- drive.google.com
- accounts.google.com
- www.google.com
- maps.google.com
- translate.google.com
- news.google.com
- edu.google.com
- classroom.google.com
- images.google.com
- books.google.com
- plus.google.com
- www.google.com
- support.google.com
- www.google.com
- support.google.com
- www.google.com
- support.google.com
- www.google.com
- support.google.com
- www.google.com
- support.google.com
- www.google.com
- support.google.com
+
+IP found:
+
+ - 216.58.206.77
- 216.58.206.142
- 216.58.208.142
- 216.58.214.14
- 216.58.206.110
- 216.58.212.101
- 216.58.210.46
- 216.58.201.14
- 216.58.206.46
- 216.58.198.110
- 216.58.206.36
- 216.58.206.77
- 216.58.208.142
- 216.58.214.14
- 216.58.206.110
- 216.58.212.101
- 216.58.210.46
- 216.58.201.14
- 216.58.206.46
- 216.58.213.110
- 216.58.198.110
- 216.58.206.36
- 216.58.206.77
- 216.58.198.110
- 216.58.206.142
- 216.58.208.142
- 216.58.214.14
- 216.58.206.110
- 216.58.212.101
- 216.58.210.46
- 216.58.201.14
- 216.239.34.10
- 216.58.206.46
- 216.58.206.36
- 216.58.206.77
- 216.58.206.142
- 216.58.208.174
- 216.58.214.14
- 216.58.206.110
- 216.58.212.101
- 216.58.210.46
- 216.58.201.14
- 216.58.206.46
- 216.58.213.110
- 216.58.198.110
- 216.58.206.36
- 216.58.206.77
- 216.58.208.142
- 216.58.206.142
- 216.58.213.110
- 216.58.208.174
- 216.58.214.14
- 216.58.206.110
- 216.58.212.101
- 216.58.210.46
- 216.58.201.14
- 216.58.206.46
- 216.58.206.36
- 216.58.206.77
- 216.58.206.142
- 216.58.208.142
- 216.58.214.14
- 216.58.206.110
- 216.58.212.101
- 216.58.210.46
- 216.58.201.14
- 172.217.20.110
- 216.58.213.110
- 216.58.198.110
- 216.58.206.36
- 216.58.206.77
- 216.58.206.142
- 216.58.213.110
- 216.58.208.142
- 216.58.214.14
- 216.58.206.110
- 216.58.212.101
- 216.58.210.46
- 216.58.201.14
- 216.239.34.10
- 216.58.206.68
- 216.58.206.46
- 216.58.206.36
- 216.58.206.77
- 216.58.206.142
- 216.58.208.142
- 216.58.214.14
- 216.58.206.110
- 216.58.212.101
- 216.58.210.46
- 216.58.201.14
- 216.58.206.46
- 216.58.213.110
- 216.58.198.110
- 216.58.206.36
- 216.58.206.77
- 216.58.206.142
- 216.58.208.142
- 216.58.214.14
- 216.58.206.110
- 216.58.212.101
- 216.58.210.46
- 216.58.201.14
- 216.58.206.46
- 216.58.213.110
- 216.58.198.110
- 216.58.206.36
- 216.58.206.77
- 216.58.206.142
- 216.58.213.110
- 216.58.208.142
- 216.58.214.14
- 216.58.206.110
- 216.58.212.101
- 216.58.210.46
- 216.58.201.14
- 216.239.34.10
- 216.58.206.46
- 216.58.198.110
- 216.58.206.36
- 216.58.214.14
- 216.58.206.36
- 216.58.214.14
- 216.58.206.36
- 216.58.214.14
- 216.58.206.36
- 216.58.214.14
- 216.58.206.36
- 216.58.214.14
- 216.58.206.36
- 216.58.214.14
- 216.58.206.36
- 216.58.214.14
- 216.58.206.36
- 216.58.206.36
- 216.58.206.77
- 216.58.198.110
- 216.58.206.142
- 216.58.213.110
- 216.58.208.142
- 216.58.214.14
- 216.58.206.110
- 216.58.212.101
- 216.58.210.46
- 216.58.201.14
- 216.58.206.46
- 216.58.206.36
- 216.58.206.77
- 216.58.208.142
- 216.58.206.142
- 216.58.213.110
- 216.58.214.14
- 216.58.206.110
- 216.58.212.101
- 216.58.210.46
- 216.58.201.14
- 216.58.206.46
- 216.58.206.78
- 216.58.206.45
- 216.58.208.142
- 216.58.198.238
- 216.58.206.110
- 216.58.201.5
- 216.58.211.110
- 172.217.23.14
- 216.58.206.46
- 216.58.213.78
- 216.58.204.4
- 216.58.206.78
- 216.58.206.45
- 216.58.208.142
- 216.58.198.238
- 216.58.206.110
- 216.58.201.5
- 216.58.211.110
- 172.217.23.14
- 216.58.206.46
- 216.58.213.78
- 216.58.204.4
- 216.58.198.110
- 216.58.206.45
- 216.58.208.142
- 216.58.198.238
- 216.58.206.110
- 216.58.201.5
- 216.58.211.110
- 172.217.23.14
- 216.58.206.46
- 216.58.213.78
- 216.58.204.4
- 216.58.206.45
- 216.58.206.78
- 216.58.206.110
- 216.58.208.142
- 216.58.198.238
- 216.58.201.5
- 216.58.198.174
- 172.217.23.14
- 216.58.206.46
- 216.58.213.78
- 216.58.204.4
- 216.58.198.238
- 216.58.204.4
- 216.58.198.238
- 216.58.204.4
- 216.58.198.238
- 216.58.204.4
- 216.58.198.238
- 216.58.204.4
- 216.58.198.238
- 216.58.204.4
- 216.58.198.238
- 216.58.204.4
+
+vhosts found:
+
+Shodan results:
+
+
+theHarvester scan statistics
+
+
+
+
+| Domain |
+Date |
+Recordtype |
+Source |
+Total results |
+
+
+| google.com | 2018-12-12 | host | email | 1 |
google.com | 2018-12-12 | host | google | 1 | google.com | 2018-12-12 | ip | DNS-resolver | 1 | google.com | 2018-12-14 | host | google | 21 | google.com | 2018-12-14 | host | shodan | 1 | google.com | 2018-12-14 | ip | DNS-resolver | 17 | google.com | 2018-12-14 | ip | shodan | 2 | google.com | 2018-12-15 | host | email | 1 | google.com | 2018-12-15 | host | google | 285 | google.com | 2018-12-15 | host | shodan | 2 | google.com | 2018-12-15 | ip | DNS-resolver | 212 | google.com | 2018-12-16 | email | google | 10 | google.com | 2018-12-16 | host | google | 210 | google.com | 2018-12-16 | ip | DNS-resolver | 140 | google.com | 2018-12-17 | email | google | 3 | google.com | 2018-12-17 | host | google | 247 | google.com | 2018-12-17 | ip | DNS-resolver | 213 | lch.com | 2018-12-14 | email | google | 15 | lch.com | 2018-12-14 | host | google | 12 | lch.com | 2018-12-14 | ip | DNS-resolver | 7 | lch.com | 2018-12-14 | shodan | DNS-resolver | 1 |
+
+
+
+
+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:
-
- - email1@google.com
- - email2@google.com
-
- Hosts found:
-
- - host1.google.com
- - host2.google.com
- - host3.google.com
-
- IP addresses found:
-
- - 87.12.42.12
- - 87.12.42.11
- - 87.12.43.11
- - 87.12.44.11
-
- 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:
-
- - email1@google.com
- - email2@google.com
-
- Hosts found:
-
- - host1.google.com
- - host2.google.com
- - host3.google.com
-
- IP addresses found:
-
- - 87.12.42.12
- - 87.12.42.11
- - 87.12.43.11
- - 87.12.44.11
-
- 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(