Copy docs into Zeek repo directly

This is based on commit 2731def9159247e6da8a3191783c89683363689c from the
zeek-docs repo.
This commit is contained in:
Tim Wojtulewicz 2025-09-15 15:52:18 -07:00
parent 83f1e74643
commit ded98cd373
1074 changed files with 169319 additions and 0 deletions

View file

@ -0,0 +1,14 @@
:tocdepth: 3
base/protocols/modbus/__load__.zeek
===================================
:Imports: :doc:`base/protocols/modbus/consts.zeek </scripts/base/protocols/modbus/consts.zeek>`, :doc:`base/protocols/modbus/main.zeek </scripts/base/protocols/modbus/main.zeek>`
Summary
~~~~~~~
Detailed Interface
~~~~~~~~~~~~~~~~~~

View file

@ -0,0 +1,94 @@
:tocdepth: 3
base/protocols/modbus/consts.zeek
=================================
.. zeek:namespace:: Modbus
:Namespace: Modbus
Summary
~~~~~~~
Redefinable Options
###################
======================================================================================================================== =======================================
:zeek:id:`Modbus::exception_codes`: :zeek:type:`table` :zeek:attr:`&default` = :zeek:type:`function` :zeek:attr:`&redef`
:zeek:id:`Modbus::function_codes`: :zeek:type:`table` :zeek:attr:`&default` = :zeek:type:`function` :zeek:attr:`&redef` Standard defined Modbus function codes.
======================================================================================================================== =======================================
Detailed Interface
~~~~~~~~~~~~~~~~~~
Redefinable Options
###################
.. zeek:id:: Modbus::exception_codes
:source-code: base/protocols/modbus/consts.zeek 43 43
:Type: :zeek:type:`table` [:zeek:type:`count`] of :zeek:type:`string`
:Attributes: :zeek:attr:`&default` = :zeek:type:`function` :zeek:attr:`&redef`
:Default:
::
{
[2] = "ILLEGAL_DATA_ADDRESS",
[8] = "MEMORY_PARITY_ERROR",
[11] = "GATEWAY_TARGET_DEVICE_FAILED_TO_RESPOND",
[5] = "ACKNOWLEDGE",
[3] = "ILLEGAL_DATA_VALUE",
[10] = "GATEWAY_PATH_UNAVAILABLE",
[6] = "SLAVE_DEVICE_BUSY",
[4] = "SLAVE_DEVICE_FAILURE",
[1] = "ILLEGAL_FUNCTION"
}
.. zeek:id:: Modbus::function_codes
:source-code: base/protocols/modbus/consts.zeek 6 6
:Type: :zeek:type:`table` [:zeek:type:`count`] of :zeek:type:`string`
:Attributes: :zeek:attr:`&default` = :zeek:type:`function` :zeek:attr:`&redef`
:Default:
::
{
[40] = "PROGRAM_CONCEPT",
[19] = "RESET_COMM_LINK_884_U84",
[20] = "READ_FILE_RECORD",
[15] = "WRITE_MULTIPLE_COILS",
[6] = "WRITE_SINGLE_REGISTER",
[14] = "POLL_584_984",
[125] = "FIRMWARE_REPLACEMENT",
[8] = "DIAGNOSTICS",
[23] = "READ_WRITE_MULTIPLE_REGISTERS",
[91] = "OBJECT_MESSAGING",
[9] = "PROGRAM_484",
[7] = "READ_EXCEPTION_STATUS",
[127] = "REPORT_LOCAL_ADDRESS",
[21] = "WRITE_FILE_RECORD",
[10] = "POLL_484",
[4] = "READ_INPUT_REGISTERS",
[13] = "PROGRAM_584_984",
[12] = "GET_COMM_EVENT_LOG",
[41] = "MULTIPLE_FUNCTION_CODES",
[17] = "REPORT_SLAVE_ID",
[2] = "READ_DISCRETE_INPUTS",
[16] = "WRITE_MULTIPLE_REGISTERS",
[24] = "READ_FIFO_QUEUE",
[90] = "PROGRAM_UNITY",
[1] = "READ_COILS",
[11] = "GET_COMM_EVENT_COUNTER",
[5] = "WRITE_SINGLE_COIL",
[126] = "PROGRAM_584_984_2",
[22] = "MASK_WRITE_REGISTER",
[43] = "ENCAP_INTERFACE_TRANSPORT",
[18] = "PROGRAM_884_U84",
[3] = "READ_HOLDING_REGISTERS"
}
Standard defined Modbus function codes.

