Code Monkey home page Code Monkey logo

cybics's Introduction

CybICS Logo

Understanding industrial Cybersecurity.


License KiBot C/C++ CI flawFinder C TruffleHog devContainer


The CybICS project is interesting for anyone who wants to delve into the world of industrial cybersecurity or deepen their knowledge.

Getting Started

First, read through this page to get a better understanding of the testbed setup.

CybICS

The complete CybICS testbed

Physical Process

For educational purpose, a very simple process has been chosen. The process represents a control loop, where the system needs a specific gas pressure. This pressure is achieved by a compressor from a gas storage tank (GST) compressing the gas in the high pressure tank (HPT) buffer. The gas is toxic and flammable. It will be released and burned via a mechanical blow-out valve, if there is a critical overpressure in the HPT.

All pressure values are in bar above normal atmospheric pressure.

Gas Storage Tank (GST)

The gas storage is used to buffer gas from the external gas supply. The pressure from the external gas supply can not be regulated. Only the fill level of the GST will be controlled by the PLC.

Pressure Description Range
<50 Low 0-49
<150 Normal 50-99
150+ Full 150-255

Controll Loop: The GST is kept between 60 and 240 with a simple control (Filling GST to GST < 240 when GST < 60). The compressor to fill up the HPT can only run if the GST is at least filled up to a normal filling level.

High Pressure Tank (HPT)

The high pressure tank is the tank that serves as a buffer for the system pressure. The measurement unit of the sensor is in bar.

Pressure Description Range
<1 Empty 0-0
<50 Low 1-49
<100 Normal 50-99
<150 High 100-149
150+ Critical 150-255

Controll Loop: The HPT is kept between 60 and 90 with a simple control. (Running compressor when HPT < 60 up to HPT < 90)

System

The system can be operated in the normal pressure range between 50 to 100 bar (HPT > 50 & HPT < 100). If the pressure is too low, the system can not operate. If the pressure if too high, the system can be damaged.

Blowout (BO)

The blowout valve is a mechanical valve. This is not operated by the PLC. It will open and release toxic gas if the HPT pressure is above 220 bar to prevent bursting of the HPT. The blowout will release the toxic gas, until it is again in a range below 200 bar (BO open when HPT > 220 until HPT > 200).

Hardware

The hardware is kept minimal and ready to order. (link)

Software

The software contains all necessary elements to setup the CybICS testbed. For development two VSCode devcontainers are available. One for the STM32 controller, which is simulating the physical process and another for all the software running on the Raspberry Pi. (link)

Component Description Running on
OpenPLC Programmable Logic Controller Raspberry Pi
FUXA Historian and HMI Raspberry Pi
Physical Process STM32

Fuxa and OpenPLC

For controlling the physical process, OpenPLC is used. This is an open source PLC, with an web interfce for programming and configuration. FUXA is used as an HMI and historian, with an web interface for the operator.

Training

This part of the repository offers an insight into possible learning and training units. On the one hand, these include basic knowledge about PLCs and physical processes, as well as cyber attacks link.

Abbreviations

Abbreviation Long Description
GST Gas Storage Tank
HPT High Pressure Tank
LED Light-emitting Diode
PCB Printed Circuit Board
PLC Programmable Logic Controller

cybics's People

Contributors

mniedermaier avatar manliebert avatar

Stargazers

Erwan Cordier avatar Rhinozerossola avatar  avatar Aditya waghaskar avatar  avatar  avatar  avatar  avatar  avatar  avatar Spucknapf avatar  avatar

Watchers

 avatar  avatar

Forkers

kabel-knrd

cybics's Issues

Fix bash warning "setlocale"

Warning message:
bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8) /bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)

Implement CTF flags into trainings.

For the trainings, there should be a flag, when the task was completed successfully.
Examples Ideas:

  • Flag in Modbus Messages
  • Flag in FUXA HMI
  • Flag in OpenPLC
  • Flag appears in FUXA, when Blowout was triggered
  • Flag to read from OPC UA

