发新话题
打印

[原创]shellcode变形工具

[原创]shellcode变形工具

看了国外的一个shellcode变形的程序,感觉挺hao也想自己写一个。。。但是太麻烦的变形我又懒得写。

程序采用简单的异或方式,对shellcode进行变形。这样可以去除掉原shellcode中的”\x00"部分。

如果你拿到的shellcode是汇编写的,那么你需要用相应的汇编编译程序将shellcode编译成二进制文件(.bin文件),如果你拿到的shellcode本身就是"\x68\xC1\x92\x92\x2\x68\xB2"的形式,你可以利用下面的程序把它写入到一个.bin文件中:
复制内容到剪贴板
代码:
#include <stdio.h>
#include <string.h>
int main()
{
char shellcode[]="\x31\xc0\x31\xdb\x31\xc9\x31\xd2\x50\x6a\x0a\x68\x2e\x63\x6f\x6d\x68\x74\x69\x6d"
"\x65\x68\x65\x76\x69\x6c\x68\x31\x33\x39\x40\x68\x73\x68\x65\x6e\x89\xe1\xb2\x15\xb0\x04\xcd\x80\x31"
"\xc0\x31\xdb\xb0\x01\xcd\x80\xc3\x90\x90";   

FILE* fp;
fread(shellcode,st.st_size,1,fd);
fclose(fd);
fp=fopen("aaa.bin","wb");
fwrite(shellcode,1,strlen(shellcode),fp);
fclose(fp);
return 0;
}
其中的shellcode数组你可以替换为你向变形的shellcode,执行完上面的程序后就会生成一个aaa.bin的文件,然后你再用这个工具来对它变形:

E:\lcc\lcc>csc aaa.bin
      Shellcode transfiguration tools with xor method

              written by 无敌最寂寞@EST

[-]the size of aaa.bin file  is:55 bytes

[-]Size of reading from file:55 bytes

[-]Starting to xor with our shellcode!

[+]trying to xor with 0x02

[+]Encoded shellcode of xor with 0x02

\x68\xC1\x92\x92\x02\x68\xB2\x03\xCF\x82\x68\x33\xC2\x33\xD9\x68\xB2\x06\xCF\x82
\x68\x8B\xE3\xB0\x17\x68\x71\x6A\x67\x6C\x68\x31\x3B\x42\x6A\x68\x6B\x6E\x6A\x33
\x68\x67\x6A\x67\x74\x68\x6A\x76\x6B\x6F\x68\x2C\x61\x6D\x6F\x68\x52\x68\x08\x6A
\x68\x33\xCB\x33\xD0\x68\x33\xC2\x33\xD9\x33\xC9\x8B\xDC\x80\x33\x02\x43\x41\x83
\xF9\x04\x75\xF6\x54\xC3


程序在windows 2003 English Edition编译通过。。。

附件

csc.rar (2 KB)

2005-1-30 13:15, 下载次数: 253

俺是mika!别叫错了! 俺的QQ:794773 http://hi.baidu.com/stealthwalker/ my private area ------------------------------------------------------------ <a href=http://hi.baidu.com/stealthwalker target=_blank></a>

TOP

发新话题