我想写一个非常简单的程序,强调如何缓冲区溢出漏洞利用可以绕过密码保护系统。通过输入一个字符串时,要求输入我的密码的第二次,大于15个字符简单的缓冲区溢出漏洞利用
#include <stdio.h>
#include <string.h>
int main(void)
{
char buff[15];
char tempbuff[15];
int pass = 0;
printf("\n Enter a password of length between 1 and 15 characters : \n");
gets(buff);
//strcpy("%s",buff);
printf("\n Enter your password : \n");
gets(tempbuff);
//strcpy("%s",tempbuff);
if(strcmp(tempbuff, buff))
{
printf ("\n Wrong Password \n");
}
else
{
printf ("\n Correct Password \n");
pass = 1;
}
if(pass)
{
/* Now Give root or admin rights to user*/
printf ("\n Root privileges given to the user \n");
}
return 0;
}
从本质上讲,我试图从0通变量的值修改为1:该代码如下。但是,我还没有做到这一点。任何帮助将非常感激!
你用Google搜索“如何利用缓冲区溢出C”? – Arc676
相关:http://stackoverflow.com/questions/6220212/buffer-overflow-in-c – Arc676
我已经编译到程序集,但似乎无法确定传递变量所在的位置。 – user2904796