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

JA4 Python uses reverse DNS #145

Open
CopyOfA opened this issue Aug 14, 2024 · 0 comments
Open

JA4 Python uses reverse DNS #145

CopyOfA opened this issue Aug 14, 2024 · 0 comments
Assignees

Comments

@CopyOfA
Copy link

CopyOfA commented Aug 14, 2024

In the Python code for JA4, lines 456 and 461, there is a system call to tshark. In this call, there is no -n, which would inform tshark to not perform domain name resolution. By default, tshark will perform domain name resolution, so in its current implementation, JA4 is performing domain name resolution. This is a massive slow-down and should be remedied if domain name resolution is unnecessary. For example, in line 461, the code could be changed:

ps = Popen(["tshark", "-nr", args.pcap, "-T", "ek"], stdout=PIPE, stderr=PIPE)

This change will result in a massive increase in processing speed. When I tested the speed difference, I used a PCAP file with 90979 packets. When I used the default settings in ja4.py, the processing took over 100 seconds (measured using bash time command; I killed the process after 100 seconds), while after making the suggested change on line 461 (shown above), the processing took about 22 seconds.

If reverse DNS is unnecessary, this should be changed, but if it's necessary, you can close this issue.

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

No branches or pull requests

2 participants