示例#1
0
def registerPocFromFile():
    """
    @function import方式导入Poc文件, import Poc的时候自动rigister了
    """
    for path in kb.pocFiles:
        if path.endswith(".py"):
            if not isOldVersionPoc(path):
                registerPyPoc(path)
            else:
                warnMsg = "%s is old version poc" % path
                logger.log(CUSTOM_LOGGING.WARNING, warnMsg)
        elif path.endswith(".json"):
            registerJsonPoc(path)
示例#2
0
def registerPocFromFile():
    """
    @function import方式导入Poc文件, import Poc的时候自动rigister了
    """
    for path in kb.pocFiles:
        if path.endswith(".py"):
            if not isOldVersionPoc(path):
                registerPyPoc(path)
            else:
                warnMsg = "%s is old version poc" % path
                logger.log(CUSTOM_LOGGING.WARNING, warnMsg)
        elif path.endswith(".json"):
            registerJsonPoc(path)
示例#3
0
def registerPocFromDict():
    """
    @function import方式导入Poc文件, import Poc的时候自动rigister了
    """
    if conf.requires:
        return

    for pocname, poc in kb.pocs.items():
        pocDict = {pocname: poc}
        if pocname.endswith(".py"):
            if not isOldVersionPoc(poc):
                registerPyPoc(pocDict)
            else:
                warnMsg = "%s is old version poc" % pocname
                logger.log(CUSTOM_LOGGING.WARNING, warnMsg)
        elif poc.endswith(".json"):
            registerJsonPoc(pocDict)
        else:
            if conf.isPycFile:
                registerPyPoc(pocDict)
            else:
                warnMsg = "invalid PoC %s" % pocDict["pocname"]
                logger.log(CUSTOM_LOGGING.WARNING, warnMsg)
示例#4
0
def registerPocFromDict():
    """
    @function import方式导入Poc文件, import Poc的时候自动rigister了
    """
    if conf.requires:
        return

    for pocname, poc in kb.pocs.items():
        pocDict = {pocname: poc}
        if pocname.endswith(".py"):
            if not isOldVersionPoc(poc):
                registerPyPoc(pocDict)
            else:
                warnMsg = "%s is old version poc" % pocname
                logger.log(CUSTOM_LOGGING.WARNING, warnMsg)
        elif poc.endswith(".json"):
            registerJsonPoc(pocDict)
        else:
            if conf.isPycFile:
                registerPyPoc(pocDict)
            else:
                warnMsg = "invalid PoC %s" % pocDict["pocname"]
                logger.log(CUSTOM_LOGGING.WARNING, warnMsg)