Uninstalling Metasploit

When you uninstall, you remove all installed Metasploit components from the system and delete all project data. Before you remove Metasploit and its components, you should export any project data that you may want to keep, such as any reports and host data that you want to save.

Removing Metasploit from Linux Systems

  1. Open the command line terminal.
  2. Use the cd command to change the directory path to the Metasploit directory. If you installed Metasploit in the default directory, type the following:
1
$ cd ~/opt/metasploit-4.13.1

Replace the version number 4.13.1 with your version number. 3. Type the following to stop all Metasploit services and press Enter:

1
$./ctlscript.sh.stop
  1. Type the following to uninstall Metasploit and all its components:
1
$ ./uninstall
  1. Click Yes to confirm that you want to uninstall all Metasploit components and modules.
  2. Click Yes to confirm that you want to delete the data saved in the projects. If you click No, the $INSTALLER_ROOT/apps directory remains intact, and you can continue to access the Metasploit data stored in this directory.

Another option to remove Metasploit is to remove the directory.

  1. Shut down all Metasploit services.
  2. Type rm -rf /opt/metasploit The Metasploit folder and all its contents are removed.

Targeting the Right Folder

When using rm -rf make sure you are targeting the right folder. This is a destructive action and you can not go back.

Removing Metasploit from Windows Systems

  1. Navigate to Start > All Programs > Metasploit.
  2. Click Uninstall Metasploit.
  3. Click Yes to confirm that you want to delete all saved project data.
  4. Click OK when the process completes.

Removing Metasploit from macOS

  1. Open the command line terminal.
  2. Use the cd command to change the directory path to the Metasploit directory.
1
cd /opt/metasploit-framework/bin
  1. Type the following to uninstall Metasploit and all its components:
1
sudo ./msfremove
  1. Answer Y to confirm that you want to uninstall all Metasploit components and modules.