Forum Discussion
Marc_Bergeron_5
Nimbostratus
Aug 15, 2007Process POST data
I'm looking to patch a security issue in our application until our developers have time to do their thing, and I'm hoping to do it with iRules.
What I have is a log-in page, login.asp, that ...
Deb_Allen_18
Aug 15, 2007Historic F5 Account
Maybe this?
when HTTP_REQUEST_DATA {
if {[string tolower [HTTP::path]] contains "login.asp"} {
save original password value
set pw [findstr [HTTP::payload] "&password=" 10 &]
strip special characters from entire payload
set newPayload [string map {< "" > "" % ""} [HTTP::payload]]
if original pw value was changed, replace original value
if {[string first &password=$pw $newPayload] < 0 }{
regsub {("&password=)(.*?)(&)?} $newPayload {\1$pw\3} newPayload
}
HTTP::payload replace 0 [HTTP::payload length] $newPayload
HTTP::release
log local0. "new payload: $newPayload"
}
}Should work regardless of password parameter position.
/deb
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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