Blog · English
Folks, lock down your web servers
6,499 requests in 16 days: what vulnerability scanners look for on a small private website, how they disguise themselves and what you should do about it.
Folks, lock down your web servers
Since November 12, someone has rattled my web server 6,499 times asking for files that have no business being on a web server. That averages out to around 400 attempts a day, and on November 15 it was 908.
I only see this because I now analyse my traffic with my own statistics program. It shows requests like these in a separate overview. It is sobering.
What they are looking for
Almost half of the requests target PHP scripts and backdoors, and more than a quarter go after credentials and configuration files.
| Target | Requests | Share |
|---|---|---|
| PHP scripts and backdoors | 2,914 | 44.8% |
| Credentials and configuration | 1,844 | 28.4% |
| WordPress | 1,369 | 21.1% |
| Admin interfaces | 169 | 2.6% |
| Backups and databases | 106 | 1.6% |
| Devices and server services | 97 | 1.5% |
f97.be runs neither PHP nor WordPress. So nearly two thirds of these requests cannot find anything there at all. The senders do not care: they do not check what is running on a server, they simply try everything.
The favourite targets
At the very top are two unremarkable names: /.git/config with 42 requests and /.env with 41.
.env: Many web applications store database passwords and API keys in this file. Almost one in five requests is after it: 1,231 requests for 274 different addresses, from.env.bakto/backend/.env. The senders know that people make backup copies and forget about them..git: If a Git directory sits inside the web root, the entire source code including its history can often be downloaded. That includes every password that was ever checked in.info.php,phpinfo.php,i.php: Forgotten test pages that spill half the server configuration.wp_filemanager.php: A file manager in a WordPress plugin folder. Anyone who reaches it can, in the worst case, upload their own files to the server.k.php,ws.php,alfa.php,this_is_a_new_hello_world.php: Names like these belong to no normal software. This is presumably a hunt for backdoors left behind by an earlier intruder. This group alone accounts for 749 different addresses.
All in all, the requests are spread across 1,774 different addresses. Even the front runner only reaches 42.
Disguised as a browser
Whoever is after credentials pretends to be a perfectly ordinary browser. Of the 1,844 requests in this group, 1,682 carried a browser identifier, which is 91%.
With the PHP scripts and backdoors it is the other way round: 2,380 of 2,914 requests were recognisable as bots, which is 82%.
So blocking known bots only stops the honest ones. The identifier is sent by the sender themselves, and they can write whatever they like into it.
What you should do
The most important rule: only what the whole world is allowed to see belongs in the web root.
- Clean up.
.env, Git directories, database backups and copies with extensions like.bak,.oldor.savehave no place there. - Block dot files. Have the web server reject everything that begins with a dot. The only exception is
/.well-known/, which is needed for certificates among other things. - Delete test pages. You need a
phpinfopage for five minutes, not five years. - Maintain WordPress. Apply updates promptly and delete unused plugins rather than just deactivating them.
- Hide admin interfaces. They belong behind a VPN or a restriction to your own address, or at the very least behind two-factor authentication.
- Check for yourself. Open your own address with
/.envand/.git/config. The answer must be an error message.
If something was exposed after all, deleting it is not enough. Then every affected password and key has to be changed immediately.
Not an attack, just background noise
None of this is aimed at me personally. Requests like these hit every address on the net, automatically and around the clock, so they hit yours too. On top of that, eStat weeded out 119,208 page views from 66,304 machines posing as visitors during the same period.
The only thing that matters is whether there is anything to take from you. So look in your log files, and then in your web root.