You have two possible ways to go, as you already have libpcap installed:

One would be to do all capturing in Perl using Net::PCap and Net::PCapUtils - but this means that you'll have to write your captured stream to disk yourself and if you use other programs to postprocess the data, this might be undesireable.

The other way would be to find the console tethereal runs in, and send a CTRL-C to it. You have to find the console window, and finding the console window requires that you give it a unique window title (for example under Windows NT/2k/XP by launching the other process through a .cmd file which first sets the console window title). Then try SendKeys from the Win32::GuiTest package to send a ^C to it. That already might be enough, but possibly you have to send a "close-click" to the console window itself, and that is where it starts getting ugly :-)


In reply to Re: Reliable tethereal capture by Corion
in thread Reliable tethereal capture by pgb

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.