View file

@ -0,0 +1,17 @@
:orphan:
Package: base/protocols/modbus
==============================
Support for Modbus protocol analysis.
:doc:`/scripts/base/protocols/modbus/__load__.zeek`
:doc:`/scripts/base/protocols/modbus/consts.zeek`
:doc:`/scripts/base/protocols/modbus/main.zeek`
Base Modbus analysis script.

View file

@ -0,0 +1,122 @@
:tocdepth: 3
base/protocols/modbus/main.zeek
===============================
.. zeek:namespace:: Modbus
Base Modbus analysis script.
:Namespace: Modbus
:Imports: :doc:`base/protocols/modbus/consts.zeek </scripts/base/protocols/modbus/consts.zeek>`
Summary
~~~~~~~
Types
#####
============================================== =
:zeek:type:`Modbus::Info`: :zeek:type:`record`
============================================== =
Redefinitions
#############
==================================================================== ==========================================================
:zeek:type:`Log::ID`: :zeek:type:`enum`
* :zeek:enum:`Modbus::LOG`
:zeek:type:`connection`: :zeek:type:`record`
:New Fields: :zeek:type:`connection`
modbus: :zeek:type:`Modbus::Info` :zeek:attr:`&optional`
:zeek:id:`likely_server_ports`: :zeek:type:`set` :zeek:attr:`&redef`
==================================================================== ==========================================================
Events
######
================================================= ===================================================================
:zeek:id:`Modbus::log_modbus`: :zeek:type:`event` Event that can be handled to access the Modbus record as it is sent
on to the logging framework.
================================================= ===================================================================
Hooks
#####
=========================================================== =
:zeek:id:`Modbus::log_policy`: :zeek:type:`Log::PolicyHook`
=========================================================== =
Detailed Interface
~~~~~~~~~~~~~~~~~~
Types
#####
.. zeek:type:: Modbus::Info
:source-code: base/protocols/modbus/main.zeek 12 29
:Type: :zeek:type:`record`
.. zeek:field:: ts :zeek:type:`time` :zeek:attr:`&log`
Time of the request.
.. zeek:field:: uid :zeek:type:`string` :zeek:attr:`&log`
Unique identifier for the connection.
.. zeek:field:: id :zeek:type:`conn_id` :zeek:attr:`&log`
Identifier for the connection.
.. zeek:field:: tid :zeek:type:`count` :zeek:attr:`&log` :zeek:attr:`&optional`
Modbus transaction ID
.. zeek:field:: unit :zeek:type:`count` :zeek:attr:`&log` :zeek:attr:`&optional`
The terminal unit identifier for the message
.. zeek:field:: func :zeek:type:`string` :zeek:attr:`&log` :zeek:attr:`&optional`
The name of the function message that was sent.
.. zeek:field:: pdu_type :zeek:type:`string` :zeek:attr:`&log` :zeek:attr:`&optional`
Whether this PDU was a response ("RESP") or request ("REQ")
.. zeek:field:: exception :zeek:type:`string` :zeek:attr:`&log` :zeek:attr:`&optional`
The exception if the response was a failure.
.. zeek:field:: track_address :zeek:type:`count` :zeek:attr:`&default` = ``0`` :zeek:attr:`&optional`
(present if :doc:`/scripts/policy/protocols/modbus/track-memmap.zeek` is loaded)
Events
######
.. zeek:id:: Modbus::log_modbus
:source-code: base/protocols/modbus/main.zeek 33 33
:Type: :zeek:type:`event` (rec: :zeek:type:`Modbus::Info`)
Event that can be handled to access the Modbus record as it is sent
on to the logging framework.
Hooks
#####
.. zeek:id:: Modbus::log_policy
:source-code: base/protocols/modbus/main.zeek 10 10
:Type: :zeek:type:`Log::PolicyHook`