Hi,
You can use mod_rewrite to forbid access. For example to block a user-agent like "BAD-AGENT" and/or a GET request for phpmyadmin for example, you can use
Code:
RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} "BAD-AGENT" [OR]
RewriteCond %{THE_REQUEST} ^GET\ /phpmyadmin
RewriteRule (.*) - [F]
Of course you can add more user-agent strings or request (like POST, CONNECT etc).
Now if you want to ban them for a time period you can use fail2ban
Regards