urlcatblindquery¶
Description¶
This command is similar in functionality to urlcatquery command of
PEM. This will be available from HTTP_REQUEST irule event. It takes
the URL as the input. The input could be a URL encrypted string or an
IPV4 address and search for the entry in the database. IPV6 addresses
are not currently supported. iRule returns the URL categories returned
by the urlcat library.
Examples¶
when HTTP_REQUEST timing on {
set input_url http://[HTTP::host]:80
binary scan [md5 $input_url] H* key
set new_url $key[HTTP::uri]
set urlcat [urlcatblindquery $new_url]
if {$urlcat eq "Unknown" }{
#logging if hash doesn't match
log local0. "New URI is $new_url MD5 Mismatch"
return
} else {
#Adding URL Category if find matching DB
CLASSIFY::urlcat add $urlcat
}
}
In this example, the input URL gets encrypted in MD5 format, and then
the resulting string gets compared with the entries the database.