sudo apt update
sudo apt install git -y
git clone https://github.com/thiagoralves/OpenPLC_v3.git
cd OpenPLC_v3
./install.sh linux
sudo ./start_openplc.sh
OpenPLC starts, and displays various addresses to view the Dashboard, as shown below.
Installing Sudo
If you are using a minimal Debian install, you may not have sudo. In that case, execute these commands. In the third one, replace username with the name of your normal user account, which may be "debian".
su root apt install sudo /sbin/adduser username sudo exit exit
Log in with username openplc and password openplc
The Dashboard appears, as shown below.
Click the "Add new device" button.
In the "Add new device" page, make these entries, as shown below.
Click the "Save device" button.
The Slave Device appears in the list, as shown below. On the lower left, click the "Start PLC" button.The Runtime Logs show that the server is listening on port 502, as shown below.
Your Windows system should already have qModMaster installed. If it does not, follow the steps in the blue box below.
Installing qModMaster
In a Web browser, go tohttps://sourceforge.net/projects/qmodmaster/Download the Windows pre-compiled binary.Open your Downloads folder.
Right-click the https://sourceforge.net/projects/qmodmaster/ file and click "Extract All...", Extract. Click Extract
Double-click the qModMaster folder to open it.
Double-click the qModMaster.exe file.
qModMaster opens, as shown below.
Enter the IP address of your Linux server, as shown below.
Click the OK button.
In the qModMaster window, set the Modbus Mode to TCP, outlined in red in the image below. In the qModMaster window, click the Connect button, outlined in blue in the image above.The data fills in in the lower pane, showing five zeroes.
https://www.wireshark.org/Launch Wireshark.
Double-click the adapter that goes to the Internet, which was Ethernet1 on my system, outlined in red in the image below.
Flag OT 101.1: Read Request (15 pts)
In QModMaster, read the five coils from the slave again.Wireshark shows four packets, as shown below: a Query, an Acknowledgement (ACK), a Response, and another Acknowledgement.
In the top pane, click the Response packet.
In the Details pane, expand the Modbus/TCP container.
The flag is covered by a green rectangle in the image below.
Posted 12-28-23
Updated with sudo install 2-10-24