|
@@ -14,12 +14,6 @@ from ID2TLib.SMBLib import smb_port
|
|
logging.getLogger("scapy.runtime").setLevel(logging.ERROR)
|
|
logging.getLogger("scapy.runtime").setLevel(logging.ERROR)
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
|
|
|
|
class SMBLorisAttack(BaseAttack.BaseAttack):
|
|
class SMBLorisAttack(BaseAttack.BaseAttack):
|
|
|
|
|
|
@@ -29,7 +23,7 @@ class SMBLorisAttack(BaseAttack.BaseAttack):
|
|
|
|
|
|
"""
|
|
"""
|
|
|
|
|
|
- super(SMBLorisAttack, self).__init__("SMBLoris Attack", "Injects an SMBLoris DoS Attack",
|
|
+ super(SMBLorisAttack, self).__init__("SMBLoris Attack", "Injects an SMBLoris (D)DoS Attack",
|
|
"Resource Exhaustion")
|
|
"Resource Exhaustion")
|
|
|
|
|
|
|
|
|
|
@@ -84,7 +78,7 @@ class SMBLorisAttack(BaseAttack.BaseAttack):
|
|
self.add_param_value(Param.ATTACK_DURATION, 30)
|
|
self.add_param_value(Param.ATTACK_DURATION, 30)
|
|
|
|
|
|
def generate_attack_pcap(self):
|
|
def generate_attack_pcap(self):
|
|
- def getIpData(ip_address: str):
|
|
+ def get_ip_data(ip_address: str):
|
|
"""
|
|
"""
|
|
:param ip_address: the ip of which (packet-)data shall be returned
|
|
:param ip_address: the ip of which (packet-)data shall be returned
|
|
:return: MSS, TTL and Window Size values of the given IP
|
|
:return: MSS, TTL and Window Size values of the given IP
|
|
@@ -161,7 +155,7 @@ class SMBLorisAttack(BaseAttack.BaseAttack):
|
|
self.ip_src_dst_equal_check(ip_source_list, ip_destination)
|
|
self.ip_src_dst_equal_check(ip_source_list, ip_destination)
|
|
|
|
|
|
|
|
|
|
- destination_mss_value, destination_ttl_value, destination_win_value = getIpData(ip_destination)
|
|
+ destination_mss_value, destination_ttl_value, destination_win_value = get_ip_data(ip_destination)
|
|
|
|
|
|
minDelay,maxDelay = self.get_reply_delay(ip_destination)
|
|
minDelay,maxDelay = self.get_reply_delay(ip_destination)
|
|
|
|
|
|
@@ -172,7 +166,7 @@ class SMBLorisAttack(BaseAttack.BaseAttack):
|
|
|
|
|
|
for attacker in range(num_attackers):
|
|
for attacker in range(num_attackers):
|
|
|
|
|
|
- source_mss_value, source_ttl_value, source_win_value = getIpData(ip_source_list[attacker])
|
|
+ source_mss_value, source_ttl_value, source_win_value = get_ip_data(ip_source_list[attacker])
|
|
|
|
|
|
attacker_seq = randint(1000, 50000)
|
|
attacker_seq = randint(1000, 50000)
|
|
victim_seq = randint(1000, 50000)
|
|
victim_seq = randint(1000, 50000)
|
|
@@ -180,7 +174,7 @@ class SMBLorisAttack(BaseAttack.BaseAttack):
|
|
sport = 1025
|
|
sport = 1025
|
|
|
|
|
|
|
|
|
|
- timestamp_next_pkt = uniform(first_timestamp, first_timestamp+0.010)
|
|
+ timestamp_next_pkt = uniform(first_timestamp, update_timestamp(first_timestamp, pps))
|
|
|
|
|
|
while timestamp_next_pkt <= attack_ends_time:
|
|
while timestamp_next_pkt <= attack_ends_time:
|
|
|
|
|