Open Niek opened 3 years ago
Sorry for the late reply, but if you did already
I tried PyPy3 but it fails on the pcapy dependency
then you know more than I do.
Best idea I currently have: Rewrite the whole thing and use C.
Also: Maybe the scoring algorithm might be a bit slow, since the database lookups occur very often...
Probably the best would be to rewrite in golang using https://pkg.go.dev/github.com/google/gopacket/pcap - that makes is easier to run on Windows too. Are you interested in collaborating on this? The high-level stuff (OS guesser etc) is quite trivial, but decoding the TCP info is more of a challenge.
Have you ever tried to set the filter conditions more precisely? According to the code, all data passing through port 443 or port 80 will be parsed. In fact, only TCP SYN is required. TCP ack is not required. It is used for logging.
By the way, if your server is actively requested, you'd better add the destination port limit, such as
tcp dst port 443 and (tcp[tcpflags] & (tcp-syn) != 0)
Setting a stricter pcap filter definitely helps. I also rewrote zardaxt in Golang, which helps quite a bit as well. But ultimately the best option would be to run a HTTP server, access the local socket directly and get rid of the pcap dependency.
I don't quite understand. You mean Golang acts as a web server, accepts all traffic, and only parses the SYN in it?
Yes - spawn a HTTP server in Golang, access the raw TCP socket and parse the incoming traffic through gopacket. That should be much faster than intercepting through pcap.
I have a similar idea for this project. Although workman can be used as a web server directly, I didn't get the TLS in it. So I put an nginx directly in front of it. The workload of parsing data is too difficult, come on.
Probably the best would be to rewrite in golang using https://pkg.go.dev/github.com/google/gopacket/pcap - that makes is easier to run on Windows too. Are you interested in collaborating on this? The high-level stuff (OS guesser etc) is quite trivial, but decoding the TCP info is more of a challenge.
Hi, Is This Still On The Table?
I'd Love To Contribute To A Golang Version Of Zardaxt.
Seems to be rewritten in Go already: https://headers.cf/tcp
They could have open sourced it ;)
Seems to be rewritten in Go already: https://headers.cf/tcp
They could have open sourced it ;)
That's me :) I need to improve the code (not using pcap but using the raw TCP socket) and then I can look into releasing it.
I am correctly collecting new classification data, this time the number of samples will be a bit larger.
I am also including the TCP timestamp clock frequency in the next classification data release. It is quite interesting that there seem to be three different TCP Timestamp frequencies out in the wild: 100hz, 250hz and 1000hz (by far the most common). I think the clock frequency should also correlate with the OS type.
What I also observed is that there seems to be sometimes a sudden change in TCP timestamps base value. Any idea?
Seems to be rewritten in Go already: https://headers.cf/tcp They could have open sourced it ;)
That's me :) I need to improve the code (not using pcap but using the raw TCP socket) and then I can look into releasing it.
@Niek is not ready yet? Thanks.
@Niek
Seems to be rewritten in Go already: https://headers.cf/tcp They could have open sourced it ;)
That's me :) I need to improve the code (not using pcap but using the raw TCP socket) and then I can look into releasing it.
@Niek is not ready yet? Thanks.
I know Python is not the fastest language, but is this expected to use 50%+ CPU on a fast machine?
Is there any other way to optimize this? I tried PyPy3 but it fails on the pcapy dependency. Any other ideas?