New in CWP Edge / LTSFree with every CWPpro licenceWebsites up to 300x faster

CWP now includes LSPHP, LSAPI-Cache and CWP Cage at no extra cost with all CWPpro licences. The LSAPI-Cache plugin is integrated into our WordPress and other script installers. Available now in the Edge-Latest and LTS-Stable versions. Discuss in the forum

LSPHP / Cache ›
CWP Secure KernelKernel-level protectionEvery site in its own sandbox

Every PHP site, cron job and SSH session runs in its own profile that the kernel enforces. A hacked WordPress cannot read other accounts’ files, and crypto miners and unexpected processes are stopped. Discuss in the forum

Secure Kernel ›
CWP DataCenter PanelFree for CWPpro serversAll your servers on one screen

Manage all your CWP servers from one panel: live health, every hosting account, CWP and OS updates on many servers at once, backups, SSL, firewall and Telegram alerts. Discuss in the forum

DataCenter Panel ›
CWP Backup ServerFree for CWPpro serversBackups that ransomware cannot reach

Protected backups of all your CWP servers on a separate machine. Snapshots a hosting server cannot delete, and restore of files, databases, mail and whole accounts in the admin and user panel. Discuss in the forum

Backup Server ›
WordPress ManagerIncluded & freeWordPress managed from the panel

Install, secure, update, back up and clone WordPress sites without FTP. Updates are tested on a staging clone first and applied to the live site only when they pass, with a backup taken first. Discuss in the forum

WordPress Manager ›
CWP CageIsolationEvery account in its own cage

Per-account isolation built from Linux namespaces and cgroups. A break-in or a runaway script on one site cannot reach another account, the panel or the rest of the server; resource limits per hosting package. Discuss in the forum

CWP Cage ›
Script InstallerOne-click appsWordPress, Joomla, Moodle and more in one click

CWP’s own script installer in the user panel: pick an app, choose the domain and folder, and it is live in seconds with its database and admin login created automatically. Ready for LSPHP and LSAPI-Cache. Discuss in the forum

Script Installer ›
DNS ClusterFor every control panelOne DNS cluster for all your servers

Your servers keep creating domains as usual; the zones are collected into one authoritative PowerDNS cluster you control, with DNSSEC, roles and a full activity trail. Accepts CWP, cPanel, Plesk, DirectAdmin and BIND. Discuss in the forum

DNS Cluster ›
CWP BillingFree to useBilling and support system for hosting providers

Clients, services, invoices, payments, domains, server provisioning and support tickets in one place. All gateways, server modules and registrars are free, with free migration from WHMCS, ClientExec and Blesta. Discuss in the forum

CWP Billing ›
CWPproFrom $1.49 per monthEvery CWP feature unlocked

CWPpro is the professional version of Control Web Panel: all features, unlimited accounts, the latest CWP version and security fixes first. $1.49 per month or $11.99 per year. Discuss in the forum

Get CWPpro ›

How to stop malicious scans

Started by gailclark80, March 27, 2025, 01:44:07 AM

Previous topic - Next topic

gailclark80

When I checked the Apache access logs (/usr/local/apache/logs/access_log), I found that there were a lot of malicious scans, and their IP addresses were changed frequently as if they were not well monitored.

The files it scans are non-existent

How can I block these accesses?

