From dcc68914bd4aa776187a7af01845ecbacde7859f Mon Sep 17 00:00:00 2001 From: Ilija Lazoroski Date: Mon, 10 Jan 2022 14:17:48 +0100 Subject: [PATCH] BB: Add log4j machines to monkey zoo --- envs/monkey_zoo/docs/fullDocs.md | 74 ++++++++++++++++++++++--- envs/monkey_zoo/terraform/images.tf | 16 ++++++ envs/monkey_zoo/terraform/monkey_zoo.tf | 30 ++++++++++ 3 files changed, 113 insertions(+), 7 deletions(-) diff --git a/envs/monkey_zoo/docs/fullDocs.md b/envs/monkey_zoo/docs/fullDocs.md index d10525aa1..71a373843 100644 --- a/envs/monkey_zoo/docs/fullDocs.md +++ b/envs/monkey_zoo/docs/fullDocs.md @@ -35,8 +35,12 @@ This document describes Infection Monkey’s test network, how to deploy and use [Nr. 3-46 Powershell](#_Toc536021480)
[Nr. 3-47 Powershell](#_Toc536021481)
[Nr. 3-48 Powershell](#_Toc536021482)
-[Nr. 250 MonkeyIsland](#_Toc536021483)
-[Nr. 251 MonkeyIsland](#_Toc536021484)
+[Nr. 3-49 Log4j Solr](#_Toc536021483)
+[Nr. 3-50 Log4j Solr](#_Toc536021484)
+[Nr. 3-51 Log4j Tomcat](#_Toc536021485)
+[Nr. 3-52 Log4j Tomcat](#_Toc536021486)
+[Nr. 250 MonkeyIsland](#_Toc536021487)
+[Nr. 251 MonkeyIsland](#_Toc536021488)
[Network topography](#network-topography)
# Warning\! @@ -1201,7 +1205,7 @@ Update all requirements using deployment script:
- @@ -1229,7 +1233,7 @@ Update all requirements using deployment script:

Nr. 3-49 Log4j Solr

+

Nr. 3-49 Log4j Solr

(10.2.3.49)

(Vulnerable)
- @@ -1245,7 +1249,7 @@ Update all requirements using deployment script:
- + @@ -1257,7 +1261,63 @@ Update all requirements using deployment script:

Nr. 3-50 Log4j-solr

+

Nr. 3-50 Log4j Solr

(10.2.3.50)

(Vulnerable)
Default server’s port:-8983
Notes:
- + + + + + + + + + + + + + + + + + + + + + +

Nr. 250 MonkeyIsland

+

Nr. 3-51 Log4j Tomcat

+

(10.2.3.51)

(Vulnerable)
OS:Ubuntu 18.04LTS
Software:Apache Tomcat 8.0.36
Default server’s port:8080
Notes:
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

Nr. 3-52 Log4j-tomcat

+

(10.2.3.52)

(Vulnerable)
OS:Windows Server 2016 x64
Software:Apache Tomcat 8.0.36
Default server’s port:8080
Notes:User: m0nk3y, Password: Tomcat@22
+ + + + + @@ -1289,7 +1349,7 @@ Update all requirements using deployment script:

Nr. 250 MonkeyIsland

(10.2.2.250)

- diff --git a/envs/monkey_zoo/terraform/images.tf b/envs/monkey_zoo/terraform/images.tf index 05cc05048..b5a2fbee7 100644 --- a/envs/monkey_zoo/terraform/images.tf +++ b/envs/monkey_zoo/terraform/images.tf @@ -77,6 +77,22 @@ data "google_compute_image" "powershell-3-45" { name = "powershell-3-45" project = local.monkeyzoo_project } +data "google_compute_image" "log4j-solr-49" { + name = "log4j-solr-49" + project = local.monkeyzoo_project +} +data "google_compute_image" "log4j-solr-50" { + name = "log4j-solr-50" + project = local.monkeyzoo_project +} +data "google_compute_image" "log4j-tomcat-51" { + name = "log4j-tomcat-51" + project = local.monkeyzoo_project +} +data "google_compute_image" "log4j-solr-50" { + name = "log4j-solr-50" + project = local.monkeyzoo_project +} data "google_compute_image" "weblogic-18" { name = "weblogic-18" project = local.monkeyzoo_project diff --git a/envs/monkey_zoo/terraform/monkey_zoo.tf b/envs/monkey_zoo/terraform/monkey_zoo.tf index 4b64b4a31..c545af20c 100644 --- a/envs/monkey_zoo/terraform/monkey_zoo.tf +++ b/envs/monkey_zoo/terraform/monkey_zoo.tf @@ -418,6 +418,36 @@ resource "google_compute_instance_from_template" "log4j-solr-50" { } } +resource "google_compute_instance_from_template" "log4j-tomcat-51" { + name = "${local.resource_prefix}log4j-tomcat-51" + source_instance_template = local.default_linux + boot_disk{ + initialize_params { + image = data.google_compute_image.log4j-tomcat-51.self_link + } + auto_delete = true + } + network_interface { + subnetwork="${local.resource_prefix}monkeyzoo-main" + network_ip="10.2.3.51" + } +} + +resource "google_compute_instance_from_template" "log4j-tomcat-52" { + name = "${local.resource_prefix}log4j-tomcat-52" + source_instance_template = local.default_windows + boot_disk{ + initialize_params { + image = data.google_compute_image.log4j-tomcat-52.self_link + } + auto_delete = true + } + network_interface { + subnetwork="${local.resource_prefix}monkeyzoo-main" + network_ip="10.2.3.52" + } +} + /* We need to alter monkey's behavior for this to upload 32-bit monkey instead of 64-bit (not yet developed) resource "google_compute_instance_from_template" "upgrader-17" { name = "${local.resource_prefix}upgrader-17"

Nr. 251 MonkeyIsland

+

Nr. 251 MonkeyIsland

(10.2.2.251)