how can I run sniff() in background?

Joined
Apr 16, 2011
Messages
1
Reaction score
0
Greetings all!
Anyway excuse my English.

I can't understand how I can do this:

<loop cycle; variable is filled by some values>
<loop is still running, but simultaneously another command is running>
<loop is terminated; i want to read variable>

More specifically (it concerned with Scapy module, but I'll explain the detailes):


Code:
# sniff() command reads packets from network interface in loop and puts them as list to variable 'a'
a = sniff()

# now I want sniff() to be running in background and to run another command - ping host in this case
send(IP(dst='192.168.0.1')/ICMP())

# now I want to terminate sniff() loop and to see what in variable 'a'
print a

May be somebody who do parallel programming knows how I can do that?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,813
Latest member
lawrwtwinkle111

Latest Threads

Top