zgrab2/zmodules/ssh.go

39 lines
1.1 KiB
Go
Raw Normal View History

package zmodules
import (
log "github.com/sirupsen/logrus"
"github.com/zmap/zgrab2/zgrab2"
)
2017-08-10 19:10:34 +00:00
type SSHModule struct {
2017-08-09 20:13:18 +00:00
zgrab2.BaseModule
Client string `long:"client" description:"Mimic behavior of a specific SSH client"`
KexAlgorithms string `long:"kex-algorithms" description:"Set SSH Key Exchange Algorithms"`
HostKeyAlgorithms string `long:"host-key-algorithms" description:"Set SSH Host Key Algorithms"`
NegativeOne bool `long:"negative-one" description:"Set SSH DH kex value to -1 in the selected group"`
}
func init() {
2017-08-10 19:10:34 +00:00
var sshModule SSHModule
cmd, err := zgrab2.AddCommand("ssh", "SSH Banner Grab", "Grab a banner over SSH", &sshModule)
if err != nil {
log.Fatal(err)
}
2017-08-10 19:10:34 +00:00
sshModule.SetDefaultPortAndName(cmd, uint(22), "ssh")
}
// per module per routine initialization call
2017-08-10 19:10:34 +00:00
func (x SSHModule) PerRoutineInitialize() {
}
2017-08-10 19:10:34 +00:00
// Execute validates the options sent to SSHModule and then passes operation back to main
func (x *SSHModule) Validate(args []string) error {
zgrab2.RegisterLookup(x.Name, *x)
return nil
}
2017-08-10 19:10:34 +00:00
func (x SSHModule) Scan() (interface{}, error) {
return x, nil
}