gi8ri7
Men o'zim uchun bir qancha yomon qurilmalarni ro'yhatladim,

  1. $badUserAgents = array(
  2. 'okhttp',
  3. 'Aboundex',
  4. 'BotALot',
  5. 'Grafula',
  6. 'Ltx71',
  7. 'Nmap',
  8. 'SBIder',
  9. 'Telesphoreo',
  10. 'TightTwatBot',
  11. 'Virusdie',
  12. 'Web Collage',
  13. 'scan.lol',
  14. 'Acunetix',
  15. 'CATExplorador',
  16. 'Heritrix',
  17. 'MegaIndex',
  18. 'Nuclei',
  19. 'SpankBot',
  20. 'TheNomad',
  21. 'Trendictionbot',
  22. 'WWWOFFLE',
  23. 'check1',
  24. 'trendiction',
  25. 'BlackWidow',
  26. 'Dispatch',
  27. 'JetCar',
  28. 'NICErsPRO',
  29. 'OutfoxBot',
  30. 'Szukacz',
  31. 'Thumbor',
  32. 'VeriCiteCrawler',
  33. 'Wallpapers',
  34. 'ripz',
  35. 'ubermetrics'
  36. );
  37. $agent = strtolower($_SERVER['HTTP_USER_AGENT']);
  38. $badAgents = strtolower($badUserAgents);
  39. foreach ($badAgents as $value) {
  40. if (strpos($agent, $value) !== false) {
  41. header("HTTP/1.1 403 Forbidden");
  42. die("Hacking attempt!");
  43. }
  44. }

9 daqiqa 7 soniyadan keyin yozdi:
P/s: Ro'yhatni birinchisida turgan "okhttp" chatda @code_one qilgan sho'xligidan 100% himoya qiladi chunki u https://javadoc.io/doc/com.squareup.okhttp3/okhttp/3.9.1/okhttp3/OkHttpClient.html bundan foidalandi, Bundan aslida nima maqsadda foidalanishadi bilmayman qolga 33 ta user agent aniq yomon client
16 daqiqa 16 soniyadan keyin yozdi:
Ha aytgancha buni .htaccess orqali qilish ham mumkin

  1. ## USER AGENT BANING
  2. SetEnvIfNoCase User-Agent "^okhttp" bad_bot
  3. <limit get="" post="" head="">
  4. Order Allow,Deny
  5. Allow from all
  6. Deny from env=bad_bot
  7. </limit>