Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

scapy sending packets until ctrl+c not working

First I tried running this:

from scapy.all import *
while True:
    send([ARP(op=ARP.who_has, psrc="192.168.1.60")])

I sends 9 packets then stops. I wanted it to run until I press ctrl+c. I have a list of ip ["192.168.1.7","192.168.1.12","192.168.1.32","192.168.1.223"] I tried running:

from scapy.all import *
   while True:
       for ip in mylist:
           send([ARP(op=ARP.who_has, psrc="192.168.1.60")])

It still sends 9 packets and stop. I would like to know how to send packets until I press ctrl+C.

like image 700
Bob Ebert Avatar asked Dec 05 '25 09:12

Bob Ebert


1 Answers

Can you use:

 send(ARP(op=1,psrc='172.16.16.255'),loop=1)

It should keep going until you hit Ctrl+C.

Ok. I edited it to iterate over your list:

mylist = ('192.168.1.12','192.168.1.32','192.168.1.223')
while True:
    for i in mylist:
        send(ARP(op=1,psrc='192.168.1.60',pdst=i))
like image 185
Noob123 Avatar answered Dec 06 '25 22:12

Noob123