Forum Discussion
jonathan_239725
Nov 21, 2016Nimbostratus
Detect regexp pattern in tcp payload
I was hoping someone could help me out on the proper syntax and approach to using either matches_regex or regexp to match a string pattern in a tcp payload. Basically I am trying to detect if within...
jspiglerj2rsolves
Nov 22, 2016Nimbostratus
Thanks Kevin. Yes, the payload was in the response and I was trying to capture it from the client's request. Duhoh...
This is what i have now
when SERVER_CONNECTED {
TCP::collect
}
when SERVER_DATA {
if { [regexp {[a-zA-Z0-9] {13,16}} [TCP::payload]] } {
log local0. "Pattern detected"
}
TCP::release
}
Something interesting though, maybe you guys could shed some light on this. If I dump my tcpdump to log, I see the HTTP header in plain text fine but none of the page content. I know theres going to be un readable binary information in there due to photos, but I thought I would see some of the page content.
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