shells
In cybersecurity
What are shells?
• Software that lets you talk to the operating system
(translator between you and computer)
• GUI shell (windows, mac, linux)
• CLI (command line interface, texts on a terminal)
• Used to remotely control systems, part of an attack methodology
• Steal data, install backdoors, privilege escalation
Why shells?
• Hackers use shells to break in systems
• Security professionals/ blue teamers study shells to detect/ block
them
• Knowing all three (reverse/bind/web) shells help you understand
attacks/ build defenses
What do you need to know?
• Basic Understanding of Networking
• Fundamental Knowledge of Web Application Security
• Basic Command Line Proficiency
• Familiarity with scripting languages like Bash, Python, or PHP
• (Tryhackme)
Types of shells
• Reverse – target connects back to attacker
• Bind – target listens, attacker connects
• Web – script on the website that runs commands
Reverse shells
• Attacker sets up listener to wait for connection
• Target/victim connects back to attacker
• Victim calls the attacker’s phone
Bind shells
• Target opens port and “waits”
• Attacker connects directly to it
• It’s open so it’s easier to spot
• Victim leaves door open, attackers walk right in
Web shells
• Script hidden in a hacked website
• Attacker sends command through browser
• Attacker hiding a remote control on your tv
tools
• Netcat (nc) – send/receive connections
• Ncat, socat, rlwrap – “better” versions with more features
• Also used for pentesting
Shell payloads
• Tiny command/ script that opens a shell
• Written in many languages (bash, python, php, sql, etc)
• Payload creates connection for reverse/bind shells