Skip to content

hcninja/scfmt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Releases

No releases published

Packages

No packages published

Languages