03-Oct-2019 07:41
Hi Guys,
Need help for below regexp,
when HTTP_REQUEST_DATA {
set payload [URI::decode [HTTP::payload]]
regexp {^.*txtURL=([^&]+).*$} $payload -> gotURL
regexp {^.*username=([^&]+).*$} $payload -> username
regexp {^.*password=([^&]+).*$} $payload -> password
HTTP::release
}
works for simpel password, but facing issue with password having following characters
$,&, % etc.
sample string
--- <HTTP_REQUEST_DATA>: Payload is = username=apptest&password=1234&1abc&txtURL=https://trng.example.com:443/ssoman/c/SSA
Regards,
Sajid
16-Oct-2019 06:09
This might work if there is always a field starting with &, like &txtURL, after the "password=" filed.
I asslumed that since you use a regex that excludes character & , but as you said passwords containing character '&' will not be matched while using this regex you will always have "&" as a character after the password so everything but last & will match.
^.*password=(\K.*)&