DEV Community

kumaran
kumaran

Posted on

Quickest Way to Setup your Metasploit Exploit Development Lab

Kali Linux image is available as a docker Image. Go to https[:]//www.kali[.]org/docs/containers/official-kalilinux-docker-images/

Pull the official Image using the docker command

docker pull kalilinux/kali-rolling

This should take few minutes based on your ISP speed.

Run the docker run command and it should spin up the container and get you a shell prompt

docker run -it kalilinux/kali-rolling /bin/bash

Once you are at the shell the image needs to be updated, I would recommend running apt update && apt -y install kali-linux-large to get all the bells and whistles. This would take some time and post completion you should have access to kali linux tools including metasploit framework

Run msfconsole and you should be prompted with the metasploit banner and msf prompt.

You could use vi but would recommend vscode as a IDE. Install the vscode docker extension and it should list the running containers.

Attach to the kalilinux container and open the /root/.msf4 folder. If the container is not running, you can start the container using vscode and attach.

Image description

create the folder /root/.msf4/modules/exploits/windows/ftp, metasploit looks for exploits under /root/.msf4/exploits/ the /windows/ftp is for our sample exploit for which we will use freefloat ftp.

create file freefloat123.rb under the folder /root/.msf4/exploits/ the /windows/ftp and copy the contents of https[:]//www.exploit-db.com/exploits/23226 as an example and save.

From vscode open a Integrated Shell or you can use docker exec -it /bin/bash to open an shell and run the command msfconsole. With in the msf shell run the command reload_all it will reload all the modules.

Your sample exploit should now be loaded and you can search for it using command search freefloat.

Top comments (0)