On Tue, Dec 18, 2012 at 12:35 PM, Сергей Расюкевич <rasukevich@ok.by> wrote:
Hello,

I'm writing a script and I need to get post values:


local post_arg =  m.getvars("ARGS_POST", "none");

but post_arg results in nill value.


Hi,

Assuming you have the SecRequestBodyAccess directive enabled, the m.getvars() function returns an object, you can then access the variables in the object via something like:

function main()

  local post_arg =  m.getvars("ARGS_POST", "none");

  for i = 1, #post_arg do
    m.log(3, "Variable " .. post_arg[i].name .. " is " .. post_arg[i].value);
  end

  return nil;
end

--
 - Josh

 
This is how I'm starting script:
SecRule REMOTE_ADDR "@ipMatch <local ip here>"
"phase:2,t:none,t:urlDecode,nolog,chain,allow"
                         SecRuleScript "/usr/local/apache/conf/test.lua"

Could anybody advise something?


--
С Уважением, Сергей Расюкевич
компания ООО "Открытый Контакт"
Отдел технической поддержки
+375293078949 ( моб. )
2110121 ( гор. )


------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
mod-security-users mailing list
mod-security-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mod-security-users
Commercial ModSecurity Rules and Support from Trustwave's SpiderLabs:
http://www.modsecurity.org/projects/commercial/rules/
http://www.modsecurity.org/projects/commercial/support/