Skip to content

Jin v2.5.0

Choose a tag to compare

@sapiuwu sapiuwu released this 08 Oct 06:46
· 4 commits to master since this release

Bugs that produce wrong results today.

P1: IPv6 / host:port target parsing

  • Add a single centralized target parser, internal/hostutil (Split/Host/DialAddress/RootDomain), and route every parsing site through it (replaces the 5 manual "cut at first colon" sites):
    • internal/adapter/in/cli/args.go — cleanHost (deleted; did not strip :port or brackets at all)
    • internal/application/service/full_scan_service.go (manual stripping deleted; target passed straight to the port use case)
    • internal/application/service/techstack_service.go — rootDomain (deleted; now hostutil.RootDomain)
    • internal/adapter/out/scanner/tls_inspector.go — tlsHost (now a one-liner over hostutil.Host)
    • internal/adapter/out/scanner/http_server_scanner.go — extractRootDomain (deleted; now hostutil.RootDomain)
  • Fix false "closed" ports: jin ports -t example.com:8080 used to dial example.com:8080:443 (tcp_port_scanner.go:69) and report every port closed. The target is now parsed once in PortScanService.Scan and dialed via net.JoinHostPort (hostutil.DialAddress).
  • Make IPv6 literal targets (2001:db8::1, [::1]:8080) dialable in tcp_port_scanner.go.
  • Port-selection precedence (was undefined): explicit -p list > port embedded in the target (validated 1–65535) > configured defaults.
  • Add the first unit tests of the project — table-driven tests in internal/hostutil/hostutil_test.go (Split, Host, DialAddress, RootDomain covering [::1], [::1]:8080, 2001:db8::1, example.com:8080, example.com, https://example.com/path, credentials, trailing dot, IP literals) plus internal/application/service/port_scan_service_test.go (host extraction, port precedence, error propagation) using a fake out.PortScanner.