Documentation
¶
Overview ¶
Package unitronics implements service detection for Unitronics PCOM protocol.
Detection Strategy: 1. Send PCOM/TCP ASCII ID command to port 20256 2. Validate response structure and protocol mode 3. Extract device model, HW version, and OS version from response 4. Map model code to known PLC model names 5. Generate CPE from normalized model and OS version
PCOM/TCP Protocol: - 6-byte TCP header (transaction ID, mode, length) - ASCII mode (0x65) payload with STX/ETX framing - ID command returns model code, HW version, and OS version
Version Detection: - Model code (6 hex chars) identifies PLC model - OS version (major.minor.build format) - HW version (1 hex char)
CPE Generation: - Vendor: unitronics - Product: Normalized model name (lowercase, underscores) - Version: OS version in major.minor.build format
Index ¶
Constants ¶
const ( PCOM = "pcom" DEFAULT_PORT = 20256 TCP_HEADER_LENGTH = 6 ASCII_MODE = 0x65 BINARY_MODE = 0x66 STX_ASCII = 0x2F // '/' ETX_ASCII = 0x0D // '\r' RESPONSE_INDICATOR = 0x41 // 'A' MIN_RESPONSE_LENGTH = 13 // 6-byte header + 7-byte minimum ASCII payload ("/A00ID" prefix) )
Protocol constants
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PCOMPlugin ¶
type PCOMPlugin struct{}
PCOMPlugin implements the Plugin interface for PCOM fingerprinting
func (*PCOMPlugin) Name ¶
func (p *PCOMPlugin) Name() string
Name returns the protocol name for PCOM
func (*PCOMPlugin) PortPriority ¶
func (p *PCOMPlugin) PortPriority(port uint16) bool
PortPriority returns true if the port is the default PCOM port (20256)
func (*PCOMPlugin) Priority ¶
func (p *PCOMPlugin) Priority() int
Priority returns the execution priority (400 = ICS/SCADA priority)
func (*PCOMPlugin) Run ¶
func (p *PCOMPlugin) Run(conn net.Conn, timeout time.Duration, target plugins.Target) (*plugins.Service, error)
Run executes the PCOM fingerprinting logic
func (*PCOMPlugin) Type ¶
func (p *PCOMPlugin) Type() plugins.Protocol
Type returns the protocol type (TCP)