流沙团
任务门测试实验
2018-3-23 流沙团


0x001 部署环境



eq 8003f500 0000e500`00c30000

eq 8003f0c0 0000e912`fdcc0068



0x002 测试代码







// 20180323_01.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include <windows.h>
#include <stdio.h>

DWORD dwOK;
DWORD dwESP;
DWORD dwCS;

__declspec(naked)func()
{
dwOK = 1;
__asm
{
mov eax,esp
mov dwESP,eax
mov ax,cs
mov word ptr [dwCS],ax

iretd
}
}
//eq 8003f500 0000e500`00c30000
//eq 8003f0c0 0000e912`fdcc0068

int main(int argc, char* argv[])
{
char bu[0x10];
int iCr3;
printf("intput CR3:\n");
scanf("%x",&iCr3); //!process 0 0

DWORD iTESS[0x68] = {// 0x00427a30
0x00000000,//link
(DWORD)bu,//esp0,这里是自己定义的栈地址
0x00000010,//ss0
0x00000000,//esp1
0x00000000,//ss1
0x00000000,//esp2
0x00000000,//ss2
(DWORD)iCr3,//cr3
0x00401020,//eip,这里是上面的测试入口函数的地址。
0x00000000,//eflags
0x00000000,//eax
0x00000000,//ecx
0x00000000,//edx
0x00000000,//ebx
(DWORD)bu,//esp,这里是自己定义的栈地址
0x00000000,//ebp
0x00000000,//esi
0x00000000,//edi
0x00000023,//es
0x00000008,//cs
0x00000010,//ss
0x00000023,//ds
0x00000030,//fs
0x00000000,//gs
0x00000000,//ldt
0x20ac0000 // 这个位置暂时忽略,填这个值就行了
};

__asm{
int 0x20
}

printf("ok = %d ESP=%x CS = %x \n",dwOK,dwESP,dwCS);

return 0;
}









发表评论:
昵称

邮件地址 (选填)

个人主页 (选填)

内容