Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cleaned up some dependencies/imports #1

Open
wants to merge 21 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion commander.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions launch_load.py
Original file line number Diff line number Diff line change
Expand Up @@ -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':
Expand Down
4 changes: 2 additions & 2 deletions launch_src.py
Original file line number Diff line number Diff line change
Expand Up @@ -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':
Expand Down
4 changes: 2 additions & 2 deletions launch_tx.py
Original file line number Diff line number Diff line change
Expand Up @@ -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':
Expand Down
2 changes: 1 addition & 1 deletion mitm.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions nefics/helper104.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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))
print(build_104_asdu_packet(45, 3, 123, 2, 5, 1, SE=1, QU=1, SCS=0))
6 changes: 3 additions & 3 deletions nefics/rtu.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion nefics/simcomm.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.')
Expand Down