UT: Replace Hadoop with MSSQL in test data

Previously, in the UT data, Hadoop had only windows in the
"supported_os" field in the config. Now that that field is stripped out
from the config, the supported OSes are picked up from the main code
(from `SUPPORTED_OS` in the master's `Exploiter` class) which has both
winodws and linux for Hadoop. This caused the tests to fail.

This commit changes the UT data to include the MSSQL exploiter (windows
only) instead of the Hadoop exploiter. The tests pass now.
This commit is contained in:
Shreya Malviya 2022-06-22 09:27:47 -07:00
parent 104c7ac210
commit 452028f221
1 changed files with 4 additions and 4 deletions

View File

@ -38,7 +38,7 @@ def exploiter_config():
return {
"options": {"dropper_path_linux": "/tmp/monkey"},
"brute_force": [
{"name": "HadoopExploiter", "options": {"timeout": 10}},
{"name": "MSSQLExploiter", "options": {"timeout": 10}},
{"name": "SSHExploiter", "options": {}},
{"name": "WmiExploiter", "options": {"timeout": 10}},
],
@ -105,11 +105,11 @@ def test_exploiter(callback, hosts, hosts_to_exploit, run_exploiters):
host_exploit_combos = get_host_exploit_combos_from_call_args_list(callback.call_args_list)
assert ("ZerologonExploiter", hosts[0]) in host_exploit_combos
assert ("HadoopExploiter", hosts[0]) in host_exploit_combos
assert ("MSSQLExploiter", hosts[0]) in host_exploit_combos
assert ("SSHExploiter", hosts[0]) in host_exploit_combos
assert ("WmiExploiter", hosts[0]) in host_exploit_combos
assert ("ZerologonExploiter", hosts[1]) in host_exploit_combos
assert ("HadoopExploiter", hosts[1]) in host_exploit_combos
assert ("MSSQLExploiter", hosts[1]) in host_exploit_combos
assert ("WmiExploiter", hosts[1]) in host_exploit_combos
assert ("SSHExploiter", hosts[1]) in host_exploit_combos
@ -196,6 +196,6 @@ def test_all_exploiters_run_on_unknown_host(callback, hosts, hosts_to_exploit, r
host_exploit_combos = get_host_exploit_combos_from_call_args_list(callback.call_args_list)
assert ("ZerologonExploiter", hosts[0]) in host_exploit_combos
assert ("HadoopExploiter", hosts[0]) in host_exploit_combos
assert ("MSSQLExploiter", hosts[0]) in host_exploit_combos
assert ("SSHExploiter", host) in host_exploit_combos
assert ("WmiExploiter", hosts[0]) in host_exploit_combos