diff --git a/envs/monkey_maker/README.md b/envs/monkey_maker/README.md index 275ab6bbf..c273b6b04 100644 --- a/envs/monkey_maker/README.md +++ b/envs/monkey_maker/README.md @@ -26,3 +26,32 @@ terraform init terraform apply ``` +### Usage + +To login to windows use Administrator: %HwuzI!Uzsyfa=cB*XaQ6xxHqopfj)h) credentials + +You'll find docker files in `/home/ubuntu/docker_envs/linux/...` + +To build docker image for 32 bit linux: +``` +cd /home/ubuntu/docker_envs/linux/py3-32 +sudo docker build -t builder32 . +``` + +To build docker image for 64 bit linux: +``` +cd /home/ubuntu/docker_envs/linux/py3-64 +sudo docker build -t builder64 . +``` + +To build 32 bit monkey binary: +``` +cd /home/ubuntu/monkey_folder/monkey +sudo docker run -v "$(pwd):/src" builder32 -c "export SRCDIR=/src/infection_monkey && /entrypoint.sh" +``` + +To build 64 bit monkey binary: +``` +cd /home/ubuntu/monkey_folder/monkey +sudo docker run -v "$(pwd):/src" builder64 -c "export SRCDIR=/src/infection_monkey && /entrypoint.sh" +``` diff --git a/envs/monkey_maker/terraform/instances.tf b/envs/monkey_maker/terraform/instances.tf index 495b2ca64..e7ba1877e 100644 --- a/envs/monkey_maker/terraform/instances.tf +++ b/envs/monkey_maker/terraform/instances.tf @@ -11,14 +11,14 @@ resource "aws_instance" "island_windows" { associate_public_ip_address = true } -resource "aws_instance" "island_linux_64" { - ami = "ami-050a22b7e0cf85dd0" +resource "aws_instance" "island_linux" { + ami = "ami-0495203541087740a" instance_type = "t2.micro" private_ip = "10.0.0.252" subnet_id = "${aws_subnet.main.id}" key_name = "monkey_maker" tags = { - Name = "monkey_maker_linux_64" + Name = "monkey_maker_linux" } vpc_security_group_ids = ["${aws_security_group.monkey_maker_sg.id}"] associate_public_ip_address = true diff --git a/envs/os_compatibility/README.md b/envs/os_compatibility/README.md index 43456c75e..0e2043bf5 100644 --- a/envs/os_compatibility/README.md +++ b/envs/os_compatibility/README.md @@ -28,8 +28,30 @@ terraform apply ``` ## Usage + 1. Launch os_compat_ISLAND machine and upload your binaries/update island. Reset island environment. 2. Launch/Reboot all other os_compat test machines (Can be filtered with tag "Puropose: os_compat_instance") 3. Wait until machines boot and run monkey 4. Launch `test_compatibility.py` pytest script with island ip parameter (e.g. `test_compatibility.py --island 111.111.111.111:5000`) + +## Machines + +Since island machine is built from custom AMI it already has the following credentials: + +Administrator: %tPHGz8ZuQsBnEUgdpz!6f&elGnFy?;. + +The following machines does not download monkey automatically, so you'll have to manually check them: + +- os_compat_kali_2019 +- os_compat_oracle_6 +- os_compat_oracle_7 +- windows_2003_r2_32 +- windows_2003 + +A quick reference for usernames on different machines (if in doubt check official docs): +- Ubuntu: ubuntu +- Oracle: clckwrk +- CentOS: centos +- Everything else: ec2-user + diff --git a/envs/os_compatibility/terraform/instances.tf b/envs/os_compatibility/terraform/instances.tf index 781f0e636..e20c60000 100644 --- a/envs/os_compatibility/terraform/instances.tf +++ b/envs/os_compatibility/terraform/instances.tf @@ -3,7 +3,7 @@ resource "aws_instance" "island" { - ami = "ami-01cc9554aa0b4c00e" + ami = "ami-004f0217ce761fc9a" instance_type = "t2.micro" private_ip = "10.0.0.251" subnet_id = "${aws_subnet.main.id}" @@ -18,7 +18,6 @@ resource "aws_instance" "island" { volume_type = "standard" delete_on_termination = true } - #associate_public_ip_address = false } locals { @@ -48,7 +47,7 @@ Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="userdata.txt" #!/bin/bash rm ./monkey-linux-64 -wget --no-check-certificate https://10.0.0.251:5000/api/monkey/download/monkey-linux-64 || curl https://10.0.0.251:5000/api/monkey/download/monkey-linux-64 -k -o monkey-linux-64 +wget --no-check-certificate -q https://10.0.0.251:5000/api/monkey/download/monkey-linux-64 -O ./monkey-linux-64 || curl https://10.0.0.251:5000/api/monkey/download/monkey-linux-64 -k -o monkey-linux-64 chmod +x ./monkey-linux-64 ./monkey-linux-64 m0nk3y -s 10.0.0.251:5000 --// @@ -75,7 +74,7 @@ Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="userdata.txt" #!/bin/bash rm ./monkey-linux-32 -wget --no-check-certificate https://10.0.0.251:5000/api/monkey/download/monkey-linux-32 || curl https://10.0.0.251:5000/api/monkey/download/monkey-linux-32 -k -o monkey-linux-32 +wget --no-check-certificate -q https://10.0.0.251:5000/api/monkey/download/monkey-linux-32 -O ./monkey-linux-32 || curl https://10.0.0.251:5000/api/monkey/download/monkey-linux-32 -k -o monkey-linux-32 chmod +x ./monkey-linux-32 ./monkey-linux-32 m0nk3y -s 10.0.0.251:5000 --// @@ -177,7 +176,8 @@ module "kali_2019" { env_vars = "${local.env_vars}" user_data = "${local.user_data_linux_64}" } -// Requires m3.medium + +// Requires m3.medium which usually isn't available //module "rhel_5" { // source = "./instance_template" // name = "rhel_5" @@ -269,7 +269,7 @@ module "ubuntu_12" { user_data = "${local.user_data_linux_64}" } -// Requires m3.medium instance +// Requires m3.medium instance which usually isn't available // module "ubuntu_12_32" { // source = "./instance_template" // name = "ubuntu_12_32" @@ -324,24 +324,16 @@ module "windows_2008" { user_data = "${local.user_data_windows_64}" } + module "windows_2008_32" { source = "./instance_template" name = "windows_2008_32" - ami = "ami-0acaec54bac5cbb8f" + ami = "ami-3606352b" ip = "10.0.0.6" env_vars = "${local.env_vars}" user_data = "${local.user_data_windows_32}" } -module "windows_2008_r2" { - source = "./instance_template" - name = "windows_2008_r2" - ami = "ami-0252def122d07efd3" - ip = "10.0.0.7" - env_vars = "${local.env_vars}" - user_data = "${local.user_data_windows_64}" -} - module "windows_2012" { source = "./instance_template" name = "windows_2012" @@ -364,7 +356,7 @@ module "windows_2016" { source = "./instance_template" name = "windows_2016" ami = "ami-02a6791b44938cfcd" - ip = "10.0.0.16" + ip = "10.0.0.116" env_vars = "${local.env_vars}" user_data = "${local.user_data_windows_64}" } @@ -373,7 +365,7 @@ module "windows_2019" { source = "./instance_template" name = "windows_2019" ami = "ami-09fe2745618d2af42" - ip = "10.0.0.19" + ip = "10.0.0.119" env_vars = "${local.env_vars}" user_data = "${local.user_data_windows_64}" } diff --git a/envs/os_compatibility/test_compatibility.py b/envs/os_compatibility/test_compatibility.py index 218115c48..51a9f5ebb 100644 --- a/envs/os_compatibility/test_compatibility.py +++ b/envs/os_compatibility/test_compatibility.py @@ -25,11 +25,10 @@ machine_list = { "10.0.0.5": "windows_2003", "10.0.0.8": "windows_2008", "10.0.0.6": "windows_2008_32", - "10.0.0.7": "windows_2008_r2", "10.0.0.12": "windows_2012", "10.0.0.11": "windows_2012_r2", - "10.0.0.16": "windows_2016", - "10.0.0.19": "windows_2019", + "10.0.0.116": "windows_2016", + "10.0.0.119": "windows_2019", }