I want to execute two Scapy commands simultaneously in a Python file, e.g: send(IP(dst="x.x.x.x") and sniff(). The problem I am trying to resolve is that when the script begin sniffing (on a server side) , the packet (from client) is already received before the beginning of sniff(). Is it possible to run two commands at the same time ? Thanks
Asked
Active
Viewed 937 times
1
-
1Use two threads. Done. ;) – Depado Mar 04 '14 at 16:04
-
You have two different machines you are using for this or it is on the same machine? – RyPeck Mar 04 '14 at 16:19
-
For a good question regarding threading problems and Scapy, see here - http://stackoverflow.com/questions/16279661/scapy-fails-to-sniff-packets-when-using-multiple-threads – RyPeck Mar 04 '14 at 16:20
-
I am using two virtual machines – farfalla Mar 04 '14 at 16:42
-
Have you looked at the `sr1()` function? – RyPeck Mar 06 '14 at 23:47