Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Improve msfdb to work with pg_createcluster, pg_ctlcluster and other Debian-specific tools #11369
The msfdb script that you provide does not run out of the box on Debian/Ubuntu/Kali (see #10939) because the Debian packages do not provide
The reason for this is that the Debian packages provide some higher level helper tools to manage multiple instances of the database:
Due to this, in Kali we are still using our former "msfdb" script (see discussion https://bugs.kali.org/view.php?id=4374). But we are thus missing the features to control the webservice server.
It would be nice if your msfdb script could work in a Debian-based environment by leveraging the above tools instead of trying to use
At a personal level, I find the end-to-end management of the database service questionable. Kali's version of msfdb just assumed that there was a "postgresql" service that we can start and stop through systemd and would initialize the metasploit database in the pre-existing PostgreSQL instance and it would be nice if your msfdb allowed us to continue doing that without requiring a supplementary PostgreSQL instance.
On a related note, this cluster management system is already managing dynamically the port numbers above 5432 for alternate clusters and it is thus likely that your own allocation logic in msfdb would conflict with this one.
referenced this issue
Feb 7, 2019
@rhertzog I recently looked into the
In your preferred use case, how is Metasploit configured to use pre-existing PostgreSQL instance?
I guess so. Usually when there are two versions, it's because an upgrade is needed/planned and we are better creating the metasploit cluster using the latest version. That said a point can be made that if the ugprade did not happen yet, we might be better using the default version (i.e. the one which runs on port 5432). The difference is rather minimal and both approaches are OK.
But somehow it depends on how you envision the use of the cluster... do you want a single metasploit cluster on the system shared by all users or do you want to setup a cluster for each metasploit user?
In Debian/Kali, if you install postgresql (which we do by way of dependencies) you can assume that there will be an instance configured to run on the default port 5432 and that it will be started with "systemctl start postgresql". From there on, our current msfdb just creates a dedicated user and database in that instance (by relying on the fact that the "postgres" unix user is the super user for that instance).