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
- Open the command line terminal.
- 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
- Type the following to uninstall Metasploit and all its components:
1$ ./uninstall
- Click Yes to confirm that you want to uninstall all Metasploit components and modules.
- 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.
- Shut down all Metasploit services.
- 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
- Navigate to Start > All Programs > Metasploit.
- Click Uninstall Metasploit.
- Click Yes to confirm that you want to delete all saved project data.
- Click OK when the process completes.
Removing Metasploit from macOS
- Open the command line terminal.
- Use the
cd
command to change the directory path to the Metasploit directory.
1cd /opt/metasploit-framework/bin
- Type the following to uninstall Metasploit and all its components:
1sudo ./msfremove
- Answer Y to confirm that you want to uninstall all Metasploit components and modules.
Did this page help you?