tethereal capture with system

R

ramartin

I am trying to write a program which starts an Ethereal capture (using
tethereal) using the system() call in PERL. I would like the capture
to begin, and then use a packet injection tool to create and send
packets, also using the system() call after the capture has begun. My
question is how do I execute more than one system command in Perl using
Win32 at a time, without waiting for the first call to return? Any
examples someone could point me to would also be great.

Thanks,
Ryan
 
D

DJ Stunks

I am trying to write a program which starts an Ethereal capture (using
tethereal) using the system() call in PERL. I would like the capture
to begin, and then use a packet injection tool to create and send
packets, also using the system() call after the capture has begun. My
question is how do I execute more than one system command in Perl using
Win32 at a time, without waiting for the first call to return? Any
examples someone could point me to would also be great.

Thanks,
Ryan

use perlipc;

(fork && exec);

-jp
 
M

Michael Greb

I am trying to write a program which starts an Ethereal capture (using
tethereal) using the system() call in PERL. I would like the capture
to begin, and then use a packet injection tool to create and send
packets, also using the system() call after the capture has begun. My
question is how do I execute more than one system command in Perl using
Win32 at a time, without waiting for the first call to return? Any
examples someone could point me to would also be great.

Thanks,
Ryan

$ perldoc -q 'start a process in the background'
Found in /usr/share/perl/5.8/pod/perlfaq8.pod
How do I start a process in the background?

Several modules can start other processes that do not block your
Perl program. You can use IPC::Open3, Parallel::Jobs, IPC::Run, and
some of the POE modules. See CPAN for
more details.

You could also use

system("cmd &")

or you could use fork as documented in "fork" in perlfunc, with
further examples in perlipc. Some things to be aware of, if you¹re
on a Unix-like system:
<snip>
 
R

ramartin

I guess my problem is i want to execute these commands, with the first
command running, and the second command running after the first one
starts but before it finished executing. This is in a windows
environment.

Command 1 - tethereal -i 4-c 10 -T pdml --- Want to run
using system to start the capture
Command 2 - netwox 37 --ip4-dst XXX.XXX.XXX.XXX -- Want to run once
the tethereal capture has begun, but before it finishes

Any ideas?

Thanks,
Ryan
 
R

ramartin

Nevermind guys, thanks for the help anyway. The issue was after the
forks you need to put one of the threads to sleep for a bit to let the
longer thread boot up.
 

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

Forum statistics

Threads
474,183
Messages
2,570,967
Members
47,520
Latest member
KrisMacono

Latest Threads

Top