[WordPress Security] Configuration Probing: Your Backups Might Be Your Greatest Weakness

From: Wordfence <list_at_wordfence.com>
Date: Tue, 29 Nov 2022 10:03:23 -0800

The Wordfence Threat Intelligence team shows how improperly stored wp-config.php backups can put websites at risk.

Wordfence-Logo.png (https://email.wordfence.com/e3t/Ctc/GC+113/cwG7R04/VVPYkx7_HT4FW7Vhd5K5-cZQgW178YCN4SZWs9N4-lLgf3pdqSV1-WJV7CgRN_W4jprMH401JXjW7hvQ_L5l49WYW2-GD0V5cJDSDN53NHRBLM1rzW62MH_66XL5NdW2dHxmc7YTfHvW4d-1Cz61LtdYN9bN211CxgB7W4gx2dx4vdLDVVX_XWj1kwll3V7fBkZ1hkJgvW914q2W3ncHlzW8tQbLC3ydCPbW5krZws4vHCQQW5jpPpQ8cygSyW4-jMjR8zJfDWW4nNq4w6h26zkVMG6YW4t30SrW2-l-PC3RzqrWW4VJkFk7bj_jZ36dt1 )

Config Probing Featured (https://email.wordfence.com/e3t/Ctc/GC+113/cwG7R04/VVPYkx7_HT4FW7Vhd5K5-cZQgW178YCN4SZWs9N4-lLhL3pdskV1-WJV7CgJLPW2QgQn48LftW0W7JTGmH3dn8Y_W7jnbFw3psvBhW2thKvC3WXDnQW64txFS3TlW7nW4fBWZ17vlF0RN7l5sBnjLp8HW92YQ3B5RlG73W6-pTV85cDv23W1xxJLf5JnTk_W4gwQpM877yXXW8xlcxv86XvrbW7NyRzv89t-B-W7JbySG6ljrQrW7pDxmn1rHN-xW5CFTb54tJkwcW57Yg5z5JSnpwW4x6VDh3wqmk1W89_PX52W_PgXN5sZHC4y7YcVN2zCt1GxGnn9W1NbNxj4mMFdMW4HYKDB8Rv0F2W2FxxLw8gSQW4W3zzBrW4JTy9pW2w-xTs71YpYMW57TW6C5pBrGJW6M_19r5NDdZSVPzZt72sVTBLW4d4-1n1KWNP033wh1 )

Configuration files exist to make life easier for developers and website operators. In a world without configuration files, every instance of code that depended on a database connection could potentially require the connection details to be hard coded or manually entered. Other reusable data would be defined multiple times, causing code bloat and possible performance issues. Even just making changes to a website could be a tedious task of tracking down exactly where configuration details are kept, and updating all instances. Configuration files are a great resource for maintaining a website with ease, but they are also a common resource for malicious actors.

Sensitive Data in WordPress Configuration Files

WordPress includes a core file named wp-config.php that defines the database credentials, secret keys, the database table prefix to use, and required file paths. Defining these in a configuration file is convenient, but if a malicious actor can get their hands on the wp-config.php file, then they have a lot of information that can lead to data theft and even a site takeover. In WordPress, the website content is stored within the database, including the user details for administrators and other roles. This file is protected by default in WordPress, but what happens when you need to change some minor details in the file, and you make a backup with a different name, but leave it in a web accessible directory?

Let’s take a look at the database details included in the wp-config.php file. What is defined here is the name of the database, the name of the database user as well as the associated password, the hostname for the location of the database, and the default character set and collation. If other protections are not in place on the database server, such as IP restriction, this information can give a malicious actor everything they need to access the database. With unrestricted database access, they can then insert new admin users which in turn provides them with unrestricted access to the website and all of its backend data.

Screenshot from 2022-11-21 19-05-51 (https://email.wordfence.com/e3t/Ctc/GC+113/cwG7R04/VVPYkx7_HT4FW7Vhd5K5-cZQgW178YCN4SZWs9N4-lLhL3pdskV1-WJV7CgMDLW6X7Tgq5mbvGJW1Cjkvb6sMjnyW7fvv6-54KnmQW5klwhl1zKws1W7Rzmwk76RWWGN7rjr6hCRcxPW2H0fhJ8cNR9qW62ScPC1CSzgtN6KsK1nPSlJ3W2rgqyb2bvgb6W6WcCst30MqzVN8YpbxSkKCgxW14G5sj8tDqvnW87l-wP95rtpNVsBcZ25HJXVmW3KcXdd4dxMvMW3tX-Bd9lzGvrW6fB5_h8VTdgvMFHR8yF5_7JW42rhvX344pCCW2B2Kt93gDBJ1W44Jd0G1yLkG4W2C3qrr1KqBdZW2B1R5V84g8TVN8yHPBX-zfNdW1NKpHB5G-9r3W7yRMgn1m59kMW3JgjNv2Z0rmCW1X6_sF6bYmD6W1hCWNS3c77jK3b_y1 )

Common Backup Mistakes

A common way of backing up the wp-config.php file is to make a copy of the file and add a new file extension like .txt, .bak, or .html to the end of the filename. This is a quick way to make a backup, and ensure it is readily available to be reactivated by changing the filename back to the original. The problem is that leaving these files in a web-accessible directory makes it relatively simple for malicious actors to find the sensitive data contained in the file.

Let's say the file is updated to change the absolute path for the WordPress website, with the original backed up as wp-config.php.html. If you go to the backup file directly in a browser, you will get a white page. This seems harmless and safe, but it also gives the information that the file exists, just without any actual HTML code to display content on the screen. If instead the page is called using a cURL command from a terminal, the file contents will be displayed.

Screenshot from 2022-11-22 13-11-56 (https://email.wordfence.com/e3t/Ctc/GC+113/cwG7R04/VVPYkx7_HT4FW7Vhd5K5-cZQgW178YCN4SZWs9N4-lLhL3pdskV1-WJV7CgQF-W3qS0Y52SRN-6W6c8SdX89M2WcN5CWzdRCyF23Mn4-zT6lCCBW2L5wd88-wgBFW2MqN2J1qWhLzW8XDC2L2YQ9k2W7ZX_Qy1P6fmmW5dkTwV5HLm2pW1_mdmh4JML8LW5z_cgv35YJ75W6lNG6f6p-G9BW8cK5dz4Rdj6kW2GGSxk7cFbhjW6XBwjq7m3YZ4W4GS3Js8RPd69W6VG2Ns76dyClW6WZs5Y8ks_s1N4psndDyDqPJW89CcP84V9HvDN8w_9p89w9jmW5C2BK94g9QcmN8PtNJ9WnxstW1gvkt86Sh3TvW46SNZJ7szg2xW76VZLQ2ckG2KVhGSh92V1Fd9N2mk1pmXG5dYW49Z91g7HwHZjN2w9Y-XnY4zD3ghJ1 )

If the file is backed up as wp-config.php.bak the browser will download the file when it is loaded, and if the file is backed up as wp-config.php.txt then the content will display in the browser directly.

Screenshot from 2022-11-22 13-34-44 (https://email.wordfence.com/e3t/Ctc/GC+113/cwG7R04/VVPYkx7_HT4FW7Vhd5K5-cZQgW178YCN4SZWs9N4-lLhL3pdskV1-WJV7CgW70N1pBLsLV5035W6d8lpq4msdbMW8fC5rt6W12b7W2vlGkR3HNxdjW2Gshch1JppttVpW7B02kqlYZN3nkgw57CjTsW4P7kLG3yG6CfW6C8H5T55kpJ7W5Dd1318lzn3sW97Vlrq7VlBbDVsL8zk1SxsrDVKw_-q3FNW0TW18bHqt17_Z1VW6fFSHl2-DqWJW1-7pwv54qZ__W2ptf362wb66nW9g6jtd5W2JrtW4zwnD57N1txHN5_981TpJyvdW4q6Qh-46jTyfW3P8YM67BFtW_W79pRl35CSnqfW6Zpf7z1v8MvsW376T7w5g1V84W1-phqt57_VjbN6JYfk97VzJzW8LV8nt22lB3QN8rPNqtPvn1NW2jjPl96tx8DD3dkb1 )

Configuration Backup Probing

There are multiple techniques used to probe for backups of configuration files. One simple technique is using what is known as Google dorks. This technique makes use of built-in search functionality in Google and other search engines. For instance, the search phrase inurl:wp-config.php intext:DB_PASSWORD will return results for files containing wp-config.php within the URL that also contain DB_PASSWORD in the body of the file that loads. Malicious actors will also often automate the process of finding backup configuration files with the use of scripts and prebuilt tools. Using some form of automation to find these files makes the process much more efficient.

Probing for backups of the wp-config.php file is a very common practice. It is so common, in fact, that the Wordfence firewall has tracked 70,408,576 attempts to locate these backups in the last 30 days alone.

Config Probing Total Hits (https://email.wordfence.com/e3t/Ctc/GC+113/cwG7R04/VVPYkx7_HT4FW7Vhd5K5-cZQgW178YCN4SZWs9N4-lLhL3pdskV1-WJV7CgDN0W74V5VN5TM8z6VyKBPf371LcfW8qm3XN3CCYjWW8z2hL59d2VtrW3g0PNh1kKYxyW5_fzdj8t5mHhW4L9h5K1PZmw-W3KzHmG1_xT63W2stGb-2KPPlnVwxMpq5Mx7jmN1q-VcZPJ9WKW4nqKlk7_khjtW5lzq971p14ksW7JTZQt87ZVbsVjlgmq4_PRtLW70QgxX6Xr8MqW1p-S513jHcm4W2Rdg521rXwW4W8kZQNx42NJDzW5SmXzF89BD7PW49Z9s43qSFfdW4wqqfv2KF4jBW89sn1t5_3RQXW4jrvT273tNh3W4SzBzW8VXWxXW8RDVzS25Jgn1W1TsjM-6qBH2bN2N8KPdGWF_FW2428h630Bjp6W1FYTbk16SDrT3dQG1 )

In this data, we did identify four legitimate uptime scanners that were being used to find this file. The thing with these scanners is that they are not expensive, and two of them even have free versions available. Because there is no legitimate reason to scan for backups of the wp-config.php file, it appears that malicious actors have determined that the resources required to use these scanners are outweighed by the benefits of implementing a known legitimate solution for nefarious purposes. These scanners account for a little over 6.5 million attempts to locate the wp-config.php file backups.

The following are the top ten IP addresses we have blocked from probing for wp-config.php backups.

- 3.69.53.252 with 3953193 attempts
- 3.71.111.191 with 2165519 attempts
- 52.59.9.15 with 1726745 attempts
- 35.83.251.89 with 1707670 attempts
- 3.96.219.221 with 1645568 attempts
- 35.182.107.115 with 1553854 attempts
- 34.240.248.60 with 1526032 attempts
- 50.16.69.90 with 1065868 attempts
- 3.99.130.127 with 952639 attempts
- 35.91.211.91 with 789722 attempts

Config Probing Top 10 IPs (https://email.wordfence.com/e3t/Ctc/GC+113/cwG7R04/VVPYkx7_HT4FW7Vhd5K5-cZQgW178YCN4SZWs9N4-lLhL3pdskV1-WJV7CgXCXW7GBGp72Vn2CpN1lbGK0-gNFlW8MK_kG1_sqhQW3QJQz39bFKcPW7QhKHT60sWgFW5FlN6M7Rq8n0W2M18cJ9fD012W4wlCfT8mpmKGW7vYljZ6m_FmMN5QZMHf7rWVPW5xdY3f5Vw1gXW2gp8tW791fV-Vmd0Pd1cw1wXW3w9vmG6xzqKBW8WbRCc7kd6hWW4J20nM6NHpWCW8zvBz33fNw5mW11HY6N2CKmX0W2Gwp025HwrR3W1kJXcp1dShwhW9hct0V6JbM6dW2739RL767gx3W4y_NdF8ssrrdW4jM1pG6cm9LQW67WDGL4bq7l7W2MKbT81Lt2kzVNpbSN9kYPJbW959ZqR3nWZRhW6zkJtl4nSQtlW3kvYt17Rp3l73c7S1 )

All of these are registered to Amazon, and are spread around the world, which is not uncommon. Threat actors will often use servers in any location that could be useful to them, especially if there is a location that is known for allowing (or at least turning a blind eye to) the type of activity they will be using the server for.

Conclusion

Looking at the data collected in the last 30 days, it becomes clear that scanning for configuration files such as wp-config.php is wide-spread among malicious actors. The database credentials alone can prove incredibly valuable to anyone whose intent is to take over a website. With more than 40% of current websites running WordPress, this makes finding wp-config.php files even more valuable as it only requires knowledge of a single content management system (CMS).

The Wordfence Scanner includes an option to “Scan for publicly accessible configuration, backup, or log files” which will alert you if any publicly accessible configuration, backup, or log files are present in your site’s directory. This setting is enabled on a standard scan and can be checked for custom scans as well. If you received results indicating that you have a publicly accessible sensitive file, we strongly recommend removing it from the publicly accessible directory immediately.

If you believe your site has been compromised as a result of a configuration probing attack or some other exploit, we offer incident response services via Wordfence Care (https://email.wordfence.com/e3t/Ctc/GC+113/cwG7R04/VVPYkx7_HT4FW7Vhd5K5-cZQgW178YCN4SZWs9N4-lLgS3pdrrV1-WJV7CgLtdW9cZKsF7BnJrGW4N8SfF7w-9jMW3__G6D6FdGy3W2P7nMz2g1Yr7W1KD5L17djSwPW7lR2yw941MhwW6f5xgT4xzscwW3GXfzr5hzkNsVh9qHL8MkggcW7zdY2M5zqWDbW3VTpV56Nmf8YW3qZdt23NRsS6W5_5QjF8Nqh7wW246kWZ69R0zYW4Jr2q77_zmWXN4Bps8H8JdvXW2MskzX644CzVW2kNS5Q8fs4KsW68T33T43HzCwW5yt2sj9dtdDTW4wBjF_5dvbPrW51_zPz8TwGn2W63kp042HJW44W5q3Jl62jSynV341y1 ) . If you need your site cleaned immediately, Wordfence Response (https://email.wordfence.com/e3t/Ctc/GC+113/cwG7R04/VVPYkx7_HT4FW7Vhd5K5-cZQgW178YCN4SZWs9N4-lLgS3pdrrV1-WJV7CgDNYV24f-X4F7KLFW2-188t6l0B5hW33CcKR33kDMqW5n5C5P73n5wlW33T0j034ss98W10LTcH58Lf_hVYb71R2Lx9LyW6mQmsD7zJMf0W3FRYrZ42tjhhW2JS7Ch2PJ2x7W41MXB553vcHDW7wySQt7qPJ2VW99XYJH99QBHWW48DKh01TysybW6xFPJC1drYrVW3238jZ32BQd_W8TCfRB8ybnmDVnZ4FL1mj9sGW1pXrMV7Tsmd6W3WSgg-8Cq4P-W1tFnCt3Hs8-KW8gfwg21rzsqvW3xmJ-c3kl6JYV4xph81BXvMK33d01 ) offers the same service with 24/7/365 availability and a 1-hour response time. Both of these products include hands-on support in case you need further assistance.

The Full Product Lineup:

wf-stacked-free-1 (https://email.wordfence.com/e3t/Ctc/GC+113/cwG7R04/VVPYkx7_HT4FW7Vhd5K5-cZQgW178YCN4SZWs9N4-lLgy3pdr7V1-WJV7CgCL0W8mmynV1HBSV_W5htbCk2cztzCW4YxD5-3pM2cmN8Mh631hvT2TW3zk3WN1mFvPNW3GdlZb5n0_LsW68fLpJ1vY5hqN7m8HK2GW0VyW3XF-dZ94lrVRW71jyG13RxD_vW6pjsc53VQrcWW2pTzbM2fyMsRW7JYJHJ7kJFDSW78WRmG79TTbBW8gC33Q4P13l-W54gWfZ4T5XG3W37rl7n8VQr1DW7KQ0HC5v6JbWW75JF4B3gKQ1jN6t6LL3qJvKtW6M_XQ-6gvN2rW6yD-nF34lh8y3bJY1 )

wf-stacked-premium-1 (https://email.wordfence.com/e3t/Ctc/GC+113/cwG7R04/VVPYkx7_HT4FW7Vhd5K5-cZQgW178YCN4SZWs9N4-lLgS3pdrrV1-WJV7CgBndW62VQVB3HFY40W8TY7lY893wfyW5SRxVV8msRKbN2hMzmjH2M01V-yYSh8nWsCTN7L4VmVPp2hvW7-_PGs4LKtwzW3yZk9K8DKLXYW9b2ddK3Rcxd4W5LSXLw18kkJYVqGYZZ36gG62W1GJ9L54Yj_qKW5fdBRz75_zZPV1Gk_B904vqTW2FPLyV7zRrQgW2v9TK11-91XsW16Pd943rLjTvMf_Zlw4_VfSVb_SFB7JdZcwW3FBGDJ17RXHMW14zBtd5RYQqnW7Q8GnT7b98KwVm_nQz87YN49W1HsKk-1Ff4dS3dQg1 )

wf-stacked-care-3 (https://email.wordfence.com/e3t/Ctc/GC+113/cwG7R04/VVPYkx7_HT4FW7Vhd5K5-cZQgW178YCN4SZWs9N4-lLgy3pdr7V1-WJV7CgWrWW3pLqjr7WvqhbW3zh4qg37_gj2F7rKQ8BkfxLW5RDt8J6tYpjrW5fXVGZ12ySLsN2HhxW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FjW13J4D78WgpKb2lx1 )

logo-defiant (https://email.wordfence.com/e3t/Ctc/GC+113/cwG7R04/VVPYkx7_HT4FW7Vhd5K5-cZQgW178YCN4SZWs9N4-lLgf3pdqSV1-WJV7CgVxCW2CgYps6nNk3jW491q4-55c-c-W1-wqWG20n5_SW65xM473S6Ty6W89DSNT5_nj06W7k_7CQ26F3qLW37PN1D99Nx97N6k2fZY9wLTrW2K_xyj4m0DfrW1gXNBv1mPKMlW6VtDbd2TN0-KW5lqpl43SNLbqW7Q7Jg76PvF7NW3lQskj91l6bmW1Cw6GC7xxNh7W3m98sm1n3L8NN7Zbh7wGQJ_DW17VFtt8Kl-2nW2FTsK94H36PcMsLqMsjLVjB33gl1 )

Defiant, Inc., 1700 Westlake Ave N STE 200, Seattle, WA 98109, United States

Unsubscribe (https://email.wordfence.com/hs/manage-preferences/unsubscribe-all?languagePreference=en&d=Vn8Pp4892TtnVsxx1M3JN_XyW41Rcn-4h29fmN6J4V3WmWcMZW8w9LZT5rY1DWV25z0_8fvTSJW7fVDcb5059C7N7sVt3Q1yf0NW30K4pn1ZmYqTW41sXmt2xyc8sf4Q0b61t3&v=3&_hsenc=p2ANqtz-_0Z49kElvmzzokUz0ggZWfE7_ohJ6hYleBaW-h5MiMV62vFbePXnDBlMu9lckj87Abi3hykq0BMXO3sqnV4ORsBns2qg&_hsmi=235942788 )

Manage preferences (https://email.wordfence.com/hs/manage-preferences/unsubscribe?languagePreference=en&d=Vn8Pp4892TtnVsxx1M3JN_XyW41Rcn-4h29fmN6J4V3WmWcMZW8w9LZT5rY1DWV25z0_8fvTSJW7fVDcb5059C7N7sVt3Q1yf0NW30K4pn1ZmYqTW41sXmt2xyc8sf4Q0b61t3&v=3&_hsenc=p2ANqtz-_0Z49kElvmzzokUz0ggZWfE7_ohJ6hYleBaW-h5MiMV62vFbePXnDBlMu9lckj87Abi3hykq0BMXO3sqnV4ORsBns2qg&_hsmi=235942788 )

You're receiving this email because you signed up to the Wordfence WordPress security mailing list.
Received on Tue Nov 29 2022 - 19:03:30 CET

This archive was generated by hypermail 2.3.0 : Tue Nov 29 2022 - 19:12:26 CET