fd
There are 2 things that we need to achieve in this challenge to get the flag.
Make
read
function get input fromstdin
(Standard input)Successfully pass the
if condition
withLETMEWIN
string inbuf
read
function in line 3 is dependent upon the variable fd (Line 1)
which is user-controlled by the value of argv[1]
Our target is fd = 0
(0 - Standard Input File Descriptor [stuff we type using our keyboards]). If we are able to get fd = 0,
we will be able to store the value "LETMEWIN"
into the buf
and successfully pass the strcmp
function and get the flag.
Converting the hex value of 0x1234
to integer we get 4660
.
Now we have the integer value that if passed to the program, will make it wait for user input, which will be stored into the buf
variable for strcmp
.
Last updated