Question: Use the SEED VM ( this lab is from SEED and has been slightly modified ) gcc - z execstack - o vul _ prog
Use the SEED VM this lab is from SEED and has been slightly modified
gcc z execstack o vulprog Labc
sudo chown root vulprog
sudo chmod s vulprog
Do the following successfully using a string format vulnerability
Crash program
Print secret value secret
Modify secret value secret
Modify secret value secret with a predetermined value x
Get a root shell
Evenvulprog.c
#include
#include
#define SECRET x
void vulfuncchar userinput
int secret;
int a b c d; other variables, not used here.
getting the secret
secret SECRET;
printfThe variable secrets address is xx
unsigned int&secret;
printfThe variable secrets value is xx or d
unsigned intsecret secret;
Vulnerable place
printfuserinput;
printf
;
Verify whether your attack is successful
printfThe original secret: xx or d
SECRET, SECRET;
printfThe new secret: xx or d
secret, secret;
return;
int mainint argc, charargv
FILE badfile;
char str;
badfile fopenvulfilerb;
freadstr sizeofchar badfile;
vulfuncstr;
return ;
if you cant get a shell, I want to see all the steps you did
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
