|
@@ -619,14 +619,21 @@ class MembersMgmtCommAttack(BaseAttack.BaseAttack):
|
|
assign_realistic_timestamps(messages, external_ids, local_ids, avg_delay_local, avg_delay_external, zero_reference)
|
|
assign_realistic_timestamps(messages, external_ids, local_ids, avg_delay_local, avg_delay_external, zero_reference)
|
|
|
|
|
|
portSelector = PortSelectors.LINUX
|
|
portSelector = PortSelectors.LINUX
|
|
|
|
+ reserved_ports = set(int(line.strip()) for line in open("resources/reserved_ports.txt").readlines())
|
|
|
|
+ def filter_reserved(get_port):
|
|
|
|
+ port = get_port()
|
|
|
|
+ while port in reserved_ports:
|
|
|
|
+ port = get_port()
|
|
|
|
+ return port
|
|
|
|
+
|
|
# create port configurations for the bots
|
|
# create port configurations for the bots
|
|
use_multiple_ports = self.get_param_value(Param.MULTIPORT)
|
|
use_multiple_ports = self.get_param_value(Param.MULTIPORT)
|
|
for bot in sorted(bot_configs):
|
|
for bot in sorted(bot_configs):
|
|
- bot_configs[bot]["SrcPort"] = portSelector.select_port_udp()
|
|
|
|
|
|
+ bot_configs[bot]["SrcPort"] = filter_reserved(portSelector.select_port_udp)
|
|
if not use_multiple_ports:
|
|
if not use_multiple_ports:
|
|
- bot_configs[bot]["DstPort"] = Generator.gen_random_server_port()
|
|
|
|
|
|
+ bot_configs[bot]["DstPort"] = filter_reserved(Generator.gen_random_server_port)
|
|
else:
|
|
else:
|
|
- bot_configs[bot]["DstPort"] = portSelector.select_port_udp()
|
|
|
|
|
|
+ bot_configs[bot]["DstPort"] = filter_reserved(portSelector.select_port_udp)
|
|
|
|
|
|
# assign realistic TTL for every bot
|
|
# assign realistic TTL for every bot
|
|
if self.get_param_value(Param.TTL_FROM_CAIDA):
|
|
if self.get_param_value(Param.TTL_FROM_CAIDA):
|