SSHscan is a simple utility for inspecting or auditing an SSH server for various settings such as supported encryption and key exchange algorithms.
In order to start, go get this repository:
go get github.com/adedayo/sshscanIn your code simply import as usual and enjoy:
package main
import
(
"fmt"
"github.com/adedayo/sshscan"
)
func main() {
scan := sshscan.Inspect("host", "22")
fmt.Printf("%#v\n", scan)
}This should produce an output similar to the following:
sshscan.SSHExchange{ProtocolVersion:"SSH-2.0-OpenSSH_7.6p1 Ubuntu-4\r\n", Cookie:[16]uint8{0x9e, 0x37, 0xe0, 0x10, 0xf0, 0x28, 0x5d,0xf9, 0x7c, 0x31, 0xb6, 0xb5, 0x84, 0xb, 0xf4, 0xa4}, KEXAlgorithms:[]string{"ssh-rsa", "rsa-sha2-512", "rsa-sha2-256", "ecdsa-sha2-nistp256", "ssh-ed25519"}, ServerHostKeyAlgos:[]string{"[email protected]", "aes128-ctr", "aes192-ctr", "aes256-ctr", "[email protected]", "[email protected]"}, EncAlgosC2S:[]string{"[email protected]", "aes128-ctr", "aes192-ctr", "aes256-ctr", "[email protected]", "[email protected]"}, EncAlgosS2C:[]string{"[email protected]", "[email protected]", "[email protected]", "[email protected]", "[email protected]", "[email protected]", "[email protected]", "hmac-sha2-256", "hmac-sha2-512", "hmac-sha1"}, MACAlgosC2S:[]string{"[email protected]", "[email protected]", "[email protected]", "[email protected]", "[email protected]", "[email protected]", "[email protected]", "hmac-sha2-256", "hmac-sha2-512", "hmac-sha1"}, MACAlgosS2C:[]string{"none", "[email protected]"}, CompAlgosC2S:[]string{"none", "[email protected]"}, CompAlgosS2C:[]string{""}, LanguagesC2S:[]string{""}, LanguagesS2C:[]string{""}, Fail:false, FailReason:""}
sshscan is also available as a command-line tool.
Prebuilt binaries may be found for your operating system here: https://github.com/adedayo/sshscan/releases
For macOS X, you could install via brew as follows:
brew tap adedayo/tap
brew install sshscan#scan on the default port 22
sshscan host
#specify port explicitly
sshscan -p 22222 hostFor JSON-formatted output simply add the --json or -j flag:
sshscan --json hostBSD 3-Clause License