I have few virtual hosts on my server (say \*.mydomain.com
), but I got lots of "spam/hack requests" for some totally other domain, like xchecker.net
91.122.59.90 - - [2019-09-06 18:09:35] "POST http://fdc.xchecker.net/proxy2017/http/engine16.php HTTP/1.0" 403 302 # "http://fdc.xchecker.net/proxy2017/http/engine16.php" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20100101 Firefox/16.0"
while my domain is nothing like *.*.net - those request fails because they ask for non-existent files,
[Fri Sep 06 18:14:50.416879 2019] [authz_core:error] [pid 226975] [client 5.136.243.174:56314] AH01630: client denied by server configuration: /usr/htdocs, referer: RefererString
but I would like to reject them even earlier, as they ask for domain I do not even have.
I tried something like
RewriteEngine on
RewriteCond %{THE_REQUEST} .*http.* [NC]
RewriteCond %{THE_REQUEST} !.*mydomain.com.* [NC]
RewriteRule ^.* - [G,L]
but it did not work at all
How should I reject such requests just based on bad domain access?
The main problem was, that I had each virtual host in different file and common file alloved to set things like
but did not enabled set (additional) Rewrite Engine configuration.
So I included to each virtual host file those lines:
(maybe followed by more rules like this (for site I want make mostly private))
and created common include file
x-my-rules
(Which is not perfect, but works for me to fight following:
http://fdc.xchecker.net/proxy201..
totally different siteCONNECT some/service
which I do not even hostGET ../../mnt/Datafile
try to get files out of structurexchecker.net
to nonexistent filesBing
and there was many attacks byAnkit
botand I will later go thru logs again and add more rules, for other tries to misuse of my site)