2019-12-17 00:41:31 +08:00
|
|
|
# OS compatibility
|
|
|
|
|
|
|
|
## About
|
|
|
|
|
2022-04-15 21:40:34 +08:00
|
|
|
OS compatibility is an environment on AWS that
|
2019-12-17 00:41:31 +08:00
|
|
|
is designed to test monkey binary compatibility on
|
2022-04-15 21:40:34 +08:00
|
|
|
different operating systems.
|
2019-12-17 00:41:31 +08:00
|
|
|
This environment is deployed using terraform scripts
|
|
|
|
located in this directory.
|
|
|
|
|
|
|
|
## Setup
|
|
|
|
|
|
|
|
To setup you need to put `accessKeys` file into `./aws_keys` directory.
|
|
|
|
|
|
|
|
Contents of `accessKeys` file should be as follows:
|
|
|
|
|
|
|
|
```
|
|
|
|
[default]
|
|
|
|
aws_access_key_id = <...>
|
|
|
|
aws_secret_access_key = <...>
|
|
|
|
```
|
|
|
|
Also review `./terraform/config.tf` file.
|
|
|
|
|
|
|
|
Launch the environment by going into `terraform` folder and running
|
|
|
|
```angular2html
|
|
|
|
terraform init
|
|
|
|
terraform apply
|
|
|
|
```
|
2019-12-17 18:01:58 +08:00
|
|
|
|
|
|
|
## Usage
|
2020-01-20 18:32:27 +08:00
|
|
|
|
2020-03-18 17:49:33 +08:00
|
|
|
0. Add your machine's IP to the `os_compat_island` security group ingress rules.
|
2019-12-19 19:54:22 +08:00
|
|
|
1. Launch os_compat_ISLAND machine and upload your binaries/update island. Reset island environment.
|
2020-03-18 17:49:33 +08:00
|
|
|
2. Launch/Reboot all other os_compat test machines (Can be filtered with tag "Purpose: os_compat_instance")
|
2019-12-17 18:01:58 +08:00
|
|
|
3. Wait until machines boot and run monkey
|
2022-04-15 21:40:34 +08:00
|
|
|
4. Launch `test_compatibility.py` pytest script with island ip parameter
|
2019-12-17 18:01:58 +08:00
|
|
|
(e.g. `test_compatibility.py --island 111.111.111.111:5000`)
|
2020-01-20 18:32:27 +08:00
|
|
|
|
|
|
|
## Machines
|
|
|
|
|
|
|
|
Since island machine is built from custom AMI it already has the following credentials:
|
|
|
|
|
|
|
|
Administrator: %tPHGz8ZuQsBnEUgdpz!6f&elGnFy?;.
|
|
|
|
|
2020-01-20 23:47:49 +08:00
|
|
|
For windows_2008_r2 Administrator:AGE(MP..txL
|
|
|
|
|
2020-01-20 18:32:27 +08:00
|
|
|
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
|
2020-01-20 23:47:49 +08:00
|
|
|
- windows_2008_r2
|
2020-01-20 18:32:27 +08:00
|
|
|
|
|
|
|
A quick reference for usernames on different machines (if in doubt check official docs):
|
|
|
|
- Ubuntu: ubuntu
|
|
|
|
- Oracle: clckwrk
|
|
|
|
- CentOS: centos
|
2020-08-31 15:36:47 +08:00
|
|
|
- Debian: admin
|
2020-01-20 18:32:27 +08:00
|
|
|
- Everything else: ec2-user
|
|
|
|
|
2020-03-18 17:49:33 +08:00
|
|
|
To manually verify the machine is compatible use commands to download and execute the monkey.
|
2020-03-18 18:39:47 +08:00
|
|
|
Also, add your IP to `os_compat_instance` security group.
|
2020-03-18 17:49:33 +08:00
|
|
|
|
|
|
|
Example commands:
|
|
|
|
- Powershell:
|
|
|
|
```cmd
|
|
|
|
[System.Net.ServicePointManager]::CertificatePolicy = New-Object TrustAllCertsPolicy
|
|
|
|
Set-MpPreference -DisableRealtimeMonitoring $true -ErrorAction SilentlyContinue
|
2022-06-02 20:00:59 +08:00
|
|
|
Invoke-WebRequest -Uri 'https://10.0.0.251:5000/api/agent-binaries/windows' -OutFile 'C:\windows\temp\monkey-windows-64.exe' -UseBasicParsing
|
2020-03-18 17:49:33 +08:00
|
|
|
C:\windows\temp\monkey-windows-64.exe m0nk3y -s 10.0.0.251:5000
|
|
|
|
```
|
|
|
|
|
|
|
|
- Bash:
|
|
|
|
```shell script
|
2022-06-02 20:00:59 +08:00
|
|
|
wget --no-check-certificate -q https://10.0.0.251:5000/api/agent-binaries/linux -O ./monkey-linux-64 || curl https://10.0.0.251:5000/api/agent-binaries/linux -k -o monkey-linux-64
|
2020-03-18 17:49:33 +08:00
|
|
|
chmod +x ./monkey-linux-64
|
|
|
|
./monkey-linux-64 m0nk3y -s 10.0.0.251:5000
|
|
|
|
```
|