Fading Coder

One Final Commit for the Last Sprint

Home > Tech > Content

Deploying Vulnerable Environments with Vulhub and Docker

Tech May 15 1

Host Privilege Configuration

Administrative permissions are necessary for managing container environments. Verify the active session and elevate privileges:

id
sudo -i

If the administrative account lacks credentials, assign them using:

echo "root:strongpass" | chpasswd

Network Isolation and Remote Access

Configuring the virtual machine network adapter to NAT mode isolates the lab topology via vmnet8 while permitting outbound connectivity through the host IP. To facilitate remote terminal access from the host workstation, deploy an SSH daemon:

apt update & apt install -y openssh-server

Modify the daemon parameters to permit administrative logins:

SSH_CFG="/etc/ssh/sshd_config"
cp $SSH_CFG ${SSH_CFG}.orig
sed -i 's/^#PermitRootLogin.*/PermitRootLogin yes/' $SSH_CFG
sed -i 's/^#PasswordAuthentication.*/PasswordAuthentication yes/' $SSH_CFG
systemctl enable --now ssh

Resolving Local Port Conflicts

Default configurations may reserve port 53 for local DNS resolution, which conflicts with containerized DNS services. Identify active listeners and neutralize the conflict:

ss -tulnp | grep :53
NM_CFG="/etc/NetworkManager/NetworkManager.conf"
cp $NM_CFG ${NM_CFG}.orig
sed -i 's/^dns=dnsmasq/#dns=dnsmasq/' $NM_CFG
systemctl restart NetworkManager

Provisioning Docker and Vulhub

Acquire the container orchestration tools and the vulnerability repository:

curl -fsSL https://get.docker.com | bash
docker --version
apt install -y python3-pip
pip3 install docker-compose

Retrieve the Vulhub project assets and instantiate a specific vulnerable application:

git clone https://github.com/vulhub/vulhub.git /opt/vulhub_repo
cd /opt/vulhub_repo/flask/ssti
docker-compose build
docker-compose up -d

Following experimentation, tear down the resources to restore system state:

docker-compose down -v
Tags: vulhubdocker

Related Articles

Understanding Strong and Weak References in Java

Strong References Strong reference are the most prevalent type of object referencing in Java. When an object has a strong reference pointing to it, the garbage collector will not reclaim its memory. F...

Comprehensive Guide to SSTI Explained with Payload Bypass Techniques

Introduction Server-Side Template Injection (SSTI) is a vulnerability in web applications where user input is improper handled within the template engine and executed on the server. This exploit can r...

Implement Image Upload Functionality for Django Integrated TinyMCE Editor

Django’s Admin panel is highly user-friendly, and pairing it with TinyMCE, an effective rich text editor, simplifies content management significantly. Combining the two is particular useful for bloggi...

Leave a Comment

Anonymous

◎Feel free to join the discussion and share your thoughts.