Forum Discussion
R__Winters_7757
Nimbostratus
Sep 16, 2010iRule to alert on hotlinking
Hey all,
I am looking for an irule to trigger an alert whenever hotlinking is detected. We are having issues with phishers mirroring our pages but thankfully they keep the FQDN of the image...
Sep 16, 2010
Something like this should work for you. Just check the Referer header and see if it's from the same domain as the request.
when HTTP_REQUEST {
if { [HTTP::header exists "Referer"] } {
if { ! ([HTTP::header "Referer"] starts_with "http://[HTTP::host]") } {
log local0. "Someone is hotlinking this image. Uri: [HTTP::uri]; Referer: '[HTTP::header Referer]'";
}
}
}this only checks http:// requests. You'll need to add additional logic to check for https:// urls.
As for alerting, you should be able to setup an alert on syslog to trigger when the above string is added to the log.
-Joe
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
