From c966acf537ddb2f3d388e8f9ca78db85f197cda0 Mon Sep 17 00:00:00 2001 From: jzold Date: Sun, 16 Dec 2018 16:37:36 +0000 Subject: [PATCH 1/6] added scanning history report for domain --- lib/reportgraph.py | 47 ++++++++++++++++++++---------------- report.html | 16 ++++++------- stash.py | 60 ++++++++++++++++++++++++++++++---------------- theHarvester.py | 14 +++++++++-- 4 files changed, 86 insertions(+), 51 deletions(-) diff --git a/lib/reportgraph.py b/lib/reportgraph.py index d4d5281fd40..24c94fe5a12 100644 --- a/lib/reportgraph.py +++ b/lib/reportgraph.py @@ -3,6 +3,7 @@ import plotly.plotly as py import plotly import stash + from datetime import datetime try: db=stash.stash_manager() db.do_init() @@ -15,8 +16,13 @@ def __init__(self, domain): self.domain = domain self.bardata = [] self.barcolumns = [] - self.scatterxhosts = [] - self.scatteryhosts = [] + self.scatterxdata = [] + self.scattercountemails = [] + self.scattercounthosts = [] + self.scattercountips = [] + self.scattercountshodans = [] + self.scattercountvhosts = [] + def drawlatestscangraph(self,domain,latestscandata): self.barcolumns= ['email','host','ip','shodan','vhost'] @@ -25,8 +31,6 @@ def drawlatestscangraph(self,domain,latestscandata): self.bardata.append(latestscandata['ip']) self.bardata.append(latestscandata['shodan']) self.bardata.append(latestscandata['vhost']) - # for i in scandata: - # self.bardata.append(scandata[i]) layout = dict(title = "Last scan - number of targets identified for "+ domain +" on "+str(latestscandata["latestdate"]), xaxis = dict(title = 'Targets'), yaxis = dict(title = 'Hits'),) @@ -36,43 +40,46 @@ def drawlatestscangraph(self,domain,latestscandata): }, auto_open=False,include_plotlyjs=False,filename='report.html', output_type='div') return barchartcode - def drawscattergraph(self,domain,latestscandata): - scandata = latestscandata - for i in scandata['scandetails']: - self.scatterxhosts.append(i) - self.scatteryhosts.append(scandata[i]) + 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'])) trace0 = go.Scatter( - x=[date1,date2,date3,date4,date5], - y=[3, 10, 9, 17,10], + x=self.scatterxdata, + y=self.scattercounthosts, mode = 'lines+markers', name = 'hosts') trace1 = go.Scatter( - x=[date1,date2,date3,date4,date5], - y=[2, 6, 9, 10, 5], + x=self.scatterxdata, + y=self.scattercountips, mode = 'lines+markers', name = 'IP address') trace2 = go.Scatter( - x=[date1,date2,date3,date4,date5], - y=[1, 2, 4, 6, 2], + x=self.scatterxdata, + y=self.scattercountvhosts, mode = 'lines+markers', name = 'vhost') trace3 = go.Scatter( - x=[date1,date2,date3,date4,date5], - y=[2, 3, 2, 5, 7], + x=self.scatterxdata, + y=self.scattercountshodans, mode = 'lines+markers', name = 'shodan') trace4 = go.Scatter( - x=[date1,date2,date3,date4,date5], - y=[12, 14, 20, 24, 20], + 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'), diff --git a/report.html b/report.html index 3a16e7fae73..256fef67c2d 100644 --- a/report.html +++ b/report.html @@ -16,10 +16,10 @@

TheHarvester scanning dashboard

2

-

247

-

183

+

534

+

380

0

-

15

+

25

0

@@ -31,18 +31,18 @@

TheHarvester scanning dashboard 

 

-

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

