Documentation
¶
Index ¶
- Variables
- func RegisterModule()
- type Flags
- type Module
- type Results
- type Scanner
- func (scanner *Scanner) GetDialerGroupConfig() *zgrab2.DialerGroupConfig
- func (scanner *Scanner) GetName() string
- func (scanner *Scanner) GetScanMetadata() any
- func (scanner *Scanner) GetTrigger() string
- func (scanner *Scanner) Init(flags zgrab2.ScanFlags) error
- func (scanner *Scanner) InitPerSender(senderID int) error
- func (scanner *Scanner) Protocol() string
- func (scanner *Scanner) Scan(ctx context.Context, dialGroup *zgrab2.DialerGroup, target *zgrab2.ScanTarget) (zgrab2.ScanStatus, any, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNoMatch = errors.New("pattern did not match")
Functions ¶
func RegisterModule ¶
func RegisterModule()
RegisterModule is called by modules/banner.go to register the scanner.
Types ¶
type Flags ¶
type Flags struct {
zgrab2.BaseFlags `group:"Basic Options"`
zgrab2.TLSFlags `group:"TLS Options"`
ReadTimeout int `long:"read-timeout" default:"10" description:"Read timeout in milliseconds"`
BufferSize int `long:"buffer-size" default:"8209" description:"Read buffer size in bytes"`
MaxReadSize int `long:"max-read-size" default:"512" description:"Maximum amount of data to read in KiB (1024 bytes)"`
Probe string `` /* 173-byte string literal not displayed */
ProbeFile string `long:"probe-file" description:"Read probe from file as byte array (hex). Mutually exclusive with --probe."`
Pattern string `long:"pattern" description:"Pattern to match, must be valid regexp."`
UseTLS bool `long:"tls" description:"Sends probe with TLS connection. Loads TLS module command options."`
MaxTries int `` /* 154-byte string literal not displayed */
Hex bool `long:"hex" description:"Store banner value in hex. Mutually exclusive with --base64."`
Base64 bool `long:"base64" description:"Store banner value in base64. Mutually exclusive with --hex."`
MD5 bool `long:"md5" description:"Calculate MD5 hash of banner value."`
SHA1 bool `long:"sha1" description:"Calculate SHA1 hash of banner value."`
SHA256 bool `long:"sha256" description:"Calculate SHA256 hash of banner value."`
}
Flags give the command-line flags for the banner 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) NewScanner ¶
NewScanner returns a new Scanner object.
type Results ¶
type Results struct {
Banner string `json:"banner,omitempty"`
Length int `json:"length,omitempty"`
TLSLog *zgrab2.TLSLog `json:"tls,omitempty"`
MD5 string `json:"md5,omitempty"`
SHA1 string `json:"sha1,omitempty"`
SHA256 string `json:"sha256,omitempty"`
}
ScanResults instances are returned by the module's Scan function.
type Scanner ¶
type Scanner struct {
// contains filtered or unexported fields
}
Scanner is the implementation of the zgrab2.Scanner interface.
func (*Scanner) GetDialerGroupConfig ¶ added in v0.2.0
func (scanner *Scanner) GetDialerGroupConfig() *zgrab2.DialerGroupConfig
func (*Scanner) GetScanMetadata ¶ added in v1.0.0
GetScanMetadata returns any metadata on the scan itself from this module.
func (*Scanner) GetTrigger ¶
GetTrigger returns the Trigger defined in the Flags.
func (*Scanner) InitPerSender ¶
InitPerSender initializes the scanner for a given sender.
func (*Scanner) Scan ¶
func (scanner *Scanner) Scan(ctx context.Context, dialGroup *zgrab2.DialerGroup, target *zgrab2.ScanTarget) (zgrab2.ScanStatus, any, error)
Click to show internal directories.
Click to hide internal directories.