Level07
echo $LOGNAME
Last updated
Was this helpful?
echo $LOGNAME
Last updated
Was this helpful?
When we login as level07 we get a binary executable file called level07
:
When we execute the binary flag07
we get the following output :
It prints level07
which could by the name of the binary, or maybe the name of the directory or event the name of the user or something else. To know what's going on we should decompile the binary.
Lets transfer the binary to a machine where proper tools are avalable to disassemble and analyse the binary.
Once we have got the binary we can simply use to decompile the binary and get a C source code :
And the C source code of the file level07
is as follows :
Just by looking at the source code we can see that the program is printing the environment varaible LOGNAME which is level07
in the vm. So we can see this level is similar to level04 where we have a program that calls acho with a String
that we can control (because we can change the environment variable value)
To get the flag for this level all we need to do is change the environment variable LOGNAME so that echo calls the getflag
program:
So the Password to connect to the account level08 is fiumuikeil55xe9cu4dood66h