RewriteEngine on
RewriteCond %{HTTP_USER_AGENT} ^$ [OR]
RewriteCond %{HTTP_USER_AGENT} ^(java|curl|wget) [NC,OR]
RewriteCond %{HTTP_USER_AGENT} (winhttp|HTTrack|clshttp|archiver|loader|email|harvest|extract|grab|miner) [NC,OR]
RewriteCond %{HTTP_USER_AGENT} (libwww-perl|curl|wget|python|nikto|scan) [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ({|}|<|>|’|%0A|%0D|%27|%3C|%3E|) [NC,OR]
RewriteCond %{REQUEST_URI} ^(.*)?wp-upload [NC,OR]
RewriteCond %{REQUEST_URI} ^(.*)?wp-admin
RewriteRule .* index.php [F,L]