韩冰 发表于 2005-1-20 14:44

菜鸟手动脱壳全过程,超详细~~~

<P>菜鸟手动脱Armadillo CopyMem-ll +Debug-Blocker壳全过程,超详细。。。
【使用<a href="http://hackbase.com/hacker/tool" target="_blank" >工具</A>】 Ollydbg,Loadpe,Imprec1.6F</P>
<P>【脱壳平台】 Win<a href="http://hackbase.com/skill" target="_blank" >2K</A></P>
<P>【<a href="http://down.hackbase.com/" target="_blank" >软件</A>名称】 按键精灵3 V3.11</P>
<P>【加壳方式】 Armadillo 3.00a - 3.60 -&gt; Silicon Realms Toolworks</P>
<P>【保护方式】 Armadillo CopyMem-ll +Debug-Blocker</P>
<P>【脱壳人】飞舞的T恤
-------------------------------------------------------------------------------- </P>
<P>【脱壳内容】 </P>
<P>小弟第一次手动脱壳就碰上了Armadillo CopyMem-ll +Debug-Blocker难缠的东东,所以整理了一下两个星期来脱Armadillo CopyMem-ll +Debug-Blocker的全过程,希望能给第一次脱Armadillo CopyMem-ll +Debug-Blocker<a href="http://bbs.hackbase.com/forumdisplay.php?fid=1&amp;sid=t82vV5P1" target="_blank" >新手</A>们一点帮助,始大家少走点弯路(我的弯路走了不少)。</P>
<P>小弟第一次脱壳,本来想从简单的壳开始学习的,可像什么upx、aspack等壳都有<a href="http://hackbase.com/hacker/tool" target="_blank" >工具</A>脱,弄的一点兴趣都没有了(本来脱壳就是想在朋友面前炫一下,有<a href="http://hackbase.com/hacker/tool" target="_blank" >工具</A>脱的壳当然没有挑战性了)。这时忽然发现N久(多久记不到了,反正刚出我就下了,一直没用)前放在咱<a href="http://hackbase.com/network/zs" target="_blank" >电脑</A>里的按键精灵3 v3.11,哈哈,小样就从你入手当我脱壳的<a href="http://hackbase.com/hacker/hacker" target="_blank" >入门</A>学习吧。</P>
<P>用PEiD.exe一看是Armadillo的壳,运行程序发现进程里有两个按键精灵3.exe,哈哈Armadillo 双进程标准壳。在这之前我先看了weiyi75、fly、csjwaman等大大们的双进程标准壳的脱文。最过选择了照着weiyi75大大的脱文《爱的中<a href="http://hackbase.com/gest/experience" target="_blank" >体验</A>之Armadillo3.x双进程之Mr.Captor》按步就搬的开脱了。主要是weiyi75的脱文里的脱法简单易学,对我这个<a href="http://bbs.hackbase.com/forumdisplay.php?fid=1&amp;sid=t82vV5P1" target="_blank" >新手</A>来说比较直观简便。</P>
<P>OD载入程序,插件自动隐藏OD,忽略所有异常。</P>
<P>00485000 按&gt; $Content$nbsp; 60               pushad    //外壳入口
00485001    .  E8 00000000       call 按键精灵.00485006
00485006    $Content$nbsp; 5D                pop ebp
00485007    .  50                push eax
00485008    .  51                push ecx
00485009    .  EB 0F             jmp short 按键精灵.0048501A
.....................................................................</P>
<P>命令行下断点 BP OpenMutexA,F9运行。</P>
<P>中断</P>
<P>77E6C503 K&gt;  55                  push ebp
77E6C504     8BEC                mov ebp,esp
77E6C506     51                  push ecx
77E6C507     51                  push ecx
77E6C508     837D 10 00          cmp dword ptr ss:,0
77E6C50C     56                  push esi
77E6C50D     0F84 4AB90200       je KERNEL32.77E97E5D
.....................................................................</P>
<P>堆栈内容</P>
<P>0012F574    0045C5F1  /CALL 到 OpenMutexA
0012F578    001F0001  |Access = 1F0001
0012F57C    00000000  |Inheritable = FALSE
0012F580    0012FBB4  \MutexName = "2A8:AC7B8F140"   //注意MutexName 这个地址 每个机器不同,以看到的为主。</P>
<P>找一块程序领空空地址,写入一些欺骗Arm的<a href="http://hackbase.com/hacker" target="_blank" >代码</A>。</P>
<P>Ctrl+G 401000 </P>
<P>00401000    0000            ADD BYTE PTR DS:,AL  //都是空地址。
00401002    0000            ADD BYTE PTR DS:,AL
00401004    0000            ADD BYTE PTR DS:,AL
00401006    0000            ADD BYTE PTR DS:,AL
00401008    0000            ADD BYTE PTR DS:,AL
0040100A    0000            ADD BYTE PTR DS:,AL
0040100C    0000            ADD BYTE PTR DS:,AL
0040100E    0000            ADD BYTE PTR DS:,AL</P>
<P>OD直接双击修改,填入以下<a href="http://hackbase.com/hacker" target="_blank" >代码</A>。</P>
<P>00401000     60                  pushad
00401001     9C                  pushfd
00401002     68 B4FB1200         push 12FBB4                       ; ASCII "2A8:AC7B8F140"
00401007     33C0                xor eax,eax
00401009     50                  push eax
0040100A     50                  push eax
0040100B     E8 6D97A677         call KERNEL32.CreateMutexA
00401010     9D                  popfd
00401011     61                  popad
00401012   - E9 ECB4A677         jmp KERNEL32.OpenMutexA
............................................................</P>
<P>将当前的 Eip 77E6C503 切换到 401000 来。</P>
<P>点右键 选在此处新建 Eip ,看到Eip 变为 401000</P>
<P>F9运行。</P>
<P>中断</P>
<P>77E6C503 K&gt;  55                  push ebp  //双击它或F2清除断点。
77E6C504     8BEC                mov ebp,esp
77E6C506     51                  push ecx
77E6C507     51                  push ecx
77E6C508     837D 10 00          cmp dword ptr ss:,0
77E6C50C     56                  push esi
77E6C50D     0F84 4AB90200       je KERNEL32.77E97E5D
............................................................</P>
<P>找 magic jmp 命令行下断点,bp GetModuleHandleA</P>
<P>77E63DFC K&gt;  55                  push ebp  //F2去掉断点,右键改为硬件执行。
77E63DFD     8BEC                mov ebp,esp
77E63DFF     837D 08 00          cmp dword ptr ss:,0
77E63E03     74 18               je short KERNEL32.77E63E1D
77E63E05     FF75 08             push dword ptr ss:
77E63E08     E8 87FFFFFF         call KERNEL32.77E63D94
77E63E0D     85C0                test eax,eax
77E63E0F     74 08               je short KERNEL32.77E63E19
77E63E11     FF70 04             push dword ptr ds:
77E63E14     E8 3F240000         call KERNEL32.GetModuleHandleW
77E63E19     5D                  pop ebp
77E63E1A     C2 0400             retn 4
........................................................................</P>
<P>F9运行,多次硬件中断,注意堆栈值。</P>
<P>7次F9提示一个非法指令错误,Shift+F9忽略。
0012BEF8    00B1C807  /CALL 到 GetModuleHandleA 来自 00B1C801
0012BEFC    00B2D6C8  \pModule = "kernel32.dll"
0012BF00    00B2E67C  ASCII "VirtualAlloc"</P>
<P>0012BEF8    00B1C824  /CALL 到 GetModuleHandleA 来自 00B1C81E
0012BEFC    00B2D6C8  \pModule = "kernel32.dll"
0012BF00    00B2E670  ASCII "VirtualFree"</P>
<P>9次F9提示一个非法指令错误,Shift+F9忽略。</P>
<P>堆栈内容</P>
<P>0012BC70    00B0799B  /CALL 到 GetModuleHandleA 来自 00B07995
0012BC74    0012BDAC  \pModule = "kernel32.dll"</P>
<P>点调试菜单,里面清除硬件断点。</P>
<P>Ctrl+F9 返回。</P>
<P>00B07995     FF15 C480B200       call dword ptr ds:        ; KERNEL32.GetModuleHandleA
00B0799B     8B0D E011B300       mov ecx,dword ptr ds:
00B079A1     89040E              mov dword ptr ds:,eax
00B079A4     A1 E011B300         mov eax,dword ptr ds:
00B079A9     393C06              cmp dword ptr ds:,edi
00B079AC     75 16               jnz short 00B079C4
00B079AE     8D85 B4FEFFFF       lea eax,dword ptr ss:
00B079B4     50                  push eax
00B079B5     FF15 CC80B200       call dword ptr ds:        ; KERNEL32.LoadLibraryA
00B079BB     8B0D E011B300       mov ecx,dword ptr ds:
00B079C1     89040E              mov dword ptr ds:,eax
00B079C4     A1 E011B300         mov eax,dword ptr ds:
00B079C9     393C06              cmp dword ptr ds:,edi
00B079CC     0F84 AD000000       je 00B07A7F    //这是文章中提到的magic jmp,我改。</P>
<P>改为</P>
<P>00B07995     FF15 C480B200       call dword ptr ds:        ; KERNEL32.GetModuleHandleA
00B0799B     8B0D E011B300       mov ecx,dword ptr ds:
00B079A1     89040E              mov dword ptr ds:,eax
00B079A4     A1 E011B300         mov eax,dword ptr ds:
00B079A9     393C06              cmp dword ptr ds:,edi
00B079AC     75 16               jnz short 00B079C4
00B079AE     8D85 B4FEFFFF       lea eax,dword ptr ss:
00B079B4     50                  push eax
00B079B5     FF15 CC80B200       call dword ptr ds:        ; KERNEL32.LoadLibraryA
00B079BB     8B0D E011B300       mov ecx,dword ptr ds:
00B079C1     89040E              mov dword ptr ds:,eax
00B079C4     A1 E011B300         mov eax,dword ptr ds:
00B079C9     393C06              cmp dword ptr ds:,edi
00B079CC     E9 AE000000         jmp 00B07A7F  //修改 (我试过改标志位Z)</P>
<P>.........................................................</P>
<P>清除所有断点。在401000段下内存断点,按F9</P>
<P>00B206B2     8B04B0              mov eax,dword ptr ds:  //来到这里
00B206B5     3341 54             xor eax,dword ptr ds:
00B206B8     8B0D 9455B300       mov ecx,dword ptr ds:                 ; 按键精灵.00495260
00B206BE     3341 04             xor eax,dword ptr ds:
00B206C1     8B0D 9455B300       mov ecx,dword ptr ds:                 ; 按键精灵.00495260
00B206C7     3341 74             xor eax,dword ptr ds:
00B206CA     8B0D 9455B300       mov ecx,dword ptr ds:                 ; 按键精灵.00495260
00B206D0     3341 30             xor eax,dword ptr ds:
00B206D3     8B0D 9455B300       mov ecx,dword ptr ds:                 ; 按键精灵.00495260
00B206D9     3341 20             xor eax,dword ptr ds:</P>
<P>提示被调试程序无法处理异常,Shift+F9忽略,game over程序退出。</P>
<P>天哪,我错在那里啦!我怎么就到不了“push ebp   //到达地球人都知道的位置”</P>
<P>想想第一次脱壳,没这么顺利也是正常的,那么我们在试试其他大大的方法,在后来三、四天里偶用了能找到的脱标准壳的方法来脱它,TMD没一个成功的,这期间每天晚上19点到1点,我都在学习<a href="http://hackbase.com/hacker/leak" target="_blank" >研究</A>各各armadillo标准壳的脱法,搞的每天上班没精神。还是没有一点收获,总不能半途而废吧?去论谈上问问各位大虾吧。。。</P>
<P>期间loveboom大大成给于提示说“可能不是标准双进程壳或是高版本的,所以你按双进程的来脱是不行的”可对于<a href="http://bbs.hackbase.com/forumdisplay.php?fid=1&amp;sid=t82vV5P1" target="_blank" >新手</A>的我来说,说了等于白说,希望下次小弟提问时,各们大大能提供详细一点的资料。。。^<a href="http://www1.hackbase.com/hacker/tutorial/200501199601.htm#" target="_blank" >_</A>^</P>
<P>后来还多亏wangli<a href="http://www1.hackbase.com/hacker/tutorial/200501199601.htm#" target="_blank" >_</A>com大大的指点。。。</P>
<P>先找oep,在OD中重开程序,下bp WaitForDebugEvent,F9运行</P>
<P>77E7A6CF K&gt;  55                  push ebp   //来到这里,F2清除断点
77E7A6D0     8BEC                mov ebp,esp
77E7A6D2     81EC 9C000000       sub esp,9C
77E7A6D8     53                  push ebx
77E7A6D9     56                  push esi
77E7A6DA     57                  push edi</P>
页: [1]
查看完整版本: 菜鸟手动脱壳全过程,超详细~~~