diff --git a/README.md b/README.md index bb545a6..17c9019 100644 --- a/README.md +++ b/README.md @@ -47,6 +47,8 @@ The scanner supports outputting the scan result as json. To do so, provide the ` ```json { + "RemoteAddr": "127.0.0.1:22", + "IsServer": true, "Banner": "SSH-2.0-OpenSSH_8.9p1 Ubuntu-3ubuntu0.5", "SupportsChaCha20": true, "SupportsCbcEtm": false, diff --git a/tscanner/tscanner.go b/tscanner/tscanner.go index c0b7eec..cc0480f 100644 --- a/tscanner/tscanner.go +++ b/tscanner/tscanner.go @@ -34,6 +34,10 @@ const kexStrictIndicatorServer = "kex-strict-s-v00@openssh.com" // Report contains the results of a vulnerability scan. type Report struct { + // Contains the IP address and port of the scanned peer. + RemoteAddr string + // Indicates whether the scanned host was acting as client or server. + IsServer bool // Banner contains the SSH banner of the remote peer. Banner string // SupportsChaCha20 indicates whether the remote peer supports the ChaCha20-Poly1305 cipher. @@ -107,6 +111,8 @@ func ScanWithTimeout(address string, scanMode ScanMode, verbose bool, timeout in } } report := new(Report) + report.RemoteAddr = conn.RemoteAddr().String() + report.IsServer = scanMode == ServerScan report.Banner = remoteBanner report.SupportsChaCha20 = slices.Contains(remoteKexInit.EncryptionAlgorithmsClientToServer, chaCha20Poly1305) || slices.Contains(remoteKexInit.EncryptionAlgorithmsServerToClient, chaCha20Poly1305)