LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 03-31-2007, 03:30 PM   #1
exl75
Member
 
Registered: Mar 2007
Posts: 54

Rep: Reputation: 15
Question Extracting Packet Information


Given the packet below in Linux:

12:37:02.582260 00:20:16:5c:80:12 > ff:ff:ff:ff:ff:ff, ethertype IPv4 (0x0800),

How do u determine information about: the host that sent this packet,the network interface manufacturer,hostname,time packet was sent,how long its been up,and any other information that could be extracted from the packet. Any help is greatly appreciated.

Last edited by exl75; 04-11-2007 at 12:35 PM.
 
Old 03-31-2007, 03:47 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
none of that information is present. the packet contains the hardware address of the previous layer 3 device, but outside of the clients local lan, this is just another router.

this and the other thread suggest you don't really see what ip as a protocol can and can't do. if a packet on the internet held all that pointless information just think how much space and bandwidth that would use up! uptime? why should that sort of information ever want to be visible to a network without a specific protocol / query for it?
 
Old 03-31-2007, 03:57 PM   #3
exl75
Member
 
Registered: Mar 2007
Posts: 54

Original Poster
Rep: Reputation: 15
I was thinking more that in Linux,there are commands you can run to try to get all that information from the packet information that you just have.Is there such a thing? Are there any commands that one can use to run against the packet to get that information? Im not sure,Im new to Linux,and Linux Networking as a whole.Thanks.
 
Old 03-31-2007, 04:00 PM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
well this is nothing to do with linux at all, it's just the capabilities of IP. a basic IP packet really is very small, you can very easily see bit by bit what each 1 or 0 means. you can use tools like wireshark to analyse packets, and that will display timestamps and such, but this data is about when the app got a packet, not data held within the packet itself.

so yeah, not linux related, and as far as tools in general, if any operating system was going to have tools to weedle out little bits of data like this, it'd be linux long before windows, i guarentee it.
 
Old 03-31-2007, 04:06 PM   #5
exl75
Member
 
Registered: Mar 2007
Posts: 54

Original Poster
Rep: Reputation: 15
Great,for this one as well,I was thinking that you can run Linux commands cause this packet is from a Linux box,so I was not sure how to interpret all the information stored within the packet or the information that Im looking at.It seems like,at least it was my impression,that you can get the host name,interface manuf,time stamp and such by running some commands against the packet information.Im not quite sure what to do here.
 
Old 03-31-2007, 04:09 PM   #6
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
You can look into the packet using Wireshark for instance. There are also console-based tools, but the output for a single packet is then quite large.
 
Old 03-31-2007, 04:11 PM   #7
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
on the end machine itself, yes you can see the nic manufacturer, by virtue of it being encoded into the mac address, but then you already have mant better ways to find that sort of info out without resorting to packet sniffing.
 
Old 03-31-2007, 04:12 PM   #8
exl75
Member
 
Registered: Mar 2007
Posts: 54

Original Poster
Rep: Reputation: 15
Great,thanks.This tool,once i get it,will it be able to give all this information on any packets or how would it work briefly?
 
Old 03-31-2007, 04:13 PM   #9
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
just have a look at wireshark.org there's no point us repeating what it can tell you.
 
Old 03-31-2007, 04:16 PM   #10
exl75
Member
 
Registered: Mar 2007
Posts: 54

Original Poster
Rep: Reputation: 15
Yeah,thats true :-). Thanks a lot for you help.
 
Old 03-31-2007, 05:04 PM   #11
exl75
Member
 
Registered: Mar 2007
Posts: 54

Original Poster
Rep: Reputation: 15
Do you know anything about pcap? tcpdump? isnt it used as a low level tool for pcap network capture? would that work in this case? that may be just an alternative instead of using a GUI such as with wireshark?? Also,the bpf,or Berkely Packet Filters?? whats your take on all these low level tools,would they be any good if I wanted to use them??

Last edited by exl75; 03-31-2007 at 05:13 PM.
 
Old 04-01-2007, 03:16 AM   #12
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
wireshark uses libpcap as a lower level, pcap in itself is not a tool, but a library. if you don't want a gui, just use the console interface to wireshark, tshark. or tcpdump.
 
Old 04-01-2007, 01:20 PM   #13
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
And bpf is a way to write filters to get only the packets you want. Wireshark has a nice GUI for that.
 
Old 04-01-2007, 02:14 PM   #14
exl75
Member
 
Registered: Mar 2007
Posts: 54

Original Poster
Rep: Reputation: 15
Is there a site or online documentation where I can find examples of tcmpdump or bpf or tshark used as low level tools for packet capture? I cant use the GUI versions cause my system is not set up to handle it.
 
Old 04-01-2007, 02:23 PM   #15
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
well the low level data is in all ip packets... wireshark.org has plenty of examples.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Extracting Information from Web pagges opto General 3 09-25-2006 02:19 AM
Packet Filter to redirect a packet to a user level process akawale Linux - Networking 3 09-01-2006 12:06 PM
how do i read the data in the packet that i have captured after packet capture? gajaykrishnan Programming 23 04-19-2006 05:09 AM
dump packet data to file, but no packet header Nathanael Linux - Networking 3 02-08-2006 10:27 AM
Extracting terminal/console information Woodsman Slackware 6 11-12-2005 12:34 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 01:30 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration