Glossary
Shellcode
Shellcode is a small piece of position-independent machine code used as the payload of an exploit — classically to spawn a shell, hence the name.
Shellcode is a small piece of position-independent machine code used as the payload of an exploit. When a vulnerability hands you control of execution, the shellcode is what actually runs. The name comes from its original purpose: spawning a command shell.
A minimal Linux x86 example that calls execve("/bin/sh") is 25 bytes:
\x31\xc0\x50\x68\x2f\x2f\x73\x68\x68\x2f\x62\x69\x6e\x89\xe3\x50\x53\x89\xe1\xb0\x0b\xcd\x80
Shellcode must usually avoid certain bytes (often 0x00), run regardless of where it lands in memory, and be small. Modern payloads do far more than open a shell — reverse TCP connections, command execution, staged loaders — but the term stuck.
Read the full guide: What is shellcode?