-
UID:17777
-
- 注册时间2007-05-02
- 最后登录2025-05-03
- 在线时间18637小时
-
- 发帖786318
- 搜Ta的帖子
- 精华0
- 飞翔币211574
- 威望215717
- 飞扬币2615516
- 信誉值8
-
访问TA的空间加好友用道具
- 发帖
- 786318
- 飞翔币
- 211574
- 威望
- 215717
- 飞扬币
- 2615516
- 信誉值
- 8
|
静态数据- 病毒文件来源:Practical Malware Analysis书中的lab11-01。
- md5 value: 复制代码 隐藏代码md5,A9C55BB87A7C5C3C923C4FA12940E719sha1,D971656C6C605A6E2130AB83A38420E655428F94sha256,57D8D248A8741176348B5D12DCF29F34C8F48EDE0CA13C30D12E5BA0384056D7
- no packer - vc++ 6.0
- compiler-stamp,0x00000000,Mon Nov 07 02:55:06 2011
- import APIs: 复制代码 隐藏代码TerminateProcess,0x29E,0x7734,execution,implicit,-,x,kernel32.dllGetEnvironmentStrings,0x106,0x77C2,execution,implicit,-,x,kernel32.dll
- strings: 复制代码 隐藏代码ascii,53,0x0000808A,-,registry,-,SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogonunicode,53,0x0000C6AE,-,registry,-,Software\Microsoft\Windows NT\CurrentVersion\Winlogon存在开机启动加载的功能。
resource区存在PE标志头:4D5A,可能是藏有病毒文件。 动态数据- 启动lab11-01.exe时,创建进程: Explorer.EXE, Lab11-01.exe, svchost.exe.
- 在lab11-01.exe同一路径下创建文件msginal32.dll.
IDA 分析分析 lab11-01.exe- 释放lab11-01.exe的resource区, 创建名为msgina32.dll的文件,把resource的内容复制到msgina32.dll中. 复制代码 隐藏代码mov edx, [ebp+hResData]push edx ; hResDatacall ds:LockResource ; Retrieves a pointer to the specified resource in memory.
打开msgina32.dll文件复制resource内容 复制代码 隐藏代码push offset aWb ; "w" Opens an empty file for writing. ; b Open in binary (untranslated) mode.push offset aMsgina32Dll ; "msgina32.dll"call _fopen 写入内容: 复制代码 隐藏代码mov [ebp+pFile], eaxmov ecx, [ebp+pFile]push ecx ; FILE *mov edx, [ebp+dwSize]push edx ; size_tpush 1 ; size_tmov eax, [ebp+pResData]push eax ; void *call _fwrite ; write data from pResData to pFile named msgina32.dll - 获得当前执行模块的完整路径; 复制代码 隐藏代码push ecx ; lpFilenamepush 0 ; hModulecall ds:GetModuleFileNameA
- 操作注册表: 'SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon',意味着每次系统启动的时候都会加载msgina32.dll。
- 键 = "GinaDLL".
- 值 = msgina32.dll full path. 复制代码 隐藏代码mov ecx, [ebp+size]push ecx ; cbDatamov edx, [ebp+filename]push edx ; lpDatapush 1 ; dwTypepush 0 ; Reservedpush offset ValueName ; "GinaDLL"mov eax, [ebp+phkResult]push eax ; hKeycall ds:RegSetValueExA
分析 msgina32.dllDllMain- 加载msgina.dll,由于注册表被修改的原因,每次系统启动会自动加载该DLL。 复制代码 隐藏代码lea ecx, [esp+20Ch+pFilePath]push offset String2 ; "UTF-16LE", '\MSGina',0push ecx ; lpString1call ds:lstrcatW ; pFilePath = syspath + "\\MSGina"lea edx, [esp+20Ch+pFilePath]push edx ; lpLibFileNamecall ds:LoadLibraryW
分析export函数WlxLoggedOutSAS。
- 获得WlxLoggedOutSAS函数地址。 复制代码 隐藏代码push esipush edipush offset aWlxloggedoutsa_0 ; "WlxLoggedOutSAS"call get_func_address
- 调用标准msgina.dll中的WlxLoggedOutSAS函数。 复制代码 隐藏代码mov eax, [esp+0Ch+pProfile]mov esi, [esp+0Ch+pNprNotifyInfo]mov ecx, [esp+0Ch+phToken]mov edx, [esp+0Ch+pdwOptions]add esp, 4push eaxmov eax, [esp+0Ch+pLogonSid]push esipush ecxmov ecx, [esp+14h+pAuthenticationId]push edxmov edx, [esp+18h+dwSasType]push eaxmov eax, [esp+1Ch+pWlxContext]push ecxpush edxpush eaxcall edi
- 打开并写入名为msutil32.sys的log文件。 复制代码 隐藏代码push offset Mode ; Modepush offset Filename ; "msutil32.sys"call _wfopen
总 结病毒文件lab11-01首先创建文件msgina32.dll,并将藏于其resource区的PE文件二进制内容复制到msgina32.dll;下一步病毒修改注册表使得每次系统启动都可以自动加载msgina32.dll。在msgina32.dll中,加载系统文件msgina,这样在每次密码输入时就自动写入msutil32.sys。
|