Linux Rules the World! (Linux)
Lock and Key
We are given a private RSA key file. We can use ssh-keygen -p to change the passphrase.
root@no:~/Downloads# chmod 600 cybot01_bot1.key
root@no:~/Downloads# ssh-keygen -p -f cybot01_bot1.key
Key has comment 'bot1@ip-172-31-34-218'
Enter new passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved with the new passphrase.root@no:~/Downloads# ssh -i cybot01_bot1.key [email protected]Once in, the flag is in the home directory.
CDDC21{b0t_eNtR3nC3}
License to Run
The challenge description hinted at some malicious file that can be run. I looked for all the files that were executable by bot2, and found an interesting file in the home directory.
bot2@cybot01:/$ find / -executable -type f 2>/dev/null | grep flag
/usr/src/linux-aws-headers-5.4.0-1045/tools/perf/trace/beauty/mount_flags.sh
/usr/src/linux-aws-headers-5.4.0-1045/tools/perf/trace/beauty/move_mount_flags.sh
/usr/src/linux-aws-headers-5.4.0-1045/tools/perf/trace/beauty/mmap_flags.sh
/usr/src/linux-aws-headers-5.4.0-1045/tools/perf/trace/beauty/rename_flags.sh
/usr/src/linux-aws-5.8-headers-5.8.0-1035/tools/perf/trace/beauty/mount_flags.sh
/usr/src/linux-aws-5.8-headers-5.8.0-1035/tools/perf/trace/beauty/move_mount_flags.sh
/usr/src/linux-aws-5.8-headers-5.8.0-1035/tools/perf/trace/beauty/mmap_flags.sh
/usr/src/linux-aws-5.8-headers-5.8.0-1035/tools/perf/trace/beauty/rename_flags.sh
/home/bot2/.#flag$!!1Running this file gives us the flag.
Historian
In the .viminfo file, a secret file location is revealed. The /usr/local/share/secret file contains the flag.
Line Inspection
There is a random-secrets file with lots of gibberish. Grepping the CDDC substring gives us the flag.
Super
We are allowed to run /usr/bin/cat /var/log/* as bot6 with no password.
We can use path traversal to get the flag:
Path to Win
There is a systeminfo binary in the home directory.
Running it gives the following output.
We can deduce that the systeminfo binary calls id. Note that since systeminfo has SUID permissions, it runs as bot7. If the id call does not use an absolute path, then we can perform PATH variable manipulation to force the execution of our custom payload.
This time, running systeminfo gives us a shell as root.
Last updated
Was this helpful?