Skip to content

Installation

daniel-infosec edited this page May 2, 2019 · 7 revisions

Debian/Ubuntu

Source: https://github.com/rapid7/metasploit-framework/tree/master/docker

  • Install docker

If using Kali, follow the instructions here instead: https://medium.com/@calypso_bronte/installing-docker-in-kali-linux-2018-1-ef3a8ce3648

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
apt-key fingerprint 0EBFCD88
add-apt-repository \
   "deb [arch=amd64] https://download.docker.com/linux/debian jessie stable"
apt-get -y update
apt-get -y install docker-ce
  • Install docker-compose

https://docs.docker.com/compose/install/

  • Get the project
git clone https://github.com/praetorian-code/purple-team-attack-automation.git
cd purple-team-attack-automation
  • Modify LHOST and exposed ports
echo "version: '3'
services:
  ms:
    environment:
    # example of setting LHOST
      LHOST: 0.0.0.0
    # example of adding more ports
    ports:
      - 8080:8080
      - 443:443
      - 80:80
" > docker-compose.local.override.yml
  • Now you need to set the COMPOSE_FILE environment variable to load your local override.
echo "COMPOSE_FILE=./docker-compose.yml:./docker-compose.override.yml:./docker-compose.local.override.yml" >> .env
  • Start the docker service

service docker start

  • Build the container
docker-compose build
  • Run the container
./docker/bin/msfconsole
  • If you get permissions issues about access to a metasploit folder:
chmod -R ugo+rw ~/.msf4
  • Run reload_all so modules will show up when you search

RHEL/CentOS

(Verified with http://isoredirect.centos.org/centos/7/isos/x86_64/CentOS-7-x86_64-Minimal-1810.iso)

  • Install docker

https://docs.docker.com/install/linux/docker-ce/centos/

sudo yum install -y yum-utils \
  device-mapper-persistent-data \
  lvm2
sudo yum-config-manager \
    --add-repo \
    https://download.docker.com/linux/centos/docker-ce.repo
sudo yum install docker-ce docker-ce-cli containerd.io
  • Install docker-compose
sudo curl -L "https://github.com/docker/compose/releases/download/1.24.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
  • Get the project
git clone https://github.com/praetorian-code/purple-team-attack-automation.git
cd purple-team-attack-automation
  • Modify LHOST and exposed ports
echo "version: '3'
services:
  ms:
    environment:
    # example of setting LHOST
      LHOST: 0.0.0.0
    # example of adding more ports
    ports:
      - 8080:8080
      - 443:443
      - 80:80
" > docker-compose.local.override.yml
  • Now you need to set the COMPOSE_FILE environment variable to load your local override.
echo "COMPOSE_FILE=./docker-compose.yml:./docker-compose.override.yml:./docker-compose.local.override.yml" >> .env
  • Build the container
sudo docker-compose build

(You may need to use sudo to build and run the container depending on your system configuration.)

  • Run the container
sudo ./docker/bin/msfconsole
You can’t perform that action at this time.