Skip to content

label more IPs with hostnames #2

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

Open
crazyideas21 opened this issue Apr 13, 2024 · 1 comment · May be fixed by #15
Open

label more IPs with hostnames #2

crazyideas21 opened this issue Apr 13, 2024 · 1 comment · May be fixed by #15
Assignees
Labels
enhancement New feature or request

Comments

@crazyideas21
Copy link
Contributor

The current version labels IPs with hostnames obtained from DNS and SNI (assuming TLS 1.2). However, there are still cases where the src_hostname or dst_hostname fields are empty, because the parser didn't see any corresponding IP-hostname mappings from DNS and SNI.

Here's one thing the user (say @Rameen-Mahmood) can do to mitigate this issue: Instead of parsing one pcap at a time, you can capture a bunch of pcaps (e.g., repeated experiments from the same app, or running tcpdump on multiple apps) and run this parser on the pcaps at the same time (e.g., python parser.py output.csv *.pcap). In this way, the parser can use DNS/SNI information extracted from one pcap and apply this IP-hostname mapping to other pcaps.

Still, I'd expect a number of IPs with no hostname labels. What I can do to mitigate this situation would be:

  • query against a private passive DNS API to turn these IPs into hostnames (although this process could be error-prone especially if the IPs are on shared infrastructure)
  • find the reverse DNS data (i.e., PTR records) for unlabeled IP addresses (although this process is moot in cases where the PTR records simply correspond to the IP address, e.g., the PTR record of 54.156.150.34 is ec2-54-156-150-34.compute-1.amazonaws.com, which is not useful and you could have used the IP address instead)
@crazyideas21 crazyideas21 added the enhancement New feature or request label Apr 13, 2024
@crazyideas21 crazyideas21 self-assigned this Apr 13, 2024
@Rameen-Mahmood
Copy link
Member

Update: pcap-parser now supports handling multiple pcap files at once, including entire directories of pcaps. Users can now parse a batch of pcap files in a single command:
python parse.py <output_csv_file> <directory_containing_pcap_files>

@Rameen-Mahmood Rameen-Mahmood linked a pull request Nov 15, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants