@@ -672,11 +672,21 @@ class BaseAttack(metaclass=abc.ABCMeta):
"""
def is_invalid(ip_address_param: ipaddress.IPv4Address):
+ """
+ TODO FILL ME
+ :param ip_address_param:
+ :return:
return ip_address_param.is_multicast or ip_address_param.is_unspecified or ip_address_param.is_loopback or \
ip_address_param.is_link_local or ip_address_param.is_reserved or ip_address_param.is_private
# Generate a random IP from specific class
def generate_address(ip_class_param):
+ :param ip_class_param:
if ip_class_param == "Unknown":
return ipaddress.IPv4Address(random.randint(0, 2 ** 32 - 1))
else:
@@ -718,10 +728,19 @@ class BaseAttack(metaclass=abc.ABCMeta):
def is_invalid(ip_address: ipaddress.IPv6Address):
+ :param ip_address:
return ip_address.is_multicast or ip_address.is_unspecified or ip_address.is_loopback or \
ip_address.is_link_local or ip_address.is_private or ip_address.is_reserved
def generate_address():
return ipaddress.IPv6Address(random.randint(0, 2 ** 128 - 1))
ip_addresses = []
@@ -288,9 +288,9 @@ class DDoSAttack(BaseAttack.BaseAttack):
def generate_attack_pcap(self):
- Creates a pcap containing the attack packets.
+ Creates a pcap containing the attack packets.
- :return: The location of the generated pcap file.
+ :return: The location of the generated pcap file.
if len(self.packets) > 0:
self.packets = sorted(self.packets, key=lambda pkt: pkt.time)
@@ -80,7 +80,7 @@ class EternalBlueExploit(BaseAttack.BaseAttack):
def generate_attack_packets(self):
- Creates the attack packets.
+ Creates the attack packets.
# Timestamp
timestamp_next_pkt = self.get_param_value(atkParam.Parameter.INJECT_AT_TIMESTAMP)
@@ -315,9 +315,9 @@ class EternalBlueExploit(BaseAttack.BaseAttack):
# Store timestamp of first packet (for attack label)
self.attack_start_utime = self.packets[0].time
@@ -21,34 +21,15 @@ class Label:
self.parameters = parameters
def __eq__(self, other):
- """
- TODO: FILL ME
- :param other:
- :return:
return self.timestamp == other.timestamp
def __lt__(self, other):
return self.timestamp_start < other.timestamp_start
def __gt__(self, other):
return self.timestamp_start > other.timestamp_start
def __str__(self):
return ''.join(
['(', self.attack_name, ',', self.attack_note, ',', str(self.timestamp_start), ',', str(self.timestamp_end),
')'])