|
@@ -11,6 +11,7 @@ from Attack.AttackParameters import Parameter as Param
|
|
from Attack.AttackParameters import ParameterTypes
|
|
from Attack.AttackParameters import ParameterTypes
|
|
# from ID2TLib import PcapFile
|
|
# from ID2TLib import PcapFile
|
|
# from ID2TLib.PcapFile import PcapFile
|
|
# from ID2TLib.PcapFile import PcapFile
|
|
|
|
+from ID2TLib.Ports import PortSelectors
|
|
|
|
|
|
class MessageType(Enum):
|
|
class MessageType(Enum):
|
|
"""
|
|
"""
|
|
@@ -186,7 +187,7 @@ class MembersMgmtCommAttack(BaseAttack.BaseAttack):
|
|
id_src, id_dst = msg.src["ID"], msg.dst["ID"]
|
|
id_src, id_dst = msg.src["ID"], msg.dst["ID"]
|
|
ip_src, ip_dst = msg.src["IP"], msg.dst["IP"]
|
|
ip_src, ip_dst = msg.src["IP"], msg.dst["IP"]
|
|
mac_src, mac_dst = msg.src["MAC"], msg.dst["MAC"]
|
|
mac_src, mac_dst = msg.src["MAC"], msg.dst["MAC"]
|
|
- port_src, port_dst = int(msg.src["Port"]), int(msg.dst["Port"])
|
|
|
|
|
|
+ port_src, port_dst = int(msg.src["SrcPort"]), int(msg.dst["DstPort"])
|
|
ttl = int(msg.src["TTL"])
|
|
ttl = int(msg.src["TTL"])
|
|
|
|
|
|
# update duration
|
|
# update duration
|
|
@@ -517,9 +518,11 @@ class MembersMgmtCommAttack(BaseAttack.BaseAttack):
|
|
updated_msgs.append(respns_msg)
|
|
updated_msgs.append(respns_msg)
|
|
last_response[(req_msg.src, req_msg.dst)] = respns_msg.time
|
|
last_response[(req_msg.src, req_msg.dst)] = respns_msg.time
|
|
|
|
|
|
|
|
+ portSelector = PortSelectors.LINUX
|
|
# create port configurations for the bots
|
|
# create port configurations for the bots
|
|
for bot in bot_configs:
|
|
for bot in bot_configs:
|
|
- bot_configs[bot]["Port"] = Generator.gen_random_server_port()
|
|
|
|
|
|
+ bot_configs[bot]["SrcPort"] = portSelector.select_port_udp()
|
|
|
|
+ bot_configs[bot]["DstPort"] = Generator.gen_random_server_port()
|
|
|
|
|
|
# print(local_init_ids)
|
|
# print(local_init_ids)
|
|
# print(bot_configs)
|
|
# print(bot_configs)
|