In-depth Analysis: Mining Trojan Analysis and Emergency Response Disposal Under a Complete Attack Chain

0 22
1. PrefaceMalicious propagation links found in the recent research on botnet vul...

1. Preface

Malicious propagation links found in the recent research on botnet vulnerability propagation, and the samples were downloaded and analyzed based on the links. Finally, the sample was confirmed to be a mining virus.

This virus is very complete due to the fact that the c2 is still alive during the analysis process, and the sample is obtained from the vulnerability propagation entry. Therefore, the attack chain of this sample is very complete, and the landing analysis and disposal operation has been carried out.

2. Attack Chain Analysis

In-depth Analysis: Mining Trojan Analysis and Emergency Response Disposal Under a Complete Attack Chain

In the ips alarm log, after decoding the payload information, the suspicious sample propagation behavior is located.

1711423423_66023fbf9c006090141c3.png!small?1711423424405


Conduct threat intelligence correlation analysis on the target domain and find that the domain is marked as mining by Weibei.

1711423431_66023fc7292f079be0a53.png!small?1711423431117

Conduct a landing analysis of the download link, and after analysis, it is found that the script is mainly used to download and execute subsequent stage samples (elf mining + sh execution script).

1711423436_66023fcca455c9cdfcc2f.png!small?1711423436181

Since the c2 is still alive, all the virus samples on this c2 can be downloaded. Download the corresponding samples for analysis, and prioritize the analysis of the dupa.sh script. The main functions of this script are: to judge the victim's processor architecture for downloading the corresponding executable mining sample, to rename the mining virus sample to the highest execution permission and run it.

1711423442_66023fd260d9e419e8a7e.png!small?1711423443809

The mining virus executed after the operation belongs to a sample modified from the xmrig open-source code, and the communication protocol of this sample is stratum. The communication content is as follows:

1711423446_66023fd6c2c9ee5e4510c.png!small?1711423446319

3. Domain Name Communication Resolution

Domain

Function

download.asyncfox.xyz

Download Mining Trojan and Execute Script

c2.asyncfox.xyz

Online Server

xmr-pool.asyncfox.xyz

Mining Pool

1711423453_66023fdd43cc7c3476055.png!small?1711423453795

4. Manual Virus Elimination and Location

This chapter mainly focuses on practical operations, how to discover, locate, and completely remove the virus from the victim's host after the security device alarm. The following logical correlation analysis is performed through operations such as process, file, network, scheduled tasks, and dual-process guardians.

4.1 Discovering Suspicious Processes

Using the 'top' command, it was observed that the CPU usage rate is extremely high, the target process is php, and the pid is 822.

1711423458_66023fe28f539cf71bd12.png!small?1711423459329

4.2 Locating Virus File Path Based on pid

There are two methods to locate: 'lsof -p $pid' and 'll /proc/$pid/exe'.

The main purpose of 'lsof' is to obtain the original file paths involved in the process id and the related network communication.

1711423463_66023fe78e0f87ed1f768.png!small?1711423463694

The command 'll /proc/$pid/exe' is mainly used to locate the original file path.

1711423467_66023feb9b37e6fa03c3d.png!small?1711423467619

4.3 Locating Suspicious Processes via Network

The command 'netstat -antp' can be used to confirm the TCP communication of the current victim's host and the corresponding pid. This is also a method to locate suspicious processes, where after executing the command, threat intelligence correlation of the communicating IPs in the terminal can assist in location.


1711423472_66023ff0a6b75236a2409.png!small?1711423473871

1711423480_66023ff87af2c0f75e93f.png!small?1711423481140

4.4 crontab persistence investigation

This operation can be performed before or after virus cleaning, and here it is assumed that priority is given to investigation. Because mining viruses need to achieve the goal of hackers' mining profits, persistent operations are generally indispensable. Therefore, it is good to develop the habit of investigating crontab.

crontab -l, view the current user's scheduled tasks. Find a boot restart task, and after path analysis, it is associated and located as a mining virus created.

