From DDoS to Brute Force: The Big Enemies of Small and Mid-Sized Websites

Last month we went into a mid-sized e-commerce client's server logs for routine maintenance and counted 41,000 failed login attempts on the admin panel in a single weekend. The client had no idea. "Who would bother attacking a small site like ours?" they asked on the phone — I've lost count of how many times I've heard that line in the past five years. The answer is always the same: nobody is attacking you specifically. The overwhelming majority of attacks aren't targeted; they're automated. Bots scan IP blocks one after another and pile onto whatever looks weak. Being small doesn't take you off the target list; it only raises the odds of being caught defenseless, because you don't have the security budget of a large enterprise.

In this post, I'll walk through the three types of attacks we run into most often in the field, and a realistic defense for each — meaning one that won't drain your budget.

Brute force: the most ordinary attack, the richest loot

Bots try millions of email/password pairs compiled from past data breaches against your login forms 24/7. This is called credential stuffing, and the only reason it works is that people use the same password everywhere. Your system may never have been breached; but if a password your customer uses on another site has leaked and they use the same one with you, the attacker is walking through the front door with a key.

Defense is built in layers. Add an increasing delay per login attempt: the first failure is free, the second costs two seconds, the third eight... For a bot, that makes the whole operation uneconomical. Add account- and IP-based lockouts; on the server side, fail2ban handles this nicely, and it can be done inside the application too. Put admin panels behind IP restrictions, or at the very least behind a second verification layer.

And the real point: 2FA. With two-factor authentication turned on, the account doesn't fall even if the password leaks. This single measure breaks the entire economics of brute force attacks. Make 2FA mandatory, not optional, for admin accounts — we now tell our clients this with the seriousness of a contract clause.

Four layers of defense against brute force and credential stuffing attacks: increasing delays, lockouts, IP restrictions on the panel and two-factor authentication.
This single measure breaks the entire economics of brute force attacks.

Is changing the panel URL real protection? No; anyone determined will find it. But because it cuts bot noise significantly, your logs become readable and real threats are easier to spot. We call this "hygiene, not protection."

Then there's the visibility issue. The client I mentioned at the start hadn't noticed the attack because nobody was looking at the logs — and a log nobody reads is as useless as a log never kept. A simple alerting setup that counts failed login attempts and sends an email or message when a threshold is crossed is half a day's work in most frameworks. It may not stop an attack on its own; but it buys you the most valuable thing of all: early warning. The cost of a security incident grows exponentially with the time it takes to notice it.

With DDoS, the goal isn't to shut off the tap but to filter the water

The bitter truth about volumetric DDoS is this: you can't absorb that traffic on your own server. The pipe fills up before the attack even reaches you; and your hosting company, rather than protecting you, usually saves its own network by null-routing your IP (that is, cutting off access to it entirely). The outage the attacker wanted ends up being delivered by your own hosting provider. That's why the "let's get a more powerful server" reflex is a waste of money for this problem.

It also helps to understand the economics of the attack: on underground markets, DDoS-for-hire services called "booters" sell minutes of attack time for a few dollars. So anyone holding a grudge against you — it doesn't have to be a competitor; even a customer who felt slighted on your site will do — can target you with pocket money. In this asymmetry, where defense costs many times more than attack, the only rational strategy is to shift the load from your own shoulders onto those of much bigger players: the CDN layer.

The realistic solution is to route your traffic through a CDN/proxy layer before it reaches you. Cloudflare and similar services filter malicious traffic at the edge and forward the clean traffic to you; your origin server's IP is also hidden from the outside world. For small and mid-sized sites, even the free or low-cost tiers of these services can be a lifesaver.

There's one detail, though, that has burned us in the field again and again: your origin IP may have long since leaked through DNS history records, forgotten subdomains, or the headers of emails sent from your server. If it has, the attacker hits your server directly without ever touching the CDN, and the whole investment goes to waste. When you move behind a CDN, change your origin IP too, and allow only the CDN's IP ranges in your firewall. We've seen so many setups that skipped these two steps that they now sit at the very top of our checklist.

Comparison of why buying a more powerful server falls short against volumetric DDoS, the advantage of a CDN or proxy layer, and the risk of origin IP leakage.
Shifting the load onto the shoulders of much bigger players is the only rational strategy.

The sneaky one: application-layer DoS

Everyone talks about attacks with hundreds of thousands of requests per second; yet you can take a site down with 10 requests per second — as long as each request is expensive. A search page running without filters, a report screen with no limit on the date range, a list with an N+1 problem that fires a separate query for every row... An attacker hammering these endpoints (sometimes even a bot with no malicious intent at all) can bring your database to its knees within minutes.

Last year we lived through exactly this scenario with a client: an ordinary search engine bot, crawling through the site's filter combinations, kept landing on a query that triggered a full table scan every time. There was no attack; the site went down anyway.

The defense here is to set rate limits according to an endpoint's cost. 300 requests per minute may be normal for the homepage; for a heavy report screen, even 5 per minute is too many. Put expensive jobs in a queue and tell the user, "your report is being prepared, we'll let you know when it's ready." Put a timeout on every query so that a single runaway query can't hold the whole connection pool hostage.

Four measures against application-layer DoS: rate limits based on endpoint cost, queuing, query timeouts and caching.
Every caching investment made for performance is also a security investment.

Caching deserves its due at this layer too. If pages returned to anonymous users are served from cache, the flood of incoming requests never reaches your database; the edge server absorbs it and moves on. In other words, every caching investment you make for performance is also a security investment — two birds with one stone, and plump ones at that.

Four things everyone should do, whatever the budget

If I had to squeeze all these years of field experience into four points, I'd say this: put your site behind a CDN/proxy layer (changing your origin IP as you do), add 2FA and attempt limits to your logins, rate-limit expensive endpoints separately and strictly, and set up monitoring that will wake you up at night when traffic looks abnormal. None of these four is a big investment of money or time; but they make 95% of automated attacks boring for you.

That's exactly the point of security anyway: not being an easy target. Bots aren't romantics; wherever they meet resistance, they move on to the next IP.

Back to the client from the beginning of this post — every one of those 41,000 attempts hit the wall of attempt limits and 2FA we set up in two hours of work, and fizzled out. The next month, the same panel saw fewer than 200 attempts; the bots had gotten bored. If you're curious what's going on in your own logs (and I think you should be), write to us for a security check; we'll do the looking, and the decision is yours.