Cybersecurity Glossary

What is a Reverse Shell?

In a reverse shell, a target system initiates an outbound connection to an operator and attaches a command interpreter to that channel. The operator sends commands and receives output. Reversing the direction often works through NAT and simple inbound firewall rules when outbound traffic is permitted.

How does a reverse shell work?

  1. An attacker or authorized tester first achieves command execution on the target.
  2. A listener or command-and-control service waits on a controlled system.
  3. The target connects over TCP, HTTP(S), DNS, WebSocket or another permitted channel.
  4. A shell process links its input and output to that channel.
  5. The operator may stabilize the interactive session and performs follow-up actions with the compromised process's rights.

Encryption and common destination ports can make traffic resemble normal HTTPS. A raw reverse shell is often unstable and not persistent; professional malware uses more robust beacons, authentication and reconnection.

How does it differ from a bind shell and backdoor?

TermDifference
Reverse shellThe target connects outbound to the operator.
Bind shellThe target opens an inbound port to which the operator connects.
BackdoorPersistent or hidden access; it may use a reverse shell but is a broader concept.
Web shellA server-side script accepts commands over web requests and need not maintain an outbound connection.
Legitimate remote administrationAn authenticated, approved service with roles, logging and controlled operation.

How is initial access obtained?

The reverse shell is normally not the original vulnerability. It may follow remote code execution, command injection, an unsafe upload, stolen administration access, malicious software or a compromised deployment pipeline. Good remediation closes this entry path; blocking only the observed destination IP or shell command is insufficient.

What impact does it have?

The operator gains interactive access with the affected service's or user's rights. They can read files, find configuration and secrets, launch processes, transfer tools and escalate privileges. Persistence, data theft and lateral movement often follow. Container and service boundaries can contain impact only when permissions, mounts and credentials are actually restricted.

How is it detected and prevented?

  • Process: A web server, database, office app or build agent unexpectedly launches a shell, interpreter or network tool.
  • Network: A server creates long-lived or periodic connections to rare destinations, dynamic DNS or unusual ports.
  • Egress control: Workloads can reach only necessary destinations through controlled proxies and DNS resolvers.
  • Least privilege: Restrict service accounts, containers, filesystems and secrets so a shell reaches little.
  • Primary defense: Prevent and patch code execution, unsafe uploads and stolen access.

One outbound TCP channel is not proof. Process tree, user, destination reputation, DNS, payload characteristics and change context together make a reliable signal.

What matters during an incident and penetration test?

During an incident, isolate the system, preserve volatile data and connections, block destinations and investigate both initial access and follow-up actions. Rotate credentials exposed to that context. In a penetration test, establishing a shell requires explicit approval, known destinations and stopping conditions. A minimal command-execution proof may suffice; stabilization, tool transfer and lateral movement belong only in the agreed scope.

Penetration Tests

Uncover Security Vulnerabilities

Professional penetration testing for your business

Web Apps
Networks
Mobile Apps
10% New Customer Discount
Plan Now

Thank you for your feedback! We will review it and optimize this content.

Do you have feedback on Reverse Shell? Tell us!