+

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
  • Mail.google.com
  • news.google.com
  • images.google.com
  • mx.google.com
  • plus.google.com
  • www.docs.google.com
  • scholar.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
  • Mail.google.com
  • news.google.com
  • images.google.com
  • mx.google.com
  • plus.google.com
  • www.docs.google.com
  • scholar.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
  • Mail.google.com
  • news.google.com
  • images.google.com
  • docs.google.com
  • video.google.com
  • .news.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
  • adssettings.google.com
  • Mail.google.com
  • edu.google.com
  • images.google.com
  • gotonet.google.com
  • news.google.com
  • docs.google.com
  • video.google.com
  • .news.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
  • adssettings.google.com
  • Mail.google.com
  • edu.google.com
  • images.google.com
  • gotonet.google.com
  • news.google.com
  • docs.google.com
  • video.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
  • Mail.google.com
  • edu.google.com
  • images.google.com
  • gotonet.google.com
  • news.google.com
  • docs.google.com
  • video.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
  • account.google.com
  • adssettings.google.com
  • Mail.google.com
  • images.google.com
  • ...google.com
  • plus.google.com
  • ...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
  • account.google.com
  • adssettings.google.com
  • images.google.com
  • photos.google.com
  • books.google.com
  • mx.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
  • adssettings.google.com
  • Mail.google.com
  • images.google.com
  • ...google.com
  • plus.google.com
  • ...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
  • account.google.com
  • adssettings.google.com
  • Mail.google.com
  • images.google.com
  • ...google.com
  • plus.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
  • account.google.com
  • adssettings.google.com
  • Mail.google.com
  • images.google.com
  • ...google.com
  • plus.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
  • account.google.com
  • adssettings.google.com
  • Mail.google.com
  • images.google.com
  • code.google.com
  • www.support.google.com
  • .mail.google.com
  • screenshot-www.google.com
  • docs.google.com
  • www.docs.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
  • Mail.google.com
  • images.google.com
  • code.google.com
  • www.support.google.com
  • .mail.google.com
  • screenshot-www.google.com
  • docs.google.com
  • www.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
  • +
  • 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.201.5
  • 216.58.206.45
  • 216.58.206.78
  • 216.58.198.110
  • 216.58.206.110
  • 216.58.198.174
  • 172.217.23.14
  • 216.58.206.46
  • 216.58.213.78
  • 216.58.213.100
  • 108.177.15.189
  • 216.58.204.4
  • 216.58.201.5
  • 216.58.206.45
  • 216.58.206.78
  • 216.58.198.110
  • 216.58.206.110
  • 216.58.198.174
  • 172.217.23.14
  • 216.58.206.46
  • 216.58.213.110
  • 216.58.213.100
  • 108.177.15.189
  • 216.58.204.4
  • 216.58.201.5
  • 216.58.206.45
  • 216.58.206.78
  • 216.58.213.110
  • 216.58.198.110
  • 216.58.206.110
  • 216.58.198.174
  • 172.217.23.14
  • 216.58.206.46
  • 216.58.204.78
  • 216.58.204.4
  • 216.58.201.5
  • 216.58.206.45
  • 216.58.206.78
  • 216.58.213.110
  • 216.58.208.142
  • 216.58.198.238
  • 216.58.206.110
  • 216.58.198.174
  • 172.217.23.14
  • 216.58.206.46
  • 216.58.213.78
  • 216.58.204.78
  • 216.58.204.4
  • 216.58.201.5
  • 216.58.206.45
  • 216.58.206.78
  • 216.58.213.110
  • 216.58.208.142
  • 216.58.198.238
  • 216.58.206.110
  • 216.58.198.174
  • 172.217.23.14
  • 216.58.206.46
  • 216.58.204.78
  • 216.58.204.4
  • 216.58.201.5
  • 216.58.206.45
  • 216.58.206.78
  • 216.58.213.110
  • 216.58.208.142
  • 216.58.198.238
  • 216.58.206.110
  • 216.58.198.174
  • 172.217.23.14
  • 216.58.206.46
  • 216.58.204.78
  • 216.58.204.4
  • 216.58.201.5
  • 216.58.206.78
  • 216.58.206.45
  • 216.58.198.110
  • 216.58.206.110
  • 216.58.198.174
  • 216.58.206.46
  • 216.58.213.110
  • 172.217.17.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.213.110
  • 216.58.206.46
  • 216.58.204.4
  • 216.58.201.5
  • 216.58.206.78
  • 216.58.206.45
  • 216.58.198.110
  • 216.58.206.110
  • 216.58.198.174
  • 216.58.206.46
  • 216.58.213.110
  • 216.58.198.238
  • 216.58.204.4
  • 216.58.201.5
  • 216.58.206.78
  • 216.58.206.45
  • 216.58.198.110
  • 216.58.206.110
  • 216.58.198.174
  • 216.58.206.46
  • 216.58.213.78
  • 216.58.204.4
  • 216.58.201.5
  • 216.58.206.78
  • 216.58.206.45
  • 216.58.198.110
  • 216.58.206.110
  • 216.58.198.174
  • 216.58.206.46
  • 216.58.213.78
  • 216.58.204.4
  • 216.58.201.5
  • 216.58.206.78
  • 216.58.206.45
  • 216.58.214.14
  • 216.58.213.110
  • 216.58.198.110
  • 216.58.206.110
  • 216.58.198.174
  • 216.58.206.46
  • 108.177.15.189
  • 216.58.204.4
  • 216.239.32.27
  • 216.58.201.5
  • 216.58.206.78
  • 216.58.206.45
  • 216.58.214.14
  • 216.58.213.110
  • 216.58.198.110
  • 216.58.206.110
  • 216.58.198.174
  • 216.58.206.46
  • 108.177.15.189
  • 216.58.204.4
  • 216.239.32.27
  • 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.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:

    @@ -52,7 +52,7 @@

    Shodan results:

    -

    Report generated on 2018-12-15 17:19:32.865421

    +

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

    \ No newline at end of file diff --git a/stash.py b/stash.py index 724de672aca..61d52baecd5 100644 --- a/stash.py +++ b/stash.py @@ -9,7 +9,7 @@ def __init__(self): self.results = "" self.totalresults = "" self.latestscandomain = {} - self.domainscanhistory = {} + self.domainscanhistory = [] self.scanboarddata = {} def do_init(self): @@ -126,29 +126,47 @@ def getscanboarddata(self): finally: conn.close() - def getscanhistory(self,domain): - '''dis needs fixing; minden datumhoz kell a count of hosts, emails, ip vhost for a specific domain''' + def getscanhistorydomain(self,domain): try: - self.getscanhistory["domain"] = domain conn = sqlite3.connect(self.db) c = conn.cursor() - c.execute('''SELECT COUNT(*) from results WHERE domain=? AND type="host"''',(domain,)) - data = c.fetchone() - self.domainscanhistory["host"] = data[0] - c.execute('''SELECT COUNT(*) from results WHERE domain=? AND type="email"''',(domain,)) - data = c.fetchone() - self.domainscanhistory["email"] = data[0] - c.execute('''SELECT COUNT(*) from results WHERE domain=? AND type="ip"''',(domain,)) - data = c.fetchone() - self.domainscanhistory["ip"] = data[0] - c.execute('''SELECT COUNT(*) from results WHERE domain=? AND type="vhost"''',(domain,)) - data = c.fetchone() - self.domainscanhistory["vhost"] = data[0] - c.execute('''SELECT COUNT(*) from results WHERE domain=? AND type="shodan"''',(domain,)) - data = c.fetchone() - self.domainscanhistory["shodan"] = data[0] - c.execute('''SELECT find_date FROM results WHERE domain=?''',(domain,)) - data = c.fetchone() + #self.domainscanhistory[domain].append(domain) + + c.execute('''SELECT DISTINCT(find_date) FROM results WHERE domain=?''',(domain,)) + dates = c.fetchall() + #id = 1 #this is an ID for the dict + for date in dates: + c = conn.cursor() + c.execute('''SELECT COUNT(*) from results WHERE domain=? AND type="host" AND find_date=?''',(domain,date[0])) + counthost = c.fetchone() + c = conn.cursor() + c.execute('''SELECT COUNT(*) from results WHERE domain=? AND type="email" AND find_date=?''',(domain,date[0])) + countemail = c.fetchone() + c = conn.cursor() + c.execute('''SELECT COUNT(*) from results WHERE domain=? AND type="ip" AND find_date=?''',(domain,date[0])) + countip = c.fetchone() + c = conn.cursor() + c.execute('''SELECT COUNT(*) from results WHERE domain=? AND type="vhost" AND find_date=?''',(domain,date[0])) + countvhost = c.fetchone() + c = conn.cursor() + c.execute('''SELECT COUNT(*) from results WHERE domain=? AND type="shodan" AND find_date=?''',(domain,date[0])) + countshodan = c.fetchone() + #self.domainscanhistory[str(date[0])] = date[0] + results = { + "date" : str(date[0]), + "hosts" : str(counthost[0]), + "email" : str(countemail[0]), + "ip" : str(countip[0]), + "vhost" : str(countvhost[0]), + "shodan" : str(countshodan[0]) + } + #results = domain+";"+str(date[0])+";"+str(counthost[0])+";"+str(countemail[0])+";"+str(countip[0])+";"+str(countvhost[0])+";"+str(countshodan[0]) + #self.domainscanhistory["result"+str(id)] = results + #self.domainscanhistory.append[domain,pdate,counthost,countemail,countip,countvhost,countshodan] + self.domainscanhistory.append(results) + #self.domainscanhistory[str(date[0])] = date[0] + #self.domainscanhistory["domain"] = domain + #id += 1 return self.domainscanhistory except Exception as e: print(e) diff --git a/theHarvester.py b/theHarvester.py index a9302cf39cb..9dd59859120 100755 --- a/theHarvester.py +++ b/theHarvester.py @@ -217,7 +217,8 @@ def start(argv): all_hosts = search.get_hostnames() db=stash.stash_manager() db.store_all(word,all_hosts,'email','bing') - db.store_all(word,all_hosts,'host','bing') + db.store_all(word,all_hosts,'host','bing') + all_emails = [] elif engineitem == "dogpile": print("[-] Searching in Dogpilesearch..") @@ -267,6 +268,8 @@ def start(argv): print("====================") db=stash.stash_manager() db.store_all(word,people,'name','googleplus') + all_emails = [] + all_hosts = [] for user in people: print(user) sys.exit() @@ -277,6 +280,8 @@ def start(argv): search.process() people = search.get_people() db=stash.stash_manager() + all_emails = [] + all_hosts = [] db.store_all(word,people,'name','twitter') print("Users from Twitter:") print("-------------------") @@ -290,6 +295,8 @@ def start(argv): search.process() people = search.get_people() db=stash.stash_manager() + all_emails = [] + all_hosts = [] db.store_all(word,people,'name','linkedin') print("Users from Linkedin:") print("-------------------") @@ -303,6 +310,8 @@ def start(argv): search.process_profiles() people = search.get_profiles() db=stash.stash_manager() + all_emails = [] + all_hosts = [] db.store_all(word,people,'name','google-profile') print("Users from Google profiles:") print("---------------------------") @@ -657,6 +666,7 @@ def start(argv): db = stash.stash_manager() scanboarddata = db.getscanboarddata() latestscandomain = db.getlatestscandomain(word) + scanhistorydomain = db.getscanhistorydomain(word) from lib import statichtmlgenerator generator = statichtmlgenerator.htmlgenerator(word) HTMLcode = generator.generatedashboardcode(scanboarddata) @@ -665,7 +675,7 @@ def start(argv): import datetime graph = reportgraph.graphgenerator(word) HTMLcode += graph.drawlatestscangraph(word, latestscandomain) - #HTMLcode += graph.drawscattergraph(word, latestscandata) + HTMLcode += graph.drawscattergraphscanhistory(word, scanhistorydomain) HTMLcode += '

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

    ' HTMLcode +=''' From 9b0c30d579a0591538a15a27a7c0bdf31dfaa332 Mon Sep 17 00:00:00 2001 From: jzold Date: Sun, 16 Dec 2018 16:43:05 +0000 Subject: [PATCH 2/6] deleting as not required --- oldreport.html | 61 ------------------------------------------------- 1 file changed, 61 deletions(-) delete mode 100644 oldreport.html diff --git a/ oldreport.html b/ oldreport.html deleted file mode 100644 index deeaa93b968..00000000000 --- a/ oldreport.html +++ /dev/null @@ -1,61 +0,0 @@ - -

    theHarvester results

    for :google.com

    Dashboard:

    0%
    100%
    0%
    0%
    0%
     0  2  0  0  0 
     Emails  hosts  Vhost  TLD  Shodan 

    E-mails names found:

    No emails found

    Hosts found:

    • support.google.com:216.58.198.238
    • www.google.com:216.58.204.4
    \ No newline at end of file From 2adc67a6302ba59b8a1a1f32ba021ee4f0d2007b Mon Sep 17 00:00:00 2001 From: jzold Date: Sun, 16 Dec 2018 16:43:18 +0000 Subject: [PATCH 3/6] deleting as not required --- oldreport.xml | 1 - 1 file changed, 1 deletion(-) delete mode 100644 oldreport.xml diff --git a/ oldreport.xml b/ oldreport.xml deleted file mode 100644 index 46bfaafa88a..00000000000 --- a/ oldreport.xml +++ /dev/null @@ -1 +0,0 @@ -216.58.198.238support.google.com216.58.204.4www.google.com \ No newline at end of file From d1dbca0157b4a753c6876cf45dcc9d13418a657c Mon Sep 17 00:00:00 2001 From: jzold Date: Sun, 16 Dec 2018 21:17:00 +0000 Subject: [PATCH 4/6] cleanup of the stash module --- stash.py | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/stash.py b/stash.py index 61d52baecd5..ab2476d9769 100644 --- a/stash.py +++ b/stash.py @@ -130,11 +130,8 @@ def getscanhistorydomain(self,domain): try: conn = sqlite3.connect(self.db) c = conn.cursor() - #self.domainscanhistory[domain].append(domain) - c.execute('''SELECT DISTINCT(find_date) FROM results WHERE domain=?''',(domain,)) dates = c.fetchall() - #id = 1 #this is an ID for the dict for date in dates: c = conn.cursor() c.execute('''SELECT COUNT(*) from results WHERE domain=? AND type="host" AND find_date=?''',(domain,date[0])) @@ -151,7 +148,6 @@ def getscanhistorydomain(self,domain): c = conn.cursor() c.execute('''SELECT COUNT(*) from results WHERE domain=? AND type="shodan" AND find_date=?''',(domain,date[0])) countshodan = c.fetchone() - #self.domainscanhistory[str(date[0])] = date[0] results = { "date" : str(date[0]), "hosts" : str(counthost[0]), @@ -160,13 +156,7 @@ def getscanhistorydomain(self,domain): "vhost" : str(countvhost[0]), "shodan" : str(countshodan[0]) } - #results = domain+";"+str(date[0])+";"+str(counthost[0])+";"+str(countemail[0])+";"+str(countip[0])+";"+str(countvhost[0])+";"+str(countshodan[0]) - #self.domainscanhistory["result"+str(id)] = results - #self.domainscanhistory.append[domain,pdate,counthost,countemail,countip,countvhost,countshodan] self.domainscanhistory.append(results) - #self.domainscanhistory[str(date[0])] = date[0] - #self.domainscanhistory["domain"] = domain - #id += 1 return self.domainscanhistory except Exception as e: print(e) From ffdfd6cc75bc312c16af4dfdd9ff548d332397c0 Mon Sep 17 00:00:00 2001 From: jzold Date: Mon, 17 Dec 2018 20:36:30 +0000 Subject: [PATCH 5/6] added theHarvester scan statistics table to the report --- lib/reportgraph.py | 121 ++++++++++----------- lib/statichtmlgenerator.py | 208 ++++++++++++++++++++++--------------- report.html | 126 ++++++++++++---------- stash.py | 75 ++++++++----- testreport.py | 188 --------------------------------- testreportstack.py | 186 --------------------------------- theHarvester.py | 6 +- 7 files changed, 310 insertions(+), 600 deletions(-) delete mode 100644 testreport.py delete mode 100644 testreportstack.py diff --git a/lib/reportgraph.py b/lib/reportgraph.py index 24c94fe5a12..c357aecc2a6 100644 --- a/lib/reportgraph.py +++ b/lib/reportgraph.py @@ -22,74 +22,79 @@ def __init__(self, domain): 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 d22c6e22aef..d43f8dbe7a6 100644 --- a/lib/statichtmlgenerator.py +++ b/lib/statichtmlgenerator.py @@ -3,89 +3,129 @@ def __init__(self,word): 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:

    -
      - ''' - 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 256fef67c2d..f7613dd8be8 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

    +

     

    + + + + + + + + + + + + +
    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 ab2476d9769..eda27a6a5e7 100644 --- a/stash.py +++ b/stash.py @@ -11,6 +11,7 @@ def __init__(self): self.latestscandomain = {} self.domainscanhistory = [] self.scanboarddata = {} + self.scanstats = [] def do_init(self): conn = sqlite3.connect(self.db) @@ -99,32 +100,32 @@ def getlatestscandomain(self,domain): 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 @@ def getscanhistorydomain(self,domain): 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 4e7628e55fc..00000000000 --- 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:

    -
      -
    • NONE
    • -
    - ''' - 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 bf1ec979372..00000000000 --- 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:

    -
      -
    • NONE
    • -
    - ''' - 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 84ae38f8d5a..bc6bf93c6d6 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( From c2c36b79320848ef40465a6d716eb83b53986660 Mon Sep 17 00:00:00 2001 From: jzold Date: Mon, 17 Dec 2018 20:43:08 +0000 Subject: [PATCH 6/6] deleted report.html --- report.html | 76 ----------------------------------------------------- 1 file changed, 76 deletions(-) delete mode 100644 report.html diff --git a/report.html b/report.html deleted file mode 100644 index f7613dd8be8..00000000000 --- a/report.html +++ /dev/null @@ -1,76 +0,0 @@ - - - - -

    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

    -

     

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