Computer >> Máy Tính >  >> Kết nối mạng >> An ninh mạng

[ĐÃ CỐ ĐỊNH] Cách loại bỏ phần mềm độc hại WP-VCD trong WordPress

Phần mềm độc hại WP-VCD, được đặt tên theo tệp wp-vcd.php đã và đang tạo ra một sự tàn phá khá lớn trong không gian WordPress. Kể từ lần đầu tiên được phát hiện bởi nhóm tình báo về mối đe dọa bảo mật của chúng tôi hơn một năm trước, phần mềm độc hại này đã phát triển và trở nên tinh vi hơn. Dưới đây là nghiên cứu của chúng tôi về sự phát triển của phần mềm độc hại khét tiếng này cũng như cách khắc phục và ngăn chặn sự lây nhiễm phần mềm độc hại wp-vcd trên trang web của bạn.

Các triệu chứng của phần mềm độc hại WP-VCD:

  1. Người dùng quản trị mới được thêm vào WordPress: Chúng tôi đã thấy tin tặc tự thêm mình làm người dùng trong WordPress với đặc quyền của quản trị viên.

  2. Tiêu thụ tài nguyên cao: Phần mềm độc hại WP-VCD được biết là tiêu thụ tài nguyên máy chủ của bạn. Chúng tôi cũng đã thấy các công ty lưu trữ tạm ngưng tài khoản với lý do là "sử dụng tài nguyên cao".

  3. Thời gian tải trang web bị chậm lại: Thường thì thời gian tải của các trang web bị nhiễm phần mềm độc hại này bị ảnh hưởng xấu. Trong một số trường hợp, chúng tôi đã thấy các trang web thường mất 2-3 giây để tải và mất hơn 30 giây để tải!

  4. Mã Javascript không xác định: Chúng tôi đã thấy mã javascript không xác định được thêm vào một số tệp WP quan trọng như functions.php, index.php hoặc gần như tất cả các tệp WP cốt lõi. Điều thứ hai thường là một cơn ác mộng để sửa chữa, thường dẫn đến việc chuyển hướng trang web sang các miền độc hại.

  5. Mã PHP độc hại trong các thư mục lõi: Mã ‘WP-VCD’ được thêm ở nhiều nơi khác nhau trong WordPress. Đây là tên của phần mềm độc hại đến từ đâu. Từ tên của nó, người ta có thể cho rằng tệp là một phần của WordPress nhưng trên phân tích mã hóa thì nó là phần mềm độc hại.

    Dưới đây là một ví dụ về phần mềm độc hại WP-VCD ẩn trong thư mục wp-include, được gắn cờ bởi trình quét phần mềm độc hại của Astra Security.


    [ĐÃ CỐ ĐỊNH] Cách loại bỏ phần mềm độc hại WP-VCD trong WordPress

Các nguyên nhân hàng đầu gây nhiễm vi-rút WP-VCD:

Sau khi bị nhiễm, việc loại bỏ sự lây nhiễm và đảm bảo WordPress của bạn kín nước an toàn về sau là điều cần thiết. Đồng thời, điều quan trọng không kém là phải biết những gì có thể là nguồn lây nhiễm ngay từ đầu. Một số điểm đầu vào mà chúng tôi đã xác định bao gồm:

  • Chủ đề vi phạm bản quyền &không có giá trị: Phần mềm độc hại WP-VCD được cài đặt sẵn với các phiên bản vi phạm bản quyền của một chủ đề / plugin trả phí. Các chủ đề và plugin bị vô hiệu hóa (vi phạm bản quyền) này chứa các tập lệnh độc hại được triển khai khi bạn cài đặt chúng.

    After setting its foot on your website through a nulled theme, it goes on to infect every other theme on your site. In the case of a shared server, this malware then propagates to infect each unprotected site hosted on that server. That’s why we often see this malware infects all the websites on the same server when they aren’t containerized.

  • Un-updated plugins &themes: This is one of the top causes of almost all WordPress infections. However, updating all the themes/plugins after the infection has happened doesn’t mean the infection would go away. Cleaning the infection is still required and so is ensuring proactive security, more on it below.

  • No proactive security on the website: Truth be told, hackers have evolved their techniques over the years. They gain thousands of dollars from such hacks, which means that they can spend hundreds of dollars automating these hacks to infect thousands/millions of websites at once.

    To protect against such evolved WordPress hack techniques, a small investment in a security tool goes a long long way. Saves you headaches at times like these and prevention of SEO/marketing/sales loss from the downtime is another added benefit.

How exactly does the WP-VCD malware work?

[some technical (yet super important) jargon ahead]

It’s really important to understand what exactly does WP-vcd does and how it’s able to slow your website eating up all your precious server resources.

