这个环境下的栈溢出与实战

<强>

<强>

,

# include

# include

#定义口令“1234567”

int verify_password (char *密码)

{

,,,,,,,,intauthenticated;

,,,,,,,,charbuffer [8];//8

,,,,,,,,验证=strcmp(密码,密码);

,,,,,,,,strcpy(缓冲区,密码);//

,,,,,,,,returnauthenticated;

}

主要()

{

,,,,,,,,intvalid_flag=0;

,,,,,,,,charpassword [1024],

,,,,,,,,而(1)

,,,,,,,,{

,,,,,,,,,,,,,,,,,,printf (“:”);

,,,,,,,,,,,,,,,,,,scanf (“% s”,密码);

,,,,,,,,,,,,,,,,,,valid_flag=verify_password(密码);

,,,,,,,,,,,,,,,,,,如果(valid_flag)

,,,,,,,,,,,,,,,,,,{

,,,,,,,,,,,,,,,,,,,,,,,,,,,printf (" ! \ n \ n”);

,

,,,,,,,,,,,,,,,,,,}

,,,,,,,,,,,,,,,,,,其他

,,,,,,,,,,,,,,,,,,{

,,,,,,,,,,,,,,,,,,,,,,,,,,,printf (" ! \ n”);

,,,,,,,,,,,,,,,,,,,,,,,,,,,打破;

,,,,,,,,,,,,,,,,,,}

,,,,,,,,}

}

,

,

,

这个环境下的栈溢出与实战”> 1 </p> <p>, </p> <p> <img src=

,

2

,

,

,

这个环境下的栈溢出与实战”> 3 </p> <p>, </p> <p> </p> <p> Cnullcharbuffer8888buffer 'int认证</p> <p>,,,,,,,,authenticatedstrcmpmainauthenticated0 </p> <p>, </p> <p> ollydbg </p> <p>, </p> <p> <img src=

4 8 q

这个环境下的栈溢出与实战

5

这个环境下的栈溢出与实战

6 ASCII71q 68 qbuffer0018fb4cauthenticated

,

,

1,

2,

3,这个64年



这个环境下的栈溢出与实战