### Alternative Method: :::warning If you want to do everything manullay, might not have enough instructions, you need to trouble shoot things on your own. ::: You can create a folder and start running Containers individually. ##### Kali Linux Installation - Install Kali image: ```console docker pull kalilinux/kali-rolling ``` - Run interactive mode: ```console docker run -t -i kalilinux/kali-rolling /bin/bash ``` ```console apt-get update apt-get upgrade ``` ```console apt install sqlmap ``` ```console echo $USER'@'$HOSTNAME':~'" Hello, Hello, can anyone hear me?" ``` #### Challenge 1: Running WordPress - Create a docker-compose.yml with below code, Alternatively you can run containers individually. You need a Wordpress and Database - https://docs.docker.com/samples/wordpress/ ```console version: '3.1' services: wordpress: image: "wordpress:4.1.0" ports: - 8000:80 environment: WORDPRESS_DB_HOST: db WORDPRESS_DB_USER: exampleuser WORDPRESS_DB_PASSWORD: examplepass WORDPRESS_DB_NAME: exampledb WORDPRESS_CONFIG_EXTRA: define('WP_ALLOW_REPAIR', true ); define('WP_HOME','http://wpdistillery.vm'); define('WP_SITEURL','http://wpdistillery.vm'); volumes: - type: bind source: ./wpFolder target: /var/www/html db: image: mysql:5.7 environment: MYSQL_DATABASE: exampledb MYSQL_USER: exampleuser MYSQL_PASSWORD: examplepass MYSQL_RANDOM_ROOT_PASSWORD: '1' volumes: - db:/var/lib/mysql volumes: wordpress: db: ``` - Create a wpFolder - Reason: we are referring source as wpFolder on volumes, which helps to load all dependencies - You need to use name as is, as we have reference in yml file as source. - source: ./wpFolder - FIX EXPLANATION ```shell mkdir wpFolder ``` - Run Docker build: - WRITE EXPLANATION ```shell docker-compose up -d ``` ![](https://i.imgur.com/AOewVh5.png) ![](https://i.imgur.com/DJlhxVi.png) - Verify the containers installed: - WRITE EXPLANATION ```shell docker ps -a ``` ![](https://i.imgur.com/d09PeXI.png) - Visit http://localhost:8080/ to access Wordpress - It should run within localhost - Use HTTP by default its port 8080 from source yml file, if you need to change localhost change with in yml fle. - Continue with setup and login. - If you observe source file, we are running image: "wordpress:4.1.0" Invoke kali in new terminal: ```shell docker run -t -i kalilinux/kali-rolling /bin/bash ``` ```shell ping -c 3 127.0.0.1 ``` - If you receive ping: http://127.0.0.1:8080: Name or service not known or bash: ping: command not found, run this: ```shell apt-get update ``` ```shell apt-get install iputils-ping ``` Explain here - http://examplenew:8000 - If not you will see below response ![](https://i.imgur.com/rLhPtx1.png) You need to do volume mount to make Containers talk to eachother - https://www.tutorialworks.com/container-networking/ - https://medium.com/geekculture/how-to-make-docker-containers-talk-to-each-other-38029a461ad2 Use wget to download the site's default page and pipe the output to gawk, which should extract just the page title: `wget -qO- 'http://127.0.0.1:8080/' | gawk -v IGNORECASE=1 -v RS='</title' 'RT{gsub(/.*<title[^>]*>/,"");print;exit}' ` ```shell apt-get install wpscan ``` ```shell= wpscan --update ``` #### Not working, need to fix only need to run wpscan url once nano ~/.wpscan/scan.yml` - wpscan --update - wpscan -h - Is you received any errors here similar to - Could not find 'webrick' (>= 0) among 113 total gem(s) (Gem::MissingSpecError)Checked in 'GEM_PATH=/root/.local/share/gem/ruby/3.0.0:/var/lib/gems/3.0.0:/usr/local/lib/ruby/gems/3.0.0:/usr/lib/ruby/gems/3.0.0:/usr/lib/x86_64-linux-gnu/ruby/gems/3.0.0:/usr/share/rubygems-integration/3.0.0:/usr/share/rubygems-integration/all:/usr/lib/x86_64-linux-gnu/rubygems-integration/3.0.0' , execute `gem env` for more information - apt install -y ruby-full - wpscan --url http://127.0.0.1:8080 --api-token TOKEN - wget -qO- 'http://localhost:8080/' | gawk -v IGNORECASE=1 -v RS='</title' 'RT{gsub(/.*<title[^>]*>/,"");print;exit}' - There won't be an ### M1 Troubleshoot After running ```docker-compose up -d```, if you get this error ```ERROR: no matching manifest for linux/arm64/v8 in the manifest list entries```, try this: 1. ```open docker-compose.yml``` 2. Add ```platform``` under services. ```console services: db: platform: linux/x86_64 image: mysql:5.7 ... ``` 3. Save and re-run ```docker-compose up -d```. [Stack Overflow Source](https://stackoverflow.com/questions/65456814/docker-apple-silicon-m1-preview-mysql-no-matching-manifest-for-linux-arm64-v8)