• 标 题:tElock XXX 之forgot、heXer修改版脱壳
  • 作 者:fly
  • 时 间:004-07-04,21:02
  • 链 接:http://bbs.pediy.com

下载页面:  http://bbs.pediy.com/showthread.php?s=&threadid=2440  或 点击此处本地下载
软件大小:  65 KB
             
【软件简介】:forgot、heXer的tElock修改版
             
【作者声明】:只是感兴趣,没有其他目的。失误之处敬请诸位大侠赐教!
             
【调试环境】:WinXP、Ollydbg1.10、PEiD、LordPE、ImportREC
             
————————————————————————————————— 
【脱壳过程】:
          
      
昨天黄昏,有人自4楼坠落,刹那间殒命。
成功、失败、喜悦、悲伤、爱情、事业……人世间的一切都与他无关了。
不说了,窗外夏雨正浓,脱个壳吧。
————————————————————————————————— 
一、消除ZwSetInformationThread反跟踪
             
             
设置Ollydbg忽略除了“INT3中断”之外的所有其它异常选项。老规矩:用IsDebug 1.4插件去掉Ollydbg的调试器标志。
注意:不要在程序中下INT3普通断点,可以下硬件断点,否则forgot会让你ReBoot。
         

代码:
   00430862     E9 99D7FFFF         jmp xxx.0042E000//进入OD后停在这

           
Shift+F9运行,程序中断在异常处
代码:
  0042E0E1     CC                  int3//第1次异常 0042EC81     CC                  int3//第1次异常

           
现在可以忽略所有的异常选项了。Ctrl+S 搜索命令序列:
代码:
  push 0 push 0 push 11 push eax

找到在0042F7EE处
代码:
      0042F7DE     8BBD A7204000       mov edi,dword ptr ss:[ebp+4020A7] 0042F7E4     85FF                test edi,edi 0042F7E6     74 0F               je short xxx.0042F7F7//改为:JMP 0042F7F7 ★ 0042F7E8     FF95 191F4000       call dword ptr ss:[ebp+401F19] 0042F7EE     6A 00               push 0//找到这里 0042F7F0     6A 00               push 0 0042F7F2     6A 11               push 11 0042F7F4     50                  push eax 0042F7F5     FFD7                call edi//ZwSetInformationThread

           
当然,你可以先BP ZwSetInformationThread ,得知这个Anti的地址啦。
           
           
————————————————————————————————— 
二、消除自校验
           
           
Ctrl+S 搜索命令序列:
代码:
  push 30 push ebx

找到在0042FDEF处。我们在其上面的0042FDD7的跳转处下个 硬件执行断点。
           
代码:
  0042FDCF     FF95 7F154000       call dword ptr ss:[ebp+40157F] 0042FDD5     85C0                test eax,eax 0042FDD7     0F85 D7000000       jnz xxx.0042FEB4//改为JMP ★ 0042FDDD     8B95 4C394000       mov edx,dword ptr ss:[ebp+40394C] 0042FDE3     0195 14394000       add dword ptr ss:[ebp+403914],edx 0042FDE9     0195 20394000       add dword ptr ss:[ebp+403920],edx 0042FDEF     6A 30               push 30//找到这里 0042FDF1     53                  push ebx 0042FDF2     FFB5 20394000       push dword ptr ss:[ebp+403920] 0042FDF8     E8 FDF7FFFF         call xxx.0042F5FA 0042FDFD     EB 58               jmp short xxx.0042FE57

           
这里的自校验方式和tElock是一样的。
           
           
————————————————————————————————— 
三、Magic Jump:避开输入表加密
           
           
Shift+F9运行,会有几个000006EF异常,继续Shift+F9,直至Ollydbg中断在0042FDD7的 硬件执行断点 处。
下面就是处理IAT的地方啦。
         
代码:
    0042FEB4     8985 34394000       mov dword ptr ss:[ebp+403934],eax 0042FEBA     8D85 7C304000       lea eax,dword ptr ss:[ebp+40307C]

           
可以看出只加密下面4个DLL的函数:
代码:
  0043007C   47 44 49 33 32 2E 44 4C 4C 55 53 45 52 33 32 2E  GDI32.DLLUSER32. 0043008C   44 4C 4C 53 48 45 4C 4C 33 32 2E 44 4C 4C 4B 45  DLLSHELL32.DLLKE 0043009C   52 4E 45 4C 33 32 2E 44 4C 4C                    RNEL32.DLL

         
