Documentation ¶
Overview ¶
Package dnp3 provides a zgrab2 module that scans for dnp3. Default port: 20000 (TCP)
Copied unmodified from the original zgrab. Connects, and reads the banner. Returns the raw response.
Index ¶
- Constants
- func Crc16(bs []byte) (crc uint16)
- func GetDNP3Banner(logStruct *DNP3Log, connection net.Conn) (err error)
- func RegisterModule()
- type DNP3Log
- type Flags
- type Module
- type Scanner
- func (scanner *Scanner) GetName() string
- 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(target zgrab2.ScanTarget) (zgrab2.ScanStatus, interface{}, error)
Constants ¶
View Source
const ( LINK_MIN_HEADER_LENGTH = 10 // minimum link header length in bytes LINK_START_FIELD = 0x0564 // Pre-set 2-byte start field LINK_DIR_BIT = 1 // Direction bit LINK_PRM_BIT = 1 // Primary message bit LINK_FCB_BIT = 0 // Frame count bit LINK_FCV_BIT = 0 // Frame count valid bit LINK_BROADCAST_ADDRESS = 0x0001 // Broadcast address w/o mandatory application response LINK_UNCONFIRMED_USER_DATA_FC = 0x4 // don't require link layer response function code LINK_REQUEST_STATUS_FC = 0x9 // 4-bit function code for requesting link status LINK_STATUS_FC = 0xB // 4-bit response function code for link status FUNCTION_CODE_NOT_SUPPORTED = 0xF // Unsupported function code response TRANSPORT_START_SEQUENCE = 0x00 // starting sequence number for transport packet APP_START_SEQUENCE = 0x00 // starting sequence number for application packet APP_CON_BIT = 0 // no app acknowledgement APP_UNS_BIT = 0 // not an unsolicited response APP_FUNC_CODE_READ = 0x01 // 1-byte function code for reading APP_GROUP_0 = 0x00 // group 0 refers to all static data APP_GROUP_0_QUALIFIER = 0x00 // objects are packed without index prefix APP_GROUP_0_RANGE = 0x0000 // no range due to no qualifier APP_GROUP_0_SOFTWARE_VERSION = 0xF2 // group 0 attribute - device manufacturer's software version APP_GROUP_0_HARDWARE_VERSION = 0xF3 // group 0 attribute - device manufacturer's hardware version APP_GROUP_0_LOCATION = 0xF5 // group 0 attribute - device location APP_GROUP_0_DEVICE_ID = 0xF6 // group 0 attribute - device application id APP_GROUP_0_DEVICE_NAME = 0xF7 // group 0 attribute - device name APP_GROUP_0_SERIAL_NUMBER = 0xF8 // group 0 attribute - device manufacturer's serial number APP_GROUP_0_DNP3_SUBSET = 0xF9 // subset of the dnp3 protocol that is implemented APP_GROUP_0_PRODUCT_NAME = 0xFA // group 0 attribute - device manufacturer's product name and model APP_GROUP_0_ALL_ATTRIBUTES = 0xFE // get all available group 0 attributes in single response APP_GROUP_0_LIST_ATTRIBUTES = 0xFF // list available group 0 attributes )
DNP3 Flags
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Flags ¶
type Flags struct { zgrab2.BaseFlags // TODO: Support UDP? Verbose bool `long:"verbose" description:"More verbose logging, include debug fields in the scan results"` }
Flags holds the command-line configuration for the dnp3 scan module. Populated by the framework.
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 (module *Module) NewFlags() interface{}
NewFlags returns a default Flags object.
func (*Module) NewScanner ¶
func (module *Module) NewScanner() zgrab2.Scanner
NewScanner returns a new Scanner instance.
type Scanner ¶
type Scanner struct {
// contains filtered or unexported fields
}
Scanner implements the zgrab2.Scanner interface.
func (*Scanner) GetTrigger ¶
GetTrigger returns the Trigger defined in the Flags.
func (*Scanner) InitPerSender ¶
InitPerSender initializes the scanner for a given sender.
Click to show internal directories.
Click to hide internal directories.