diff --git a/README.md b/README.md index 5e5bd79..1cdd133 100644 --- a/README.md +++ b/README.md @@ -1 +1,9 @@ # Network Emulation Framework for Industrial Control Systems (NEFICS) + +Bruh, I just copied the files from multiple projects that had dependencies and corrected some stuff that was wrong with the imports. +But maybe I'm just stoopid. + +## source +https://github.com/Cyphysecurity/IEC104_Parser + +https://github.com/Cyphysecurity/NEFICS diff --git a/commander.py b/commander.py index 4a9829e..22915f9 100644 --- a/commander.py +++ b/commander.py @@ -7,7 +7,7 @@ import scapy.all as scapy import netifaces as nic import ipaddress -from IEC104_Raw.dissector import APDU +from nefics.IEC104.dissector import APDU from iec104 import IEC104, get_command IEC104_PORT = 2404 diff --git a/launch_load.py b/launch_load.py index 33bd177..12b8cd0 100644 --- a/launch_load.py +++ b/launch_load.py @@ -4,8 +4,8 @@ import signal from threading import Thread from time import sleep -from rtu import Load, RTU_LOAD -from simcomm import SimulationHandler +from nefics.rtu import Load, RTU_LOAD +from nefics.simcomm import SimulationHandler if __name__ == '__main__': if sys.platform[:3] == 'win': diff --git a/launch_src.py b/launch_src.py index 0d481d7..9e78769 100644 --- a/launch_src.py +++ b/launch_src.py @@ -4,8 +4,8 @@ import signal from threading import Thread from time import sleep -from rtu import Source, RTU_SOURCE -from simcomm import SimulationHandler +from nefics.rtu import Source, RTU_SOURCE +from nefics.simcomm import SimulationHandler if __name__ == '__main__': if sys.platform[:3] == 'win': diff --git a/launch_tx.py b/launch_tx.py index ecbee1b..e43b87b 100644 --- a/launch_tx.py +++ b/launch_tx.py @@ -4,8 +4,8 @@ import signal from threading import Thread from time import sleep -from rtu import Transmission, RTU_TRANSMISSION -from simcomm import SimulationHandler +from nefics.rtu import Transmission, RTU_TRANSMISSION +from nefics.simcomm import SimulationHandler if __name__ == '__main__': if sys.platform[:3] == 'win': diff --git a/mitm.py b/mitm.py index 4bea496..2fe67f9 100644 --- a/mitm.py +++ b/mitm.py @@ -8,7 +8,7 @@ from hashlib import md5 from time import sleep import scapy.all as scapy -from IEC104_Raw.dissector import * +from nefics.IEC104_Raw.dissector import * def getMAC(ip: str, interface: str) -> str: ans, unans = scapy.srp(scapy.Ether(dst='ff:ff:ff:ff:ff:ff')/scapy.ARP(op=1, pdst=ip), iface=interface, verbose=0) diff --git a/nefics/helper104.py b/nefics/helper104.py index 76bb5cf..90947ab 100644 --- a/nefics/helper104.py +++ b/nefics/helper104.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 -from IEC104.dissector import ASDU, APCI, APDU -from IEC104.ioa import * +from nefics.IEC104.dissector import ASDU, APCI, APDU +from nefics.IEC104.ioa import * import time from datetime import datetime @@ -86,4 +86,4 @@ def testfr(actcon:bool=False) -> bytes: if __name__ == '__main__': print(build_104_asdu_packet(3, 1, 1003, 4, 3, 1, value=67)) print(build_104_asdu_packet(36, 2, 101, 4, 7, 1, value=54.3)) - print(build_104_asdu_packet(45, 3, 123, 2, 5, 1, SE=1, QU=1, SCS=0)) \ No newline at end of file + print(build_104_asdu_packet(45, 3, 123, 2, 5, 1, SE=1, QU=1, SCS=0)) diff --git a/nefics/rtu.py b/nefics/rtu.py index 5c83fdb..ddb79b3 100644 --- a/nefics/rtu.py +++ b/nefics/rtu.py @@ -7,9 +7,9 @@ from datetime import datetime from time import sleep from binascii import hexlify -from IEC104.dissector import APDU -from IEC104.const import * -from helper104 import * +from nefics.IEC104.dissector import APDU +from nefics.IEC104.const import * +from nefics.helper104 import * RTU_TYPES = [ # Supported RTU types 'SOURCE', diff --git a/nefics/simcomm.py b/nefics/simcomm.py index 6703d82..c442f5e 100644 --- a/nefics/simcomm.py +++ b/nefics/simcomm.py @@ -6,7 +6,7 @@ from time import sleep from struct import pack, unpack from threading import Thread -from rtu import RTU, RTU_SOURCE, RTU_TRANSMISSION, RTU_LOAD, RTU_TYPES +from nefics.rtu import RTU, RTU_SOURCE, RTU_TRANSMISSION, RTU_LOAD, RTU_TYPES if sys.platform[:3] == 'win': print('Intended to be executed in a mininet Linux environment.')