Git Product home page Git Product logo

fortiphyd / grficsv2 Goto Github PK

View Code? Open in Web Editor NEW
382.0 21.0 70.0 195.63 MB

Version 2 of the Graphical Realism Framework for Industrial Control Simulation (GRFICS)

License: GNU General Public License v3.0

C++ 54.30% Makefile 0.44% Python 0.76% Shell 10.28% JavaScript 0.88% CSS 0.05% HTML 0.03% PHP 0.01% Dockerfile 0.03% C 19.58% Emacs Lisp 0.01% M4 0.39% Yacc 10.26% LLVM 2.26% Smalltalk 0.74%
ics-security plc-programming hmi cybersecurity industrial-automation

grficsv2's People

Contributors

anhilator avatar djformby avatar mrideout avatar nickfortiphyd avatar sam-bryce avatar thus0 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

grficsv2's Issues

Cannot connect to the PLC

Good afternoon,

I've set up everything according to your 2nd video and the system works up to a point.

What works:
-the Unity UI plant page
-the HMI page
-the VMs.

The part that doesn't work is the PLC. I'm getting a EADDRINUSE for port 8080 when running the sudo nodejs server.js command.

I suppose it has something to do with port 8080, but there's nothing else running in VirtualBox.
Screenshot 2023-10-22 193007

Usage of variables HMI_* in OpenPLC

Hi,

first of all, thanks for the great work ! I've managed to run GRFICSv2 with docker containers and I've used OpenPLCv3 instead of OpenPLCv2 as the web interface is nicer. The chemical plan seems to work : I can see the values on ScadaBR which match what I see on the Simulation. I can also change directly OpenPLC holding registers with modbus command to change the pressure_sp.

I have a question : what's the purpose of the variables hmi_* registers at %MWxx as ScadaBR seems to read %IWxx variables ?

https://github.com/Fortiphyd/GRFICSv2/blob/master/workstation_vm/simplified_te.st#L377

  hmi_pressure AT %MW20 : INT;
   hmi_level AT %MW21 : INT;
   hmi_f1_valve_pos AT %MW22 : INT;
   hmi_f1_flow AT %MW23 : INT;
   hmi_f2_valve_pos AT %MW24 : INT;
   hmi_f2_flow AT %MW25 : INT;
   hmi_purge_valve_pos AT %MW26 : INT;
   hmi_purge_flow AT %MW27 : INT;
   hmi_product_valve_pos AT %MW28 : INT;
   hmi_product_flow AT %MW29 : INT;
   scan_count AT %MW30 : UINT := 0;

Simulation VM (ChemicalPlant) network issue

I've imported VM with NAT interface selected as noticed in description. But I have only loopback interface with no Internet connetction to download all needful updates as mentioned in instruction. I tried to change /etc/network/interface but with no success

GRFICS info questions - host-only adapters and documentation

Hi,
first of all thanks for all your work and effort you're putting in such project, it is really a good resource for learning and practicing on ICS. i have only a few questions that i hope you can answer:

  • is it possible to change the networking architecture of the environment or it is constrained to the specified host-only network adapters?
  • are there more resourse/documentation on how to use and configure the framework besides the provided video tutorials? Or maybe also some already implemented framework use case?

Thanks,

Installation of pfSense stops

My installation of pfSense stops at the point shown below:

pfsense_install

  • Took the VMs from the manual
  • Network adapters are configured according to the manual
  • Restart after Network Configuration
  • Windows 10
  • Virtual Box 7.0

OpenPLC / libmodbus not supporting "Read Write Register" (0x17) function

According to the Usenix paper, a libmodbus version had been used for OpenPLC that is vulnerable to a buffer overflow. The buffer overflow can be verified by issuing an according "Read Registers" command that results in a service crash (or SIGSEGV under gdb). As the paper further mentions, the lesser-known "Read Write Register" function (code 0x17) has to be used to gain actual Remote Code Execution.

Unfortuantely, the Modbus service on the PLC returns an "Illegal Function" error, when using that function code, as can be seen from the pymodbus.console output:
image

and also under Wireshark:
image
image

Looking at the libmodbus code inside this repo (and also on the pre-built PLC VM), one can see that this function code is defined:
https://github.com/Fortiphyd/GRFICSv2/blob/master/plc_vm/OpenPLC_v2-master/libmodbus-3.0.4/src/modbus-private.h#L65

and that it should also be properly handled:
https://github.com/Fortiphyd/GRFICSv2/blob/master/plc_vm/OpenPLC_v2-master/libmodbus-3.0.4/src/modbus.c#L870

So, the code path for responding with an "Illegal Function" error should not be taken.

EDIT:
Taking another look at the PLC code base, I realized that the openplc gets linked against libmodbus, but actually uses its own Modbus implementation. The modbus.cpp does not contain a definition for function code 0x17 and also does not have the code implemented for handling it. Thus the message handling function defaults to the "Illegal Function" response.

The overflow still triggers for read requests, due to the modbus.cpp having been modified, accordingly: https://github.com/Fortiphyd/GRFICSv2/blob/master/plc_vm/OpenPLC_v2-master/core/modbus.cpp#L292

So, apparently, it would be required to also re-implement the "Read and Write Registers" function inside the modbus.cpp to gain code executioin.

Reset PLC

After uploading the attack.st file, what file needs to be uploaded to revert the PLC to normal operation?

What are these values ?

Hello,
inside at process simulation, what are these values ?

Inside at Unity 3D
A: 47%
B: 1%
C: 52%

Simulation in C++
A_in_purge
B_in_purge
C_in_purge

ScadaBR
AComp
BComp
CComp

PLC logs

Where can I find all the logs

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.