代码:
    0042FEC0     60                  pushad 0042FEC1     33C9                xor ecx,ecx 0042FEC3     2AF6                sub dh,dh 0042FEC5     8A13                mov dl,byte ptr ds:[ebx] 0042FEC7     F6C2 40             test dl,40 0042FECA     74 03               je short xxx.0042FECF 0042FECC     80E2 5F             and dl,5F 0042FECF     0AD2                or dl,dl 0042FED1     74 1E               je short xxx.0042FEF1 0042FED3     43                  inc ebx 0042FED4     FEC6                inc dh 0042FED6     41                  inc ecx 0042FED7     3A5408 FF           cmp dl,byte ptr ds:[eax+ecx-1] 0042FEDB     74 E8               je short xxx.0042FEC5 0042FEDD     3A5408 08           cmp dl,byte ptr ds:[eax+ecx+8] 0042FEE1     74 E2               je short xxx.0042FEC5 0042FEE3     3A5408 12           cmp dl,byte ptr ds:[eax+ecx+12] 0042FEE7     74 DC               je short xxx.0042FEC5 0042FEE9     3A5408 1D           cmp dl,byte ptr ds:[eax+ecx+1D] 0042FEED     74 D6               je short xxx.0042FEC5 0042FEEF     EB D0               jmp short xxx.0042FEC1 0042FEF1     0AF6                or dh,dh 0042FEF3     895424 1C           mov dword ptr ss:[esp+1C],edx 0042FEF7     61                  popad 0042FEF8     C685 E1314000 00    mov byte ptr ss:[ebp+4031E1],0 0042FEFF     74 24               je short xxx.0042FF25//Magic Jump!改为JMP ★             0043005D     81E3 FFFFFF7F       and ebx,7FFFFFFF 00430063     53                  push ebx 00430064     FFB5 34394000       push dword ptr ss:[ebp+403934] 0043006A     FF95 7B154000       call dword ptr ss:[ebp+40157B]; kernel32.GetProcAddress             00430161     3107                xor dword ptr ds:[edi],eax//地址写入 00430163     58                  pop eax 00430164     48                  dec eax 00430165     74 09               je short xxx.00430170 00430167     40                  inc eax 00430168     F8                  clc 00430169     8803                mov byte ptr ds:[ebx],al 0043016B     43                  inc ebx 0043016C     3803                cmp byte ptr ds:[ebx],al 0043016E     75 F9               jnz short xxx.00430169 00430170     8385 38394000 04    add dword ptr ss:[ebp+403938],4 00430177     E9 B9FDFFFF         jmp xxx.0042FF35 0043017C     83C6 14             add esi,14 0043017F     8B95 4C394000       mov edx,dword ptr ss:[ebp+40394C] 00430185     E9 13FCFFFF         jmp xxx.0042FD9D//循环

           
           
————————————————————————————————— 
四、第2区段内存访问断点大法:直达OEP
           
           
取消以前的所有断点,包括硬件断点。
Alt+M打开内存镜像窗口,在401000第2个区段处下内存访问断点,Shift+F9运行,直达OEP!
           
代码:
  00404C8F     E9 90000000         jmp xxx.00404D24//在这儿用LordPE纠正ImageSize后完全DUMP这个进程 00404D24     60                  pushad 00404D25     68 20F54000         push xxx.0040F520 ; ASCII "tElockv098" 00404D2A     6A 00               push 0 00404D2C     6A 00               push 0 00404D2E     E8 55750000         call xxx.0040C288 ; jmp to kernel32.CreateMutexA 00404D33     E8 80750000         call xxx.0040C2B8 ; jmp to ntdll.RtlGetLastWin32Error 00404D38     3D B7000000         cmp eax,0B7 00404D3D     75 18               jnz short 00404D57//改为JMP就可以同时开几个tElock了 00404D3F     6A 00               push 0 00404D41     68 2BF54000         push xxx.0040F52B ; ASCII "Reminder" 00404D46     68 34F54000         push xxx.0040F534 ; ASCII "Another instance of tElock is already running!" 00404D4B     6A 00               push 0 00404D4D     E8 86760000         call xxx.0040C3D8 ; jmp to user32.MessageBoxA

           
运行ImportREC,选择这个进程。把OEP改为00004C8F,点“IAT AutoSearch”,点“Get Import”,FixDump,正常运行!
           
             
—————————————————————————————————    
代码:
                                      ,     _/          /| _.-~/            \_     ,        青春都一晌        ( /~   /              \~-._ |\        `\\  _/                \   ~\ )          忍把浮名     _-~~~-.)  )__/;;,.          \_  //'   /'_,\   --~   \ ~~~-  ,;;\___(  (.-~~~-.        换了破解轻狂  `~ _( ,_..--\ (     ,;'' /    ~--   /._`\    /~~//'   /' `~\         ) /--.._, )_  `~   "  `~"  "      `"      /~'`\    `\\~~\                             "     "   "~'  ""

    

     Cracked By 巢水工作坊——fly [OCN][FCG][NUKE][DCM]

                2004-07-04  20:00

  • 标 题:forgot/hexer变形telock脚本.
  • 作 者:loveboom
  • 时 间:004-07-05,15:44
  • 链 接:http://bbs.pediy.com

//加点颜色看看有没有好点一点:D

code:
   msgyn "设置:按ALT+O打开异常项,除倒数第一和第三项外,其它全部打钩,这个脚本只对forgot/hexer的修改版telock有用,要继续吗?"
   cmp $RESULT,0
   je lblret

var addr
var cbase
var csize
gmi eip,CODEBASE
mov cbase,$RESULT
gmi eip,CODESIZE
mov csize,$RESULT

start:
   run

lbl1:
   gpa "GetModuleHandleA","kernel32.dll"
   bp $RESULT
   esto

lbl2:
   bc $RESULT
   rtu
   find eip,#85FF74??FF95#
   cmp $RESULT,0
   je lblabort
   mov addr,$RESULT
   bphws addr,"x"
   
lbl3:
   eob lbl4
   run
   esto
   esto
   esto

lbl4:
   bphwc addr
   mov edi,0
   find eip,#61C685#
   cmp $RESULT,0
   je lblabort
   mov addr,$RESULT
   add addr,8
   mov [addr],#EB#
lbl5:
   run
lbl6:
   bprm cbase,csize
   esto

end:
   bpmc
   cmt eip,"OEP!"
   msg "Script by loveboom[DFCG][FCG],Thank you for using my script!"
   
lblret:
   ret

lblabort:
   msg "出错,脚本将会结束,可能目标程序不是forgot/hexer的变形telock加的壳:(!"
   ret
本代码的着色效果由xTiNt自动完成
下载xTiNt http://211.90.75.84/web/kanaun/download/xTiNt.rar

上非