Here's an example
52.247.121.133 - - [26/Mar/2025:06:14:20 +0000] "GET /wp-includes/images/smaxx.php HTTP/1.0" 301 -
52.247.121.133 - - [26/Mar/2025:06:14:21 +0000] "GET /wp-includes/images/smaxx.php HTTP/1.0" 404 34983
52.247.121.133 - - [26/Mar/2025:06:14:21 +0000] "GET /wp-content/plugins/core-plugin/smaxx.php HTTP/1.0" 301 -
52.247.121.133 - - [26/Mar/2025:06:14:21 +0000] "GET /wp-content/plugins/core-plugin/smaxx.php HTTP/1.0" 404 34983
52.247.121.133 - - [26/Mar/2025:06:14:21 +0000] "GET /wp-includes/smaxx.php HTTP/1.0" 301 -
52.247.121.133 - - [26/Mar/2025:06:14:21 +0000] "GET /wp-includes/smaxx.php HTTP/1.0" 404 34983
52.247.121.133 - - [26/Mar/2025:06:14:22 +0000] "GET /wp-content/plugins/smaxx.php HTTP/1.0" 301 -
52.247.121.133 - - [26/Mar/2025:06:14:22 +0000] "GET /wp-content/plugins/smaxx.php HTTP/1.0" 404 34983
52.247.121.133 - - [26/Mar/2025:06:14:22 +0000] "GET /xt/smaxx.php HTTP/1.0" 301 -
52.247.121.133 - - [26/Mar/2025:06:14:22 +0000] "GET /xt/smaxx.php HTTP/1.0" 404 34983
52.247.121.133 - - [26/Mar/2025:06:14:22 +0000] "GET /wp-content/smaxx.php HTTP/1.0" 301 -
52.247.121.133 - - [26/Mar/2025:06:14:22 +0000] "GET /wp-content/smaxx.php HTTP/1.0" 404 34983
52.247.121.133 - - [26/Mar/2025:06:14:23 +0000] "GET /wp-content/themes/twentyfive/smaxx.php HTTP/1.0" 301 -
52.247.121.133 - - [26/Mar/2025:06:14:23 +0000] "GET /wp-content/themes/twentyfive/smaxx.php HTTP/1.0" 404 34983
52.247.121.133 - - [26/Mar/2025:06:14:23 +0000] "GET /wp-content/upgrade/sx.php HTTP/1.0" 301 -
52.247.121.133 - - [26/Mar/2025:06:14:23 +0000] "GET /wp-content/upgrade/sx.php HTTP/1.0" 404 34983
52.247.121.133 - - [26/Mar/2025:06:14:23 +0000] "GET /.well-known/pki-validation/sx.php HTTP/1.0" 404 16
52.247.121.133 - - [26/Mar/2025:06:14:23 +0000] "GET /wp-admin/user/sx.php HTTP/1.0" 301 -
52.247.121.133 - - [26/Mar/2025:06:14:23 +0000] "GET /wp-admin/user/sx.php HTTP/1.0" 404 34983
52.247.121.133 - - [26/Mar/2025:06:14:24 +0000] "GET /wp-includes/ID3/sx.php HTTP/1.0" 301 -
52.247.121.133 - - [26/Mar/2025:06:14:24 +0000] "GET /wp-includes/ID3/sx.php HTTP/1.0" 404 34983
52.247.121.133 - - [26/Mar/2025:06:14:24 +0000] "GET /wp-includes/blocks/sx.php HTTP/1.0" 301 -
52.247.121.133 - - [26/Mar/2025:06:14:24 +0000] "GET /wp-includes/blocks/sx.php HTTP/1.0" 404 34983
52.247.121.133 - - [26/Mar/2025:06:14:24 +0000] "GET /sx.php HTTP/1.0" 301 -
52.247.121.133 - - [26/Mar/2025:06:14:24 +0000] "GET /sx.php HTTP/1.0" 404 34983
52.247.121.133 - - [26/Mar/2025:06:14:25 +0000] "GET /wp-includes/sx.php HTTP/1.0" 301 -
52.247.121.133 - - [26/Mar/2025:06:14:25 +0000] "GET /wp-includes/sx.php HTTP/1.0" 404 34983
52.247.121.133 - - [26/Mar/2025:06:14:25 +0000] "GET /wp-admin/sx.php HTTP/1.0" 301 -
52.247.121.133 - - [26/Mar/2025:06:14:25 +0000] "GET /wp-admin/sx.php HTTP/1.0" 404 34983
52.247.121.133 - - [26/Mar/2025:06:14:25 +0000] "GET /wp-content/plugins/fix/sx.php HTTP/1.0" 301 -
52.247.121.133 - - [26/Mar/2025:06:14:26 +0000] "GET /wp-content/plugins/fix/sx.php HTTP/1.0" 404 34983
52.247.121.133 - - [26/Mar/2025:06:14:26 +0000] "GET /wp-admin/includes/sx.php HTTP/1.0" 301 -
52.247.121.133 - - [26/Mar/2025:06:14:26 +0000] "GET /wp-admin/includes/sx.php HTTP/1.0" 404 34983
52.247.121.133 - - [26/Mar/2025:06:14:26 +0000] "GET /cgi-bin/sx.php HTTP/1.0" 301 -
52.247.121.133 - - [26/Mar/2025:06:14:26 +0000] "GET /cgi-bin/sx.php HTTP/1.0" 404 34983
52.247.121.133 - - [26/Mar/2025:06:14:26 +0000] "GET /wp-admin/css/sx.php HTTP/1.0" 301 -
52.247.121.133 - - [26/Mar/2025:06:14:27 +0000] "GET /wp-admin/css/sx.php HTTP/1.0" 404 34983
52.247.121.133 - - [26/Mar/2025:06:14:27 +0000] "GET /wp-admin/network/sx.php HTTP/1.0" 301 -
52.247.121.133 - - [26/Mar/2025:06:14:27 +0000] "GET /wp-admin/network/sx.php HTTP/1.0" 404 34983
52.247.121.133 - - [26/Mar/2025:06:14:27 +0000] "GET /wp-includes/block-supports/sx.php HTTP/1.0" 301 -
172.177.146.185 - - [26/Mar/2025:04:53:39 +0000] "GET /wp-includes/IXR/about.php HTTP/1.0" 404 34983
172.177.146.185 - - [26/Mar/2025:04:53:39 +0000] "GET /wp-admin/js/about.php HTTP/1.0" 404 34983
172.177.146.185 - - [26/Mar/2025:04:53:39 +0000] "GET /.well-known/pki-validation/about.php HTTP/1.0" 404 16
172.177.146.185 - - [26/Mar/2025:04:53:39 +0000] "GET /wp-includes/pomo/about.php HTTP/1.0" 404 34983
172.177.146.185 - - [26/Mar/2025:04:53:39 +0000] "GET /wp-includes/block-patterns/about.php HTTP/1.0" 404 34983
172.177.146.185 - - [26/Mar/2025:04:53:40 +0000] "GET /wp-content/updraft/about.php HTTP/1.0" 404 34983
172.177.146.185 - - [26/Mar/2025:04:53:40 +0000] "GET /wp-content/upgrade-temp-backup/about.php HTTP/1.0" 404 34983
172.177.146.185 - - [26/Mar/2025:04:53:40 +0000] "GET /wp-content/themes/about.php HTTP/1.0" 404 34983
172.177.146.185 - - [26/Mar/2025:04:53:40 +0000] "GET /wp-admin/includes/about.php HTTP/1.0" 404 34983
172.177.146.185 - - [26/Mar/2025:04:53:41 +0000] "GET /images/about.php HTTP/1.0" 404 34983
172.177.146.185 - - [26/Mar/2025:04:53:41 +0000] "GET /wp-content/blogs.dir/about.php HTTP/1.0" 404 34983
172.177.146.185 - - [26/Mar/2025:04:53:41 +0000] "GET /wp-includes/images/about.php HTTP/1.0" 404 34983
172.177.146.185 - - [26/Mar/2025:04:53:41 +0000] "GET /wp-includes/about.php HTTP/1.0" 404 34983
172.177.146.185 - - [26/Mar/2025:04:53:41 +0000] "GET /cgi-bin/about.php HTTP/1.0" 404 34983
172.177.146.185 - - [26/Mar/2025:04:53:42 +0000] "GET /wp-content/gallery/about.php HTTP/1.0" 404 34983
172.177.146.185 - - [26/Mar/2025:04:53:42 +0000] "GET /wp-includes/blocks/about.php HTTP/1.0" 404 34983
172.177.146.185 - - [26/Mar/2025:04:53:42 +0000] "GET /wp-admin/css/about.php HTTP/1.0" 404 34983
172.177.146.185 - - [26/Mar/2025:04:53:42 +0000] "GET /wp-admin/images/about.php HTTP/1.0" 404 34983
172.177.146.185 - - [26/Mar/2025:04:53:42 +0000] "GET /.well-known/pki-validation/cloud.php HTTP/1.0" 404 16
172.177.146.185 - - [26/Mar/2025:04:53:42 +0000] "GET /.well-known/acme-challenge/cloud.php HTTP/1.0" 404 16
172.177.146.185 - - [26/Mar/2025:04:53:42 +0000] "GET /wp-admin/network/cloud.php HTTP/1.0" 404 34983
172.177.146.185 - - [26/Mar/2025:04:53:43 +0000] "GET /cloud.php HTTP/1.0" 404 34983
172.177.146.185 - - [26/Mar/2025:04:53:43 +0000] "GET /cgi-bin/cloud.php HTTP/1.0" 404 34983
172.177.146.185 - - [26/Mar/2025:04:53:43 +0000] "GET /wp-content/updates.php HTTP/1.0" 404 34983
172.177.146.185 - - [26/Mar/2025:04:53:43 +0000] "GET /css/cloud.php HTTP/1.0" 404 34983
172.177.146.185 - - [26/Mar/2025:04:53:43 +0000] "GET /wp-admin/user/cloud.php HTTP/1.0" 404 34983
172.177.146.185 - - [26/Mar/2025:04:53:44 +0000] "GET /img/cloud.php HTTP/1.0" 404 34983
172.177.146.185 - - [26/Mar/2025:04:53:44 +0000] "GET /wp-admin/css/colors/coffee/cloud.php HTTP/1.0" 404 34983
172.177.146.185 - - [26/Mar/2025:04:53:44 +0000] "GET /wp-admin/images/cloud.php HTTP/1.0" 404 34983
172.177.146.185 - - [26/Mar/2025:04:53:44 +0000] "GET /avaa.php HTTP/1.0" 404 34983
172.177.146.185 - - [26/Mar/2025:04:53:44 +0000] "GET /images/cloud.php HTTP/1.0" 404 34983
172.177.146.185 - - [26/Mar/2025:04:53:45 +0000] "GET /wp-admin/js/widgets/cloud.php HTTP/1.0" 404 34983
172.177.146.185 - - [26/Mar/2025:04:53:45 +0000] "GET /wp-includes/Requests/Text/admin.php HTTP/1.0" 404 34983
172.177.146.185 - - [26/Mar/2025:04:53:45 +0000] "GET /wp-admin/css/colors/cloud.php HTTP/1.0" 404 34983
172.177.146.185 - - [26/Mar/2025:04:53:45 +0000] "GET /wp-admin/includes/cloud.php HTTP/1.0" 404 34983
172.177.146.185 - - [26/Mar/2025:04:53:45 +0000] "GET /wp-admin/css/colors/blue/cloud.php HTTP/1.0" 404 34983
172.177.146.185 - - [26/Mar/2025:04:53:46 +0000] "GET /wp-admin/cloud.php HTTP/1.0" 404 34983
172.177.146.185 - - [26/Mar/2025:04:53:46 +0000] "GET /updates.php HTTP/1.0" 404 34983
172.177.146.185 - - [26/Mar/2025:04:53:46 +0000] "GET /libraries/legacy/updates.php HTTP/1.0" 404 34983
172.177.146.185 - - [26/Mar/2025:04:53:46 +0000] "GET /libraries/phpmailer/updates.php HTTP/1.0" 404 34983
172.177.146.185 - - [26/Mar/2025:04:53:46 +0000] "GET /libraries/vendor/updates.php HTTP/1.0" 404 34983

