AbsoluteNano
π¦ SUDO MAKE ME A SANDWICH
| Category | Author |
|---|---|
| π¦ Miscellaneous | Darkraicg492 |
Challenge Prompt
You have complete power with nano. Think you can get the flag?
Additional details will be available after launching your challenge instance.
Problem Type
- Sudo
Solve
We are told we need to SSH into the machine, so we start with that.
Upon logging in we check the directory where we see that there is a flag.txt file, but it is read only by Root.
If we run a sudo -l to list out the commands we can run as root we see we can run nano with no password, but only against the file /etc/sudoers.
If we run the command we are allowed to run:
Inside the file we see the last line that letβs us run nano as root against the /etc/sudoers file. If we remove the text /etc/sudoers, we can run nano as root against any file!
Before:
After:
You can use Control + X to exit, Y to save and then Enter key to save as the same filename to overwrite.
We can use those permissions to give us sudo rights to the flag.txt file.
Inside the flag.txt file we have the flag!