好友
阅读权限40
听众
最后登录1970-1-1
|
Armadillo Find Protected V1.8查壳,如下:
!- Protected Armadillo
Protection system (Professional)
!- <Protection Options>
Standard protection or Minimum protection
!- <Backup Key Options>
No Registry Keys at All
!- <Compression Options>
Better/Slower Compression
!- <Other Options>
487FDD00 Version 6.04 18-07-2008
!- Elapsed Time 00h 00m 00s 328ms
单进程标准壳。
两种方法脱壳。
第一种方法:使用断点:
bp VirtualProtect
bp CreateThread
首先bp 下断VirtualProtect ,处理iat加密。shift+f9运行,注意寄存器eax。
运行七次。当一个大的缓冲,且ecx值为00401000时,取消断点返回
00B8CC8C 8B8D C8D5FFFF MOV ECX,DWORD PTR SS:[EBP-2A38]
00B8CC92 51PUSH ECX
00B8CC93 8B95 C4D5FFFF MOV EDX,DWORD PTR SS:[EBP-2A3C]
00B8CC99 52PUSH EDX
00B8CC9A 8B85 74D8FFFF MOV EAX,DWORD PTR SS:[EBP-278C]
00B8CCA0 0385 C0D5FFFF ADD EAX,DWORD PTR SS:[EBP-2A40]
ctrl + f查找。“push 100 ”
查到这里:
00B42EC0 55 PUSH EBP //这里改为retn
00B42EC1 8BEC MOV EBP,ESP
00B42EC3 83EC 2CSUB ESP,2C
00B42EC6 833D 20F6BB00 00 CMP DWORD PTR DS:[BBF620],0
00B42ECD 75 59JNZ SHORT 00B42F28
00B42ECF C745 EC 13004BBA MOV DWORD PTR SS:[EBP-14],BA4B00>
00B42ED6 68 00010000PUSH 100 //找到这里。将段首改为retn。
接着再下第二个断点:bp CreateThread shift+f9运行。
7C8106C7 > 8BFF MOV EDI,EDI //断在这里,alt+f9返回
7C8106C9 55 PUSH EBP
7C8106CA 8BEC MOV EBP,ESP
7C8106CC FF75 1CPUSH DWORD PTR SS:[EBP+1C]
--------------------------------------------------------------------------------------
00B7614C 50PUSH EAX //返回到这里,单步走
00B7614D FF15 9032BB00 CALL DWORD PTR DS:[BB3290] ; kernel32.CloseHandle
00B76153 5EPOP ESI
00B76154 5BPOP EBX
00B76155 8BE5MOV ESP,EBP
---------------------------------------------------------------------------------------
00B93057 8975 F4 MOV DWORD PTR SS:[EBP-C],ESI
00B9305A 8B45 08 MOV EAX,DWORD PTR SS:[EBP+8]
00B9305D 8338 00 CMP DWORD PTR DS:[EAX],0
00B93060 75 40 JNZ SHORT 00B930A2
00B93062 8B0D 2C0BBC00 MOV ECX,DWORD PTR DS:[BC0B2C] ; UnPackMe.00454380
00B93068 8B15 2C0BBC00 MOV EDX,DWORD PTR DS:[BC0B2C] ; UnPackMe.00454380
00B9306E 8B41 6C MOV EAX,DWORD PTR DS:[ECX+6C]
00B93071 3342 3C XOR EAX,DWORD PTR DS:[EDX+3C]
00B93074 8B0D 2C0BBC00 MOV ECX,DWORD PTR DS:[BC0B2C] ; UnPackMe.00454380
00B9307A 3341 78 XOR EAX,DWORD PTR DS:[ECX+78]
00B9307D 8945 E0 MOV DWORD PTR SS:[EBP-20],EAX
00B93080 8B55 08 MOV EDX,DWORD PTR SS:[EBP+8]
00B93083 8B42 18 MOV EAX,DWORD PTR DS:[EDX+18]
00B93086 50PUSH EAX
00B93087 8B4D 08 MOV ECX,DWORD PTR SS:[EBP+8]
00B9308A 8B51 14 MOV EDX,DWORD PTR DS:[ECX+14]
00B9308D 52PUSH EDX
00B9308E 8B45 08 MOV EAX,DWORD PTR SS:[EBP+8]
00B93091 8B48 10 MOV ECX,DWORD PTR DS:[EAX+10]
00B93094 51PUSH ECX
00B93095 8B55 F4 MOV EDX,DWORD PTR SS:[EBP-C]
00B93098 2B55 E0 SUB EDX,DWORD PTR SS:[EBP-20]
00B9309B FFD2CALL EDX
00B9309D 8945 FC MOV DWORD PTR SS:[EBP-4],EAX
00B930A0 EB 48 JMP SHORT 00B930EA
00B930A2 8B45 08 MOV EAX,DWORD PTR SS:[EBP+8]
00B930A5 8338 01 CMP DWORD PTR DS:[EAX],1
00B930A8 75 40 JNZ SHORT 00B930EA
00B930AA 8B0D 2C0BBC00 MOV ECX,DWORD PTR DS:[BC0B2C] ; UnPackMe.00454380
00B930B0 8B15 2C0BBC00 MOV EDX,DWORD PTR DS:[BC0B2C] ; UnPackMe.00454380
00B930B6 8B41 6C MOV EAX,DWORD PTR DS:[ECX+6C]
00B930B9 3342 3C XOR EAX,DWORD PTR DS:[EDX+3C]
00B930BC 8B0D 2C0BBC00 MOV ECX,DWORD PTR DS:[BC0B2C] ; UnPackMe.00454380
00B930C2 3341 78 XOR EAX,DWORD PTR DS:[ECX+78]
00B930C5 8945 DC MOV DWORD PTR SS:[EBP-24],EAX
00B930C8 8B55 08 MOV EDX,DWORD PTR SS:[EBP+8]
00B930CB 8B42 04 MOV EAX,DWORD PTR DS:[EDX+4]
00B930CE 50 PUSH EAX
00B930CF 8B4D 08 MOV ECX,DWORD PTR SS:[EBP+8]
00B930D2 8B51 08 MOV EDX,DWORD PTR DS:[ECX+8]
00B930D5 52PUSH EDX
00B930D6 6A 00 PUSH 0
00B930D8 8B45 08 MOV EAX,DWORD PTR SS:[EBP+8]
00B930DB 8B48 0C MOV ECX,DWORD PTR DS:[EAX+C]
00B930DE 51PUSH ECX
00B930DF 8B55 F4 MOV EDX,DWORD PTR SS:[EBP-C]
00B930E2 2B55 DC SUB EDX,DWORD PTR SS:[EBP-24]
00B930E5 FFD2CALL EDX //F7进入,这里就跳到OEP了。
00B930E7 8945 FC MOV DWORD PTR SS:[EBP-4],EAX
00B930EA 8B45 FC MOV EAX,DWORD PTR SS:[EBP-4]
00B930ED 5EPOP ESI
00B930EE 8BE5MOV ESP,EBP
00B930F0 5DPOP EBP
00B930F1 C3RETN
----------------------------------------------------------------------------------------
00401700 55 PUSH EBP //这里就是程序的OEP。dump吧。
00401701 8BEC MOV EBP,ESP
00401703 6A FFPUSH -1
00401705 68 00254000PUSH UnPackMe.00402500
0040170A 68 86184000PUSH UnPackMe.00401886 ; JMP to msvcrt._except_handler3
0040170F 64:A1 00000000 MOV EAX,DWORD PTR FS:[0]
00401715 50 PUSH EAX
00401716 64:89250000000 MOV DWORD PTR FS:[0],ESP
第二种方法:使用常规断点:
bp GetModuleHandleA+9
bp CreateThread
首先bp GetModuleHandleA+9 下断,处理iat加密。shift+f9运行,注意堆栈。
运行N次。找返回时机。当堆栈中出现如下,马上就到返回时机了。
001293E4 /0012EB40
001293E8 |00B88683 RETURN to 00B88683 from kernel32.GetModuleHandleA
001293EC |00BB514C ASCII "kernel32.dll"
001293F0 |00BB6D64 ASCII "VirtualFree"
001293F4 |0EF6D207
001293F8 |00454380 UnPackMe.00454380
再运行一次:寄存器为如下:这就是返回时机,ALT+F9返回。
EAX 001292B0 ASCII "kernel32.dll"
ECX 001292B0 ASCII "kernel32.dll"
EDX 00000000
EBX 00000001
ESP 00129130
EBP 00129130
ESI 00454380 UnPackMe.00454380
EDI 00000000
EIP 7C80B73A kernel32.7C80B73A
----------------------------------------------------------------------------
00B6A991 8B55 F4 MOV EDX,DWORD PTR SS:[EBP-C] //返回到这里。
00B6A994 8B0D 3C30BC00 MOV ECX,DWORD PTR DS:[BC303C]
00B6A99A 890491MOV DWORD PTR DS:[ECX+EDX*4],EAX
00B6A99D 8B55 F4 MOV EDX,DWORD PTR SS:[EBP-C]
00B6A9A0 A1 3C30BC00 MOV EAX,DWORD PTR DS:[BC303C]
00B6A9A5 833C90 00 CMP DWORD PTR DS:[EAX+EDX*4],0
00B6A9A9 75 5C JNZ SHORT 00B6AA07
00B6A9AB 8B4D F8 MOV ECX,DWORD PTR SS:[EBP-8]
00B6A9AE 8B51 08 MOV EDX,DWORD PTR DS:[ECX+8]
00B6A9B1 83E2 02 AND EDX,2
00B6A9B4 74 38 JE SHORT 00B6A9EE
00B6A9B6 B8 1C000000 MOV EAX,1C
00B6A9BB C1E0 02 SHL EAX,2
00B6A9BE 8B0D 2C0BBC00 MOV ECX,DWORD PTR DS:[BC0B2C] ; UnPackMe.00454380
00B6A9C4 8B15 2C0BBC00 MOV EDX,DWORD PTR DS:[BC0B2C] ; UnPackMe.00454380
00B6A9CA 8B35 2C0BBC00 MOV ESI,DWORD PTR DS:[BC0B2C] ; UnPackMe.00454380
00B6A9D0 8B5E 48 MOV EBX,DWORD PTR DS:[ESI+48]
00B6A9D3 335A 3C XOR EBX,DWORD PTR DS:[EDX+3C]
00B6A9D6 331C01XOR EBX,DWORD PTR DS:[ECX+EAX]
00B6A9D9 83E3 10 AND EBX,10
00B6A9DC F7DBNEG EBX
00B6A9DE 1BDBSBB EBX,EBX
00B6A9E0 F7DBNEG EBX
00B6A9E2 0FB6C3MOVZX EAX,BL
00B6A9E5 85C0TEST EAX,EAX
00B6A9E7 75 05 JNZ SHORT 00B6A9EE
00B6A9E9 ^ E9 1BFFFFFF JMP 00B6A909
00B6A9EE 8D8D C8FEFFFF LEA ECX,DWORD PTR SS:[EBP-138]
00B6A9F4 51PUSH ECX
00B6A9F5 FF15 8830BB00 CALL DWORD PTR DS:[BB3088] ; kernel32.LoadLibraryA
00B6A9FB 8B55 F4 MOV EDX,DWORD PTR SS:[EBP-C]
00B6A9FE 8B0D 3C30BC00 MOV ECX,DWORD PTR DS:[BC303C]
00B6AA04 890491MOV DWORD PTR DS:[ECX+EDX*4],EAX
00B6AA07 8B55 F4 MOV EDX,DWORD PTR SS:[EBP-C]
00B6AA0A A1 3C30BC00 MOV EAX,DWORD PTR DS:[BC303C]
00B6AA0F 833C90 00 CMP DWORD PTR DS:[EAX+EDX*4],0
00B6AA13 75 05 JNZ SHORT 00B6AA1A //magic jmp NOP掉
00B6AA15 ^ E9 EFFEFFFF JMP 00B6A909
00B6AA1A C785 BCFEFFFF>MOV DWORD PTR SS:[EBP-144],0
00B6AA24 C785 C0FEFFFF>MOV DWORD PTR SS:[EBP-140],0
00B6AA2E 8B4D F8 MOV ECX,DWORD PTR SS:[EBP-8]
00B6AA31 8B51 04 MOV EDX,DWORD PTR DS:[ECX+4]
00B6AA34 8995 C4FEFFFF MOV DWORD PTR SS:[EBP-13C],EDX
00B6AA3A EB 0F JMP SHORT 00B6AA4B
00B6AA3C 8B85 C4FEFFFF MOV EAX,DWORD PTR SS:[EBP-13C]
00B6AA42 83C0 0C ADD EAX,0C
00B6AA45 8985 C4FEFFFF MOV DWORD PTR SS:[EBP-13C],EAX
00B6AA4B 8B8D C4FEFFFF MOV ECX,DWORD PTR SS:[EBP-13C]
00B6AA51 8339 00 CMP DWORD PTR DS:[ECX],0
00B6AA54 74 11 JE SHORT 00B6AA67
00B6AA56 8B95 C0FEFFFF MOV EDX,DWORD PTR SS:[EBP-140]
00B6AA5C 83C2 01 ADD EDX,1
00B6AA5F 8995 C0FEFFFF MOV DWORD PTR SS:[EBP-140],EDX
00B6AA65 ^ EB D5 JMP SHORT 00B6AA3C
00B6AA67 33C9XOR ECX,ECX
向下拉,到这里
00B6AC9A /EB 03 JMP SHORT 00B6AC9F //下断,运行到这里时返回修复修改的magic jmp 代码。
00B6AC9C |D6 SALC
00B6AC9D |D6 SALC
00B6AC9E |8F ??? ; Unknown command
00B6AC9F \8B15 9CA1BC00 MOV EDX,DWORD PTR DS:[BCA19C]
下面再下断点bp CreateThread
剩下的与方法一一样。
unp2_.rar |
|