Skip to content

Metasploit the world’s most used penetration testing framework

License

Notifications You must be signed in to change notification settings

sonnyyu/docker-metasploit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Build it:

git clone https://github.com/sonnyyu/docker-metasploit/
cd docker-metasploit

Create a directory metasploit & postgres

mkdir $HOME/docker-metasploit/msf4
mkdir $HOME/docker-metasploit/msf4/database

Create docker network

docker network create --subnet=172.28.0.0/16 msf

Create postgres

docker run --ip 172.28.0.2 --network msf --rm --name postgres \
-v "${HOME}/docker-metasploit/msf4/database:/var/lib/postgresql/data" -e POSTGRES_PASSWORD=postgres \
-e POSTGRES_USER=postgres -e POSTGRES_DB=msf -d postgres:11-alpine

Setup metasploit

docker run --rm -it --network msf --name msf \
--ip 172.28.0.3 -e DATABASE_URL='postgres://postgres:postgres@172.28.0.2:5432/msf' \
-v "${HOME}/docker-metasploit/msf4:/home/msf/.msf4"  \
metasploitframework/metasploit-framework

Save database setting

db_save

Run Metasploit

docker run --rm -it -u 0 --network msf --name msf \
--ip 172.28.0.3 -v "${HOME}/docker-metasploit/msf4:/home/msf/.msf4" \
-p 8443-8500:8443-8500 metasploitframework/metasploit-framework

Create a symbolic link

sudo ln -s /home/sonnyyu/docker-metasploit/msf /usr/bin/msf

Releases

No releases published

Packages

No packages published

Languages