[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Capturing network packets for use in userland application - TCPDUMP?

Posted on 2003-12-09
2
Medium Priority
?
307 Views
Last Modified: 2010-03-18
Hi,

I want to be able to capture packets from my network to use as input for a program i am writing. the program will dessimate the packet and use different parts of it so i need the packet in a usable format.  Can i do this with TCPDUMP?  I tried with  tcpdump -x -s 0 -i lo -w pkt -c 1, but the output from pkt looked like

\324\303\262\241^B^@^D^@^@^@^@^@^@^@^@^@\377^@^@^A^@^@^@\327Y\326?\254.^K^@W

etc

the full output cut & pastes like

Ôò¡

Any pointers?
0
Comment
Question by:dtod
2 Comments
 
LVL 2

Accepted Solution

by:
asbharadwaj earned 360 total points
ID: 9910253
Hi
>> i need the packet in a usable format
What do u exactly have in mind?

the -w option causes tcpdump to dump the raw packets to the specified file and exit
You can directly redirect the output of tcpdump to a file and read it later on in your
program
The -v option gives you verbose output and the -vv option gives you even more verbose output

You can also read the packet information from the dump file you generated using the -w
option
inorder to do that you'll have to use the -r filename option.
Your program needs to have a good understanding of the protocol it is looking for
to make good use of the tcpdump output
you'll also have to do a lot of string processing if your program is written in C or something like that
whereas a program written in something like perl will find a lot easier for this purpose

refer the tcpdump man page for more options
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 9913968
tcpdump write packets in a *usable* format. Dot.
The problem seems to be that *your* definition of usable is different to that from tcpdump.
So you first need to define, means: tell us, what a usable format is for you.
0

Featured Post

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
Suggested Courses
Course of the Month19 days, 14 hours left to enroll

872 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question