您尚未登录,请登录后浏览更多内容! 登录 | 注册并了解

QQ登录

只需一步,快速开始

 找回密码
 注册并了解

QQ登录

只需一步,快速开始

查看: 25745|回复: 7
收起左侧

[逆向工程] 解决外挂或程序禁止在虚拟机内运行的两个方法

[复制链接]

点击这里给我发消息

QQ

发表于 2013-11-14 16:00:15 | 显示全部楼层 |阅读模式
一. 修改VM配置文件 [简单]
通常反检测vmware的方法就是修改vmware的配置,我在这里简单介绍一下,如何配置。

1,用记事本打开虚拟系统镜像文件的配置文件,这个文件扩展名为vmx,比如我的虚拟系统名为XP,那这个文件就叫XP.vmx,然后在
其末尾添加这么一句,如下红色部分(注意,虚拟机不能在运行状态添加)

monitor_control.restrict_backdoor = "true"[size=14.399999618530273px]isolation.tools.getPtrLocation.disable = "TRUE"
[size=14.399999618530273px]isolation.tools.setPtrLocation.disable = "TRUE"
[size=14.399999618530273px]isolation.tools.setVersion.disable = "TRUE"
[size=14.399999618530273px]isolation.tools.getVersion.disable = "TRUE"
[size=14.399999618530273px]monitor_control.disable_directexec = "TRUE"
[size=14.399999618530273px]monitor_control.disable_chksimd = "TRUE"
[size=14.399999618530273px]monitor_control.disable_ntreloc = "TRUE"
[size=14.399999618530273px]monitor_control.disable_selfmod = "TRUE"
[size=14.399999618530273px]monitor_control.disable_reloc = "TRUE"
[size=14.399999618530273px]monitor_control.disable_btinout = "TRUE"
[size=14.399999618530273px]monitor_control.disable_btmemspace = "TRUE"
[size=14.399999618530273px]monitor_control.disable_btpriv = "TRUE"
[size=14.399999618530273px]monitor_control.disable_btseg = "TRUE"

这句的意思是关闭vmware的后门(什么后门?后面详细说)

2,开启vmware workstation,在里面的 虚拟机 -> 设置 -> 处理器 -> 勾上‘禁用二进制翻译加速’(不同汉化版翻译有所出入)

这两条一起用,可以躲过大部分检测,包括一些壳的检测,比如VMProtect等。



二  使用OP修改

1.在VM_Retn处下好断,如下:

  1. //VM_Retn
  2. Address Thread   Command                                   ; Registers and comments
  3. 01051374 Main     shr cl,6                                  ; ECX=01051301
  4. 01051377 Main     push esi
  5. 01051378 Main     dec di                                    ; EDI=0006F69F
  6. 0105137B Main     clc
  7. 0105137C Main     mov esp,ebp
  8. 0105137E Main     rcl cx,7                                  ; ECX=01058084
  9. 01051382 Main     shr cl,5                                  ; ECX=01058004
  10. 01051385 Main     test bx,25E5
  11. 0105138A Main     pop ecx                                   ; ECX=00000000
  12. 0105138B Main     sbb bx,0B0CF                              ; EBX=016378C0
  13. 01051390 Main     movzx bp,al                               ; EBP=000600A5
  14. 01051394 Main     bswap ecx
  15. 01051396 Main     pop ecx                                   ; ECX=0006FF8C
  16. 01051397 Main     pushfd
  17. 01051398 Main     sal ecx,cl                                ; ECX=6FF8C000
  18. 0105139A Main     or edx,ecx                                ; EDX=6FF8C000
  19. 0105139C Main     jmp NOTEPAD_.010534CE
  20. 010534CE Main     mov ecx,dword ptr ss:[esp+4]              ; ECX=010328FD
  21. 010534D2 Main     test esi,66FCC45D
  22. 010534D8 Main     btc bx,si                                 ; EBX=016358C0
  23. 010534DC Main     shr di,cl                                 ; EDI=00060000
  24. 010534DF Main     das                                       ; EAX=00000045
  25. 010534E0 Main     push dword ptr ss:[esp+8]
  26. 010534E4 Main     popfd
  27. 010534E5 Main     setns al                                  ; EAX=00000000
  28. 010534E8 Main     call NOTEPAD_.010532F5
  29. 010532F5 Main     push edx
  30. 010532F6 Main     mov edi,dword ptr ss:[esp+14]             ; EDI=0006FF74
  31. 010532FA Main     pop ebp                                   ; EBP=6FF8C000
  32. 010532FB Main     mov ebp,dword ptr ss:[esp+14]             ; EBP=0006FF98
  33. 010532FF Main     pop esi                                   ; ESI=010534ED
  34. 01053300 Main     pushad
  35. 01053301 Main     bswap ax
  36. 01053304 Main     mov eax,dword ptr ss:[esp+34]             ; EAX=564D5868
  37. 01053308 Main     seta bh                                   ; EBX=016300C0
  38. 0105330B Main     jmp NOTEPAD_.01051BD5
  39. 01051BD5 Main     pop ecx                                   ; ECX=0006FF74
  40. 01051BD6 Main     pop ebx                                   ; EBX=010534ED
  41. 01051BD7 Main     mov esi,dword ptr ss:[esp+30]             ; ESI=0006FF8C
  42. 01051BDB Main     pop edx                                   ; EDX=0006FF98
  43. 01051BDC Main     movsx dx,dl
  44. 01051BE0 Main     setnb dh                                  ; EDX=00060098
  45. 01051BE3 Main     push A12C39EA
  46. 01051BE8 Main     mov ebx,dword ptr ss:[esp+34]             ; EBX=00000000
  47. 01051BEC Main     jmp NOTEPAD_.010536B2
  48. 010536B2 Main     mov edx,dword ptr ss:[esp+38]             ; EDX=00005658
  49. 010536B6 Main     mov dword ptr ss:[esp],esi
  50. 010536B9 Main     mov ecx,dword ptr ss:[esp+3C]             ; ECX=0000000A
  51. 010536BD Main     push 5E6B9B41
  52. 010536C2 Main     pushfd
  53. 010536C3 Main     pushfd
  54. 010536C4 Main     mov byte ptr ss:[esp+C],ch
  55. 010536C8 Main     push dword ptr ss:[esp+4C]
  56.     Breakpoint at NOTEPAD_.010536CC
  57. 010536CC Main     retn 50     //这里下好断
  58.     Run trace closed
