Reference for Snort 3 protocol-specific service inspectors: industrial/OT protocols, email, network services, and threat detection inspectors with configuration and rule examples.
Snort 3 ships with service inspectors for dozens of protocols beyond HTTP. Each inspector decodes its protocol, normalizes the data for the detection engine, and provides protocol-specific IPS rule options so rules do not need raw byte-level decoding.
Modbus is a SCADA protocol typically carried over TCP port 502 (Modbus TCP). The inspector decodes the Modbus Application Protocol (MBAP) header and provides rule options to match on specific function codes, unit IDs, and raw PDU data without writing complex content/byte_test chains.
Configuration
Rule options
Example rules
binder ={ { when = { proto = 'tcp', ports = '502' }, use = { type = 'modbus' }, },}modbus = { }
Option
Description
modbus_data
Sets the cursor to the start of the Modbus PDU data
modbus_func
Matches a specific Modbus function code
modbus_unit
Matches a specific Modbus unit identifier
# Alert on any Modbus write multiple registers (function 16 = 0x10)alert tcp any any -> any 502 ( msg:"Modbus write multiple registers"; flow:to_server, established; modbus_func:16; sid:1000;)# Inspect raw Modbus PDU dataalert tcp any any -> any 502 ( msg:"Modbus suspicious payload"; flow:to_server, established; modbus_data; content:"|01 83|", depth 2; sid:1001;)
DNP3 (Distributed Network Protocol 3) is used in electric utilities and water treatment facilities. Snort 3 supports DNP3 over TCP (default port 20000) and UDP. The inspector reassembles transport-layer fragments into application-layer PDUs before presenting them to the detection engine.
Configuration
Rule options
Example rules
binder ={ { when = { proto = 'tcp', ports = '20000' }, use = { type = 'dnp3' }, },}dnp3 = { }
Option
Description
dnp3_data
Sets the cursor to the start of the DNP3 application data
dnp3_func
Matches a specific DNP3 function code
dnp3_ind
Matches DNP3 internal indication flags
dnp3_obj
Matches DNP3 object group and variation
# DNP3 function code in rule header (service-based rule)alert dnp3 any any -> any any ( msg:"DNP3 traffic detected"; dnp3_data; sid:2000;)# Match on specific DNP3 function codealert tcp any any -> any 20000 ( msg:"DNP3 direct operate command"; flow:to_server, established; dnp3_func:3; sid:2001;)
IEC 60870-5-104 is a telecontrol protocol for sending messages between control stations and substations, typically on TCP port 2404. The inspector decodes APDU/APCI/ASDU structures and provides rule options that avoid the need to manually check control field bits.
Configuration
Rule options
Example rules
binder ={ { when = { proto = 'tcp', ports = '2404' }, use = { type = 'iec104' }, },}iec104 = { }
Option
Description
iec104_apci_type
Matches the APCI type (i, S, or unnumbered_control_function)
iec104_asdu_func
Matches the ASDU function code by name or lowercase name
# Match on Information Transfer (Type I) APCIalert tcp any any -> any 2404 ( msg:"IEC104 Information Transfer APCI"; flow:established; iec104_apci_type:i; sid:3000;)# Match on M_SP_NA_1 (single-point information, no time tag)alert tcp any any -> any 2404 ( msg:"IEC104 M_SP_NA_1 ASDU function"; flow:established; iec104_asdu_func:M_SP_NA_1; sid:3001;)
S7comm-Plus is the protocol used by Siemens Simatic S7 PLCs (S7-1200 and S7-1500 series). The inspector decodes S7comm-Plus PDUs and provides rule options for opcode, function code, and raw content matching.
binder ={ { when = { proto = 'tcp', ports = '102' }, use = { type = 's7commplus' }, },}s7commplus = { }
OPC Unified Architecture is a platform-independent industrial protocol maintained by the OPC Foundation. Unlike most protocols, OPC UA does not define a fixed port. The inspector uses the wizard for service identification.
Configuration
Rule options
Example rules
wizard = { curses = { 'opcua' }, }opcua = { }binder ={ { when = { service = 'opcua' }, use = { type = 'opcua' } }, { use = { type = 'wizard' } },}
Option
Description
opcua_msg_type
Matches the message type (HEL, ACK, ERR, RHE, OPN, MSG, CLO)
opcua_msg_service
Matches a named OPC Foundation service (e.g., BrowseRequest)
Manufacturing Message Specification (MMS) is part of the IEC 61850 family, used in power system automation. It runs over OSI layers (TPKT, COTP, Session, Presentation, ACSE) on TCP port 102. The inspector decodes all encapsulating layers and presents the MMS PDU directly to rule options.
Configuration
Rule options
Example rules
wizard = { curses = { 'mms' }, }mms = { }binder ={ { when = { service = 'mms' }, use = { type = 'mms' } }, { use = { type = 'wizard' } },}
Option
Description
mms_data
Sets the cursor to the start of the MMS PDU, bypassing all OSI layers
mms_func
Matches a Confirmed Service Request/Response by name or function number
The SMTP inspector examines SMTP connections for commands and responses, extracts MIME attachments, identifies TLS negotiation, and can log sender addresses, recipient addresses, attachment filenames, and email headers.
The normalize option accepts all, none, or cmds. When set to cmds, only commands listed in normalize_cmds are normalized (extra whitespace is collapsed).xlink2state detects CVE-2005-0560 (Exchange X-LINK2STATE heap overflow): alert, drop, or disable.MIME decoding depth options (per attachment): set to 0 to disable, -1 for unlimited:
The IMAP inspector handles IMAP4 protocol and the POP inspector handles POP3. Both extract and decode MIME attachments for file inspection rules.
Configuration
Example rules
binder ={ { { when = { proto = 'tcp', ports = '110' }, use = { type = 'pop' } }, { when = { proto = 'tcp', ports = '143' }, use = { type = 'imap' } }, },}imap ={ qp_decode_depth = 500, b64_decode_depth = -1,}pop ={ qp_decode_depth = -1, b64_decode_depth = 3000,}
All four MIME depth options (b64_decode_depth, qp_decode_depth, bitenc_decode_depth, uu_decode_depth) are shared with SMTP. Set to 0 to disable, -1 for unlimited. The limit applies per attachment.
# Detect malware in IMAP attachmentalert imap ( msg:"Suspicious file in IMAP attachment"; flow:established; file_data; content:"|4D 5A|", depth 2; -- MZ header (Windows PE) sid:7000;)# Detect obfuscated JS delivered via POP3alert pop ( msg:"Obfuscated JS in POP3 mail"; js_data; content:"eval"; sid:7001;)
The FTP inspector splits FTP handling into three separate modules: ftp_server (server command/response parsing), ftp_client (client-side response parsing), and ftp_data (data channel file inspection).
DCE/RPC is used for Windows inter-process communication (MSRPC, SMB named pipes). Attackers commonly use DCE/RPC fragmentation to evade IDS/IPS rules. The DCE/RPC inspector performs SMB desegmentation and DCE/RPC defragmentation, eliminating these evasion techniques.In Snort 3, the Snort 2 DCE/RPC preprocessor is split into three transport-specific inspectors: dce_smb, dce_tcp, and dce_udp.
Configuration
Target-based policy
SMB file inspection
Rule options
Example rules
binder ={ { when = { proto = 'tcp', ports = '139 445 1025' }, use = { type = 'dce_smb' }, }, { when = { proto = 'tcp', ports = '135 2103' }, use = { type = 'dce_tcp' }, }, { when = { proto = 'udp', ports = '1030' }, use = { type = 'dce_udp' }, },}dce_smb = { }dce_tcp = { }dce_udp = { }
Each inspector can be tuned to the behavior of a specific OS/Samba version:
Match on a DCE/RPC interface UUID, optionally with version and fragment constraints
dce_opnum
Match on a DCE/RPC operation number or range
dce_stub_data
Set cursor to the start of the DCE/RPC stub data
byte_test: ..., dce
Byte test with endianness derived from the DCE/RPC header
byte_jump: ..., dce
Byte jump with endianness derived from the DCE/RPC header
# Match on Messenger service interface UUIDalert tcp any any -> any any ( msg:"DCE/RPC Messenger interface bind"; flow:to_server, established; dce_iface:5a7b91f8-ff00-11d0-a9b2-00c04fb6e6fc; dce_opnum:1; dce_stub_data; content:"|00 00|", depth 2; sid:8000;)# Byte test using DCE/RPC endiannessalert tcp any any -> any any ( msg:"DCE/RPC suspicious length field"; flow:to_server, established; dce_iface:4b324fc8-1670-01d3-1278-5a47bf6ee188; dce_opnum:15-18; dce_stub_data; byte_test:4,>,35000,0,relative,dce; sid:8001;)
dce_iface automatically inserts a fast pattern into the MPSE. For TCP rules it inserts |05 00 00| (to_server) or |05 00 02| (to_client). For UDP rules it inserts the interface UUID in both endian forms.
The SIP inspector handles VoIP Session Initiation Protocol traffic. It parses SIP messages (INVITE, REGISTER, BYE, etc.) and tracks call state. AppID subscribes to SIP events to identify VoIP applications.
binder ={ { when = { proto = 'udp', ports = '5060' }, use = { type = 'sip' } }, { when = { proto = 'tcp', ports = '5060' }, use = { type = 'sip' } },}sip = { }
The SOCKS inspector decodes SOCKS4/4a and SOCKS5 proxy handshakes, extracts tunnel metadata (target address, port, command type), and hands off tunneled traffic to the wizard for protocol identification.
wizard = { curses = { 'socks' }, }socks = { }binder ={ { when = { service = 'socks' }, use = { type = 'socks' } }, { use = { type = 'wizard' } },}
The port_scan inspector (IT_PROBE type) detects network reconnaissance by tracking negative responses (ICMP unreachables, TCP RSTs) and connection patterns. It runs after detection.port_scan detects:
Portscan types (one-to-one)
TCP, UDP, and IP portscans: one host scanning multiple ports on another host.
Filtered variants: no ICMP unreachable or TCP RST responses (common behind firewalls).
Decoy portscans
TCP, UDP, IP Decoy: real scanner address mixed with spoofed source addresses.
Distributed portscans (many-to-one)
Multiple hosts scanning a single target. Detected by tracking the scanned host rather than scanning hosts.
Portsweeps (one-to-many)
One host scanning the same port across many hosts. Typical exploit propagation behavior.
Also available for ICMP.
Sensitivity levels:
port_scan = default_low_port_scan -- error packets only; fewest false positivesport_scan = default_med_port_scan -- tracks connection counts; may false positive on NATsport_scan = default_high_port_scan -- continuous tracking; most sensitive, needs tuning
The back_orifice inspector (IT_NETWORK type) detects the Back Orifice remote access trojan. It analyzes UDP traffic for Back Orifice server detection packets.
back_orifice = { }
This inspector does not require stream tracking and fires on raw network packets.