Forum Discussion
Andre_Padua_397
Feb 11, 2008Historic F5 Account
Grabbing POST Parameters
Hi All,
My first post to the form is about, well, POST.
I'm trying to grab POST parameters from a specific URL. For some reason, this isn't really happening. This is the code I initially used, and it works (thanks, devcentral!)
when HTTP_REQUEST {
set clen [HTTP::header Content-Length]
}
if { $clen > 0 } {
HTTP::collect $clen
}
Then I decided to inovate and i changed the code to this:
when HTTP_REQUEST {
if {([HTTP::uri] contains "ForumLogin.aspx") && ([HTTP::method] contains "POST")} {
set clen [HTTP::header Content-Length]
}
if { $clen > 0 } {
HTTP::collect $clen
}
And not i don't capture anything. Can anyone think of what makes this happen? I know I'm posting to this URL.
Thanks,
Andre
- hoolio
Cirrostratus
Hi,when HTTP_REQUEST { log local0. "path: [HTTP::path]" if { [HTTP::method] equals "POST" and [string tolower [HTTP::path]] ends_with "forumlogin.aspx"} { if {[HTTP::header value "Content-Length"] > 0} { log local0. "Found Content-Length: [HTTP::header value Content-Length]" set content_length [HTTP::header "Content-Length"] } else { set content_length 10 } HTTP::collect $content_length } } when HTTP_REQUEST_DATA { log local0. "payload length: [HTTP::payload length]" log local0. "payload: [HTTP::payload]" }
- Andre_Padua_397Historic F5 AccountHi Hoolio,
POST /ForumLogin.aspx?Logout=-3&CodCliente=80000 HTTP/1.0 Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, */* Referer: https://www.test.com.br/ForumLogin.aspx?Logout=-3&CodCliente=80000 Accept-Language: en-us Content-Type: application/x-www-form-urlencoded User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) Host: www.test.com.br Content-Length: 777 Connection: Keep-Alive Pragma: no-cache Cookie: ASP.NET_SessionId=2oxcig45o1ixborbrefw3a45; persist_titulo=100772032.20480.0000 __EVENTTARGET=&__EVENTARGUMENT=&__VIEWSTATE=%2FwEPDwUKLTY4MDExMzA3MQ9kFgQCAQ9kFgICAQ8PFgQeCENzc0NsYXNzZR4EX...
- hoolio
Cirrostratus
What do you want to do with the parameters once you find them? If you want to remove them, you could use a stream profile and STREAM::expression to do this. If you want to decode/modify/encode them, then you'd need to collect the payload as you're trying now.
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects