Conversation started Aug 21, 2012 at 19:27.
Aug 21, 2012 19:27
I'm feeling like an idiot here. Can someone explain to me why this works: tcpdump -nn -r ringbuffer.1345575972 | grep 10.10.10.15
But this does not: tcpdump -nn -r ringbuffer.1345575972 ip host 10.10.10.15
I don't have a *nix machine up to be able to man tcpdump for you just now, sorry.
My non-working statement is syntactically correct, as near as I can tell, based on every version of the man page I've checked.
Sure you're not missing a dash or something somewhere?
`EXAMPLES
To print all packets arriving at or departing from sundown:
tcpdump host sundown
`
Well, that failed
Wait... aren't most man pages online?
Aug 21, 2012 19:33
Though not necessarily the man page for the version that you're running.
Right...
Looks to me like you've got too many args after -r?
Either way, that is, by the docs, a syntactically correct expression.
Oh, wait. The rest of that is your [expression]
Indeed.
Well, crap. Now I need to find the PCAP filter man.
Aug 21, 2012 19:36
pcap-filter(7)
@Iszi quote the string
... nevermind
@JeffFerland Thought that was right for a second after you said it, too. That's ok.
NO IT'S NOT!
What's -nn? I don't see it in the man.
Don't resolve either IPs or ports
One n says don't resolve names, and the second does ports.
Aug 21, 2012 19:42
Okay, so you want to do a tcpdump without resolving IPs or Ports, output to ringbuffer.1345575972 and filter it to only IP packets to/from 10.10.10.15?
Well, reading from and existing pcap file.
Ah, right. I thought it seemed weird to use "r" to specify output.
-r for read. You use -wto write to a file.
Well, the only difference I see between your straight tcpdump command and your grep filter is that grep doesn't limit you to IP packets?
Strictly speaking, the ip could or could not be in there and I get the same results.
Aug 21, 2012 19:47
That's what I thought, too. I'm guessing you've tried it?
naturally
Now I'm trying a hex wise filter against those byte offsets in the ip header.
So, you just threw that in as a red herring is that it? Asshole.
When you pass an IP address 'host' and 'ip host' are functionally equivalent.
That's what you think. But, tools can be... well, tools, with regards to such things.
Hey @nealmcb
@Iszi :)
Aug 21, 2012 19:51
Hey @Neal!
Hehe. I'm in an online training class right now, and the instructor just turned up Stack Overflow while trying to show us what kind of info is available on the Internet about the subject.
I'm doing an online training that's being given by a Brazilian who looks full on Irish and sounds like he's from Minnesota.
Ah-HAH!
Vlans baby.
@ScottPack What's that got to do with anything?
libpcap is doing something stupid with the filters on tagged packets.
So, what's that got to do with... Oh! Hrm. Cute.
Aug 21, 2012 19:54
I have explicitly add the vlan id to my filter.
That is, tcpdump -nn -r ringbuffer.1345575972 vlan 100 and host 10.10.10.15
mfer
Right. 'Cause otherwise you could totally end up finding packets from a 10.10.10.15 on another VLAN, I guess.
Aug 21, 2012 20:09
This appears to be behavior introduced in newer versions of libpcap, for some definition of newer.
That is, I found it about 10 pages into a bug report for debian from 2005.
 
Conversation ended Aug 21, 2012 at 20:10.