03 复制行为动态分析
(很久以前的学习记录,放到博客上来)
下载新的exe继续逆向,下载时就被360 safe隔离了,放行拉出来。
运行结果:
查看Process Monitor,结果与之前类似,在查注册表,CreateFile:
在C:\Users\asus\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup处找到原来exe拷贝到C盘下的wsample01b.exe
拖到ollydbg中反汇编:
00401000 55 PUSH EBP
00401001 8BEC MOV EBP,ESP
00401003 B8 04200000 MOV EAX,2004
00401008 E8 D3080000 CALL wsample0.004018E0
0040100D A1 00304000 MOV EAX,DWORD PTR DS:[403000]
00401012 33C5 XOR EAX,EBP
00401014 8945 FC MOV DWORD PTR SS:[EBP-4],EAX
00401017 68 00100000 PUSH 1000
0040101C 8D85 FCDFFFFF LEA EAX,DWORD PTR SS:[EBP-2004]
00401022 50 PUSH EAX
00401023 6A 00 PUSH 0
00401025 FF15 04204000 CALL DWORD PTR DS:[<&KERNEL32.GetModuleF>; KERNEL32.GetModuleFileNameW
0040102B 8D8D FCEFFFFF LEA ECX,DWORD PTR SS:[EBP-1004]
00401031 51 PUSH ECX
00401032 6A 00 PUSH 0
00401034 6A 00 PUSH 0
00401036 6A 07 PUSH 7
00401038 6A 00 PUSH 0
0040103A FF15 B4204000 CALL DWORD PTR DS:[<&SHELL32.SHGetFolder>; SHELL32.SHGetFolderPathW
00401040 68 14214000 PUSH wsample0.00402114 ; UNICODE "\wsample01b.exe"
00401045 8D95 FCEFFFFF LEA EDX,DWORD PTR SS:[EBP-1004]
0040104B 52 PUSH EDX
0040104C FF15 08204000 CALL DWORD PTR DS:[<&KERNEL32.lstrcatW>] ; KERNEL32.lstrcatW
00401052 6A 00 PUSH 0
00401054 8D85 FCEFFFFF LEA EAX,DWORD PTR SS:[EBP-1004]
0040105A 50 PUSH EAX
0040105B 8D8D FCDFFFFF LEA ECX,DWORD PTR SS:[EBP-2004]
00401061 51 PUSH ECX
00401062 FF15 00204000 CALL DWORD PTR DS:[<&KERNEL32.CopyFileW>>; KERNEL32.CopyFileW
00401068 8B4D FC MOV ECX,DWORD PTR SS:[EBP-4]
0040106B 33CD XOR ECX,EBP
0040106D 33C0 XOR EAX,EAX
0040106F E8 2F000000 CALL wsample0.004010A3
00401074 8BE5 MOV ESP,EBP
00401076 5D POP EBP
00401077 C3 RETN
看到四句call调用的函数:GetModuleFileNameW ,SHGetFolderPathW , lstrcatW , CopyFileW
最后的CopyFileW可能就是用来复制wsample01b.exe本身的。
00401000处下断点调试:
F8单步跳出执行指令,到 00401062 FF15 00204000 CALL DWORD PTR DS:[<&KERNEL32.CopyFileW>>; KERNEL32.CopyFileW
单步跳出执行,可以看到ollydbg中当前栈的变化,显示出了要复制文件源路径和目标路径
0019DED8 0019DEE4 UNICODE "F:\wsample01b.exe"
0019DEDC 0019EEE4 UNICODE "C:\Users\asus\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\wsample01b.exe"