Skip to content

feat: v0.7.0 - service detection upgrade + macOS cross-platform - #8

Merged
Bulletdev merged 6 commits into
mainfrom
feat/service-detection-upgrade
Nov 22, 2026
Merged

Bulletdev merged 6 commits into
mainfrom
feat/service-detection-upgrade

Conversation

@Bulletdev

@Bulletdev Bulletdev commented Nov 11, 2026 •

Copy link
Copy Markdown
Member

Summary

Service Detection Upgrade

  • 7 new protocol probes in 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)
  • 6 new scripts in 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)
  • Multi-probe OS detection in os.zig: 3 TCP SYN probes with different options (SEQ/OPS, WIN, ECN) + ICMP Echo probe, combined fingerprinting up to 95% confidence
  • 45 new service signatures in service-probes: 4 null-probe (CouchDB, RethinkDB, Asterisk, TeamSpeak) + 41 HTTP (Tomcat, Docker Registry, Spring Boot, Kubernetes, Metabase, Airflow, n8n, Uptime Kuma, and more)
  • TLS service labeling: probeTls now identifies underlying protocol (https, ldaps, imaps, pop3s, etc.) via ALPN and port mapping
  • Expanded port classification: 53, 88, 135, 139, 389, 464, 593, 1080, 3268, 5222, 5269, 7070, 7443, 7777, 9091 now route to proper protocol probes
  • Generic probe cascade expanded with SOCKS5, DNS, LDAP fallback probes
  • 33 new unit tests across all modules

macOS (aarch64) Cross-Platform Support

  • New src/platform.zig module - centralizes all OS-specific socket constants (IPPROTO_RAW, IP_HDRINCL, MSG_DONTWAIT) with comptime conditionals for darwin vs linux
  • macOS geteuid() via inline ARM64 assembly - std.os.linux.geteuid() is Linux-only; on macOS aarch64, uses svc #0x80 syscall 25 to check root privileges
  • Guard Linux-only ioctl in progress bar - TIOCGWINSZ now behind comptime guard with fallback to 80 columns on non-Linux

Performance

  • TCP connect scan optimization - reduced connect timeout from 3s to 1.5s, fixed burst cap at 100, adaptive poll timeout based on nearest deadline

Test plan

  • Scan a Windows AD/Domain Controller (ports 53, 88, 135, 139, 389, 445, 636, 3268, 3269, 3389) - verify DNS, Kerberos, MSRPC, NetBIOS, LDAP, SMB, RDP detection
  • Scan a machine with XMPP/Openfire (ports 5222, 5269, 7070, 7443, 9090, 9091)
  • Scan HTTPS targets (443, 8443) - verify ssl-cert script and TLS labeling
  • Scan with -A flag against a rich target and compare output with nmap -A
  • Verify Linux build still works (no regressions)
  • Verify raw socket scans (-sS) work on Linux with root
  • TCP Connect scan (-sT) runs on macOS ARM64 without root
  • Run zig build test on clean checkout

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.
@codacy-production

codacy-production Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@github-actions

Copy link
Copy Markdown

Semgrep Static Analysis

Severity Count
Errors 0
Critical (HIGH confidence) 0
Warnings 0

No issues found.

@github-actions

Copy link
Copy Markdown

Security Scan Summary

Check Status
Semgrep success
Secret Detection success

All security checks passed!

@codacy-production codacy-production Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

⚠️ Resolve issues before merging

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

Comment thread src/os.zig
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);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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.

Comment thread src/banner.zig Outdated

// DNS version.bind TXT CH query over TCP (2-byte length prefix + DNS packet)
const dns_query = [_]u8{
// TCP length prefix

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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.

@Bulletdev Bulletdev self-assigned this Nov 11, 2026
- 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
@github-actions

Copy link
Copy Markdown

Semgrep Static Analysis

Severity Count
Errors 0
Critical (HIGH confidence) 0
Warnings 0

No issues found.

@github-actions

Copy link
Copy Markdown

Security Scan Summary

Check Status
Semgrep success
Secret Detection success

All security checks passed!

Michael D. and others added 2 commits November 21, 2026 20:08
Introduce comptime OS conditionals so OhmZ compiles and runs natively
on macOS ARM64 without hardcoding Linux-only constants.

- Create src/platform.zig centralizing IPPROTO_RAW, IP_HDRINCL, and
  MSG_DONTWAIT with correct values per OS (darwin vs linux)
- Replace std.os.linux.geteuid() with inline ARM64 assembly (svc #0x80)
  on macOS, guarded by comptime builtin.os.tag check
- Guard Linux-only ioctl TIOCGWINSZ in progress.zig behind comptime,
  defaulting to 80 columns on non-Linux platforms
- Update tx.zig, rx.zig, os.zig, traceroute.zig to use platform module
@github-actions

Copy link
Copy Markdown

Semgrep Static Analysis

Severity Count
Errors 0
Critical (HIGH confidence) 0
Warnings 0

No issues found.

@github-actions

Copy link
Copy Markdown

Security Scan Summary

Check Status
Semgrep success
Secret Detection success

All security checks passed!

Reduce connect timeout from 3s to 1.5s, cap token burst at 100,
and use adaptive poll timeout based on nearest deadline instead of
fixed 10ms interval.
@github-actions

Copy link
Copy Markdown

Semgrep Static Analysis

Severity Count
Errors 0
Critical (HIGH confidence) 0
Warnings 0

No issues found.

@github-actions

Copy link
Copy Markdown

Security Scan Summary

Check Status
Semgrep success
Secret Detection success

All security checks passed!

@Bulletdev Bulletdev changed the title feat: major service detection upgrade feat: v0.7.0 - service detection upgrade + macOS cross-platform Nov 22, 2026
@Bulletdev
Bulletdev merged commit 98eeff9 into main Nov 22, 2026
10 checks passed
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

Successfully merging this pull request may close these issues.

1 participant