Repository navigation
Conversation
Add 7 new protocol probes (DNS, Kerberos, MSRPC, NetBIOS, LDAP, XMPP, SOCKS5), 6 new scripts (rdp-ntlm, ssl-cert, smb2-info, ldap-rootdse, xmpp-info, socks-auth), multi-probe OS detection with ICMP/ECN, 45 new service signatures, and TLS underlying service labeling.
Up to standards ✅🟢 Issues
|
Semgrep Static Analysis
No issues found. |
Security Scan Summary
All security checks passed! |
There was a problem hiding this comment.
Pull Request Overview
The DNS probe uses an incorrect TCP payload length, which can cause valid DNS servers to wait for additional data or reject the request. The OS fingerprinting path also accepts responses without validating the source address, allowing unrelated packets to affect results.
The SMB2 script constructs the NetBIOS session header unreliably and should encode the three-byte length explicitly. Automated coverage is also missing for the new probes, active scripts, and multi-probe OS detection, so those acceptance areas remain insufficiently demonstrated.
About this PR
- Add fixture- or integration-based automated tests for the new probes, script parsers, and OS fingerprinting paths; current tests primarily cover helpers and signatures rather than the new network behavior.
Test suggestions
- Unit-test protocol port classification and non-HTTP port recognition for all newly added ports.
- Unit-test TLS underlying-service labeling using ALPN and port mappings.
- Unit-test realm validation and extraction behavior.
- Unit-test new null-probe and HTTP service signatures.
- Exercise DNS, Kerberos, MSRPC, NetBIOS, LDAP, XMPP, and SOCKS probes against representative responses.
- Exercise all six active scripts and validate their parsed output.
- Test multi-probe OS fingerprinting with representative Windows, Linux, BSD, macOS, and network-device responses.
- Run integration scans for the stated AD, XMPP, HTTPS, and rich-target scenarios.
Prompt proposal for missing tests
Consider implementing these tests if applicable:
1. Exercise DNS, Kerberos, MSRPC, NetBIOS, LDAP, XMPP, and SOCKS probes against representative responses.
2. Exercise all six active scripts and validate their parsed output.
3. Test multi-probe OS fingerprinting with representative Windows, Linux, BSD, macOS, and network-device responses.
4. Run integration scans for the stated AD, XMPP, HTTPS, and rich-target scenarios.
Make this review better
TIP Add a ticket key to the branch or title so the reviewer can check the PR against it. Or tell us which ticket tracker you use here.
TIP Add Codacy review.md instructions or an AGENTS.md so the reviewer knows your conventions.
TIP How was this review? Give us feedback
| if (packet.fromNet(u16, tcp_hdr.src_port) != open_port) continue; | ||
| if (packet.fromNet(u16, tcp_hdr.dst_port) != src_port) continue; | ||
|
|
||
| const dst_port = packet.fromNet(u16, tcp_hdr.dst_port); |
There was a problem hiding this comment.
🟡 MEDIUM RISK
Validate the response source IP against the target before associating it with a probe, and also validate the expected ACK/sequence relationship where applicable.
TIP React 👍 if this review is right, or reply with what's wrong and how it could be better to help improve the reviewer.
|
|
||
| // DNS version.bind TXT CH query over TCP (2-byte length prefix + DNS packet) | ||
| const dns_query = [_]u8{ | ||
| // TCP length prefix |
There was a problem hiding this comment.
🟡 MEDIUM RISK
Change the TCP length prefix from 0x00, 0x1E to 0x00, 0x1D, or compute it from the payload length.
TIP React 👍 if this review is right, or reply with what's wrong and how it could be better to help improve the reviewer.
- Run zig fmt on banner.zig and scripts.zig - Compute DNS TCP length prefix from payload size instead of hardcoding - Validate TCP ACK number in OS multi-probe response matching
Semgrep Static Analysis
No issues found. |
Security Scan Summary
All security checks passed! |
Summary
banner.zig: DNS (version.bind TXT query), Kerberos (AS-REQ with realm extraction), MSRPC (DCE/RPC Bind to EPM), NetBIOS (session request), LDAP (rootDSE search with domain extraction), XMPP (stream initiation), SOCKS5 (auth negotiation)scripts.zig: rdp-ntlm-info (NLA negotiation), ssl-cert (TLS cert details via tls.zig), smb2-security-mode (signing/dialect), ldap-rootdse (domain/host attributes), xmpp-info (STARTTLS/auth/server identity), socks-auth-info (method detection)os.zig: 3 TCP SYN probes with different options (SEQ/OPS, WIN, ECN) + ICMP Echo probe, combined fingerprinting up to 95% confidenceservice-probes: 4 null-probe (CouchDB, RethinkDB, Asterisk, TeamSpeak) + 41 HTTP (Tomcat, Docker Registry, Spring Boot, Kubernetes, Metabase, Airflow, n8n, Uptime Kuma, and more)probeTlsnow identifies underlying protocol (https, ldaps, imaps, pop3s, etc.) via ALPN and port mapping+1601 lines across 7 files. Build and all tests pass.
Test plan
-Aflag against a rich target and compare output with nmap-Azig build teston clean checkout