I'm trying to block all autodiscover.xml requests to our server using iptables. The autodiscover file does not exist on our server, but because the website does not have a subdomain the requests are hitting our server. Here is what I've input so far but they aren't working. See the log following. Requests keep coming.
iptables -I INPUT -p tcp --dport 80 -m string --string "POST /autodiscover" --algo bm -j DROP
iptables -I INPUT -p tcp --dport 443 -m string --string "POST /autodiscover" --algo bm -j DROP
That results in this at the top of the INPUT chain:
DROP tcp -- anywhere anywhere tcp dpt:http STRING match "POST /autodiscover" ALGO name bm TO 65535
DROP tcp -- anywhere anywhere tcp dpt:https STRING match "POST /autodiscover" ALGO name bm TO 65535
However, I'm still getting the requests in the Apache log.
[09/Jan/2020:17:04:31 -0500] "POST /autodiscover/autodiscover.xml HTTP/1.1" 403 3668 "-" "Microsoft Office/16.0 (Windows NT 10.0; Microsoft Outlook 16.0.6701; Pro)"
[09/Jan/2020:17:12:59 -0500] "POST /autodiscover/autodiscover.xml HTTP/1.1" 403 3668 "-" "Microsoft Office/16.0 (Windows NT 10.0; Microsoft Outlook 16.0.6701; Pro)"