What Is Shellcode?
- Shellcode is a small piece of machine code that a payload executes once an attacker gains control of the instruction pointer.
- The name comes from its classic goal: spawning a command shell (e.g.,
/bin/sh) to give the attacker interactive control. - Broader meaning today: any self-contained payload code — open a port, add a user, download a stage-2, disable a defense.
- It is the "what happens next" after a vulnerability (like a buffer overflow) hands over control.
Key Takeaway
Shellcode is the delivered payload — tiny, self-contained machine code. Understanding its constraints is how defenders learn to detect and block it.