Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
10-16-2013, 02:37 PM
|
#1
|
LQ Newbie
Registered: Jul 2012
Posts: 9
Rep:
|
Read pcap data in console
Hi everyone.
I'm trying to find a way (tcpdump command parameter?) to read ALL data from a pcap file on the console.
For example, considering I want to sniff every query and response functions between 2 hosts.
I've tried with "tcpdump -A" and other option but none of them present the entire information, like Wireshark GUI does.
Any ideias?
|
|
|
10-16-2013, 03:09 PM
|
#2
|
Member
Registered: Aug 2010
Location: Beaverton, Oregon, USA
Distribution: Pfsense, Ubuntu, Centos, Fedora, Redhat, Scientfic, MacOS
Posts: 76
Rep:
|
Hello,
You need to use the -r <filename> option with tcpdump. a pcap file generally is what you get with the -w option of tcpdump.
For example: to see the traffic between hosts A and B, I use:
tcpdump -r <pcapfile> -n host A or host B
-jason
|
|
|
10-16-2013, 03:15 PM
|
#3
|
LQ Newbie
Registered: Jul 2012
Posts: 9
Original Poster
Rep:
|
Quote:
Originally Posted by jason_not
Hello,
You need to use the -r <filename> option with tcpdump. a pcap file generally is what you get with the -w option of tcpdump.
For example: to see the traffic between hosts A and B, I use:
tcpdump -r <pcapfile> -n host A or host B
-jason
|
I've used "-r" before but that shows very little info. I need something that is able to give me the entire information, as seen with Wireshark!
For example, in Wireshark we get detailed info when the following sections are expanded, for some Protocol:
- Frame data
- Ethernet data
- IP data
- TCP/UDP data
- Protocol data
I want this in a way that I can read from the CLI.
|
|
|
10-16-2013, 04:16 PM
|
#4
|
Member
Registered: Aug 2010
Location: Beaverton, Oregon, USA
Distribution: Pfsense, Ubuntu, Centos, Fedora, Redhat, Scientfic, MacOS
Posts: 76
Rep:
|
Hello,
You might need to run several different dumps to see what you want.
the -e option will print the link-level headers: this will show the source and destination mac addresses.
not sure what you mean by "frame data"
ip, tcp, and udp can all be filtered upon. if tcpdump doesn't show how to do this, read the man page on pcap-filter.
the -v options will print out more data, but this depends on the version of tcpdump.
The big issue to remember though is even though the data is there, it's hard to keep things in context. There are also lots of examples and tutorials online, such as tcpdump's website.
--jason
|
|
|
10-16-2013, 04:18 PM
|
#5
|
Member
Registered: May 2004
Location: Raleigh, NC
Distribution: Debian, Solaris, HP-UX, AIX
Posts: 208
Rep:
|
|
|
1 members found this post helpful.
|
10-16-2013, 04:21 PM
|
#6
|
Member
Registered: Aug 2010
Location: Beaverton, Oregon, USA
Distribution: Pfsense, Ubuntu, Centos, Fedora, Redhat, Scientfic, MacOS
Posts: 76
Rep:
|
Hello,
I like 0.o's reply: I hadn't realized there was a console-based wireshark.
--jason
|
|
|
10-16-2013, 06:04 PM
|
#7
|
Member
Registered: May 2004
Location: Raleigh, NC
Distribution: Debian, Solaris, HP-UX, AIX
Posts: 208
Rep:
|
You might also like this:
tcpdump -As0 -vvnn -r <pcap>
|
|
1 members found this post helpful.
|
All times are GMT -5. The time now is 10:40 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|