Results 1 to 2 of 2

Thread: PostgreSQL in kali-rolling 2022.3

  1. #1
    Join Date
    2022-Sep
    Posts
    3

    PostgreSQL in kali-rolling 2022.3

    Hello

    I am using Kali 2022.3 in a WSL2 VM (the minimal installation from the Microsoft Store)

    Code:
    $ lsb_release -a
    No LSB modules are available.
    Distributor ID: Kali
    Description:    Kali GNU/Linux Rolling
    Release:        2022.3
    Codename:       kali-rolling
    My problem is that metasploit-framework seems to require PostreSQL 13 to work:

    Code:
    $ sudo msfdb reinit[sudo] password for kali:
    System has not been booted with systemd as init system (PID 1). Can't operate.
    Failed to connect to bus: Host is down
    [+] Starting database
    System has not been booted with systemd as init system (PID 1). Can't operate.
    Failed to connect to bus: Host is down
    psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: No such file or directory
            Is the server running locally and accepting connections on that socket?
    psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: No such file or directory
            Is the server running locally and accepting connections on that socket?
    psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: No such file or directory
            Is the server running locally and accepting connections on that socket?
    [+] Deleting configuration file /usr/share/metasploit-framework/config/database.yml
    System has not been booted with systemd as init system (PID 1). Can't operate.
    Failed to connect to bus: Host is down
    [i] Database already stopped
    System has not been booted with systemd as init system (PID 1). Can't operate.
    Failed to connect to bus: Host is down
    [+] Starting database
    System has not been booted with systemd as init system (PID 1). Can't operate.
    Failed to connect to bus: Host is down
    psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: No such file or directory
            Is the server running locally and accepting connections on that socket?
    [+] Creating database user 'msf'
    Error: PostgreSQL version 13 is not installed
    psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: No such file or directory
            Is the server running locally and accepting connections on that socket?
    [+] Creating databases 'msf'
    Error: PostgreSQL version 13 is not installed
    psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: No such file or directory
            Is the server running locally and accepting connections on that socket?
    [+] Creating databases 'msf_test'
    Error: PostgreSQL version 13 is not installed
    [+] Creating configuration file '/usr/share/metasploit-framework/config/database.yml'
    [+] Creating initial database schema
    rake aborted!
    The error doesn't look much different if I set the "PGPORT" variable to use Port 5433 (my PostgreSQL 14). And the kali sources do not seem to have a package for PostgreSQL 13:

    Code:
    $ sudo apt install postgresql-13Reading package lists... Done
    Building dependency tree... Done
    Reading state information... Done
    Package postgresql-13 is not available, but is referred to by another package.
    This may mean that the package is missing, has been obsoleted, or
    is only available from another source
    
    
    E: Package 'postgresql-13' has no installation candidate
    I have tried to install PostgreSQL from a different source:

    Code:
    deb http://apt.postgresql.org/pub/repos/apt jammy-pgdg main
    But that also didn't work as it required "libicu70" and the kali repos only seem to have "libicu71" and changing further dependencies seemed very hacky.

    Is there a way to get this to work?

  2. #2
    Join Date
    2022-Sep
    Posts
    3
    I figured it out. Seems like msfdb does not like PostgreSQL on any port other than 5432. Opened a github issue here: https://github.com/rapid7/metasploit...k/issues/17017.

    The solution for me was to configure PostgreSQL to listen to port 5432 by setting
    Code:
    port = 5432
    in
    Code:
    /etc/postgresql/14/main/postgresql.conf
    and restarting the service.

Similar Threads

  1. Tips for buying WiFi adapter kali rolling version 2022.4 ?
    By thewolf in forum Installing Archive
    Replies: 1
    Last Post: 2023-02-19, 03:53
  2. Replies: 1
    Last Post: 2023-01-21, 21:01
  3. Problem installing cuda 2022.1 kali-rolling
    By HereToHelp in forum TroubleShooting Archive
    Replies: 0
    Last Post: 2022-02-13, 20:54
  4. Replies: 0
    Last Post: 2022-01-05, 05:29

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •