You’ve spent years connecting into machines. SSH to a Linux box, RDP to a jump host, a remote PowerShell session to a file server. Inbound connections, through ports someone opened on purpose.
A reverse shell flips that. Instead of breaking through the front door, the attacker gets a process on your server to dial out and hand over a command line. The firewall logs it as an allowed outbound connection. Nothing looks broken.
That’s why blue teams rarely detect a reverse shell at the perimeter. They detect it in the process tree and the egress logs, two places an IT pro already knows how to read. Below: what a reverse shell is, why firewalls wave it through, and the controls, detections, and first-hour response that actually stop it.
Reverse shell vs bind shell: who dials whom
A shell is just a command interpreter: bash, sh, cmd.exe, PowerShell. What separates the two attacks is the direction of the connection.
- Bind shell: the target opens a listening port and waits. The attacker connects in. Same shape as SSH on 22 or RDP on 3389.
- Reverse shell: the attacker’s machine listens. The target starts an outbound connection to it and attaches a shell to that connection.
Think of a company phone system. An outside caller trying to reach an internal extension directly gets stopped by the receptionist. An employee dialing out goes straight through, and once the line is open, the person on the other end can talk as long as they like.
Bind shells die against any decent inbound policy. Reverse shells were designed to skip that fight entirely.

Same firewall, same server. The only difference is which side starts the connection.
Why the firewall logs it as “allowed”
Most enterprise firewalls deny inbound traffic by default and allow outbound traffic far more freely, because users need the web and servers need updates. Attackers design around that asymmetry.
A reverse shell usually calls out on a port that’s already open: 443, 80, sometimes 53. To a stateful firewall, the session looks like any other outbound connection. Once it’s established, return traffic rides that same state. Commands flow in, output flows out.
Encryption makes it harder. Many shells wrap the channel in TLS, so even an inspecting device sees a normal-looking handshake unless it decrypts or fingerprints the traffic. The firewall did exactly what it was configured to do. The configuration was the gap.
How a reverse shell gets launched
A reverse shell isn’t a vulnerability. It’s what happens after one. Someone first needs a way to run a command on the target, then uses that execution to call home. The usual ways in:
- Phishing: a user opens a document or clicks a link that runs a script in the background.
- Remote code execution: an unpatched public-facing app (an old CMS plugin, an exposed mail server or VPN appliance) lets the attacker run commands. We covered that step in how blue teams detect remote code execution.
- Command injection: a web form passes user input straight to a system shell.
- Stolen credentials: a valid login to a management console or remote tool, used to run a script that sets up quieter, longer-lasting access.
This order matters for response. Kill the shell without finding which of these opened the door, and the attacker simply runs it again.
Not just a Linux problem
Tutorials love Linux demos, so reverse shells feel like a Linux thing. Any device with a command interpreter and a network stack can run one.
- Linux servers: bash, Netcat, Python, Perl, or PHP already on the box are enough. No malware download required.
- Windows endpoints and servers: PowerShell and cmd.exe, plus signed system binaries attackers repurpose (“living-off-the-land” binaries such as certutil.exe or rundll32.exe) to fetch and run payloads without a classic malicious .exe on disk.
- IoT and network appliances: cameras, printers, routers, and building sensors often run embedded Linux, frequently BusyBox. They rarely run endpoint agents and rarely get watched, which makes them a quiet foothold into the rest of the network.
If your monitoring only covers laptops and servers, you’re watching the most visible part of the fleet and missing the quietest.
Stopping it with the Threat & Control Method
A port-based firewall won’t stop a reverse shell on its own. Layered controls will, and the Threat & Control Method puts them in order: Inventory → Threats → Controls → Scale.
Inventory: know what’s allowed to talk out
List which servers actually need internet access, and to where. Domain controllers, database servers, and most internal app servers need little or none. That list is your Asset Inventory with an egress column. If you’ve maintained firewall rules or a CMDB, you’ve already done half of it.
Threats: ask what a shell on each box could reach
A shell on a print server and a shell on a domain controller are not the same incident. Rank assets by what an attacker could do from them, and spend controls where the damage would be largest.
Controls: close the paths
- Egress filtering: default-deny outbound for servers, with allowlists for destinations they genuinely use (update repositories, specific SaaS endpoints). Route the rest through a proxy. This one control turns a reverse shell from “connected” into “timed out.”
- Application-aware inspection: next-generation firewalls and web proxies can flag traffic on 443 that isn’t real TLS, or TLS whose fingerprint doesn’t match normal clients. With TLS inspection on, they see inside the session. Without it, they see much less.
- Endpoint detection and response (EDR): watches behavior, not file signatures. Word spawning a hidden PowerShell that opens a network connection is exactly the chain it’s built to alert on and, depending on policy, block.
- Hardening and least privilege: remove Netcat, compilers, and unused interpreters from production servers. On Windows, AppLocker or Windows Defender Application Control limits which scripts and binaries can run. Run services under low-privilege accounts so a shell inherits as little as possible.
- Segmentation: keep appliances and IoT on networks that can’t reach the internet or your core servers directly. Our guide to network segmentation for IT professionals covers the design side.
Scale: make it a rule, not a project
Turn the egress review into a standing change-control question: every new server ships with a stated outbound need, or it gets none. The same reasoning carries to containers, cloud workloads, and SaaS connectors.
How to detect a reverse shell
Detection comes down to two questions: which process started this, and who is it talking to?
Host signals: suspicious process trees
On Windows, Sysmon Event ID 1 (process creation) and Event ID 3 (network connection) give you both halves. One catch: Event ID 3 is disabled by default, so confirm your Sysmon configuration actually turns it on. On Linux, auditd rules on program execution, or your EDR’s process telemetry, do the same job.
The classic red flag is a web server spawning a shell: w3wp.exe (IIS), apache2, nginx, or a Java app server launching cmd.exe, powershell.exe, /bin/sh, or bash. Web servers serve pages. They don’t need an interactive prompt. The same logic applies to Office apps spawning script hosts, or a database service spawning a shell.
For a quick manual look on a Linux server you suspect, ss -tnp lists established TCP connections with the process that owns each one. A bash or sh process holding an outbound connection deserves a very close look. On Windows, Get-NetTCPConnection -State Established shows the owning process ID for each connection.
Network signals: odd outbound connections
- Long-lived sessions: browsing is bursty. A shell often holds one connection to one external host for hours.
- No DNS lookup first: most legitimate software resolves a name before connecting. A connection straight to a hardcoded IP stands out.
- Wrong process on a web port: powershell.exe, bash, or python talking on 443 is not a browser.
- Interactive traffic shape: small, keystroke-sized packets in and bursts of output back, on a server that normally moves bulk data or nothing at all.
None of these alone proves a reverse shell. Two or three together, on a server that shouldn’t talk to the internet at all, is a ticket you escalate. These patterns also translate well into Sigma rules for threat detection, so one analyst’s catch becomes the whole SOC’s alert.
First-hour response when the alert fires
Picture week one in a SOC. An alert flags a likely reverse shell on a production server. This order keeps the evidence intact and the attacker out, and it fits inside the broader incident response lifecycle.
- Contain the host, don’t power it off. Use your EDR’s network isolation, or cut it off at the switch port or virtual NIC. Powering off destroys what’s in memory.
- Capture volatile evidence. Active connections, running processes and their parents, logged-in users, scheduled tasks, shell history. Follow your team’s forensic procedure if one exists.
- Find the way in. The shell is a symptom. Review web, email, and authentication logs leading up to the first outbound connection to learn how the command got executed.
- Eradicate and recover. Kill the processes, hunt for persistence (new accounts, scheduled tasks, cron jobs, new services, added SSH keys), patch the entry point, and rebuild from a known-good image if you can’t trust the host.
- Rotate credentials. Treat anything cached on or reachable from that host as exposed: user passwords, service account secrets, API keys, session tokens.
Skip step 3 and the incident isn’t closed. It’s paused.
Your IT background is the head start
Detecting a reverse shell isn’t exotic. It’s knowing how processes start, which servers should talk to the internet, and what normal traffic looks like, then noticing when something breaks the pattern. You’ve done the first half of that for years. Cybersecurity is not rocket science; it’s familiar infrastructure seen from the attacker’s side.
That shift is also how your experience reads on a security resume. Not “managed firewall rules,” but “designed server egress policy that limits outbound attack paths.” Same work, different language, and it’s a core step on the blue team career path for IT pros.
Want to practice this reasoning with structure? From IT to Cybersecurity applies the Threat & Control Method to real scenarios like this one, built for people who already run infrastructure.
Prefer to start with one practical breakdown at a time? Join the Keep IT Safe newsletter.

