Skip to content

Commit e36a1ba

Browse files
committed
Concealment mitm now reads the concealment values from a .csv file, in the future, it might be worth to provide multi-tag support
1 parent 94c98c3 commit e36a1ba

File tree

4 files changed

+4
-19
lines changed

4 files changed

+4
-19
lines changed

dhalsim/network_attacks/concealment_netfilter_queue.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,26 +38,17 @@ def capture(self, packet):
3838
if len(p) == 116:
3939
this_session = int.from_bytes(p[Raw].load[4:8], sys.byteorder)
4040
tag_name = p[Raw].load.decode(encoding='latin-1')[54:56]
41-
self.logger.debug('ENIP TCP Session ID: ' + str(this_session))
42-
self.logger.debug('Received tag is: ' + tag_name)
43-
self.logger.debug('Attack tag is: ' + self.attacked_tag)
4441
if self.attacked_tag == tag_name:
4542
# This is a packet being sent to SCADA server, conceal the manipulation
46-
self.logger.debug('Packet source: ' + p[IP].src )
47-
self.logger.debug('SCADA IP: ' + self.intermediate_yaml['scada']['public_ip'])
4843
if p[IP].src == self.intermediate_yaml['scada']['public_ip']:
49-
self.logger.debug('SCADA session: ' + str(this_session))
5044
self.scada_session_ids.append(this_session)
5145
else:
52-
self.logger.debug('PLC session: ' + str(this_session))
5346
self.attack_session_ids.append(this_session)
5447

5548
if len(p) == 102:
5649
this_session = int.from_bytes(p[Raw].load[4:8], sys.byteorder)
5750
if this_session in self.attack_session_ids:
58-
self.logger.debug('Modifying because session is: ' + str(this_session))
5951
value = translate_payload_to_float(p[Raw].load)
60-
self.logger.debug('tag value is:' + str(value))
6152

6253
if 'value' in self.intermediate_attack.keys():
6354
p[Raw].load = translate_float_to_payload(

dhalsim/network_attacks/mitm_netfilter_queue.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,19 +33,13 @@ def capture(self, packet):
3333
if len(p) == 116:
3434
this_session = int.from_bytes(p[Raw].load[4:8], sys.byteorder)
3535
tag_name = p[Raw].load.decode(encoding='latin-1')[54:56]
36-
self.logger.debug('ENIP TCP Session ID: ' + str(this_session))
37-
self.logger.debug('Received tag is: ' + tag_name)
38-
self.logger.debug('Attack tag is: ' + self.attacked_tag)
3936
if self.attacked_tag == tag_name:
40-
self.logger.debug('Modifying tag: ' + tag_name)
4137
self.session_ids.append(this_session)
4238

4339
if len(p) == 102:
4440
this_session = int.from_bytes(p[Raw].load[4:8], sys.byteorder)
4541
if this_session in self.session_ids:
46-
self.logger.debug('Modifying because session is: ' + str(this_session))
4742
value = translate_payload_to_float(p[Raw].load)
48-
self.logger.debug('tag value is:' + str(value))
4943

5044
if 'value' in self.intermediate_attack.keys():
5145
p[Raw].load = translate_float_to_payload(

examples/ctown_topology/ctown_concealment_mitm.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ network_attacks:
33
type: concealment_mitm
44
tag: T3
55
target: PLC4
6-
value: 42.0
6+
value: 8.0
77
concealment_data: concealment_test.csv
88
trigger:
9-
start: 5
10-
end: 15
9+
start: 648
10+
end: 936
1111
type: time

examples/ctown_topology/ctown_config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
inp_file: ctown_map.inp
2-
iterations: 20
2+
iterations: 2880
33
network_topology_type: complex
44
plcs: !include ctown_plcs.yaml
55

0 commit comments

Comments
 (0)