1711423487_66023fff430e42e6e701d.png!small?1711423487132

Execute crontab -e to edit, which can be used for hosts with many scheduled tasks. If the victim host only has one scheduled task and it is directly created by the virus, you can execute crontab -r to delete it.

4.5 Why can't the virus be killed?

After locating the virus pid, original path, and persistence location, begin the virus cleaning work. Prioritize killing the process, then completely delete the virus sample, and then crontab -r to delete the scheduled task. If the virus flares up again, a new process and corresponding pid are started.

1711423493_660240051e0dda376bb55.png!small

After network packet capture analysis, the sample will execute wget or curl after being deleted to land and execute the mining virus sample.

Analysis of causes:

  1. Persistent scripts, scheduled detection of communication, according to the process or communication IP, if it does not exist, re-download the mining virus sample from the c2 end.
  2. Process guardianship operation
    1. In the case where the file is not deleted, pid detection is performed, and the sample is re-executed if it is exited.
    2. If the associated path cannot be found when the file is deleted, the mining virus sample should be re-downloaded from the c2 end.

4.6 Continue to kill (process guardianship location)

After analyzing the reasons why the virus cannot be killed in Chapter 4.5, analyze separately according to the two causes. After analysis, it was found that the virus has the operation of process guardianship.

The process tree can be used to associate and analyze the relevant processes (subprocesses) of the virus process. This approach is particularly important. Attention should be paid to avoid falling into a thinking trap during the analysis and troubleshooting process, complicating simple problems. In the future, when dealing with similar virus troubleshooting and cleaning operations, attention should be focused on subprocesses, involving process guardianship.

Two commands can be used to view the relevant subprocesses of the virus process.

ps -afjx

pstree -p $pid

1711423508_66024014ce0254eb12235.png!small?1711423511577

1711423525_660240259c932b9609872.png!small?1711423526654

After clearing the watchdogd process, use the clearing steps in Chapter 4.5 to completely remove the virus.

5. Summary and Protection

Mining malware is still one of the more popular types of malware on the Internet today, with the focus of its attacks on enterprise servers. It uses various system vulnerabilities and weak passwords to infiltrate, implant, and spread, ultimately achieving the goal of mining profits.

Enterprise users need to update software and hardware versions in a timely manner. For assets exposed to the public network, regular asset discovery management and vulnerability scanning should be carried out, patches should be applied in a timely manner, and passwords should be changed to strengthen their strength to prevent hackers from infiltrating through vulnerabilities and weak passwords.

Simultaneously, through network security products such as firewalls deployed on the customer's boundary network, the customer's assets can be monitored and protected, and the communication of mining viruses can be blocked to prevent the implantation of mining viruses and the mining communication of mining viruses.

你可能想看:

Announcement regarding the addition of 7 units as technical support units for the Ministry of Industry and Information Technology's mobile Internet APP product security vulnerability database

As announced today, Glupteba is a multi-component botnet targeting Windows computers. Google has taken action to disrupt the operation of Glupteba, and we believe this action will have a significant i

It is possible to perform credible verification on the system boot program, system program, important configuration parameters, and application programs of computing devices based on a credible root,

In-depth analysis of cross-domain vulnerability chain: from postMessage to the precise attack path of CSRF

Be vigilant against the domestic mining trojan CPLMiner using WMI to reside and mine

Case of cyber security planning project for a financial institution under the background of data security and security compliance

(3) Is the national secret OTP simply replacing the SHA series hash algorithms with the SM3 algorithm, and becoming the national secret version of HOTP and TOTP according to the adopted dynamic factor

Emergency response of the Windows system from the perspective of permission maintenance

Distributed Storage Technology (Part 2): Analysis of the architecture, principles, characteristics, and advantages and disadvantages of wide-column storage and full-text search engines

b) It should have a login failure handling function, and should configure and enable measures such as ending the session, limiting the number of illegal login attempts, and automatically logging out w

最后修改时间:
admin
上一篇 2025年03月30日 07:19
下一篇 2025年03月30日 07:42

评论已关闭