How to generate shellcode (3 ways, compared)
Compare ways to generate shellcode — msfvenom, hand-rolled assembly, and a browser-based generator — with the trade-offs and when to use each.
"Generate shellcode" can mean three very different workflows. They trade control for speed and place different amounts of trust in someone else's bytes. If you are not sure what shellcode is yet, start with the guide.
Option 1: hand-rolled assembly
You write the assembly, assemble it, extract the bytes.
- Pro: total control, smallest output, you understand every byte.
- Con: slow, architecture-specific, easy to introduce bad bytes by accident.
- Use when: size is tight, you need an exotic primitive, or you are learning. See Linux shellcode.
Option 2: a framework (msfvenom)
The framework templates a payload and encodes it for you.
- Pro: fast, many payload/encoder combinations.
- Con: larger output, signatured by defenders, and it lives on a shared jump box you may not want to depend on. Moving that workflow off the jump box is its own discussion: browser-native vs msfvenom.
- Use when: you need a standard payload quickly and signature is not a concern.
Option 3: a browser-based generator
A client-side generator assembles and encodes in your browser — nothing leaves the machine.
- Pro: no install, nothing uploaded, fast iteration on format and bad-char sets. What stays local and what does not is documented in the threat model.
- Con: you still must verify the output yourself (true of every option).
- Use when: you want speed without standing up tooling, or you are working from a restricted workstation.
Picking format and encoders
Whatever route you take, two choices follow: output format (\x, 0x, raw, base64) to match where the bytes will live, and encoders to dodge forbidden byte values. Encoder order matters — see encoder pipeline order.
Generate shellcode now
Build, encode, and export a payload entirely client-side in the Shellcodes builder — pick the architecture, choose a preset, set your bad characters, and export in the format you need. Then disassemble it to confirm the bytes before you run anything. Authorized testing only: responsible use.