what you don't know can hurt you

Ascii To Shellcode Encoder / Decoder Tool

Ascii To Shellcode Encoder / Decoder Tool
Posted Jun 2, 2010
Authored by gunslinger | Site gunslingerc0de.wordpress.com

This is an ascii to shellcode encoder / decoder tool written in Python.

tags | shellcode, python
MD5 | 1a014013f1e97bb91ab115cc764ac7ca

Ascii To Shellcode Encoder / Decoder Tool

Change Mirror Download
#!/usr/bin/python
'''
This is ascii <-> shellcode encode / decoder tool
programmer : gunslinger_ <yudha.gunslinger[at]gmail.com>
This was written for educational purpose only. or fucking messing around...
i.e how to use encode mode :
--------------------------------------------------------------
gunslinger@localhost:~/shellcode$ ./shellcodeencdec.py
shellcode hex encode decoder
programmer : gunslinger_
what do you want to do ? encode / decode
=> encode
Please input data : /bin
shellcode => \x2f\x62\x69\x6e
gunslinger@localhost:~/shellcode$
--------------------------------------------------------------
i.e how to use decode mode :
"\x68\x2f\x2f\x73\x68" // push $0x68732f2f
"\x68\x2f\x62\x69\x6e" // push $0x6e69622f
we know 'x68' is push, so drop it...
"\x2f\x2f\x73\x68" $0x68732f2f
"\x2f\x62\x69\x6e" $0x6e69622f
--------------------------------------------------------------
gunslinger@localhost:~/shellcode$ ./shellcodeencdec.py
shellcode hex encode decoder
programmer : gunslinger_
what do you want to do ? encode / decode
=> decode
Please input data : \x2f\x2f\x73\x68
hex => 2f2f7368
plaintext => //sh
gunslinger@localhost:~/shellcode$ ./shellcodeencdec.py
shellcode hex encode decoder
programmer : gunslinger_
what do you want to do ? encode / decode
=> decode
Please input data : \x2f\x62\x69\x6e
hex => 2f62696e
plaintext => /bin
gunslinger@localhost:~/shellcode$
--------------------------------------------------------------
and we got that is "/bin//sh"

warning ! this is not disassemble tool !
'''
import binascii, sys, time

RED = '\033[31m'
WHITE = '\033[37m'
RESET = '\033[0;0m'

def main():
print "shellcode hex encode decoder"
print "programmer : gunslinger_ <yudha.gunslinger[at]gmail.com>"
print "what do you want to do ? %sencode%s / %sdecode%s" % (RED, RESET, WHITE, RESET)
q = raw_input("=> ")

if q == "encode":
inputtype = raw_input("Please input data : ")
print "shellcode => ",
for encoded in inputtype:
print "\b\\x"+encoded.encode("hex"),
sys.stdout.flush()
time.sleep(0.5)
print RESET

elif q == "decode":
inputtype = raw_input("Please input data : ")
cleaninput = inputtype.replace("\\x","")
print "hex => ",cleaninput
print "plaintext => ",
print "\b"+cleaninput.decode("hex")

else:
print "wrong answer ! your choice is %sencode%s or %sdecode%s" % (RED, RESET, WHITE, RESET)
sys.exit(1)

if __name__ == '__main__':
main()

Comments

RSS Feed Subscribe to this comment feed

No comments yet, be the first!

Login or Register to post a comment

File Archive:

December 2019

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Dec 1st
    1 Files
  • 2
    Dec 2nd
    16 Files
  • 3
    Dec 3rd
    17 Files
  • 4
    Dec 4th
    23 Files
  • 5
    Dec 5th
    11 Files
  • 6
    Dec 6th
    10 Files
  • 7
    Dec 7th
    1 Files
  • 8
    Dec 8th
    1 Files
  • 9
    Dec 9th
    12 Files
  • 10
    Dec 10th
    0 Files
  • 11
    Dec 11th
    0 Files
  • 12
    Dec 12th
    0 Files
  • 13
    Dec 13th
    0 Files
  • 14
    Dec 14th
    0 Files
  • 15
    Dec 15th
    0 Files
  • 16
    Dec 16th
    0 Files
  • 17
    Dec 17th
    0 Files
  • 18
    Dec 18th
    0 Files
  • 19
    Dec 19th
    0 Files
  • 20
    Dec 20th
    0 Files
  • 21
    Dec 21st
    0 Files
  • 22
    Dec 22nd
    0 Files
  • 23
    Dec 23rd
    0 Files
  • 24
    Dec 24th
    0 Files
  • 25
    Dec 25th
    0 Files
  • 26
    Dec 26th
    0 Files
  • 27
    Dec 27th
    0 Files
  • 28
    Dec 28th
    0 Files
  • 29
    Dec 29th
    0 Files
  • 30
    Dec 30th
    0 Files
  • 31
    Dec 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2019 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close