TechTarget.com/searchsecurity

https://www.techtarget.com/searchsecurity/tip/What-reverse-shell-attacks-are-and-how-to-prevent-them

What reverse shell attacks are and how to prevent them

By Ravi Das

Attackers infiltrate target environments in a variety of ways. One common method is a direct attack. Another, called a reverse shell, uses a remote device to deploy an attack.

Let's look at what a reverse shell attack is, how it differs from a direct attack and how to prevent it.

Direct attack vs. reverse shell

When people hear "cyber attack," they often think of a direct, brute-force attack where the attacker gains access to a server, workstation, wireless device, etc. To penetrate a device in a direct attack, the malicious actor exploits vulnerabilities or security gaps and then deploys a malicious payload, as illustrated in Figure 1.

Many cyber attacks are direct attacks.

In the more roundabout reverse shell attacks, malicious actors use remote devices to connect to the target's host. All command and control takes place on the attacker's device, but the remote device executes all commands and directives to the host. This is illustrated in Figure 2.

This approach is used for the following reasons:

  1. Attackers are masked behind a remote device, making it difficult to be discovered.
  2. By using a remote device, hundreds and even thousands of other hosts can be infected at the same time, as evidenced in the SolarWinds attack.

The following two shells exist:

  1. Normal shell session. A shell is created when users first start up their devices. Each device has only one shell session. It serves to interpret user commands.
  2. Reverse shell session. This is where an attacker initiates a shell session with a host using a remote device. Once granted, the attacker has access to the host.

How a reverse shell attack is launched

In reverse shell attacks, malicious actors wait for the host to request a connection to the outside, thus giving the attack the name reverse shell. Through remote devices, attackers can configure the host and request connections outside the target's network.

Once this happens, attackers can execute a suite of commands via the remote device, for example, to deliver a malicious payload to the host. The attackers then can gain a foothold into the host and wreak havoc.

Malicious actors usually want to remain unnoticed in reverse shell attacks. Their goal is often to stay inside the environment as long as possible to move laterally within infrastructure. Once attackers find what they want, the data exfiltration process starts. Attackers often move stolen data to the hacked remote device for temporary storage.

How to prevent reverse shell attacks

Organizations should do the following to prevent attackers from setting up reverse shells:

01 Feb 2023

All Rights Reserved, Copyright 2000 - 2025, TechTarget | Read our Privacy Statement