Documentation
¶
Index ¶
- func RegisterModule()
- type Connection
- type Flags
- type Module
- type ScanResults
- type Scanner
- func (scanner *Scanner) GetDialerGroupConfig() *zgrab2.DialerGroupConfig
- func (s *Scanner) GetName() string
- func (s *Scanner) GetTrigger() string
- func (s *Scanner) Init(flags zgrab2.ScanFlags) error
- func (s *Scanner) InitPerSender(senderID int) error
- func (s *Scanner) Protocol() string
- func (s *Scanner) Scan(ctx context.Context, dialGroup *zgrab2.DialerGroup, t *zgrab2.ScanTarget) (status zgrab2.ScanStatus, result any, thrown error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Connection ¶
type Connection struct {
// contains filtered or unexported fields
}
Connection holds the state for a single connection to the MQTT server.
func (*Connection) ReadMQTTv3Packet ¶
func (mqtt *Connection) ReadMQTTv3Packet() error
ReadMQTTv3Packet reads and parses the CONNACK packet from the server.
func (*Connection) ReadMQTTv5Packet ¶
func (mqtt *Connection) ReadMQTTv5Packet() error
ReadMQTTv5Packet reads and parses the CONNACK or DISCONNECT packet from the server for MQTT v5.0.
func (*Connection) SendMQTTConnectPacket ¶
func (mqtt *Connection) SendMQTTConnectPacket(v5 bool) error
SendMQTTConnectPacket constructs and sends an MQTT CONNECT packet to the server.
type Flags ¶
type Flags struct {
zgrab2.BaseFlags
zgrab2.TLSFlags
Verbose bool `long:"verbose" description:"More verbose logging, include debug fields in the scan results"`
V5 bool `long:"v5" description:"Scanning MQTT v5.0. Otherwise scanning MQTT v3.1.1"`
UseTLS bool `long:"tls" description:"Use TLS for the MQTT connection"`
}
Flags are the MQTT-specific command-line flags.
type Module ¶
type Module struct {
}
Module implements the zgrab2.Module interface.
func (*Module) Description ¶
Description returns an overview of this module.
func (*Module) NewFlags ¶
func (m *Module) NewFlags() interface{}
NewFlags returns the default flags object to be filled in with the command-line arguments.
func (*Module) NewScanner ¶
NewScanner returns a new Scanner instance.
type ScanResults ¶
type ScanResults struct {
SessionPresent bool `json:"session_present,omitempty"`
ConnectReturnCode byte `json:"connect_return_code,omitempty"`
Response string `json:"response,omitempty"`
TLSLog *zgrab2.TLSLog `json:"tls,omitempty"`
}
ScanResults is the output of the scan.
type Scanner ¶
type Scanner struct {
// contains filtered or unexported fields
}
Scanner implements the zgrab2.Scanner interface, and holds the state for a single scan.
func (*Scanner) GetDialerGroupConfig ¶
func (scanner *Scanner) GetDialerGroupConfig() *zgrab2.DialerGroupConfig
func (*Scanner) GetTrigger ¶
GetTrigger returns the Trigger defined in the Flags.
func (*Scanner) InitPerSender ¶
InitPerSender does nothing in this module.
func (*Scanner) Scan ¶
func (s *Scanner) Scan(ctx context.Context, dialGroup *zgrab2.DialerGroup, t *zgrab2.ScanTarget) (status zgrab2.ScanStatus, result any, thrown error)
Scan performs the configured scan on the MQTT server.