Hallo Monks, am running tcpdump and i want to pipe its output to a perl script that gets me the source ip address and the dst ip address plus the port number. Here is sample of my dump:
14:42:35.155151 IP 192.168.11.128.3415 > 66.249.93.9.53: UDP, length 3 +4 14:42:35.305392 IP 66.102.9.104.80 > 192.168.11.100.40323: tcp 0 14:42:35.305540 IP 192.168.11.100.40323 > 66.102.9.104.80: tcp 0 14:42:35.374936 IP 192.168.11.6.22 > 192.168.11.128.59921: tcp 64 14:42:35.375069 IP 192.168.11.128.59921 > 192.168.11.6.22: tcp 0 14:42:35.405160 IP 72.21.192.209.53 > 192.168.11.128.49172: UDP, lengt +h 48 14:42:35.405302 IP 192.168.11.128 > 72.21.192.209: icmp 84: 192.168.11 +.128 udp port 49172 unreachable 14:42:35.605651 IP 130.89.175.33.80 > 192.168.11.100.47614: tcp 1448
Any help will be highly appreciated. Thanks

In reply to Read output from tcpdump by h3x

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.