This repository contains the supplementary materials for a thesis on the analysis of False Data Injection (FDI) attacks within a Digital Primary Substation (DPS). It focuses on the vulnerabilities of the IEC 61850 standard and the GOOSE communication protocol. The materials provided are intended to support the reproducibility and transparent auditing of the methodology, implementation, and results.
-
/ATTACKER: Contains files related to the C2_Delay attack. Important to recompile the fdi_goose.c when editing. -
/Analysis_Results: Contains Python scripts for analyzing the collected data. -
/PNG: Contains the output plots and charts generated by the analysis scripts. -
/icons: Contains icons used for the network topology diagram. -
/trials: Contains the raw network capture data (.pcapngfiles) from the experiments, organized into different scenarios. -
/C0_Baseline_meta.sh: Contains the script to compute the SHA256, check for duplicates, and add starting time that will output the metadata. -
Topology_draw.io: Contains the network topology used. -
autocapture_fixed.sh: Contains the script used to capture the network traffic for all the datasets -
packets_check.sh: Contains the script to check for duplicates within the PCAP files. -
Topology.drawio.pdf: A PDF of the network topology used in the simulation.
The experimental data is located in the /trials directory. The data is divided into three distinct scenarios, each containing multiple trial runs in .pcapng format.
C0_Baseline: Contains captures of normal network traffic, serving as a baseline for comparison.C1_FDI: Contains captures of traffic during a False Data Injection (FDI) attack.C2_Delay: Contains captures of traffic during a packet delay attack.C2_Delay:the fdi_goose.c program was modified to prompt the user to enter a numerical value. This file is added in theATTACKERfolder.
*.meta.json: A JSON file cataloging the.pcapngfiles for that scenario, including hashes and start times.pcap_to_csv.sh: A shell script to convert the.pcapngfiles into a single.csvfile for analysis.*.csv: The resulting CSV file from the conversion script.
./autocapture_fixed.sh C0_Baseline/Baseline01 baseline 120 DPSRS-eth5./autocapture_fixed.sh C0_Baseline/Baseline02 baseline 120 DPSRS-eth5./autocapture_fixed.sh C0_Baseline/Baseline03 baseline 120 DPSRS-eth5./autocapture_fixed.sh C0_Baseline/Baseline04 baseline 120 DPSRS-eth5./autocapture_fixed.sh C0_Baseline/Baseline05 baseline 120 DPSRS-eth5: this process must be repeated across ten runs per condition pointing to the location where the datasets can be stored.
- The analysis of the dataset is performed using the Python scripts in the
/Analysis_Resultsdirectory but first it must installed the.envenvironment. sudo apt-get install python3-venvpython3 -m venv venv: this command creates the venv directory to hold the virtual environment, and-mis the flag telling Python to run a module as a script such as venv module.source venv/bin/activate: now the environment must be activatepython3 per_run_analysis.py: this command must be run from the venv environment and the python file program must be located here. Once run it will create the 2d graphs for analysis.
- Data Conversion:
pcap_to_csv.shscript in each scenario directory should be run first to convert the raw.pcapngfiles into a.csvfile. This script usestsharkto extract relevant fields from the packet captures.python3 pcapng_csv.py '/home/luk3/Desktop/SGSim/C0_Baseline/Baseline01/baseline_DPSRS-eth5_20260123_220816.pcapng' output.csv
- Analysis Scripts:
Analysis_Results/analysis.py: This script loads the.csvfiles, performs data analysis, and generates several plots to visualize the results.Analysis_Results/pca_analysis.py: This script performs Principal Component Analysis (PCA) on the dataset.
- Analysis Output:
The plots generated by the analysis scripts are saved in the
/PNGdirectory. These include:
delay_analysis.pnggoose_value_distribution.pngpacket_frequency.pngpca_2d_plot.png
- The experiments were conducted in a simulated environment using SGSim.
- mininet
- sqlite3
- php-sqlite3
- tshark
- pandas
- numpy
- matplotlib.pyplot
- seaborn
Extract comlib_dps.zip and comlib_dss.zip in the same folder. (Note: these files can be found here: https://github.com/filipholik/SmartGridSim/blob/main/comlib_dps.zip).
sudo apt-get install mininetsudo apt-get install sqlite3sudo apt-get install php-sqlite3sudo apt-get install tshark
- Topology:
./StartSGTopology.sh - Available commands:
mininet> help(commands starting withsgsim_were added to Mininet, usehelpcommand for description) - GUI:
./GUI/StartGUI.sh - SCADA simulation: open web browser at
localhost:8000
sudo apt-install -y python3-venvpython -m venv venv: in your terminal, replacing "myenv" with your desired environment namesource venv/bin/activate: to activate the environmentpip install -U numpy pandas matplotlib seabornpython3 pca_analysis.py: run the script to load the datasets, explicitly defining frame.time as string to avoid parsing issues
sgsim_startcom_goose: starts the GOOSE communication between the IED1, IED4 and the DPS HMI.sgsim_attack_goose_fdi: starts the FDI attack from the attacker device inside the DPS.sgsim_startcom_sv: starts the SV communication between IED2, IED3 and the DPS HMI.sgsim_startperfmon: starts the IEC104 communication between the same devices, and timestamps to measure and list the delay, IPDV jitter, packet loss and threshold above 60 s measurement.sgsim_attack_dos: starts the DoS attack from the DSS1 RTU to the CONTROL device (assumes compromised RTU).
