When cat ls and some other commands are disabled and you need to view flag.txt file to get the flag, then how can you approach?
You can try with:
file * (to see what are files are there in the current directory as ls command is disabled)
file /bin/* (by going here you would know what commands you can run)
If you see, /bin/echo: symbolic link to /opt/toybox something like this then type /opt/toybox on the shell.
This will allow you to view what commands exactly you are allowed to run. Now you lets say come to know you can run wc and split command.
wc flag.txt
0 1 36 flag.txt (which means the file contains single line and 36 characters)
Now lets use split command:
split -b 1 flag.txt
Once you give enter, then there will be output 36 files and name starts with xaa, xab, xac so on. Each file contains single character as we specified -b 1. As the flag.txt contains 36 character so there will be 36 files.
Now if you give -b 2 then there will be 18 files outputted because each file now contains 2 characters.
sha256sum x*
Now crack this all sha256 hashes using crackstation.net
Avi
Comments
Post a Comment