Workspaces in Metasploit are used to separate datasets, allowing you to stay organized. It is a good idea to create a new workspace to organize all your collected data before starting a new penetration test, thereby avoiding contamination by previous tests.
- The default workspace is selected when connecting to the database, which is represented by the
*
character before its name:
msf > workspace * default
- To display the usage for the
workspace
command, use the-h
option as follows:
msf > workspace -h Usage: workspace List workspaces workspace -v List workspaces verbosely workspace [name] Switch workspace workspace -a [name] ... Add workspace(s) workspace -d [name] ... Delete workspace(s) workspace -D Delete all workspaces workspace -r <old> <new> Rename workspace workspace -h Show this help information
- To add a new workspace, use the
-a
option followed by the name of the workspace:
msf > workspace -a book [*] Added workspace: book
msf > workspace default * book
- To delete a workspace, use the
-d
option followed by the name of the workspace:
msf > workspace -d book [*] Deleted workspace: book [*] Switched workspace: default
- To change the current workspace, use the
workspace
command followed by the name of the workspace you want to change to:
msf > workspace book [*] Workspace: book
- To rename a workspace, use the
workspace
command with the-r
option followed by the old workspace name and the new workspace name:
msf > workspace -r book metasploit [*] Switched workspace: metasploit