When a DDoS attack on a website like yours makes it show 500 or 503, or stop opening at all, the first step is to open a ticket with Konet, so we can look at the traffic on the server and cut off the attack pattern. For lasting protection you put Cloudflare in front of the site, even on the free plan, with a Managed Challenge rule. These attacks almost always come from a botnet and they are now common, especially against e-shops.
What is a DDoS attack from a botnet
A botnet is thousands of infected computers, routers and devices around the world that send requests to your site at the same time. In a botnet attack each device makes only a few requests, each from a different IP and with a User-Agent that looks like a normal Chrome or Safari. Together, though, they send thousands of requests a minute to the same pages.
Konet has DDoS protection at the datacenter network level, with automatic filtering of malicious traffic before it reaches the server. This stops large network attacks. An attack at the HTTP level (Layer 7), however, is made of requests that look like visits. They pass through normally and exhaust the resources of your plan, meaning CPU, memory and processes. Imunify360 automatically blocks attacking IPs, but when each IP makes only a few requests, blocking per IP is not enough.
Botnets usually hit pages that are not served from cache, such as search, product filters, cart, wishlist or pages with random parameters in the URL. That way every request forces the server to run PHP and the database.
How do I tell it is an attack and not a problem with the site
The signs of a DDoS attack are specific:
- The site suddenly shows 500, 503 Service Unavailable or 508, or loads extremely slowly, although you have not changed anything.
- In cPanel > Metrics > Visitors you see the latest visits and spot the same URL or the same URL pattern again and again, from many different IPs and countries, within a few minutes. More in cPanel Visitors.
- In cPanel > Metrics > Resource Usage the account hits its CPU or process limits at the same times.
- Traffic in cPanel Raw Access is many times higher than usual, often without a Referer or with parameters your site does not use.
If you see a few IPs with very many requests, it is not a botnet but a single bot or crawler, and the cPanel IP Blocker is usually enough. If the site is slow without unusual traffic, the problem is in the site itself or in the plan's resources, as we explain in how many hosting resources your site needs.
Step 1, tell us right away with a ticket
Before you change anything, open a ticket from the Client Area. Include:
- The domain and the pages that do not open.
- Roughly since when you have seen it and which error appears.
- Whether anything changed on the site in the last few days.
- Whether the site already has Cloudflare or another proxy in front of it.
Konet checks the server logs, confirms whether it is an attack and finds which URL pattern is being hit. Usually the first measure is a temporary rule in the site's .htaccess that answers 403 to that pattern. The 403 stops the requests before they run PHP and the database, so the site breathes again within minutes. Such a rule looks roughly like this:
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/stochos-epithesis/ [NC]
RewriteRule ^ - [F,L]
The pattern must match only the attack. A rule that also catches normal pages cuts off visitors and Google. That is why the rule is best written by someone who can see the logs, and you remove it once things are back to normal.
Step 2, protection with Cloudflare (the free plan is enough)
Cloudflare sits in front of your site and checks every visitor before they reach the server. Cloudflare DDoS protection is unmetered on all plans, and the custom rules you need are available on the free plan (up to 5 rules).
- Create a Cloudflare account, add the domain and check that all DNS records were imported.
- Change the domain's nameservers to the ones Cloudflare gives you. For a .gr domain at Konet see changing nameservers on a .gr domain.
- In Cloudflare SSL/TLS choose Full (strict). The Flexible option together with a redirect to HTTPS on the site creates an endless redirect loop.
- Set the Proxy status of the records correctly, as in the table below.
| Record | Proxy status | Why |
|---|---|---|
A for example.gr |
Proxied (orange cloud) | The site goes through the protection |
www |
Proxied | Same site |
mail, MX, webmail, autodiscover |
DNS only (grey cloud) | Cloudflare does not carry email |
cpanel, ftp |
DNS only | Not site traffic, they need a direct connection |
The Managed Challenge rule for the attack
- In Cloudflare open Security > Security rules.
- Click Create rule > Custom rules and give it a name, for example "Filter attack".
- Under When incoming requests match choose the attack pattern, for example Field URI Query String, Operator contains, Value
filter_, or the path we pointed out in the ticket. - Add with And the condition Known Bots equals false. This way Google, Bing and other verified crawlers are not challenged.
- Under Then take action choose Managed Challenge and click Deploy.
A human usually passes the Managed Challenge without doing anything, while the botnet's bots are stopped at Cloudflare and never reach the server. What gets blocked and by which rule you can see in Security > Analytics, Events tab.
Temporary challenge for traffic outside Greece
If the attack keeps changing URLs, for 2 to 3 days you can put a Managed Challenge on all traffic from outside Greece. In the rule choose Country is not in Greece and Known Bots equals false. The botnet often stops once it sees that the site no longer responds.
Before you do it, think about what it affects. Your customers abroad will see a check page. If you run Google or Meta ads with visitors from other countries, it is better to pause them for those days. Services that call the site automatically, such as payment gateways or warehouse syncs, may need an exception.
For an extreme situation there is also Under Attack Mode, which you turn on from Quick Actions on the domain's Overview page in Cloudflare. It challenges every visitor, affects your statistics and is an emergency measure for a few hours.
How long do I keep the measures and when do I remove them
The pattern of a botnet attack changes. The attack often stops and comes back a few days later on different URLs.
- Remove the outside-Greece rule as soon as traffic calms down, usually after 2 to 3 days.
- Keep the Managed Challenge rule for the attack pattern for several weeks, even if you no longer see attacks in Events.
- It is best to keep Cloudflare permanently. A site that has been attacked is likely to be targeted again.
- Remove the temporary .htaccess rule once Cloudflare has taken over. If you are not sure, ask for it with a ticket.
If you see 403 errors or check pages and do not know whether they come from Cloudflare or the server, see Cloudflare error or server error.
Frequently Asked Questions
My site is small, why would anyone launch a DDoS attack on it?
Most botnets do not choose a target personally. They scan sites in bulk, especially e-shops with filters and search, and hit whatever they find slow to respond.
Doesn't Konet already have DDoS protection?
It does, at network level, and it stops large traffic attacks. A botnet attack at HTTP level looks like normal visits and you stop it with rules on the site or in Cloudflare.
Will Cloudflare hurt me in Google?
No, as long as the rules include the Known Bots exception. Google passes without a challenge and the site loads normally.
Do I need a paid Cloudflare plan?
For most attacks, no. The free plan includes DDoS protection and custom rules with Managed Challenge.
Can I block the IPs one by one?
In a botnet attack it does not help, because each request comes from a different IP. You protect the pattern of URLs being hit, not visitors one at a time.
After the attack I can't log in to cPanel from the office, why?
Your IP may have been blocked by Imunify360 during the attack. See how to unblock your IP.