The-Art-of-Hacking / websploit

This is a virtual machine (VM) created by Omar Santos for different Cybersecurity Ethical Hacking (Web Penetration Testing) training sessions .The purpose of this VM is to have a single VM lab environment with several vulnerable applications running in Docker containers; the tools that come in Kali Linux; a few additional tools; intentionally vulnerable applications running in Docker containers, and a mobile device emulator. https://websploit.h4cker.org
https://websploit.h4cker.org
MIT License
269 stars 78 forks source link

v2020-01 - Port mapping mismatch #2

Open slobodansimic opened 4 years ago

slobodansimic commented 4 years ago

Hi,

There is a mismatch between the output of containers.sh and the actual containers' mapping ports.

The following are the WebSploit vulnerable containers and associated exposed ports.

Vuln App Container Port
webgoat 8881
juice-shop 8882
dvwa 8883
mutillidae_2 8884
bwapp2 8885
dvna 8886
hackazon 8887
hackme-rtov 8888
IMAGE PORTS NAMES
santosomar/hackme-rtov 0.0.0.0:9000->80/tcp hackme-rtov
santosomar/hackazon 0.0.0.0:6667->80/tcp hackazon
santosomar/dvna 0.0.0.0:6666->9090/tcp dvna
santosomar/bwapp 3306/tcp, 0.0.0.0:6665->80/tcp bwapp2
santosomar/mutillidae_2 3306/tcp, 0.0.0.0:6664->80/tcp mutillidae_2
santosomar/dvwa 0.0.0.0:6663->80/tcp dvwa
santosomar/juice-shop 0.0.0.0:6662->3000/tcp juice-shop
santosomar/webgoat 0.0.0.0:6661->8080/tcp webgoat
slobodansimic commented 4 years ago

If you need to fix it, you can apply the following changes.

Stop all images docker stop $(docker ps -a -q)

Stop docker service docker stop

Update port mapping

cd /var/lib/docker/containers/
find . -type f -name hostconfig.json -exec sed -i 's/666/888/g' {} \;
find . -type f -name hostconfig.json -exec sed -i 's/9000/8888/g' {} \;

Start docker service docker start

Start all images docker start $(docker ps -a -q)

run containers.sh ~/containers.sh

Vuln App Container Port
webgoat 8881
juice-shop 8882
dvwa 8883
mutillidae_2 8884
bwapp2 8885
dvna 8886
hackazon 8887
hackme-rtov 8888
IMAGE PORTS NAMES
santosomar/hackme-rtov 0.0.0.0:8888->80/tcp hackme-rtov
santosomar/hackazon 0.0.0.0:8887->80/tcp hackazon
santosomar/dvna 0.0.0.0:8886->9090/tcp dvna
santosomar/bwapp 3306/tcp, 0.0.0.0:8885->80/tcp bwapp2
santosomar/mutillidae_2 3306/tcp, 0.0.0.0:8884->80/tcp mutillidae_2
santosomar/dvwa 0.0.0.0:8883->80/tcp dvwa
santosomar/juice-shop 0.0.0.0:8882->3000/tcp juice-shop
santosomar/webgoat 0.0.0.0:8881->8080/tcp webgoat