Esempio n. 1
0
 def scanTemplateEditByRelay(self, templateEdit, templateNewName, policyId,
                             relay):
     found = False
     for node in self.torNodes:
         if relay is not None:
             if relay == node.host or relay.lower() == node.nickName.lower(
             ):
                 found = True
                 break
     if found:
         nessusConverter = NessusConverter(
             self.nessusClient.scanTemplateEdit(templateEdit,
                                                templateNewName, policyId,
                                                relay))
         nessusConverter.scanTemplateToStructure()
         print "[*] Nessus scan Template Edit."
         tableTemplate = PrettyTable(
             ["Owner", "Readable Name", "Target", "Scan Name", "Policy ID"])
         if nessusConverter.nessusStructure.nessusScanTemplate is not None:
             tableTemplate.add_row([
                 nessusConverter.nessusStructure.nessusScanTemplate.owner,
                 nessusConverter.nessusStructure.nessusScanTemplate.
                 readablename,
                 nessusConverter.nessusStructure.nessusScanTemplate.target,
                 nessusConverter.nessusStructure.nessusScanTemplate.name,
                 nessusConverter.nessusStructure.nessusScanTemplate.policyId
             ])
         print tableTemplate
Esempio n. 2
0
 def scanTemplateDelete(self, templateUuid):
     nessusConverter = NessusConverter(self.nessusClient.scanTemplateDelete(templateUuid))
     nessusConverter.scanTemplateToStructure()
     print "[*] Nessus scan Template Deleted."
     tableTemplate = PrettyTable(["Owner", "Readable Name", "Target", "Scan Name", "Policy ID"])
     if nessusConverter.nessusStructure.nessusScanTemplate is not None:
         tableTemplate.add_row([nessusConverter.nessusStructure.nessusScanTemplate.owner,
                            nessusConverter.nessusStructure.nessusScanTemplate.readablename,
                            nessusConverter.nessusStructure.nessusScanTemplate.target,
                            nessusConverter.nessusStructure.nessusScanTemplate.name,
                            nessusConverter.nessusStructure.nessusScanTemplate.policyId])
     print tableTemplate
Esempio n. 3
0
 def scanTemplateAllRelays(self, policyId, templateName):
     targets = ''
     for node in self.torNodes:
         targets +=node.host+"\n"
     nessusConverter = NessusConverter(self.nessusClient.scanTemplateNew(policyId,targets,templateName))
     nessusConverter.scanTemplateToStructure()
     print "[*] Nessus scan Template New."
     tableTemplate = PrettyTable(["Owner", "Readable Name", "Target", "Scan Name", "Policy ID"])
     tableTemplate.add_row([nessusConverter.nessusStructure.nessusScanTemplate.owner,
                            nessusConverter.nessusStructure.nessusScanTemplate.readablename,
                            nessusConverter.nessusStructure.nessusScanTemplate.target,
                            nessusConverter.nessusStructure.nessusScanTemplate.name,
                            nessusConverter.nessusStructure.nessusScanTemplate.policyId])
     print tableTemplate
Esempio n. 4
0
 def scanTemplateDelete(self, templateUuid):
     nessusConverter = NessusConverter(
         self.nessusClient.scanTemplateDelete(templateUuid))
     nessusConverter.scanTemplateToStructure()
     print "[*] Nessus scan Template Deleted."
     tableTemplate = PrettyTable(
         ["Owner", "Readable Name", "Target", "Scan Name", "Policy ID"])
     if nessusConverter.nessusStructure.nessusScanTemplate is not None:
         tableTemplate.add_row([
             nessusConverter.nessusStructure.nessusScanTemplate.owner,
             nessusConverter.nessusStructure.nessusScanTemplate.
             readablename,
             nessusConverter.nessusStructure.nessusScanTemplate.target,
             nessusConverter.nessusStructure.nessusScanTemplate.name,
             nessusConverter.nessusStructure.nessusScanTemplate.policyId
         ])
     print tableTemplate
Esempio n. 5
0
 def scanTemplateByRelay(self,policyId,relay,templateName):
     found = False
     for node in self.torNodes:
         if relay is not None:
             if relay == node.host or relay.lower() == node.nickName.lower():
                 found = True
                 break
     if found:
         nessusConverter = NessusConverter(self.nessusClient.scanTemplateNew(policyId,relay,templateName))
         nessusConverter.scanTemplateToStructure()
         print "[*] Nessus scan Template New."
         tableTemplate = PrettyTable(["Owner", "Readable Name", "Target", "Scan Name", "Policy ID"])
         tableTemplate.add_row([nessusConverter.nessusStructure.nessusScanTemplate.owner,
                            nessusConverter.nessusStructure.nessusScanTemplate.readablename,
                            nessusConverter.nessusStructure.nessusScanTemplate.target,
                            nessusConverter.nessusStructure.nessusScanTemplate.name,
                            nessusConverter.nessusStructure.nessusScanTemplate.policyId])
         print tableTemplate
Esempio n. 6
0
 def scanTemplateAllRelays(self, policyId, templateName):
     targets = ''
     for node in self.torNodes:
         targets += node.host + "\n"
     nessusConverter = NessusConverter(
         self.nessusClient.scanTemplateNew(policyId, targets, templateName))
     nessusConverter.scanTemplateToStructure()
     print "[*] Nessus scan Template New."
     tableTemplate = PrettyTable(
         ["Owner", "Readable Name", "Target", "Scan Name", "Policy ID"])
     tableTemplate.add_row([
         nessusConverter.nessusStructure.nessusScanTemplate.owner,
         nessusConverter.nessusStructure.nessusScanTemplate.readablename,
         nessusConverter.nessusStructure.nessusScanTemplate.target,
         nessusConverter.nessusStructure.nessusScanTemplate.name,
         nessusConverter.nessusStructure.nessusScanTemplate.policyId
     ])
     print tableTemplate