Last active
February 9, 2018 22:09
-
-
Save kkirsche/b7e64622f00fa77f263dd31ddb6f082c to your computer and use it in GitHub Desktop.
Normal hexidecimal to python formatted hex
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| #❯❯❯ python to_py_hex.py | |
| #\x73\x72\x2e\x32\x73\x75\x6e\x2e\x72\x65\x66\x6c\x0a | |
| to_py_hex = '73722e3273756e2e7265666c0a' | |
| sets = [] | |
| for c in range(0, len(to_py_hex)): | |
| if c % 2 == 1: | |
| continue | |
| sets.append(to_py_hex[c] + to_py_hex[c+1]) | |
| shellcode = '\\x' + '\\x'.join(sets) | |
| print(shellcode) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment