All projects

The problem

Industrial devices expose values through registers and coils, but interpreting them requires the correct address notation, register type, byte order, word order and datatype. A successful connection alone does not prove that the value being read or written has been interpreted correctly.

The modbus project provides a command-line client for PLCs, VFDs, energy meters and RTUs. It combines protocol-aware operations, readable terminal output and machine-readable JSON so the same workflow can support an interactive lab session or a controlled automation script.

Architecture

  1. CLI or interactive shell

    Select a connection, operation, address range and datatype.

  2. Validation and conversion

    Resolve register notation, protocol limits, byte order and scale.

  3. pymodbus transport

    Use TCP, UDP, serial RTU/ASCII, or TLS according to the target.

  4. Simulator or authorized device

    Exchange protocol requests and responses within an approved scope.

Simplified request path. Responses are decoded into rich terminal output or JSON; diagnostics remain separate from machine-readable stdout.

Implementation

  • Read, scan and watch operations support inspecting register ranges and observing changes. Write, fill and restore operations can modify writable device state and must be treated differently from read-only inspection.
  • Datatype conversion covers integers, floating-point values and strings, with configurable byte order, word order and scaling. Standard register notation is converted to the underlying protocol offsets.
  • The client enforces documented function-code limits before sending requests and provides deterministic exit codes for usage errors, connection failures, protocol exceptions and timeouts.
  • An embedded TCP/UDP simulator provides changing sensor values for local experimentation. The interactive shell supports named connections and session settings, while JSON output supports scripted workflows.

Security takeaways

  • Traditional Modbus deployments should not be assumed to provide authentication or confidentiality. Network segmentation and access control remain important even when a client can successfully exchange requests.
  • Write, fill and restore operations can affect physical processes. Use the simulator first, define authorization and change boundaries, and do not treat an industrial production network as a test environment.
  • When TLS is used, verify the server certificate and protect client keys. An optional certificate-verification bypass is a diagnostic exception, not a secure deployment default.

Scope and limitations

A protocol client is not a complete OT security assessment. Device-specific register maps, safety constraints, operational approvals and the surrounding network architecture still determine what can be tested safely. No production-device assessment or certification is claimed by this case study.

Source references

Source review:

  • CRF & Embedded

    CC1101_DRIVER

    ESP-IDF C driver for CC1101 sub-GHz radio modules: set frequency, modulation and packet options, then send, receive or capture the demodulator output.

    Updated Source on GitHub

  • PythonNetworks

    RTSP_TO_HTTP

    HiveHack @ CyberSea challenge pipeline: find an RTSP camera, convert the stream to HLS with FFmpeg and play it over HTTP in a smart TV browser.

    Updated Source on GitHub

7SOULSeven Inch Soul