(place, parameters=None)
return testableParameters
Split the parameters into names and values, check if these parameters
    are within the testable parameters and return in a dictionary.
Split the parameters into names and values, check if these parameters
    are within the testable parameters and return in a dictionary.
Split the parameters into names and values check if these parameters are within the testable parameters and return in a dictionary .
def paramToDict(place, parameters=None):
    """
    Split the parameters into names and values, check if these parameters
    are within the testable parameters and return in a dictionary.
    """

    testableParameters = OrderedDict()

    if place in conf.parameters and not parameters:
        parameters = conf.parameters[place]

    parameters = re.sub(r"&(\w{1,4});", r"%s\g<1>%s" % (PARAMETER_AMP_MARKER, PARAMETER_SEMICOLON_MARKER), parameters)
    if place == PLACE.COOKIE:
        splitParams = parameters.split(conf.cookieDel or DEFAULT_COOKIE_DELIMITER)
    else:
        splitParams = parameters.split(conf.paramDel or DEFAULT_GET_POST_DELIMITER)

    for element in splitParams:
        element = re.sub(r"%s(.+?)%s" % (PARAMETER_AMP_MARKER, PARAMETER_SEMICOLON_MARKER), r"&\g<1>;", element)
        parts = element.split("=")

        if len(parts) >= 2:
            parameter = urldecode(parts[0].replace(" ", ""))

            if not parameter:
                continue

            if conf.paramDel and conf.paramDel == '\n':
                parts[-1] = parts[-1].rstrip()

            condition = not conf.testParameter
            condition |= conf.testParameter is not None and parameter in conf.testParameter
            condition |= place == PLACE.COOKIE and len(intersect((PLACE.COOKIE,), conf.testParameter, True)) > 0

            if condition:
                testableParameters[parameter] = "=".join(parts[1:])
                if not conf.multipleTargets and not (conf.csrfToken and parameter == conf.csrfToken):
                    _ = urldecode(testableParameters[parameter], convall=True)
                    if (_.endswith("'") and _.count("'") == 1
                      or re.search(r'\A9{3,}', _) or re.search(DUMMY_USER_INJECTION, _))\
                      and not parameter.upper().startswith(GOOGLE_ANALYTICS_COOKIE_PREFIX):
                        warnMsg = "it appears that you have provided tainted parameter values "
                        warnMsg += "('%s') with most probably leftover " % element
                        warnMsg += "chars/statements from manual SQL injection test(s). "
                        warnMsg += "Please, always use only valid parameter values "
                        warnMsg += "so sqlmap could be able to run properly"
                        logger.warn(warnMsg)

                        message = "are you really sure that you want to continue (sqlmap could have problems)? [y/N] "
                        test = readInput(message, default="N")
                        if test[0] not in ("y", "Y"):
                            raise SqlmapSilentQuitException
                    elif not _:
                        warnMsg = "provided value for parameter '%s' is empty. " % parameter
                        warnMsg += "Please, always use only valid parameter values "
                        warnMsg += "so sqlmap could be able to run properly"
                        logger.warn(warnMsg)

    if conf.testParameter and not testableParameters:
        paramStr = ", ".join(test for test in conf.testParameter)

        if len(conf.testParameter) > 1:
            warnMsg = "provided parameters '%s' " % paramStr
            warnMsg += "are not inside the %s" % place
            logger.warn(warnMsg)
        else:
            parameter = conf.testParameter[0]

            if not intersect(USER_AGENT_ALIASES + REFERER_ALIASES + HOST_ALIASES, parameter, True):
                debugMsg = "provided parameter '%s' " % paramStr
                debugMsg += "is not inside the %s" % place
                logger.debug(debugMsg)

    elif len(conf.testParameter) != len(testableParameters.keys()):
        for parameter in conf.testParameter:
            if parameter not in testableParameters:
                debugMsg = "provided parameter '%s' " % parameter
                debugMsg += "is not inside the %s" % place
                logger.debug(debugMsg)

    if testableParameters:
        for parameter, value in testableParameters.items():
            if value and not value.isdigit():
                for encoding in ("hex", "base64"):
                    try:
                        decoded = value.decode(encoding)
                        if len(decoded) > MIN_ENCODED_LEN_CHECK and all(_ in string.printable for _ in decoded):
                            warnMsg = "provided parameter '%s' " % parameter
                            warnMsg += "seems to be '%s' encoded" % encoding
                            logger.warn(warnMsg)
                            break
                    except:
                        pass

    return testableParameters
