Skip to content

Instantly share code, notes, and snippets.

@orleika
Last active August 1, 2016 15:04
Show Gist options
  • Save orleika/1e37964f7e64c2553f0dd1eb6c9d5a4a to your computer and use it in GitHub Desktop.
Save orleika/1e37964f7e64c2553f0dd1eb6c9d5a4a to your computer and use it in GitHub Desktop.
ascii -> hex(little endian)
echo "/bin/sh" | rev | xxd -p | sed 's/.\{2\}$//' | fold -s8 | sed 's/^\(.*\)/0x\1/g'
hex format
echo "68732f6e69622f" | sed 's/^0x\(.*\)$/\1/g' | fold -s2 | perl -pe 's/(\w{2})\s+/\\x\1/g'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment