Przeglądaj źródła

fixed nondeterministic ports and added Dockerfile for future regression tests

Denis Waßmann 7 lat temu
rodzic
commit
7efd6a85d1
2 zmienionych plików z 25 dodań i 1 usunięć
  1. 24 0
      Dockerfile
  2. 1 1
      code/Attack/MembersMgmtCommAttack.py

+ 24 - 0
Dockerfile

@@ -0,0 +1,24 @@
+FROM debian:latest
+
+# install all the necessary packages (see readme.md, but libpcap-dev might not be on that list, it's still needed)
+RUN apt-get update && apt-get install -y --no-install-recommends build-essential cmake libboost-dev libboost-python-dev libtins-dev libpcap-dev python3-dev sqlite3 \
+	python3-pip python3-scapy python3-numpy python3-matplotlib python3-scipy python3-setuptools
+RUN pip3 install lea # for some reason you cant install lea via apt
+
+# make the required directored to copy the files into
+RUN mkdir /id2t /id2t/code /id2t/code_boost /id2t/resources
+WORKDIR /id2t
+
+# copy all the necessary files
+# there are multiple commands because docker only copies the directories' contents and not the directory itself and dont know what else to do here
+COPY build.sh /id2t/
+COPY code/ /id2t/code/
+COPY code_boost/ /id2t/code_boost/
+COPY resources /id2t/resources
+
+# run the build-script
+RUN ./build.sh
+
+# add id2t to the path
+ENV PATH="$PATH:/id2t"
+

+ 1 - 1
code/Attack/MembersMgmtCommAttack.py

@@ -538,7 +538,7 @@ class MembersMgmtCommAttack(BaseAttack.BaseAttack):
         portSelector = PortSelectors.LINUX
         # create port configurations for the bots
         calculate_dst_port = self.get_param_value(Param.BOTNET_DST_PORT_CALCULATION)
-        for bot in bot_configs:
+        for bot in sorted(bot_configs):
             bot_configs[bot]["SrcPort"] = portSelector.select_port_udp()
             if calculate_dst_port:
                 bot_configs[bot]["DstPort"] = Generator.gen_random_server_port()