首页
社区
课程
招聘
[求助]shellcode编写
发表于: 2015-10-27 15:30 4115

[求助]shellcode编写

2015-10-27 15:30
4115
本人刚刚学shellcode的小白,想编写一段打开记事本的shellcode(windwos2000环境下),以下为代码:
#include<windows.h>
int main()
{
        LoadLibraryA("kernel32.dll");
    _asm{
            push ebp;
            mov ebp,esp;
            xor eax,eax;
                   push eax;
            sub esp,08h
                mov byte ptr [ebp-0Ch],6eh; //n
        mov byte ptr [ebp-0Bh],6fh; //o
        mov byte ptr [ebp-0Ah],74h; //t
        mov byte ptr [ebp-09h],65h; //e
        mov byte ptr [ebp-08h],70h; //p
        mov byte ptr [ebp-07h],61h; //a
        mov byte ptr [ebp-06h],64h; //d
        lea eax,[ebp-0Ch];
        push eax;           
               
                mov eax,0x77e78601      
                call eax;
               
                mov esp,ebp;
                pop ebp;
        }   
        return 0;
}
发现怎么都打不开记事本,用od调试明明应该可以呀,我用同样的方法打开过画图和计算器,不知道为什么记事本不行,求汇编大神帮我看看!!!

[课程]Linux pwn 探索篇!

收藏
免费 0
支持
分享
最新回复 (7)
雪    币: 859
活跃值: (304)
能力值: ( LV11,RANK:180 )
在线值:
发帖
回帖
粉丝
2
这是啥函数啊?
1. 函数的每个参数都要填充合适的值
2. 字符串0x00结尾
2015-10-27 15:41
0
雪    币: 180
活跃值: (21)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
3
这是 WinExec,我把变量写成calc(计算器)或者mspaint(画图)就可以,好像后面自带00结尾
2015-10-27 15:55
0
雪    币: 22
活跃值: (423)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
4
如果 0x77e78601  是WinExec的话 少个参数  

push 5;
push eax;  
mov eax,0x77e78601      
call eax;
2015-10-27 16:00
0
雪    币: 22
活跃值: (423)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
5
char szNotepad[]={"notepad"};

int main(int argc, char* argv[])
{
     FARPROC  Addr = GetProcAddress(LoadLibraryA("kernel32.dll"),"WinExec");
        __asm
        {
                push 5;
              push offset szNotepad;        
             call Addr;  
        }
        return 0;
}
2015-10-27 16:07
0
雪    币: 180
活跃值: (21)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
6
加了push 5确实行了,非常感谢,但为什么输入mspaint可以而notepad不行呢,同样是7个字节
2015-10-27 16:07
0
雪    币: 180
活跃值: (21)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
7
[QUOTE=靴子;1399191]char szNotepad[]={"notepad"};

int main(int argc, char* argv[])
{
     FARPROC  Addr = GetProcAddress(LoadLibraryA("kernel32.dll"),"WinExec");
        __asm
...[/QUOTE]

这样写怎么注入啊,asm外面有这么多东西。。。
2015-10-27 16:30
0
雪    币: 237
活跃值: (40)
能力值: ( LV3,RANK:20 )
在线值:
发帖
回帖
粉丝
8
mov eax,0x77e78601  这个地址不对
2015-12-28 15:53
0
游客
登录 | 注册 方可回帖
返回
//