复制代码
2.断下后,F7后,看代码,一直到出口处的指令为


  1. 0102F393    ED                   in eax,dx
  2. 0102F394    9C                   pushfd
  3. 0102F395    57                   push edi
  4. 0102F396    C74424 04 FEFCF284   mov dword ptr ss:[esp+4],84F2FCFE
  5. 0102F39E    60                   pushad
  6. 0102F39F    C74424 20 72265BE7   mov dword ptr ss:[esp+20],E75B2672
复制代码
3.F7步过0102F393    ED                   in eax,dx后,把edx,ebx寄存器的值清0


4.F9运行,发现可以正常运行了。

很简单,方法也是很老的东西了。原理就是:
in eax,dx这条指令在R3下会产生异常,而VMP在SEH里重新设置了新的EIP,初始化了新的VMContext,而在虚拟机里,这个异常不会触发。
简单的代码如下(摘自shellwolf在反调试文章的代码):

  1. bool IsInsideVMWare_()
  2. {
  3. bool r;
  4. _asm
  5.    {
  6.      push    edx
  7.      push    ecx
  8.      push    ebx
  9.      mov     eax, 'VMXh'
  10.      mov     ebx, 0 // any value but MAGIC VALUE
  11.      mov     ecx, 10 // get VMWare version
  12.      mov     edx, 'VX' // port number
  13.      in      eax, dx // read port
  14.                    // on return EAX returns the VERSION
  15.      cmp     ebx, 'VMXh' // is it a reply from VMWare?
  16.      setz    [r] // set return value
  17.      pop     ebx
  18.      pop     ecx
  19.      pop     edx
  20.    }
  21. return r;
  22. }
  23. bool FV_VMWare_VMX()
  24. {
  25. __try
  26.    {
  27.     return IsInsideVMWare_();
  28.    }
  29. __except(1) // 1 = EXCEPTION_EXECUTE_HANDLER
  30.    {
  31.     return false;
  32.    }
  33. }
复制代码







上一篇:如何学好破解程序【文字提示+视频教程】
下一篇:汇编常用指命

QQ

发表于 2016-3-6 02:23:46 | 显示全部楼层
支持楼主,加油。加油!

QQ

发表于 2016-3-6 18:29:32 | 显示全部楼层
谢谢,过来支持一下

QQ

发表于 2016-3-7 16:14:31 | 显示全部楼层

QQ

发表于 2016-3-8 03:01:18 | 显示全部楼层
支持楼主,加油。加油!

QQ

发表于 2016-3-8 14:00:53 | 显示全部楼层
谢谢,过来支持一下

发表于 2017-9-6 10:24:19 | 显示全部楼层
老大,能帮我处理个程序的虚拟机提示问题吗?有偿服务

发表于 2019-10-6 11:46:53 | 显示全部楼层
您好 虚拟机有没有什么外挂可以批量操作的有偿服务 真心求
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册并了解

本版积分规则

       
    闽ICP备12002833号

GMT+8, 2024-3-28 20:48 , Processed in 0.459641 second(s), 62 queries .

返回顶部