zgrab2/modules/ssh.go

63 lines
1.4 KiB
Go
Raw Normal View History

2017-10-04 15:20:17 +00:00
package modules
import (
log "github.com/sirupsen/logrus"
"github.com/zmap/zgrab2"
)
2017-09-26 18:02:27 +00:00
type SSHFlags struct {
zgrab2.BaseFlags
2017-08-30 19:39:25 +00:00
ClientID string `long:"client" description:"Specify the client ID string to use" default:"SSH-2.0-Go"`
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"`
}
2017-09-26 18:02:27 +00:00
type SSHModule struct {
}
type SSHScanner struct {
config *SSHFlags
2017-09-26 18:02:27 +00:00
}
func init() {
2017-08-10 19:10:34 +00:00
var sshModule SSHModule
2017-09-26 18:02:27 +00:00
_, err := zgrab2.AddCommand("ssh", "SSH Banner Grab", "Grab a banner over SSH", 22, &sshModule)
if err != nil {
log.Fatal(err)
}
}
func (m *SSHModule) NewFlags() interface{} {
2017-09-26 18:02:27 +00:00
return new(SSHFlags)
}
func (m *SSHModule) NewScanner() zgrab2.Scanner {
2017-09-26 18:02:27 +00:00
return new(SSHScanner)
}
2017-09-26 18:02:27 +00:00
func (f *SSHFlags) Validate(args []string) error {
return nil
}
2017-09-26 18:02:27 +00:00
func (f *SSHFlags) Help() string {
return ""
}
func (s *SSHScanner) Init(flags zgrab2.ScanFlags) error {
f, _ := flags.(*SSHFlags)
s.config = f
2017-09-26 18:02:27 +00:00
return nil
}
2017-09-26 18:02:27 +00:00
func (s *SSHScanner) InitPerSender(senderID int) error {
return nil
}
2017-09-26 18:02:27 +00:00
func (s *SSHScanner) GetName() string {
return s.config.Name
2017-09-26 18:02:27 +00:00
}
func (s *SSHScanner) Scan(t zgrab2.ScanTarget, port uint) (interface{}, error) {
return nil, nil
}