Featured image of post U disk virus

U disk virus

U disk infection virus analysis

  1. **Behaviour analysis of virus infection in USB disk. **

  2. The program obtains the registry value (part of the process of obtaining commands and modifying the registry is as follows)

The purpose of obtaining TSAppCompat is to identify the server running the service in application mode.
Obtain the server and Microsoft settings during boot auto-start to prevent DLL hijacking vulnerabilities.
The value of SafeDllSearchMode.

transparentEnable, obtains the NAT function settings of the server group

DisableMetaFiles, used to disable original file processing (valid when 1)

AppInit_Dlls, any file using user32.dll will read this place

TSUserEnabled, whether to allow remote use

Modified registry key settings:
The value of HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce\msfsa can realize the self-starting of the specified exe file (=”GHD.EXE”)

Set the original file cannot be modified

  1. File operations:

It can be observed that the system intercepted avb.exe, wrote data to it, and modified the data. It has been speculated that avb.exe is the real-time infected program.

Intercepted:

Text description automatically generated

Modify avb data

Also modified javasc

Text description automatically generated

  1. IDA analysis function

  2. Packing check

Shell checking using PEID

The test results are as follows:

GUI, text description automatically generated

Instructions are written in Delphi language, without shell.

  1. IDA analysis function

Open it using IDA and find that 5 functions are called

GUI, text, application, email description automatically generated

From the function names given by IDA, we can know that the first function is to initialize the exe file, the fourth function is the system run Run function, and the fourth function is the Halt0 function to exit the program. You can’t tell much about the second and third functions from their names.

Use the shortcut key alt+t in IDA to find the string “avb.exe”:

GUI, text, application description automatically generated

According to the found location, locate the _TForm1_FormCreate function:

eTable description has been automatically generated

Next, analyze the function of this function.

This function internally calls the ParamStr(int) function to obtain the process name and other information, and then calls the ExtraFileName() function to extract the file name. After uniformly converting it to uppercase, it performs string comparison with “javasc.exe”.

eImage contains text description automatically generated

Text low-confidence description has been automatically generated

GUI, text, application description automatically generated

If the process name is not javasc.exe, if not go to:

GUI, text, application description automatically generated

This module copies the process and renames the file to sdafdf.exe stored under C:\\windows. After completion, call the shellexecute function to run the program.

If the process is javasc.exe, then the jump module is as follows:

GUI, text, application, email description automatically generated

This module will first obtain the path where the file is located. After obtaining the file name, it will concatenate the current path and the file name to obtain the complete path information. Compare the existence of the javasc.exe file (DirectoryExists) in the current directory. If it exists:

GUI, text description automatically generated

Finally, ShellExecute will be called to expand the folder.

The next step is to determine whether avb.exe exists. If it does not exist:

Text description automatically generated

Text description has been automatically generated

Among them, the function of sub_44F3A0 function is to modify the registry:

Text medium confidence description has been automatically generated

Then copy the javasc.exe file and avb.exe file, register the service in the registry and write information to the registry.

The next step is to determine whether the process name is avb.exe. If so, copy the mscb.exe file, call and execute the function and exit normally. If not, exit the _TForm1_FormCreate function directly.

GUI low-confidence description has been automatically generated

Image contains GUI description automatically generated

Summary: The main purpose of this function is to copy files to the system directory for execution and modify registry values.

3. Analysis of response process (IDA analysis)

Search for the keyword “timer” in the left column of IDA and obtain four response processes.

Table description has been automatically generated

  1. Should_TForm1_Timer1Timer

    Text description automatically generated

1.1 Enter the function sub_44EF94() to analyze the function function

GUI, text, application, email description automatically generated

1.2 Enter the function sub_44E9FC(&v12,a1) to analyze the function function

As you can see in the while loop in the figure below, the function of this function is to traverse directory files.

Text description automatically generated

1.3 Enter function sub_44EEBC (v11) to analyze function functions

GUI, text, application description automatically generated

1.4 Enter function sub_44EAA4(v10,(int)&v11) to analyze function functions

As shown in the figure below, first find the first invalid file through FindFirst and record its creation time FatTime, and then find all files under this creation time based on the creation time.

Graphical user interface, text, application Medium confidence description automatically generated

1.5 Enter function sub_44EC88((int)v12, v9) to analyze function functions

This function copies the virus file through the CopyFileA function in the loop

Text description has been automatically generated

The first response process is to traverse the files in the directory, then find the invalid files and copy the virus.

2.Response_TForm1_Timer2Timer

GUI, text, application, email description automatically generated

v15 is the day of the obtained system time. If the system time is greater than 2009 and the date is 1, 10, 21, or 29, the infection event will be triggered.

3.Response_TForm1_Timer3Timer

GUI, Text, Application, Word description automatically generated

Enter the function sub_44F3A0 (v2, v3, v4) to analyze the function function

As shown in the figure below, you can see that its main function is to modify the registry

Text description automatically generated

4.Response_TForm1_Timer3Timer

As shown below, in step 1, find the exefile file in the memory and free it, and then call the nasm.exe program through ShellExecuteA.

Text, schedule description automatically generated

4. Antivirus process

First delete the generated corresponding file.

Text low-confidence description has been automatically generated

Image contains GUI description automatically generated

Here GHO generates javasc and avb. All need to be deleted. Since the program hides some files, we need to modify the registry values ​​first.

Graphical user interface, application description automatically generated

Graphical user interface, application, Teams description automatically generated

Delete the autostart hijacking registry key.

Text description has been automatically generated

RunOnce will run every time it is started, so it can be self-started.

Table description has been automatically generated

Delete this registry key.

Antivirus completed.

Licensed under CC BY-NC-SA 4.0
Built with hugo 🖤 Stack
版权声明:Licensed under CC BY-NC-SA 4.0「署名-非商业性使用-相同方式共享 4.0 国际」