Reputation: 11
I am getting a logwatch from my server,
/?page=/../../../../../../../etc/passwd HTTP Response 200 /?mod=../../../../../../../proc/self/environ%2500%2520HTTP/1.1%2522%2520200%25203427%2520%2522-%2522%2520%2522%253C%3fphp%2520system%28\%2522id\%2522%29%3b%2520%3f%253E HTTP Response 200 /?file=../../../../../../proc/self/environ%00 HTTP Response 200
To avoid these requests, I have installed mod_security on apache but still these requests are the log showing the same requests are replied. How can I deny those requests?
Upvotes: 1
Views: 834
Reputation: 687
I hope I got your question right.
Include the following code in your Apache configuration:
<Directory />
Options None
Order deny,allow
Deny from all
</Directory>
It prevents everybody from accessing files on your server except you explicitly configure exceptions from this rule for other directories (you'd still want others to access your web content, e.g.).
I don't know which version of Apace you're using on which OS, so I can't tell you exactly where you have to put this. Normally it's part of Apache's most basic configuration.
As your Apache installation seems to be very insecure if it allows those kinds of requests, here are some more tips to secure your Apache.
Upvotes: 1