A reverse shell is a type of shell in which the target server connects back to the attacker machine. For example, an attacker finds a target server with port 21/tcp, 80/tcp and 443/tcp in OPEN state and the FTP service running on port 21/tcp is vulnerable. Let's say an attacker exploits this port in order to open another port 1337/tcp on the target server for shell connection, as shown in the following diagram:
![](https://static.packt-cdn.com/products/9781788995238/graphics/assets/329679fa-8b99-4d97-bdc0-4661474fc593.png)
The problem arises when the attacker tries to connect to the target server on port 1337/tcp. The attacker is not able to connect to port 1337/tcp. Why? Because the firewall blocked that port. The firewall can only allow port 21/tcp, 80/tcp and 443/tcp for incoming connections and it will block all other ports, as shown in the following diagram:
![](https://static.packt-cdn.com/products/9781788995238/graphics/assets/b40bc8fa-5936-4710-9829-e7eac289c82e.png)
This...