예제 #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
파일: option.py 프로젝트: ellipsys/penework
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)