Trap Bad behavior with rewriting -phpmyadmin anywhere in the URL

I hope someone can help, since I'm a little noob when it comes to rewriting Apache mods, and if you are mistaken, this can greatly ruin the situation.

Despite the fact that my security logs, I noticed that almost 50% of intruders are phpmyadmin (another case, sometimes with version numbers in it). i.e.

xxx: //www.example.com/phpmyadmin/

xxx: //www.example.com/something/phpMyAdmin/

xxx: //www.example.com/something/morestuff/phpMyAdmin/

xxx: //www.example.com/phpMyAdmin-2.11.3/scripts/setup.php

etc .. etc etc.

I am wondering if there is a way that I can use mod rewrite to catch all this and send them to

hhhh: //www.example.com/bottrap/index.php

or something similar. (hhhh β†’ http - spam protection will not allow http)

I decided only for good measure. I will add a disclaimer to everyone in the robots.txt file and say thank you for visiting, I added my IP address to the honeypot project.

I can process php files, but even after reading the documentation to rewrite the text, I'm still pretty lost. Any help would be greatly appreciated.

+4
source share
1 answer

As long as you have no legitimate requests for anything containing β€œphpmyadmin”, you can simply add this rule at the top of the htaccess file to your document root:

RewriteRule phpbbadmin /bottrap/index.php [L] 

Turn on the R flag if you really want to redirect the request: [L,R] .

I decided only for good measure. I will add a disclaimer to everyone in the robots.txt file and say thank you for visiting, I added my IP address to the honeypot project.

I doubt that these bots read the robots.txt file. If something is like hacked websites or other users who unwittingly post malicious code on their websites or home PCs. You can include DENY From <ipaddress> in the htaccess file if the requests become annoying, but adding them to the robots.txt file can probably do little.


Adding NC makes him choose options.

 RewriteRule phpmyadmin /phpmyadmin/index.php [L,NC] 
+1
source

All Articles