Skip to content

Commit

Permalink
Ban clients with browser-like user-agent and missing referrer
Browse files Browse the repository at this point in the history
  • Loading branch information
Nakaner committed May 30, 2024
1 parent 13c28e6 commit 7caff1d
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,12 @@ RewriteCond "%{HTTP_USER_AGENT}" "^Opera/9\."
RewriteCond "%{HTTP_REFERER}" "^$"
RewriteRule "." "-" [F]

# User-agent of a browser and no referer
RewriteCond "%{HTTP_USER_AGENT}" "Gecko/[0-9]+ Firefox/[0-9.]+$"
# Empty user agents
RewriteCond "%{HTTP_REFERER}" "^$"
RewriteRule "." "-" [F]

# Generic user agents
# Dalvik, an Android HTTP library
RewriteCond "%{HTTP_USER_AGENT}" "^Dalvik/[0-9.]+ \(Linux; U; Android" [OR]
Expand Down

0 comments on commit 7caff1d

Please sign in to comment.