Shellcode formatter

José González Krause 49689e66f0 Added conversion from IP address to int and hex (LE and BE) 1 year ago
.gitignore 43f4f936a8 Initial commit 1 year ago
LICENSE 43f4f936a8 Initial commit 1 year ago
README.md 49689e66f0 Added conversion from IP address to int and hex (LE and BE) 1 year ago
scfmt.go 49689e66f0 Added conversion from IP address to int and hex (LE and BE) 1 year ago
test.obj e68c5d402f Added all the stuff 1 year ago

README.md

scfmt

Shellcode formatter is a tool for extracting the shellcode from an objdump output (tested on macho64 dump) and prints the output directly in a nice go copypasteable string.

It also supports some basic conversions for writing exploits.

Usage

objdump to shellcode

Simply pipe your objdump to scfmt:

> objdump -d test.macho64 | scfmt -e
< // payload length: 51 (0x33)
< var shellcode string = "\x48\x31\xc0\x48\x31\xff\x48\x31\xf6\x48\x31\xd2\xb8\x04\x00\x00\x02\xbf\x01\x00\x00\x00\x48\xbe\x00\x20\x00\x00\x00\x00\x00\x00\xba\x12\x00\x00\x00\x0f\x05\xb8\x01\x00\x00\x02\xbf\x00\x00\x00\x00\x0f\x05"

String to little endian 64b hex

> scfmt -s '\//bin/sh'
< 0x732f6e69622f2f

Convert IP address to int and hex (LE and BE)

> scfmt -i 127.0.0.1
< IP: 127.0.0.1
< Int: 2130706433
< Hex BE: 0x7f000001
< Hex LE: 0x0100007f