When malicious code is inserted in your website, it usually sits in core files like functions.php/index.php. Now, this malicious code makes a call to files within your website. When your website is opened from the browser, it tries to reach the files to which malware is making the call. And these files may or may not exist on your website causing the functions.php to get executed again. Essentially bringing the website loading process to a big loop. This, in the security language, is called a ‘forkbomb’.

[ĐÃ CỐ ĐỊNH] Cách loại bỏ phần mềm độc hại WP-VCD trong WordPress

Step 1:Deploys malicious scripts

In the functions.php file within your theme, you would see some code similar to this:

<?php if (file_exists(dirname(__FILE__) . '/<b>class.theme-modules.php</b>')) <b>include_once</b>(dirname(__FILE__) . '/<b>class.theme-modules.php</b>'); ?>

This code checks if there are deployer scripts available and subsequently executes them. As you can see in the code above, the file that’s been called is the class.theme-modules.php tập tin. Now, depending on where the infection emanates from (i.e. theme or plugin), the malicious script will be in file class.theme-modules.php or class.plugin-modules.php respectively.

Step 2:Creates backdoor

<?php
 
//install_code1
error_reporting(0);
ini_set('display_errors', 0);
DEFINE('MAX_LEVEL', 2); 
DEFINE('MAX_ITERATION', 50); 
DEFINE('P', $_SERVER['DOCUMENT_ROOT']);

$GLOBALS['<b>WP_CD_CODE</b>'] = 'PD9waHANCmVycm9y...(base64-encoded string of PHP code)
...

This code creates a new admin user with a name similar to 100010010 . The objective of this backdoor admin account is to make sure that the hacker is able to access the website even if you delete the malicious code basically, so that the attackers could attack your website at a later point in time.

Step 3:Gets instructions from hackers

Sometimes hackers inject URLs of their C2 servers. These URLs are later called to deploy action across the infected sites in one go. Domains such as www.krilns[.]com/code.php ​, ​krilns[.]pw ​, ​krilns[.]top , etc have been found executing this in many WP-VCD infected sites.

Step 4:Infects other files and sites

The next thing that the WP-VCD malware does is to expand itself. It deploys the malicious script in every theme and plugin on your site. Next, it goes on to find vulnerable sites on the same server and infects them too.

This propagation starts with the deployment of a script located at wp-includes/wp-vcd.php​ . It’s followed by modifications in the core wp-includes/post.php​ which at last execute the code in ​wp-vcd.php​ on every page.

How to fix &remove the WP-VCD WordPress malware?

  1. Finding &removing malicious code: There are a few places where probability of finding the malicious code is high. Though, hackers often try to improve their ways to hide the malware more creatively still these files/folders on your server are worth starting the hunt from:

    • wp-includes/wp-vcd.php
    • wp-includes/wp-tmp.php
    • wp-content/themes/*/functions.php (all themes installed on the server whether active or not)
    • class.wp.php
    • code1.php
    • class.theme-modules.php (inside the theme folder)

  2. Searching malicious string patterns :Searching for string patterns that are found in infected malware files helps you in narrowing down the search. A few of them mentioned below:

    • tmpcontentx
    • function wp_temp_setupx
    • wp-tmp.php
    • derna.top/code.php
    • stripos($tmpcontent, $wp_auth_key)

  3. Analyze functions.php: This file is one of the top infected files by hackers. Reviewing the code in functions.php can reveal the controlling code of wp-vcd malware.

  4. Run a diff check to ensure code authenticity: Run a diff check of the file contents on your server with corresponding files in the WordPress core GitHub repository or theme/plugin directory. You can use either of the approaches (or both) using SSH or using your IDE.

    [ĐÃ CỐ ĐỊNH] Cách loại bỏ phần mềm độc hại WP-VCD trong WordPress
    (File difference checking, screenshot from Astra’s malware scanner showing malware added at the top of index.php file)

  5. Run a malware scan: In such malware infection situations, a malware scanner can save you hours of hunting for malware (which still doesn’t guarantee success). Malware scanner not only scans each and every file of the server but ensures every difference in core files of your WordPress is pointed out.
[ĐÃ CỐ ĐỊNH] Cách loại bỏ phần mềm độc hại WP-VCD trong WordPress

The WP VCD malware gets a foothold in your site by leveraging loopholes in outdated plugins and themes. In most WP-VCD cases, the web owners infect themselves by installing a free/nulled plugin &themes from unauthorized sources, while in others it occurs as a result of contamination by infected sites.

Related Guide – Comprehensive Guide on WordPress
Tip:Scan WordPress for malicious cod e

One of the biggest lessons to be learnt from such hacks is to ensure your website is secure going forward. Not ending up in a hack situation like this is totally possible using Astra Security Suite that powers security of thousands of websites around the globe, stopping millions of attack and malware every day!