From 5c0adba5fe3f9cb6a0223d64a8805ba3b0385c4c Mon Sep 17 00:00:00 2001 From: laramies Date: Sun, 10 May 2015 23:43:09 +0100 Subject: [PATCH] 2.6 Rearrange htmlExport, created tests directory. --- changelog.txt | 4 +- htmlExport.py | 172 --------------------- lib/htmlExport.py | 10 +- myparser_test.py => tests/myparser_test.py | 0 4 files changed, 8 insertions(+), 178 deletions(-) delete mode 100644 htmlExport.py rename myparser_test.py => tests/myparser_test.py (100%) diff --git a/changelog.txt b/changelog.txt index 33e91c7c..53a4220b 100644 --- a/changelog.txt +++ b/changelog.txt @@ -2,7 +2,9 @@ Changelog in 2.6: ----------------- usage() improvement, CameronNemo. - +Added Yahoo and Baidu search engines. Thanks to Tatanus +Added check for the existence of Requests library. +Fixed email regex to provide cleaner results. Thanks to Peter McAlpine Changelog in 2.5: ----------------- diff --git a/htmlExport.py b/htmlExport.py deleted file mode 100644 index 549abbf1..00000000 --- a/htmlExport.py +++ /dev/null @@ -1,172 +0,0 @@ -from lib import markup -from lib import graphs -import re - - -class htmlExport(): - - def __init__(self, users, hosts, vhosts, dnsres, - dnsrev, file, domain, shodan, tldres): - self.users = users - self.hosts = hosts - self.vhost = vhosts - self.fname = file - self.dnsres = dnsres - self.dnsrev = dnsrev - self.domain = domain - self.shodan = shodan - self.tldres = tldres - self.style = "" - - def styler(self): - a = """ - """ - self.style = a - - def writehtml(self): - page = markup.page() - # page.init (title="theHarvester - # Results",css=('edge.css'),footer="Edge-security 2011")A - page.html() - self.styler() - page.head(self.style) - page.body() - page.h1("theHarvester results") - page.h2("for :" + self.domain) - page.h3("Dashboard:") - graph = graphs.BarGraph('vBar') - graph.values = [len( - self.users), - len(self.hosts), - len(self.vhost), - len(self.tldres), - len(self.shodan)] - graph.labels = ['Emails', 'hosts', 'Vhost', 'TLD', 'Shodan'] - graph.showValues = 1 - page.body(graph.create()) - page.h3("E-mails names found:") - if self.users != []: - page.ul(class_="userslist") - page.li(self.users, class_="useritem") - page.ul.close() - else: - page.h2("No emails found") - page.h3("Hosts found:") - if self.hosts != []: - page.ul(class_="softlist") - page.li(self.hosts, class_="softitem") - page.ul.close() - else: - page.h2("No hosts found") - if self.tldres != []: - page.h3("TLD domains found in TLD expansion:") - page.ul(class_="tldlist") - page.li(self.tldres, class_="tlditem") - page.ul.close() - if self.dnsres != []: - page.h3("Hosts found in DNS brute force:") - page.ul(class_="dnslist") - page.li(self.dnsres, class_="dnsitem") - page.ul.close() - if self.dnsrev != []: - page.h3("Hosts found with reverse lookup :") - page.ul(class_="dnsrevlist") - page.li(self.dnsrev, class_="dnsrevitem") - page.ul.close() - if self.vhost != []: - page.h3("Virtual hosts found:") - page.ul(class_="pathslist") - page.li(self.vhost, class_="pathitem") - page.ul.close() - if self.shodan != []: - shodanalysis = [] - page.h3("Shodan results:") - for x in self.shodan: - res = x.split("SAPO") - page.h3(res[0]) - page.a("Port :" + res[2]) - page.pre(res[1]) - page.pre.close() - ban = res[1] - reg_server = re.compile('Server:.*') - temp = reg_server.findall(res[1]) - if temp != []: - shodanalysis.append(res[0] + ":" + temp[0]) - if shodanalysis != []: - page.h3("Server technologies:") - repeated = [] - for x in shodanalysis: - if x not in repeated: - page.pre(x) - page.pre.close() - repeated.append(x) - page.body.close() - page.html.close() - file = open(self.fname, 'w') - for x in page.content: - try: - file.write(x) - except: - print "Exception" + x # send to logs - pass - file.close - return "ok" diff --git a/lib/htmlExport.py b/lib/htmlExport.py index 440faee8..549abbf1 100644 --- a/lib/htmlExport.py +++ b/lib/htmlExport.py @@ -20,10 +20,10 @@ def __init__(self, users, hosts, vhosts, dnsres, def styler(self): a = """