Shellcode Factory tool
A tool to print and test shellcodes from assembly code.
It supports both Gas and Intel syntax (.s and .asm extensions respectively), as well as x86 and x64 architectures.
Usage:
make targets [parameters]
targets:
-
assembly
- will compile the assembly code from shellcode.s -
debug
- debugs the assembly binary -
print
/xxd
/p
- will print the shellcode in hex -
set
- will callnano shellcode.s
, to set the source assembly code -
put
- will callnano tester.c
, to put in it hex-encoded shellcode -
test
- will compile tester.c and run it, thus testing the shellcode -
auto
/a
- will do all of the above in one single step:compiling shellcode.s into hex bytes,
loading those hex bytes into an auto-generated tester program (auto.c)
compiling and running that very program -
debug_sc
- debugs auto i.e. the shellcode when called from a smashed stack
parameters:
-
ARCH=XX
(default=32) XX-bit binaries (32 / 64) -
S=filename
(default=shellcode.s) Source assembly filename.
Examples:
-
make print S=foo.s
will print the shellcode from foo.s -
make ARCH=64 auto
will test x64 shellcode
Requires:
-
gcc
(as
frontend) andnasm
for GAS and INTEL syntax respectively (extensions .s and .asm) -
gdb
(I even recommend using it with thepeda
enhancement: https://github.com/longld/peda) -
python
-
cut
-
objdump
(optional: you can comment out the objdump lines in the Makefile) -
nano
(optional:set
andput
targets only, and you can replace theEDITOR=...
line in the Makefile by your own editor)