Netino

Seems all accesses are being without user access header, isn't?
These are bad bots, wasting you bandwidth and machine resources.

You are using nginx?

I did the following, in file '/etc/nginx/conf.d/vhosts/domain.com.conf', change before "location / {" directive, including the following:

if ($http_user_agent = "") { return 444; }


...like in the following:

server {
        listen 11.22.33.44:80;       
        server_name domain.com  www.domain.com;
        (...)
        if ($http_user_agent = "") { return 444; }

        location / {
        (...)
}


You need to change the /etc/nginx/conf.d/vhosts/domain.com.ssl.conf files too, if you use ssl.

Regards,
Netino

gailclark80

I don't know what header you talking about, I copied the original code from the access_log and didn't change them.

I use Nginx & Apache.

Does this affect Googlebot and Bingbot crawling pages?

Is there any other way to stop it?

overseer

Also consider installing Wordfence on the affected WP installs. It will block bad actors like this.
But Netino's solution is a good general purpose block for bots without user agent strings.

Netino

Quote from: gailclark80 on March 27, 2025, 07:08:50 AM
I don't know what header you talking about, I copied the original code from the access_log and didn't change them.

I use Nginx & Apache.
(...)

The useragent header is the HTTP header that identifies the navigator acessing you HTTP server.

Quote from: gailclark80 on March 27, 2025, 07:08:50 AM
Does this affect Googlebot and Bingbot crawling pages?
No.

Quote
Is there any other way to stop it?

Yes.
Googlebot and Bing use honest useragents, so if you want to block them, you can simply block the "Googlebot" and "bingbot" useragents directly:

if ($http_user_agent ~* "(Googlebot|bingbot)") {
    return 403;
}


You can choose too any other useragent:

if ($http_user_agent ~* "(Googlebot|bingbot|Android|iPhone|iPod|Symbian|BlackBerry|Windows Phone|Mobile|J2ME)") {
    return 403;
}


You can install the "Nginx Ultimate Bad Blocker" to block hundreds other useragents:
https://github.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker

overseer

Well-behaved bots (such as Googlebot and Bingbot) will respect a robots.txt file at the root of your site.
User-agent: Googlebot Disallow: /

Or for efficiency, use this code:
User-agent: *
Disallow: /

User-agent: Bingbot
User-agent: Googlebot
Disallow:

Starburst

I'm going to post a article on how to do this with ModSecurity.

It should block all bad bots and website scrappers.

Starburst

#7
OK, it's done.
Let me know if anyone find any bugs, it is kinda late.

https://starburst.help/security/modsecuirty/custom-modules-modsecurity/bad-bots-module-for-modsecurity/