Skip to content

Instantly share code, notes, and snippets.

@itsecurityco
Last active January 21, 2018 17:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save itsecurityco/d11938d9835c2ab14f225baf29c13602 to your computer and use it in GitHub Desktop.
Save itsecurityco/d11938d9835c2ab14f225baf29c13602 to your computer and use it in GitHub Desktop.
This script takes a string generated by msfvenom on bt5r3 via PIPE and will clean the raw shellcode
#!/usr/bin/env python
# Author: @itsecurityco
# This script takes a string generated
# by msfvenom on bt5r3 via PIPE
# and will clean the raw shellcode
import sys
import re
if sys.stdin.isatty():
print " usage: msfvenom [options] <var=val> | python %s" % sys.argv[0]
exit(0)
shellcode = ""
for line in sys.stdin:
shellcode += line
match = re.findall("x([a-z0-9]{2})", shellcode)
if match:
print "".join(match)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment