|
@@ -83,10 +83,35 @@ if [ $(uname) = 'Darwin' ]; then
|
|
fi
|
|
fi
|
|
ID2T_DIR=\$(readlink -f \$0)
|
|
ID2T_DIR=\$(readlink -f \$0)
|
|
SCRIPT_PATH=\${ID2T_DIR%/*}
|
|
SCRIPT_PATH=\${ID2T_DIR%/*}
|
|
-cd \$SCRIPT_PATH/code
|
|
|
|
|
|
+TEST_DIR=\${SCRIPT_PATH}/resources/test/
|
|
|
|
+TEST_PCAP=\${TEST_DIR}reference_1998.pcap
|
|
|
|
+cd \${SCRIPT_PATH}/code
|
|
|
|
+error=0
|
|
# Execute tests
|
|
# Execute tests
|
|
-set -e
|
|
|
|
|
|
+set +e
|
|
python3 -m unittest Test/efficiency_testing.py
|
|
python3 -m unittest Test/efficiency_testing.py
|
|
|
|
+error=\$?
|
|
|
|
+cd \$SCRIPT_PATH
|
|
|
|
+smbloris="SMBLorisAttack attackers.count=4 packets.per-second=8.0"
|
|
|
|
+smbscan1="SMBScanAttack ip.src=192.168.178.1 ip.dst=192.168.178.10-192.168.179.253"
|
|
|
|
+smbscan2="SMBScanAttack ip.src=192.168.178.1 ip.dst=192.168.178.10-192.168.178.109 hosting.ip=192.168.178.10-192.168.178.109"
|
|
|
|
+ftp="FTPWinaXeExploit ip.src=192.168.178.1 ip.dst=192.168.178.10"
|
|
|
|
+porto="PortscanAttack ip.src=192.168.178.1 port.open=80"
|
|
|
|
+portc="PortscanAttack ip.src=192.168.178.1 port.open=20"
|
|
|
|
+sqli="SQLiAttack ip.dst=192.168.0.1"
|
|
|
|
+joomla="JoomlaRegPrivExploit ip.src=192.168.178.1"
|
|
|
|
+sality="SalityBotnet"
|
|
|
|
+ddos="DDoSAttack attackers.count=10 packets.per-second=95 attack.duration=10"
|
|
|
|
+ms17="MS17Scan ip.src=192.168.178.1"
|
|
|
|
+eb="EternalBlue"
|
|
|
|
+for i in "\$smbloris" "\$smbscan1" "\$smbscan2" "\$ftp" "\$porto" "\$portc" "\$sqli" "\$joomla" "\$sality" "\$ddos" "\$ms17" "\$eb"; do
|
|
|
|
+ mprof run ./id2t -i \${TEST_PCAP} -a \${i}
|
|
|
|
+ mprof plot -t "\${i}" -o "\${TEST_DIR}\${i}.png"
|
|
|
|
+ mv mprofile_* "\${TEST_DIR}\${i}.dat"
|
|
|
|
+done
|
|
|
|
+echo "\nPlotted images can be found in \"\${TEST_DIR}\"."
|
|
|
|
+echo "By executing \"mprof plot <file>.dat\" you can get a more detailed look."
|
|
|
|
+exit \$error
|
|
EOF
|
|
EOF
|
|
|
|
|
|
chmod +x ./code/CLI.py
|
|
chmod +x ./code/CLI.py
|