Getting PostgreSQL working with Kali 2.0 and Metasploit

Metaspolit and Database Issues with Kali 2.0

Many people have had database connectivity (database connect) issues with Metasploit using Kali 2.0. By the time you read this, the issue should be fixed via a new Kali distribution. If it is not, use these steps to get your SQL database properly connected to Metasploit.

Getting PostgreSQL working with Kali 2.0 and Metasploit-1

We need to determine if your Metasploit database is working properly.

  1. First, we open Metasploit by typing msfconsole.

Getting PostgreSQL working with Kali 2.0 and Metasploit-2

  1. Next we type db_status

 Getting PostgreSQL working with Kali 2.0 and Metasploit-3

You can see from the screen shot that the database is not connected.

So let’s get out of Metasploit and go back to the terminal, then follow a few steps to get things working properly.

Step 1: Updates

The first thing we will do is go thru the standard update process from the terminal by typing:

apt-get update && apt-get upgrade

Getting PostgreSQL working with Kali 2.0 and Metasploit-4

 

Step 2:

 

Wait until the update process completes. Once it has, type in the following in the terminal command line:

service postgresql restart

Getting PostgreSQL working with Kali 2.0 and Metasploit-5

Step 3:

Next, type the following command:

msfdb init

Getting PostgreSQL working with Kali 2.0 and Metasploit-6

Note: This step may take a few minutes.

 

Step 4:

 

Next, launch msfconsole…

Getting PostgreSQL working with Kali 2.0 and Metasploit-7

 

Step 5:

 

Then type in db_status.

Getting PostgreSQL working with Kali 2.0 and Metasploit-8

 

…..and…..viola! You will now see database connected.

 

All done!

Tags: