class htmlgenerator: def __init__(self,word): self.domain = word def generatelatestscanresults(self, latestscanresults): try: html='''
| Date | Domain | Plugin | Record type | Result |
| ' + str(i[0]) + " | " html += '' + str(i[1]) + " | " html += '' + str(i[2]) + " | " html += '' + str(i[3]) + " | " html += '' + str(i[4]) + " | " html +='
''' return html except Exception as e: print("Error generating the latest scan results HTML code: " + str(e)) def beginhtml(self): html =''' ''' return html def generatedashboardcode(self, scanboarddata): try: totalnumberofdomains = scanboarddata['domains'] totalnumberofhosts = scanboarddata['host'] totalnumberofip = scanboarddata['ip'] totalnumberofvhost= scanboarddata['vhost'] totalnumberofemail= scanboarddata['email'] totalnumberofshodan= scanboarddata['shodan'] html='''
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 generatepluginscanstatistics(self, scanstatistics): try: html='''
| Domain | Date | Recordtype | Source | Total results |
| ' + str(i[0]) + " | " html += '' + str(i[1]) + " | " html += '' + str(i[2]) + " | " html += '' + str(i[3]) + " | " html += '' + str(i[4]) + " | " html +='
''' return html except Exception as e: print("Error generating scan statistics HTML code: " + str(e)) def generatescandetailsdomain(self, word, latestscandomain): #This is the old scan details try: emails = latestscandomain['scandetailsemail'] hosts = latestscandomain['scandetailshost'] ips = latestscandomain['scandetailsip'] vhosts = latestscandomain['scandetailsvhost'] shodans = latestscandomain['scandetailsshodan'] html='''