Documentation ¶
Overview ¶
Package mysql provides the mysql implementation of the zgrab2.Module. Grabs the HandshakePacket (or ERRPacket) that the server sends immediately upon connecting, and then if applicable negotiate an SSL connection.
Index ¶
- func RegisterModule()
- type Flags
- type Module
- type ScanResults
- type Scanner
- func (s *Scanner) GetName() string
- func (scanner *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(t zgrab2.ScanTarget) (status zgrab2.ScanStatus, result interface{}, thrown error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterModule ¶
func RegisterModule()
RegisterModule is called by modules/mysql.go to register the scanner.
Types ¶
type Flags ¶
type Flags struct { zgrab2.BaseFlags zgrab2.TLSFlags Verbose bool `long:"verbose" description:"More verbose logging, include debug fields in the scan results"` }
Flags give the command-line flags for the MySQL module.
type Module ¶
type Module struct { }
Module is the implementation of the zgrab2.Module interface.
func (*Module) Description ¶ added in v0.1.3
Description returns an overview of this module.
func (*Module) NewFlags ¶
func (m *Module) NewFlags() interface{}
NewFlags returns a new default flags object.
func (*Module) NewScanner ¶
NewScanner returns a new Scanner object.
type ScanResults ¶
type ScanResults struct { // ProtocolVersion is the 8-bit unsigned integer representing the // server's protocol version sent in the initial HandshakePacket from // the server. // This has been 10 for all MySQL versionssince 3.2.2 (from 1998). ProtocolVersion byte `json:"protocol_version"` // ServerVersion is a null-terminated string giving the specific // server version in the initial HandshakePacket. Often of the format // x.y.z, but not always. ServerVersion string `json:"server_version,omitempty"` // ConnectionID is the server's internal identifier for this client's // connection, sent in the initial HandshakePacket. ConnectionID uint32 `json:"connection_id,omitempty" zgrab:"debug"` // AuthPluginData is optional plugin-specific data, whose meaning // depends on the value of AuthPluginName. Returned in the initial // HandshakePacket. AuthPluginData []byte `json:"auth_plugin_data,omitempty" zgrab:"debug"` // CharacterSet is the identifier for the character set the server is // using. Returned in the initial HandshakePacket. CharacterSet byte `json:"character_set,omitempty" zgrab:"debug"` // StatusFlags is the set of status flags the server returned in the // initial HandshakePacket. Each true entry in the map corresponds to // a bit set to 1 in the flags, where the keys correspond to the // #defines in the MySQL docs. StatusFlags map[string]bool `json:"status_flags,omitempty"` // CapabilityFlags is the set of capability flags the server returned // initial HandshakePacket. Each true entry in the map corresponds to // a bit set to 1 in the flags, where the keys correspond to the // #defines in the MySQL docs. CapabilityFlags map[string]bool `json:"capability_flags,omitempty"` // AuthPluginName is the name of the authentication plugin, returned // in the initial HandshakePacket. AuthPluginName string `json:"auth_plugin_name,omitempty" zgrab:"debug"` // ErrorCode is only set if there is an error returned by the server, // for example if the scanner is not on the allowed hosts list. ErrorCode *int `json:"error_code,omitempty"` // ErrorID is the friendly name of the error code, if recognized. ErrorID string `json:"error_id,omitempty"` // ErrorMessage is an optional string describing the error. Only set // if there is an error. ErrorMessage string `json:"error_message,omitempty"` // RawPackets contains the base64 encoding of all packets sent and // received during the scan. RawPackets []string `json:"raw_packets,omitempty" zgrab:"debug"` // TLSLog contains the usual shared TLS logs. TLSLog *zgrab2.TLSLog `json:"tls,omitempty"` }
ScanResults contains detailed information about the scan.
type Scanner ¶
type Scanner struct {
// contains filtered or unexported fields
}
Scanner is the implementation of the zgrab2.Scanner interface.
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(t zgrab2.ScanTarget) (status zgrab2.ScanStatus, result interface{}, thrown error)
Scan probles the target for a MySQL server.
- Connects and waits to receive the handshake packet.
- If the server supports SSL, send an SSLRequest packet, then perform the standard TLS actions.
- Process and return the results.