MCPcopy Index your code
hub / github.com/dreadl0ck/netcap / extractSoftwareVersion

Function extractSoftwareVersion

decoder/stream/ssh/ssh_reader.go:645–654  ·  view source on GitHub ↗

extractSoftwareVersion extracts the software version from SSH ident string

(ident string)

Source from the content-addressed store, hash-verified

643
644// extractSoftwareVersion extracts the software version from SSH ident string
645func extractSoftwareVersion(ident string) string {
646 // SSH-2.0-OpenSSH_8.2p1 Ubuntu-4ubuntu0.5
647 // Extract the part after SSH-x.x-
648 parts := strings.SplitN(ident, "-", 3)
649 if len(parts) >= 3 {
650 // Return everything after SSH-2.0-
651 return parts[2]
652 }
653 return ""
654}
655
656// guessOS attempts to guess the OS from the SSH ident string
657func guessOS(ident string) string {

Callers 1

searchKexInitMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected