The best approach here is to download your server logs and use a free tool like HTTP logs viewer to identify problem IPs and access patterns. Look for patterns in the attack:
✔ Are all the IPs coming from the same country?
✔ Do they share a common prefix?
✔ Is the attack targeting a single, unimportant page?
If you spot a pattern, you can block the attack effectively.
If your website runs on apache, you can modify the .htaccess file to block malicious IPs.
Order Allow,Deny
Deny from 192.168.1.100
Allow from all
This prevents 192.168.1.100 from accessing your site.
Order Allow,Deny
Deny from 192.168.1.100
Deny from 192.168.1.101
Deny from 203.0.113.50
Allow from all
To block all IPs in a range (e.g., 192.168.1.*):
Order Allow,Deny
Deny from 192.168.1
Allow from all
For a broader range:
Deny from 192.168
This blocks 192.168.0.0 to 192.168.255.255.
If a botnet is behind the attack, block specific user-agents:
RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} BadBot|EvilScraper [NC]
RewriteRule .* - [F,L]
If the attack targets a single, unimportant page:
RewriteEngine On
RewriteCond %{REQUEST_URI} /attacked [NC]
RewriteRule .* - [F,L]
These steps should help mitigate most small to mid-sized DDoS attacks.
If the above steps don't stop the attack, it's time for professional protection.