
Exploitation of CVE-2023-44604. Using a Kali Linux VM (attacker) and a Debian 11 server VM (victim)
[WARNING]
This project is intended for educational and lab purposes only. Only use these techniques in environments you own or are authorized to test.
This lab will simulate the exploitation of CVE-2023-46604, by using a Kali Linux VM (attacker) and a Debian 11 server VM (victim).
This lab only works if your host operating system is Windows!
--> If you're using Linux, this lab will not work!
WARNING
The Apache & Java software will be auto-installed (using scripts) on the VM's. Do not install these manually on your host pc!
We use the following software in this exercise:
Install VBoxManage, and make the command a env. variable:
Clone or download the repository to a location of your choice. (the vboxmanage commands needs to be able to work in this folder)
C:\Users\<user_name>\CVE-2023-46604\After you cloned the repository on your local system, add in that folder (\CVE-2023-46604\) a new folder VDI\.
Your folder structure should now look like this:
CVE-2023-46604\
│
├── .gitignore
│
├── LICENSE
│
├── README.md
│
├── scripts\
│ ├── DebCreate.ps1
│ ├── DebDelete.ps1
│ ├── KalCreate.ps1
│ ├── KalDelete.ps1
│ ├── sshDebian.ps1
│ ├── sshKali.ps1
│ ├── softwareInstallDebian.sh
│ └── softwareInstallKali.sh
│
└── VDI\
The scripts in this lab make use of VDI's to create and delete VM's. We will now download the following VDI's:
CVE-2023-46604\VDI\ folder.Debian-original.vdiCVE-2023-46604\VDI\ folder.Kali-original.vdiYour folder structure should now look like this:
CVE-2023-46604\
│
├── .gitignore
│
├── LICENSE
│
├── README.md
│
├── scripts\
│ ├── DebCreate.ps1
│ ├── DebDelete.ps1
│ ├── KalCreate.ps1
│ ├── KalDelete.ps1
│ ├── sshDebian.ps1
│ ├── sshKali.ps1
│ ├── softwareInstallDebian.sh
│ └── softwareInstallKali.sh
│
└── VDI\
├── Debian-original.vdi
└── Kali-original.vdi
Username: osboxes
Password: osboxes.org
cd scripts
.\DebCreate.ps1
.\sshDebian.ps1
[NOTE]
On the first SSH connection, you may see a message like:The authenticity of host '[127.0.0.1]:2220' can't be established. ED25519 key fingerprint is SHA256:... Are you sure you want to continue connecting (yes/no/[fingerprint])?This is normal. SSH is warning you that the VM's host key is not yet stored in your
.ssh/known_hostsfile.
If you want to check out your Debian VM, you can ssh into the VM:
ssh -p2220 [email protected]
Username: osboxes
Password: osboxes.org
cd scripts
.\KalCreate.ps1
vboxmanage startvm "Kali Linux"
# When enabling ssh, the server will from then on start on boot.
sudo systemctl enable ssh
# Power off the VM.
sudo poweroff
From this point on, SSH will automatically start when the VM boots.
If you want to check out your Kali VM, you can ssh into the VM:
ssh -p2225 [email protected]
.\sshKali.ps1
[NOTE]
On the first SSH connection, you may see a message like:The authenticity of host '[127.0.0.1]:2225' cant be established. ED25519 key fingerprint is SHA256:... Are you sure you want to continue connecting (yes/no/[fingerprint])?This is normal. SSH is warning you that the VM's host key is not yet stored in your
.ssh/known_hostsfile.
You now have Remote Command Execution (RCE) access to the Debian victim VM.
You can execute some Linux commands to verify that you now have remote acces to the Debian11 VM:
# Show the current directory
pwd
# Check the operating system
cat /etc/os-release
# Check the current user
whoami
# Check the kernel information
uname -a
After successful exploitation:
┌─────────────────────┐
│ Host System │
│ (VirtualBox Host) │
└─────────┬───────────┘
│
┌────────────────┴────────────────┐
│ │
NAT + Port Forwarding NAT + Port Forwarding
SSH: localhost:2225 SSH: localhost:2220
│ │
┌───────────┴───────────┐ ┌───────────┴───────────┐
│ Kali Linux VM │ │ Debian 11 Server │
│ (Attacker) │ │ (Victim) │
│ │ │ │
│ NIC1: NAT │ │ NIC1: NAT │
│ NIC2: Internal Net │<───────>│ NIC2: Internal Net │
│ "inet" │ │ "inet" │
└───────────────────────┘ └───────────────────────┘
When you want to create a VM, you just run the following command in the folder scripts/:
.\DebCreate.ps1.\KaliCreate.ps1When a new VM is created, the DebCreate.ps1 and KalCreate.ps1 scripts first make a copy of the original VDI file (ex. Debian-original.vdi). VBoxManage then uses this copy to create the VM.
This ensures that any software installations or configuration changes made inside a VM are not saved into future VM creations, which allows each new VM to start from a clean VDI .
After exiting a VM, you can enter one of 2 commands to delete the VM (and a copy of the VDI). Run the following command in the folder scripts/:
.\DebDelete.ps1.\KaliDelete.ps1When the VM's are created, they use a copy to operate from of an original VDI. This way, when deleting a VM, you wont have the previously installed software still on a new VM.