Ejemplo n.º 1
0
 def registerPoc(self):
     pocString = multipleReplace(self.pocString, POC_IMPORTDICT)
     _, self.moduleName = filepathParser(self.pocName)
     try:
         importer = StringImporter(self.moduleName, pocString)
         importer.load_module(self.moduleName)
     except ImportError, ex:
         logger.log(CUSTOM_LOGGING.ERROR, ex)
Ejemplo n.º 2
0
 def registerPoc(self):
     pocString = multipleReplace(self.pocString, POC_IMPORTDICT)
     _, self.moduleName = filepathParser(self.pocName)
     try:
         importer = StringImporter(self.moduleName, pocString)
         importer.load_module(self.moduleName)
     except ImportError, ex:
         pass  # TODO
Ejemplo n.º 3
0
 def registerPoc(self):
     pocString = multipleReplace(self.pocString, POC_IMPORTDICT)
     _, self.moduleName = filepathParser(self.pocName)
     try:
         importer = StringImporter(self.moduleName, pocString)
         importer.load_module(self.moduleName)
     except ImportError, ex:
         logger.log(CUSTOM_LOGGING.ERROR, ex)
Ejemplo n.º 4
0
 def registerPoc(self):
     pocString = multipleReplace(self.pocString, POC_IMPORTDICT)
     _, self.moduleName = filepathParser(self.pocName)
     try:
         importer = StringImporter(self.moduleName, pocString)
         importer.load_module(self.moduleName)
     except ImportError, ex:
         pass  # TODO
Ejemplo n.º 5
0
def registerPyPoc(pocDict):
    pocname = pocDict.keys()[0]
    _, moduleName = filepathParser(pocname)
    try:
        importer = StringImporter(moduleName, pocDict[pocname])
        importer.load_module(moduleName)
    except ImportError, ex:
        errMsg = "%s register failed \"%s\"" % (moduleName, str(ex))
        logger.log(CUSTOM_LOGGING.ERROR, errMsg)
Ejemplo n.º 6
0
def registerPyPoc(pocDict):
    pocname = pocDict.keys()[0]
    _, moduleName = filepathParser(pocname)
    try:
        importer = StringImporter(moduleName, pocDict[pocname])
        importer.load_module(moduleName)
    except ImportError, ex:
        errMsg = "%s register failed \"%s\"" % (moduleName, str(ex))
        logger.log(CUSTOM_LOGGING.ERROR, errMsg)
Ejemplo n.º 7
0
 def registerPoc(self):
     pocString = multipleReplace(self.pocString, POC_IMPORTDICT)
     _, fileName = filepathParser(self.pocName)
     self.moduleName = "%s%s" % (fileName, hashlib.md5(
         self.target).hexdigest()[:8])
     try:
         importer = StringImporter(self.moduleName, pocString)
         importer.load_module(self.moduleName)
     except ImportError, ex:
         logger.log(CUSTOM_LOGGING.ERROR, ex)
Ejemplo n.º 8
0
def _init(self):
    super(self.__class__, self).__init__()
    conf.isPycFile = False
    conf.httpHeaders = HTTP_DEFAULT_HEADER
    try:
        kb.registeredPocs
    except Exception:
        kb.registeredPocs = {}
    # _setHTTPtimeout
    timeout = float(TASK_TIMEOUT)
    socket.setdefaulttimeout(timeout)

    # registerPoc
    pocString = multipleReplace(self.pocString, POC_IMPORTDICT)
    _, self.moduleName = filepathParser(self.pocName)
    try:
        importer = StringImporter(self.moduleName, pocString)
        importer.load_module(self.moduleName)
    except ImportError, ex:
        logger.error(ex)
Ejemplo n.º 9
0
def _init(self):
    super(self.__class__, self).__init__()
    conf.isPycFile = False
    conf.httpHeaders = HTTP_DEFAULT_HEADER
    try:
        kb.registeredPocs
    except Exception:
        kb.registeredPocs = {}
    # _setHTTPtimeout
    timeout = float(TASK_TIMEOUT)
    socket.setdefaulttimeout(timeout)

    # registerPoc
    pocString = multipleReplace(self.pocString, POC_IMPORTDICT)
    _, self.moduleName = filepathParser(self.pocName)
    try:
        importer = StringImporter(self.moduleName, pocString)
        importer.load_module(self.moduleName)
    except ImportError, ex:
        logger.error(ex)