()
Loads WAF/IDS/IPS detecting functions from script(s)
Loads WAF/IDS/IPS detecting functions from script(s)
Loads WAF / IDS / IPS detecting functions from script ( s )
def _setWafFunctions():
    """
    Loads WAF/IDS/IPS detecting functions from script(s)
    """

    if conf.identifyWaf:
        for found in glob.glob(os.path.join(paths.SQLMAP_WAF_PATH, "*.py")):
            dirname, filename = os.path.split(found)
            dirname = os.path.abspath(dirname)

            if filename == "__init__.py":
                continue

            debugMsg = "loading WAF script '%s'" % filename[:-3]
            logger.debug(debugMsg)

            if dirname not in sys.path:
                sys.path.insert(0, dirname)

            try:
                if filename[:-3] in sys.modules:
                    del sys.modules[filename[:-3]]
                module = __import__(filename[:-3])
            except ImportError, msg:
                raise SqlmapSyntaxException("cannot import WAF script '%s' (%s)" % (filename[:-3], msg))

            _ = dict(inspect.getmembers(module))
            if "detect" not in _:
                errMsg = "missing function 'detect(get_page)' "
                errMsg += "in WAF script '%s'" % found
                raise SqlmapGenericException(errMsg)
            else:
                kb.wafFunctions.append((_["detect"], _.get("__product__", filename[:-3])))
def _setWafFunctions ( ) : if conf . identifyWaf : for found in glob . glob ( os . path . join ( paths . SQLMAP_WAF_PATH , "*.py" ) ) : dirname , filename = os . path . split ( found ) dirname = os . path . abspath ( dirname ) if filename == "__init__.py" : continue debugMsg = "loading WAF script '%s'" % filename [ : - 3 ] logger . debug ( debugMsg ) if dirname not in sys . path : sys . path . insert ( 0 , dirname ) try : if filename [ : - 3 ] in sys . modules : del sys . modules [ filename [ : - 3 ] ] module = __import__ ( filename [ : - 3 ] ) except ImportError , msg : raise SqlmapSyntaxException ( "cannot import WAF script '%s' (%s)" % ( filename [ : - 3 ] , msg ) ) _ = dict ( inspect . getmembers ( module ) ) if "detect" not in _ : errMsg = "missing function 'detect(get_page)' " errMsg += "in WAF script '%s'" % found raise SqlmapGenericException ( errMsg ) else : kb . wafFunctions . append ( ( _ [ "detect" ] , _ . get ( "__product__" , filename [ : - 3 ] ) ) )