Metasploit-framework: Metasploit is not following the XDG directory standards

Created on 7 Feb 2019  路  4Comments  路  Source: rapid7/metasploit-framework

I noticed that it created a database at /home/aaronfranke/.msf4/db on my system. This is not following the XDG Base Directory Specification.

Steps to reproduce

How'd you do it?

  1. Install and run Metasploit.
  2. Note how it creates a directory in your home directory.

Expected behavior

Metasploit should create it in $XDG_CONFIG_HOME/msf4 or ~/.config/msf4.

Current behavior

Metasploit creates it in ~/.msf4

System stuff

Metasploit version

Framework: 5.0.5-dev-
Console  : 5.0.5-dev-

I installed Metasploit with:

  • [ ] Kali package via apt
  • [ ] Omnibus installer (nightly)
  • [x] Commercial/Community installer (from http://www.rapid7.com/products/metasploit/download.jsp)
  • [ ] Source install (please specify ruby version)

OS

Ubuntu 18.04.

enhancement

Most helpful comment

Hello,

since this issue is dead for 2 years now I would like to "reopen" it.
The application could simply check for configuration under $XDG_CONFIG_HOME/metasploit and if it wasn't available it would next look under $HOME/.config/metasploit and than fallback to currently used configuration which is $HOME/.msf4. If the configuration didn't exist in any of those locations the application would dump default configuration under $XDG_CONFIG_HOME/metasploit if the variable has been set or else under $HOME/.config/metasploit.

I just want to discuss it a little bit, because I hate last few dotfiles in my cluttered $HOME and I would like to manage my dotfiles properly in a standardized way.

All 4 comments

Good suggestion, though it does come at a cost of invalidating a decade of documentation on the internet and in print. Any suggestions for avoiding mass confusion in the process?

I think if we moved to .config we would probably also change from msf4 to metasploit at the same time.

image

@busterb You could have it create a symlink while the documentation is catching up, and remove the symlink after all the documentation has changed. As long as you test that the program works without the symlink (i.e. Metasploit always points to $XDG_CONFIG_HOME/metasploit and/or .config/metasploit).

Hello,

since this issue is dead for 2 years now I would like to "reopen" it.
The application could simply check for configuration under $XDG_CONFIG_HOME/metasploit and if it wasn't available it would next look under $HOME/.config/metasploit and than fallback to currently used configuration which is $HOME/.msf4. If the configuration didn't exist in any of those locations the application would dump default configuration under $XDG_CONFIG_HOME/metasploit if the variable has been set or else under $HOME/.config/metasploit.

I just want to discuss it a little bit, because I hate last few dotfiles in my cluttered $HOME and I would like to manage my dotfiles properly in a standardized way.

Was this page helpful?
0 / 5 - 0 ratings