def paramToDict ( place , parameters = None ) : testableParameters = OrderedDict ( ) if place in conf . parameters and not parameters : parameters = conf . parameters [ place ] parameters = re . sub ( r"&(\w{1,4});" , r"%s\g<1>%s" % ( PARAMETER_AMP_MARKER , PARAMETER_SEMICOLON_MARKER ) , parameters ) if place == PLACE . COOKIE : splitParams = parameters . split ( conf . cookieDel or DEFAULT_COOKIE_DELIMITER ) else : splitParams = parameters . split ( conf . paramDel or DEFAULT_GET_POST_DELIMITER ) for element in splitParams : element = re . sub ( r"%s(.+?)%s" % ( PARAMETER_AMP_MARKER , PARAMETER_SEMICOLON_MARKER ) , r"&\g<1>;" , element ) parts = element . split ( "=" ) if len ( parts ) >= 2 : parameter = urldecode ( parts [ 0 ] . replace ( " " , "" ) ) if not parameter : continue if conf . paramDel and conf . paramDel == '\n' : parts [ - 1 ] = parts [ - 1 ] . rstrip ( ) condition = not conf . testParameter condition |= conf . testParameter is not None and parameter in conf . testParameter condition |= place == PLACE . COOKIE and len ( intersect ( ( PLACE . COOKIE , ) , conf . testParameter , True ) ) > 0 if condition : testableParameters [ parameter ] = "=" . join ( parts [ 1 : ] ) if not conf . multipleTargets and not ( conf . csrfToken and parameter == conf . csrfToken ) : _ = urldecode ( testableParameters [ parameter ] , convall = True ) if ( _ . endswith ( "'" ) and _ . count ( "'" ) == 1 or re . search ( r'\A9{3,}' , _ ) or re . search ( DUMMY_USER_INJECTION , _ ) ) and not parameter . upper ( ) . startswith ( GOOGLE_ANALYTICS_COOKIE_PREFIX ) : warnMsg = "it appears that you have provided tainted parameter values " warnMsg += "('%s') with most probably leftover " % element warnMsg += "chars/statements from manual SQL injection test(s). " warnMsg += "Please, always use only valid parameter values " warnMsg += "so sqlmap could be able to run properly" logger . warn ( warnMsg ) message = "are you really sure that you want to continue (sqlmap could have problems)? [y/N] " test = readInput ( message , default = "N" ) if test [ 0 ] not in ( "y" , "Y" ) : raise SqlmapSilentQuitException elif not _ : warnMsg = "provided value for parameter '%s' is empty. " % parameter warnMsg += "Please, always use only valid parameter values " warnMsg += "so sqlmap could be able to run properly" logger . warn ( warnMsg ) if conf . testParameter and not testableParameters : paramStr = ", " . join ( test for test in conf . testParameter ) if len ( conf . testParameter ) > 1 : warnMsg = "provided parameters '%s' " % paramStr warnMsg += "are not inside the %s" % place logger . warn ( warnMsg ) else : parameter = conf . testParameter [ 0 ] if not intersect ( USER_AGENT_ALIASES + REFERER_ALIASES + HOST_ALIASES , parameter , True ) : debugMsg = "provided parameter '%s' " % paramStr debugMsg += "is not inside the %s" % place logger . debug ( debugMsg ) elif len ( conf . testParameter ) != len ( testableParameters . keys ( ) ) : for parameter in conf . testParameter : if parameter not in testableParameters : debugMsg = "provided parameter '%s' " % parameter debugMsg += "is not inside the %s" % place logger . debug ( debugMsg ) if testableParameters : for parameter , value in testableParameters . items ( ) : if value and not value . isdigit ( ) : for encoding in ( "hex" , "base64" ) : try : decoded = value . decode ( encoding ) if len ( decoded ) > MIN_ENCODED_LEN_CHECK and all ( _ in string . printable for _ in decoded ) : warnMsg = "provided parameter '%s' " % parameter warnMsg += "seems to be '%s' encoded" % encoding logger . warn ( warnMsg ) break except : pass return testableParameters