Documentation
¶
Overview ¶
Package smb provides a zgrab2 module that scans for smb. This was ported directly from zgrab.
Index ¶
- func RegisterModule()
- type Flags
- type Module
- 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 ¶
This section is empty.
Functions ¶
Types ¶
type Flags ¶
type Flags struct {
zgrab2.BaseFlags `group:"Basic Options"`
// SetupSession tells the client to continue the handshake up to the point where credentials would be needed.
SetupSession bool `long:"setup-session" description:"After getting the response from the negotiation request, send a setup session packet."`
}
Flags holds the command-line configuration for the smb scan module. Populated by the framework.
type Module ¶
type Module struct {
}
Module implements 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 instance.
type Scanner ¶
type Scanner struct {
// contains filtered or unexported fields
}
Scanner implements 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)
Scan performs the following:
- Connect to the TCP port (default 445).
- Send a negotiation packet with the default values: Dialects = { DialectSmb_2_1 }, SecurityMode = SecurityModeSigningEnabled
- Read response from server; on failure, exit with log = nil. If the server returns a protocol ID indicating support for version 1, set smbv1_support = true Pull out the relevant information from the response packet
- If --setup-session is not set, exit with success.
- Send a setup session packet to the server with appropriate values
- Read the response from the server; on failure, exit with the log so far.
- Return the log.
Click to show internal directories.
Click to hide internal directories.