Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JMirror encapsulation #504

Open
brightpinefield opened this issue Dec 14, 2020 · 3 comments
Open

JMirror encapsulation #504

brightpinefield opened this issue Dec 14, 2020 · 3 comments

Comments

@brightpinefield
Copy link

Is it possible for dpkt to read JMirror encapsulated packets, given the known JMirror UDP port? For example. In Wireshark, if I don't specify the JMirror port as UDP port 6502 this is what I see:

Screen Shot 2020-12-14 at 11 17 50 AM

When I decode the UDP Port 6502 as JMirror , I get this:

Screen Shot 2020-12-14 at 11 17 19 AM

I've attached a sample pcap if it helps... Thank you!
jmirror_ip.pcap.zip

@obormot
Copy link
Collaborator

obormot commented Dec 15, 2020

It's possible to decode the encapsulated IP layer (in this case) by manually applying it to the underlying UDP data, and skipping the 8 bytes of JMirror header. E.g. for the 1st packet of this pcap:

>> dpkt.ip.IP(dpkt.ethernet.Ethernet(buf).ip.udp.data[8:])

IP(len=60, id=22676, ttl=126, p=1, sum=48995, src=b'E\x9e\xc0N', dst=b'CF\xdb\x96', opts=b'', 
   data=ICMP(sum=55054, data=Echo(id=512, seq=29773, data=b'abcdefghijklmnopqrstuvwabcdefghi')))

@brightpinefield
Copy link
Author

@obormot thank you for this! will try it out.. so that will work for the IP layer... is there a way to get to the application layer as well?

@obormot
Copy link
Collaborator

obormot commented Dec 27, 2020

@brightpinefield dpkt will auto-decode layers if they are linked (in this example IP -> ICMP -> ICMP Echo were auto-decoded). For application layer usually one would need to specify the decoder to apply.

(Leaving the issue open since dpkt doesn't support JMirror encapsulation).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants