其他
一个数据加密恶意样本分析
本文为看雪论坛精华文章
看雪论坛作者ID:PlaneJun
1
运行效果以及行为
2
样本分析
MD5 8f2050c9937f5f21b118c18dce3054fb
SHA1 0df872ae7916dd70e69b3a319ef57612e0ace739
SHA256 32e504c5664ee16d00149c1d8fe8184b872b07f9fad93ed3bce2bf11c1cc7c3a
故其首先调用了VirtualAlloc,ida进行交叉引用可到:
int __thiscall sub_2001DC0(int this, struct tagCREATESTRUCTA *a2)
在dbg里对VirtualAlloc下断后跟踪后可得到解密的内容。
3
ShellCode分析
InitProcAddr的实现也是从Ldr中去遍历。
GetModuleFileNameW
CreateFileW
VirtualAlloc
GetFileSize
ReadFile
CloseHandle
SHGetSpecialFolderPathW
CopyFileW
SetFileAttributesW
%AppData%\CSIDL_
%AppData%\CSIDL_X
4
ShellCode1分析
strcpy(str_kernel32, "kernel32.dll");
strcpy(str_ntdll, "ntdll.dll");
strcpy(str_shell32, "shell32.dll");
strcpy(str_advapi32, "advapi32.dll");
strcpy(str_psapi, "psapi.dll");
strcpy(str_GetProcAddress, "GetProcAddress");
strcpy(str_GetModuleHandleA, "GetModuleHandleA");
strcpy(str_GetModuleFileNameA, "GetModuleFileNameA");
strcpy(str_GetModuleFileNameW, "GetModuleFileNameW");
strcpy(str_CreateProcessA, "CreateProcessA");
strcpy(str_CreateProcessW, "CreateProcessW");
strcpy(str_CreateToolhelp32Snapshot, "CreateToolhelp32Snapshot");
strcpy(str_Process32First, "Process32First");
strcpy(str_Process32Next, "Process32Next");
strcpy(str_Module32First, "Module32First");
strcpy(str_Module32Next, "Module32Next");
strcpy(str_CloseHandle, "CloseHandle");
strcpy(str_GetCurrentProcess, "GetCurrentProcess");
strcpy(str_GlobalAlloc, "GlobalAlloc");
strcpy(str_OpenProcessToken, "OpenProcessToken");
strcpy(str_GetTokenInformation, "GetTokenInformation");
strcpy(str_AllocateAndInitializeSid, "AllocateAndInitializeSid");
strcpy(str_EqualSid, "EqualSid");
strcpy(str_LookupAccountSidA, "LookupAccountSidA");
strcpy(str_OpenMutexA, "OpenMutexA");
strcpy(str_CreateMutexA, "CreateMutexA");
strcpy(str_CreateFileA, "CreateFileA");
strcpy(str_CreateFileW, "CreateFileW");
strcpy(str_GetFileSize, "GetFileSize");
strcpy(str_ReadFile, "ReadFile");
strcpy(str_GetSystemDirectoryA, "GetSystemDirectoryA");
strcpy(str_GetSystemDirectoryW, "GetSystemDirectoryW");
strcpy(str_SetFileAttributesW, "SetFileAttributesW");
strcpy(str_MoveFileExW, "MoveFileExW");
strcpy(str_SHGetSpecialFolderPathA, "SHGetSpecialFolderPathA");
strcpy(str_SHGetSpecialFolderPathW, "SHGetSpecialFolderPathW");
strcpy(str_RegOpenKeyExA, "RegOpenKeyExA");
strcpy(str_RegOpenKeyExW, "RegOpenKeyExW");
strcpy(str_RegSetValueExA, "RegSetValueExA");
strcpy(str_RegSetValueExW, "RegSetValueExW");
strcpy(str_RegQueryValueExA, "RegQueryValueExA");
strcpy(str_RegQueryValueExW, "RegQueryValueExW");
strcpy(str_RegCloseKey, "RegCloseKey");
strcpy(str_CreateDirectoryW, "CreateDirectoryW");
strcpy(str_ExitProcess, "ExitProcess");
strcpy(str_Sleep, "Sleep");
strcpy(str_GetFileTime, "GetFileTime");
strcpy(str_SetFileTime, "SetFileTime");
strcpy(str_CopyFileW, "CopyFileW");
strcpy(str_DeleteFileW, "DeleteFileW");
strcpy(str_VirtualAlloc, "VirtualAlloc");
strcpy(str_GetTickCount, "GetTickCount");
strcpy(str_IsWow64Process, "IsWow64Process");
strcpy(str_OpenProcess, "OpenProcess");
strcpy(str_DuplicateHandle, "DuplicateHandle");
strcpy(str_NtUnmapViewOfSection, "NtUnmapViewOfSection");
strcpy(str_VirtualAllocEx, "VirtualAllocEx");
strcpy(str_WriteProcessMemory, "WriteProcessMemory");
strcpy(str_GetThreadContext, "GetThreadContext");
strcpy(str_SetThreadContext, "SetThreadContext");
strcpy(str_ResumeThread, "ResumeThread");
strcpy(str_SuspendThread, "SuspendThread");
strcpy(str_TerminateProcess, "TerminateProcess");
strcpy(str_NtReadVirtualMemory, "NtReadVirtualMemory");
strcpy(str_GetCommandLineW, "GetCommandLineW");
strcpy(str_GetProcessMemoryInfo, "GetProcessMemoryInfo");
strcpy(str_WriteFile, "WriteFile");
5
ShellCode2
MD5 7396c43a6e8cca2f811939ef1be71b73
SHA-1 a7dace43bcc5e7108a9827dd3a7e03c30acdeeba
SHA-256 5548fec3bae254f7882d9b681080261ba588bc05cb63a81a28107ff49f71c513
File size 52.00 KB (53248 bytes)
E N D
看雪ID:PlaneJun
https://bbs.pediy.com/user-home-826671.htm
# 往期推荐
3.office 分析笔记 —— rtf解析器(wwlib)的不完全解读