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

Parsing a decrypted PDU-L7 Pcap with multiple sessions does not work #313

Closed
obilodeau opened this issue Apr 28, 2021 · 4 comments · Fixed by #368
Closed

Parsing a decrypted PDU-L7 Pcap with multiple sessions does not work #313

obilodeau opened this issue Apr 28, 2021 · 4 comments · Fixed by #368
Assignees
Labels
bug Something isn't working investigate Needs more thought / experience workaround A workaround exists for this bug

Comments

@obilodeau
Copy link
Collaborator

I am able to reliably reproduce a bug where a Pcap with exported PDUs containing more than one session of the same source and destination IPs is getting mixed up and doesn't convert to the correct replay file or mp4.

We should probably cleanly separate streams in the PDU parsing code. Not sure how to do that with PDU level packets (is the information available in the wireshark trace?).

Workaround: walking the pcap with filters like tcp.stream eq <1, 2, .. N> and exporting one PDU-L7 pcap per TCP streams works.

@obilodeau obilodeau added bug Something isn't working investigate Needs more thought / experience workaround A workaround exists for this bug labels Apr 28, 2021
@alxbl
Copy link
Collaborator

alxbl commented May 24, 2021

I think exported PDUs don't have proper source/dst information, so all streams get mangled together into one big soup. We should check if there's any info in the exported PDUs that could make it possible to distinguish

@obilodeau
Copy link
Collaborator Author

Good point @alxbl! I'll check but if what we need to distinguish isn't available, we will simply update our instructions to differentiate streams before exporting and document the limitation.

@alxbl alxbl self-assigned this Oct 16, 2021
@alxbl
Copy link
Collaborator

alxbl commented Oct 24, 2021

I think there's a clever way to do this by using the EXPORTEDPDU's source port and destination port tags. We can base it on the tuple (src,dst) to identify conversations, assuming that no two connections re-use the client-side port. This should work in like 99.9% of the cases. I'll look into how this could be implemented and get a capture to try with.

@alxbl
Copy link
Collaborator

alxbl commented Oct 26, 2021

I managed to get something working by parsing the Exported PDUs and creating sessions with the information available in the tags... it's messy right now but I'll clean up the code and open a PR tomorrow.

Analyzing PCAP 'multi-export.pcap' ...    - 10.2.0.1 -> 10.2.0.126: plaintext
    - 10.2.0.1 -> 10.2.0.126: plaintext
    - 10.2.0.1 -> 10.2.0.126: plaintext
[*] Processing 10.2.0.1 -> 10.2.0.126
100% (185 of 185) |#############################################################################################################################################################| Elapsed Time: 0:00:00 Time:  0:00:00

[+] Successfully wrote
[*] Processing 10.2.0.1 -> 10.2.0.126
100% (78 of 78) |###############################################################################################################################################################| Elapsed Time: 0:00:00 Time:  0:00:00

[+] Successfully wrote
[*] Processing 10.2.0.1 -> 10.2.0.126
100% (436 of 436) |#############################################################################################################################################################| Elapsed Time: 0:00:00 Time:  0:00:00

[+] Successfully wrote```

obilodeau pushed a commit that referenced this issue Jan 7, 2022
obilodeau pushed a commit that referenced this issue Jan 7, 2022
obilodeau pushed a commit that referenced this issue Jan 7, 2022
obilodeau added a commit that referenced this issue Jan 7, 2022
feat(#313): Add support for conversion of multiple exported sessions.
obilodeau pushed a commit that referenced this issue Jan 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working investigate Needs more thought / experience workaround A workaround exists for this bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants