Esempio n. 1
0
 def getOutput(self):
     output = []
     try:
         _file = readfile(self.massdnsOutput)
         for line in _file:
             line = ast.literal_eval(json.loads(json.dumps(line)))
             if line.get('status') == 'NOERROR' and line.get('data') != {}:
                 output.append(line.get('name'))
         os.remove(self.inputMDNS)
         os.remove(self.massdnsOutput)
         return output
     except Exception as err:
         print('[ + ] Error: %s' % (err))
Esempio n. 2
0
 def getOutput(self):
     output = []
     try:
         _file = readfile(self.massdnsOutput)
         for line in _file:
             line = json.loads(line)
             if line.get('status') == 'NOERROR':
                 output.append(line.get('name'))
     except Exception as err:
         print('[ + ] Error: %s'%(err))
     os.remove(self.altdnsInput)
     os.remove(self.altdnsOutput)
     os.remove(self.massdnsOutput)
     return output
Esempio n. 3
0
 def getOutput(self):
     output = ""
     try:
         _file = readfile(self.outputMascan)
         _file = "".join(_file).replace(' ','')
         for line in _file.split('},'):
             if not line.endswith(']}'):
                 line = line + '}'
                 i = json.loads(line)
                 if i.get('ip') and i.get('ports'):
                      port = str(i.get('ports')[0].get('port')) + '/' + i.get('ports')[0].get('proto')
                      output += "{port};".format(port=port)
             else:
                 i = json.loads(line) 
                 if i.get('ip') and i.get('ports'):
                     port = str(i.get('ports')[0].get('port')) + '/' + i.get('ports')[0].get('proto')
                     output += "{port};".format(port=port)
         os.remove(self.massdnsOutput)
         return output
     except Exception as err:
         print('[ + ] Error: %s'%(err))
Esempio n. 4
0
 def getOutput(self):
     try:
         return readfile(self.tmpPath)
     except Exception as err:
         print('[ E ] ERROR: ' + str(err))
Esempio n. 5
0
 def configParser(self):
     self.configPath = self.toolPath + '/{path}'.format(
         path=castleBravoV2.configName)
     content = readfile(self.configPath)
     self.config = json.loads("\n".join(content) if content != [] else '{}')
Esempio n. 6
0
 def configReload(self):
     content = readfile(self.configPath)
     self.config = json.loads("\n".join(content) if content != [] else '{}')
     self.__init__()