diff --git a/envs/monkey_zoo/blackbox/config_templates/powershell.py b/envs/monkey_zoo/blackbox/config_templates/powershell.py
index cd238fd27..96ba0b908 100644
--- a/envs/monkey_zoo/blackbox/config_templates/powershell.py
+++ b/envs/monkey_zoo/blackbox/config_templates/powershell.py
@@ -7,13 +7,20 @@ from envs.monkey_zoo.blackbox.config_templates.config_template import ConfigTemp
class PowerShell(ConfigTemplate):
config_values = copy(BaseTemplate.config_values)
+ # TODO: Remove .\\ from exploit user list when DC name is added,
+ # for more context see https://github.com/guardicore/monkey/issues/1486
config_values.update(
{
"basic.exploiters.exploiter_classes": ["PowerShellExploiter"],
- "basic_network.scope.subnet_scan_list": ["10.2.3.45", "10.2.3.46", "10.2.3.47"],
+ "basic_network.scope.subnet_scan_list": [
+ "10.2.3.45",
+ "10.2.3.46",
+ "10.2.3.47",
+ "10.2.3.48",
+ ],
"basic.credentials.exploit_password_list": ["Passw0rd!"],
"basic_network.scope.depth": 2,
- "basic.credentials.exploit_user_list": ["m0nk3y", "m0nk3y-user"],
+ "basic.credentials.exploit_user_list": ["m0nk3y", "m0nk3y-user", ".\\m0nk3y"],
"internal.classes.finger_classes": ["PingScanner"],
"internal.network.tcp_scanner.HTTP_PORTS": [],
"internal.network.tcp_scanner.tcp_target_ports": [],
diff --git a/envs/monkey_zoo/blackbox/config_templates/powershell_credentials_reuse.py b/envs/monkey_zoo/blackbox/config_templates/powershell_credentials_reuse.py
new file mode 100644
index 000000000..d6113dc15
--- /dev/null
+++ b/envs/monkey_zoo/blackbox/config_templates/powershell_credentials_reuse.py
@@ -0,0 +1,21 @@
+from copy import copy
+
+from envs.monkey_zoo.blackbox.config_templates.base_template import BaseTemplate
+from envs.monkey_zoo.blackbox.config_templates.config_template import ConfigTemplate
+
+
+class PowerShellCredentialsReuse(ConfigTemplate):
+ config_values = copy(BaseTemplate.config_values)
+
+ config_values.update(
+ {
+ "basic.exploiters.exploiter_classes": ["PowerShellExploiter"],
+ "basic_network.scope.subnet_scan_list": [
+ "10.2.3.46",
+ ],
+ "basic_network.scope.depth": 2,
+ "internal.classes.finger_classes": ["PingScanner"],
+ "internal.network.tcp_scanner.HTTP_PORTS": [],
+ "internal.network.tcp_scanner.tcp_target_ports": [],
+ }
+ )
diff --git a/envs/monkey_zoo/blackbox/conftest.py b/envs/monkey_zoo/blackbox/conftest.py
index cc608fae8..82c6d3d9a 100644
--- a/envs/monkey_zoo/blackbox/conftest.py
+++ b/envs/monkey_zoo/blackbox/conftest.py
@@ -27,6 +27,12 @@ def pytest_addoption(parser):
default=False,
help="If enabled performance tests will be run.",
)
+ parser.addoption(
+ "--skip-powershell-reuse",
+ action="store_true",
+ default=False,
+ help="Use to run PowerShell credentials reuse test.",
+ )
@pytest.fixture(scope="session")
@@ -51,3 +57,11 @@ def pytest_runtest_setup(item):
pytest.skip(
"Skipping performance test because " "--run-performance-tests flag isn't specified."
)
+
+ if "skip_powershell_reuse" in item.keywords and item.config.getoption(
+ "--skip-powershell-reuse"
+ ):
+ pytest.skip(
+ "Skipping powershell credentials reuse test because "
+ "--skip-powershell-cached flag isn't specified."
+ )
diff --git a/envs/monkey_zoo/blackbox/gcp_test_machine_list.py b/envs/monkey_zoo/blackbox/gcp_test_machine_list.py
index 968e2026d..2cd5a045c 100644
--- a/envs/monkey_zoo/blackbox/gcp_test_machine_list.py
+++ b/envs/monkey_zoo/blackbox/gcp_test_machine_list.py
@@ -25,5 +25,6 @@ GCP_TEST_MACHINE_LIST = {
"powershell-3-45",
"powershell-3-46",
"powershell-3-47",
+ "powershell-3-48",
],
}
diff --git a/envs/monkey_zoo/blackbox/test_blackbox.py b/envs/monkey_zoo/blackbox/test_blackbox.py
index 221d783f6..cc4d6ba97 100644
--- a/envs/monkey_zoo/blackbox/test_blackbox.py
+++ b/envs/monkey_zoo/blackbox/test_blackbox.py
@@ -14,6 +14,9 @@ from envs.monkey_zoo.blackbox.config_templates.hadoop import Hadoop
from envs.monkey_zoo.blackbox.config_templates.mssql import Mssql
from envs.monkey_zoo.blackbox.config_templates.performance import Performance
from envs.monkey_zoo.blackbox.config_templates.powershell import PowerShell
+from envs.monkey_zoo.blackbox.config_templates.powershell_credentials_reuse import (
+ PowerShellCredentialsReuse,
+)
from envs.monkey_zoo.blackbox.config_templates.shellshock import ShellShock
from envs.monkey_zoo.blackbox.config_templates.smb_mimikatz import SmbMimikatz
from envs.monkey_zoo.blackbox.config_templates.smb_pth import SmbPth
@@ -166,6 +169,14 @@ class TestMonkeyBlackbox:
island_client, PowerShell, "PowerShell_Remoting_exploiter"
)
+ @pytest.mark.skip_powershell_reuse
+ def test_powershell_exploiter_credentials_reuse(self, island_client):
+ TestMonkeyBlackbox.run_exploitation_test(
+ island_client,
+ PowerShellCredentialsReuse,
+ "PowerShell_Remoting_exploiter_credentials_reuse",
+ )
+
def test_smb_and_mimikatz_exploiters(self, island_client):
TestMonkeyBlackbox.run_exploitation_test(
island_client, SmbMimikatz, "SMB_exploiter_mimikatz"
diff --git a/envs/monkey_zoo/docs/fullDocs.md b/envs/monkey_zoo/docs/fullDocs.md
index 4008b464d..679f52d3e 100644
--- a/envs/monkey_zoo/docs/fullDocs.md
+++ b/envs/monkey_zoo/docs/fullDocs.md
@@ -34,8 +34,9 @@ This document describes Infection Monkey’s test network, how to deploy and use
[Nr. 3-45 Powershell](#_Toc536021479)
[Nr. 3-46 Powershell](#_Toc536021480)
[Nr. 3-47 Powershell](#_Toc536021481)
-[Nr. 250 MonkeyIsland](#_Toc536021482)
-[Nr. 251 MonkeyIsland](#_Toc536021483)
+[Nr. 3-48 Powershell](#_Toc536021482)
+[Nr. 250 MonkeyIsland](#_Toc536021483)
+[Nr. 251 MonkeyIsland](#_Toc536021484)
[Network topography](#network-topography)
# Warning\!
@@ -1171,7 +1172,35 @@ fullTest.conf is a good config to start, because it covers all machines.
Nr. 250 MonkeyIsland + | Nr. 3-48 Powershell +(10.2.3.48) |
+(Vulnerable) | +
---|---|---|
OS: | +Windows Server 2019 x64 | +|
Software: | +WinRM service | +|
Default server’s port: | +- | +|
Notes: | +User: m0nk3y, Password: Passw0rd! | +
Nr. 250 MonkeyIsland (10.2.2.250) |
---|
Nr. 251 MonkeyIsland + | Nr. 251 MonkeyIsland (10.2.2.251) |
---|