function _run(values, name)
        {
            var reason = false

            values.some(function (value) {
                if (value.length <= min_length) {
                    return false
                }
                
                // Check if user input is present in the command
                var userinput_idx = cmd.indexOf(value)
                if (userinput_idx == -1) {
                    return false
                }

                if (cmd.length == value.length) {
                    reason = _("WebShell detected - Executing command: %1%", [cmd])
                    return true
                }
                
                // Lazy loading, initialize token when needed
                if (raw_tokens.length == 0) {
                    raw_tokens = RASP.cmd_tokenize(cmd)
                }

                if (is_token_changed(raw_tokens, userinput_idx, value.length)) {
                    reason = _("Command injection - command structure altered by user input, request parameter name: %1%, value: %2%", [name, value])
                    return true
                }
            })

            return reason
        }
// Check whether the command logic is modified by user parameters
Check whether the command logic is modified by user parameters
Check whether the command logic is modified by user parameters
function _run(values, name)
        {
            var reason = false
            values.some(function (value) {
                if (value.length <= min_length) {
                    return false
                }
                var userinput_idx = cmd.indexOf(value)
                if (userinput_idx == -1) {
                    return false
                }
                if (cmd.length == value.length) {
                    reason = _("WebShell detected - Executing command: %1%", [cmd])
                    return true
                }
                if (raw_tokens.length == 0) {
                    raw_tokens = RASP.cmd_tokenize(cmd)
                }
                if (is_token_changed(raw_tokens, userinput_idx, value.length)) {
                    reason = _("Command injection - command structure altered by user input, request parameter name: %1%, value: %2%", [name, value])
                    return true
                }
            })
            return reason
        }
function _run ( values , name ) { var reason = false values . some ( function ( value ) { if ( value . length <= min_length ) { return false } var userinput_idx = cmd . indexOf ( value ) if ( userinput_idx == - 1 ) { return false } if ( cmd . length == value . length ) { reason = _ ( "WebShell detected - Executing command: %1%" , [ cmd ] ) return true } if ( raw_tokens . length == 0 ) { raw_tokens = RASP . cmd_tokenize ( cmd ) } if ( is_token_changed ( raw_tokens , userinput_idx , value . length ) ) { reason = _ ( "Command injection - command structure altered by user input, request parameter name: %1%, value: %2%" , [ name , value ] ) return true } } ) return reason }
Check whether the command logic is modified by user parameters
Check whether the command logic is modified by user parameters
// Check if user input is present in the command // Lazy loading, initialize token when needed