mqtt

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 1, 2025 License: Apache-2.0, ISC Imports: 8 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterModule

func RegisterModule()

RegisterModule registers the MQTT zgrab2 module.

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

	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.

func (*Flags) Help

func (f *Flags) Help() string

Help returns this module's help string.

func (*Flags) Validate

func (f *Flags) Validate(_ []string) error

Validate flags

type Module

type Module struct {
}

Module implements the zgrab2.Module interface.

func (*Module) Description

func (m *Module) Description() string

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

func (m *Module) NewScanner() zgrab2.Scanner

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) GetName

func (scanner *Scanner) GetName() string

GetName returns the configured name for the Scanner.

func (*Scanner) GetScanMetadata added in v1.0.0

func (scanner *Scanner) GetScanMetadata() any

GetScanMetadata returns any metadata on the scan itself from this module.

func (*Scanner) GetTrigger

func (scanner *Scanner) GetTrigger() string

GetTrigger returns the Trigger defined in the Flags.

func (*Scanner) Init

func (scanner *Scanner) Init(flags zgrab2.ScanFlags) error

Init initializes the Scanner instance with the flags from the command line.

func (*Scanner) InitPerSender

func (scanner *Scanner) InitPerSender(senderID int) error

InitPerSender does nothing in this module.

func (*Scanner) Protocol

func (scanner *Scanner) Protocol() string

Protocol returns the protocol identifier for the scanner.

func (*Scanner) Scan

func (scanner *Scanner) Scan(ctx context.Context, dialGroup *zgrab2.DialerGroup, target *zgrab2.ScanTarget) (zgrab2.ScanStatus, any, error)

Scan performs the configured scan on the MQTT server.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL