What the Shell?

Overview

This room explains what shells are in an exploitation context and focuses on the practical tools and techniques used to catch, upgrade, and stabilize them. It covers reverse shells, bind shells, interactivity problems, Netcat, Socat, and encrypted shell handling.

Core idea: getting code execution is only the start. The real difference in usability comes from whether the shell is reverse or bind, interactive or non-interactive, and whether you can stabilize it into something reliable.

1) What a Shell Is

A shell is a command-line interface used to interact with an operating system, such as bash, sh, cmd.exe, or PowerShell.

In exploitation, the goal is often to turn an initial vulnerability into a remote shell so you can execute commands on the target system.

2) Reverse Shell vs Bind Shell

Rule of thumb: reverse shells are usually easier to execute and debug, while bind shells are more situational.

3) Interactive vs Non-Interactive Shells

The room makes an important distinction between shell quality:

This is why shell stabilization matters so much after the initial callback lands.

4) Core Tools

The room centers around four main tools:

5) Netcat Basics

Netcat is the baseline tool for sending and receiving shells.

Netcat is widely available, but the default shell experience is weak and fragile.

6) Netcat Shell Stabilization

The room presents three practical stabilization approaches:

Common recovery trick: if terminal echo gets messed up after using stty raw -echo, type reset and press Enter.

7) TTY Size Fixes

Programs like editors can break if the shell has the wrong terminal dimensions.

This small step makes a big difference when using full-screen tools.

8) Socat Basics

Socat acts like a flexible connector between two endpoints and is stronger than Netcat once you know the syntax.

9) Fully Stable Socat TTY Shell

One of the most useful Linux-only techniques in the room is the fully interactive TTY reverse shell using Socat.

This gives a much better shell because it allocates a pseudoterminal, passes signals correctly, and makes the session behave like a real TTY.

10) Encrypted Socat Shells

Socat can also wrap shells in TLS, which makes the traffic encrypted and harder to inspect.

Important detail: the certificate must be present on whichever side is acting as the listener.

Exam Notes (PT1)