Forum Discussion
Mick39_201768
May 27, 2015Nimbostratus
Block HTTP access from specific user agent(2)
Dear community,
I want to arrange iRule which I learned in following URL.
https://devcentral.f5.com/questions/block-https-access-from-specific-user-agentanswer118447
Can I use iRule li...
Michael_Jenkins
May 27, 2015Cirrostratus
I'd suggest using a
switch -glob
instead of regex, because the performance will be better (and I find it simpler to read too)
when HTTP_REQUEST {
log local0. "User-Agent:[HTTP::header "User-Agent"]"
switch -glob [string tolower [HTTP::header "User-Agent"]] {
"*sqlmap*" -
"*havij*" -
"*nmap*" -
"*nessus*" -
"*absinthe*" -
"*nikto*" -
"*w3af*" -
"*pangolin*" -
"*bsqlbf*" -
"*prog.customcrawler*" -
"*sql power injector*" -
"*mysqloit*" -
"*netsparker*" {
if { !([IP::addr [IP::client_addr] equals 192.168.115.100]) } {
discard
log local0. "[HTTP::header "User-Agent"] discarding."
}
}
}
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