逆向工程第一次作业
对StackOverFlow.exe的逆向与栈溢出渗透实验报告
一、StackOverFlow.exe简述
StackOverFlow.exe程序为用户提供了一个可以向内存键入数据的端口,本身是一个检验输入的数据与默认的数据是否一致的检测数据的程序,可是由于键入数据的过程中程序并没有检测键入的字符串的长度,导致用户可以通过输入超出规定范围的字符串来恶意覆盖内存中的一些数据,导致出现安全问题
下面是这个程序的C语言源代码
#include<stdio,h>
#include<stdlib.h>
#include<string.h>
#define PASSWORD "1234567"
int verify_password(char *password){
int authentication;
char buffer[8];
authenication=strcmp(password,PASSWORD);
strcpy(buffer,password);
return authentication;
}
main(){
int valid_flag=0;
char password[1024];
while(1){
printf("please input password: ");
scanf("%s",password);
valid_flag=verify_password(password);
if(valid_flag)
{
printf("incorrect password!\n\n");
}
e