pigpio uninitialised after OpenPLC container restarts

The OpenPLC can not write outputs anymore if the OpenPLC Docker container restarts.

docker@MLB-T14s:/CybICS/software$ ssh pi@$DEVICE_IP sudo docker compose -f /home/pi/CybICS/docker-compose.yaml logs openplc -f
openplc-1  | cp: cannot stat '/workdir/webserver/dnp3_default.cfg': No such file or directory
openplc-1  | cp: cannot stat '/workdir/webserver/openplc_default.db': No such file or directory
openplc-1  | cp: cannot stat '/workdir/webserver/st_files_default/*': No such file or directory
openplc-1  | 2024-03-09 16:57:20 initMboxBlock: init mbox zaps failed
openplc-1  | WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
openplc-1  |  * Running on all addresses (0.0.0.0)
openplc-1  |  * Running on http://127.0.0.1:8080
openplc-1  |  * Running on http://172.19.0.2:8080
openplc-1  | Press CTRL+C to quit
openplc-1  | 2024-03-09 16:57:20 gpioSetMode: pigpio uninitialised, call gpioInitialise()
openplc-1  | 2024-03-09 16:57:20 gpioSetMode: pigpio uninitialised, call gpioInitialise()
openplc-1  | 2024-03-09 16:57:20 gpioSetMode: pigpio uninitialised, call gpioInitialise()
openplc-1  | 2024-03-09 16:57:20 gpioSetPullUpDown: pigpio uninitialised, call gpioInitialise()
openplc-1  | 2024-03-09 16:57:20 gpioSetMode: pigpio uninitialised, call gpioInitialise()
openplc-1  | 2024-03-09 16:57:20 gpioSetMode: pigpio uninitialised, call gpioInitialise()
openplc-1  | 2024-03-09 16:57:20 gpioSetMode: pigpio uninitialised, call gpioInitialise()
openplc-1  | 2024-03-09 16:57:20 gpioSetMode: pigpio uninitialised, call gpioInitialise()
openplc-1  | 2024-03-09 16:57:20 gpioRead: pigpio uninitialised, call gpioInitialise()

Create training session for Man-in-the-Middle attack

The attack should be a man-in-the-middle attack between the PLC and the HMI.
So the operator is tricked to see a normal behavior on the HMI, but in the real world something else is happening (e.g. too high pressure).

Tasks:

  • Create training content for a man-in-the-middle attack
  • Create python script for the attack
  • Redirect traffic between OpenPLC and FUXA
  • Manipulate registers in transit

./installRPI.sh failed "./install.sh: not found"

./installRPI.sh failed

Output:

=> ERROR [ 6/10] RUN export GNUMAKEFLAGS=-j$(nproc --all)     && alias make='make -j$(nproc --all)'     && ./install.sh docker                                                     0.3s
------                                                                                                                                                                                   
 > [ 6/10] RUN export GNUMAKEFLAGS=-j$(nproc --all)     && alias make='make -j$(nproc --all)'     && ./install.sh docker:
0.148 /bin/sh: 1: ./install.sh: not found
------
Dockerfile:16
--------------------
  15 |     WORKDIR /CybICS/OpenPLC_v3/
  16 | >>> RUN export GNUMAKEFLAGS=-j$(nproc --all) \
  17 | >>>     && alias make='make -j$(nproc --all)' \
  18 | >>>     && ./install.sh docker
  19 |     
--------------------
ERROR: failed to solve: process "/dev/.buildkit_qemu_emulator /bin/sh -c export GNUMAKEFLAGS=-j$(nproc --all)     && alias make='make -j$(nproc --all)'     && ./install.sh docker" did not complete successfully: exit code: 127

Put Raspberry Pi in Wi-Fi AP mode

To use the CybICS as a standalone device without Internet / existing Wi-Fi it should be in AP mode

  • Switch between station and AP mode e.g. with RaspAP
  • Unique WiFi Name, e.g. with STM serial number
  • DHCP

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.