View Issue Details

IDProjectCategoryView StatusLast Update
0001001Kali LinuxKali Package Bugpublic2025-07-14 09:36
Reporterjholister Assigned Tobrandont  
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionwon't fix 
PlatformVirtualboxOSWindowsOS Version8.1
Product Version1.0.6 
Summary0001001: Postgresql misconfiguration at boot - Metasploit unable to load databases on VM image.
Description

After downloading and installing the VM image, when you run metasploit, you are greeted with an error stating you cannot connect to database.
This appears to be due to a mis-configuration in the /etc/postgresql/9.1/main/postgresql.conf file which is causing postgresql to start on port 5433 instead of 5432. After making corrections to this file so it starts on the proper port of 5432 instead of 5433. The error in connecting to the port disappears and you are left with a new one stating:
"Failed to connect to database: Fatal: Password authentication failed for "msf3"

Steps To Reproduce

How to reproduce issue:

  1. Install Virtualbox from website
    https://www.virtualbox.org/wiki/Downloads
  2. Download (via torrent) Kali VM from:
    http://www.offensive-security.com/kali-llnux-vmware-arm-image-download/
  3. Validate checksum
  4. Create new image in virtualbox using the VMDK
  5. At terminal run:
    service postgresql start ; service metasploit start ; msfconsole
    You will receive the error indicated in the attached file.
Additional Information

After running service postgresql start, ss -ant will reveal that postgresql is operating on port 5433 instead of 5432. This appears to cause the failure.

/opt/metasploit/apps/pro/ui/config/database.yml show:
development:
adapter: postgresql
database: "msf3"
username: "msf3"
password: "zFhyomTtRt4P8ZF868KUyhmKvqQkvjE" (changed)
host: localhost
port: 5432
pool: 5
timeout: 5
################################################
below that is the same for production.

/etc/postgresql/9.1/main/postgresql.conf:
Port = 5433

Attached Files
Troubleshoot Kali.JPG (112,259 bytes)   
Troubleshoot Kali.JPG (112,259 bytes)   
kali troubleshoot 2.JPG (20,210 bytes)   
kali troubleshoot 2.JPG (20,210 bytes)   
initial.JPG (83,158 bytes)   
initial.JPG (83,158 bytes)   
ssant.JPG (22,669 bytes)   
ssant.JPG (22,669 bytes)   
postgresconf.JPG (45,912 bytes)   
postgresconf.JPG (45,912 bytes)   

Activities

jholister

jholister

2014-01-31 09:06

reporter   ~0001478

I got a fix for this issue from the guys at rapid 7
https://community.rapid7.com/message/11561

brandont

brandont

2014-02-03 18:42

reporter   ~0001486

Hi jholister. It looks like you were able to fix this issue.

Just curious, do you know why Postgres was originally listening on port 5433 instead of 5432? Metasploit (on Kali) uses the default Postgres port (5432) and expects the system installed Postgres to be listening on that port.

Do you have any other software (e.g. Nexpose) with a custom version of Postgres installed?

jholister

jholister

2014-02-03 23:15

reporter   ~0001487

When I installed the "Kali Linux 1.0.6 32 bitVMWare" from:
http://www.offensive-security.com/kali-llnux-vmware-arm-image-download/
Using the bit torrent option to download it,
After I installed it on virtualbox it loaded like this by default.
I'm going to re-download the torrent to see if I can replicate the issue again.
I'll report back with my findings.

jholister

jholister

2014-02-04 04:46

reporter   ~0001488

Ok, I've verified my initial issue. It is absolutely reproducable every time I try as listed above.
I've attached some images, this is the only thing I've done after starting up this VM.

jholister

jholister

2014-02-04 04:51

reporter   ~0001489

and to answer your question directly:
It's listening on port 5433 because the /etc/postgresql/9.1/main/postgresql.conf is set to listen to it by default on this image.
Modifying that file seems to fix that specific issue. But the database begins to give you authentication errors with msf3 once you fix it.

jholister

jholister

2014-02-04 04:52

reporter   ~0001490

Also of note, this is for the 32bit vm specifically, I'm not sure the same issue occurs on the 64bit vm.

jaimechiquita111

jaimechiquita111

2014-02-10 16:11

reporter   ~0001512

To enable Postgresql in MSF do this once

service postgresql start
service metasploit start
msfconsole
msf> db_status
msf> update-rc.d postgresql enable
msf> update-rc.d metasploit enable

rhertzog

rhertzog

2015-08-31 12:42

administrator   ~0003860

This bug is no longer relevant.

Issue History

Date Modified Username Field Change
2014-01-28 18:06 jholister New Issue
2014-01-28 18:06 jholister File Added: Troubleshoot Kali.JPG
2014-01-28 19:53 jholister File Added: kali troubleshoot 2.JPG
2014-01-31 09:06 jholister Note Added: 0001478
2014-02-03 18:42 brandont Note Added: 0001486
2014-02-03 18:42 brandont Assigned To => brandont
2014-02-03 18:42 brandont Status new => assigned
2014-02-03 23:15 jholister Note Added: 0001487
2014-02-04 04:46 jholister Note Added: 0001488
2014-02-04 04:46 jholister File Added: initial.JPG
2014-02-04 04:47 jholister File Added: ssant.JPG
2014-02-04 04:47 jholister File Added: postgresconf.JPG
2014-02-04 04:51 jholister Note Added: 0001489
2014-02-04 04:52 jholister Note Added: 0001490
2014-02-10 16:11 jaimechiquita111 Note Added: 0001512
2015-08-31 12:42 rhertzog Note Added: 0003860
2015-08-31 12:42 rhertzog Status assigned => closed
2015-08-31 12:42 rhertzog Resolution open => won't fix
2025-07-14 09:36 g0tmi1k Priority high => normal