Results 1 to 3 of 3

Thread: Kali v2.0 + msfdb + postgresql + armitage problem

  1. #1

    Kali v2.0 + msfdb + postgresql + armitage problem

    Hi,

    I'm trying to run armitage in Kali v2.0 + USB persistence. But i got a problem with "msfdb init" that i'm unable to fix.

    I've got latest version from all modules
    - armitage150813
    - postgresql 9.4

    Code:
    root@kali:~# apt-get clean && apt-get update && apt-get upgrade
    ...
    root@kali:~# /etc/init.d/postgresql start
    [ ok ] Starting postgresql (via systemctl): postgresql.service.
    
    root@kali:~# msfdb reinit
    psql: could not connect to server: No such file or directory
            Is the server running locally and accepting
            connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
    
    root@kali:~# netstat -nlp | grep 5432
    root@kali:~#
    
    root@kali:~# armitage[*] Starting msfrpcd for you.
    [*] MSGRPC starting on 127.0.0.1:55553 (NO SSL):Msg...
    Anyone knows how to fix this ?

    Armitage Error.jpg
    Last edited by brunoaduarte; 2015-12-30 at 04:25.

  2. #2
    Join Date
    2013-Mar
    Location
    milano
    Posts
    301
    Quote Originally Posted by brunoaduarte View Post
    Hi,

    I'm trying to run armitage in Kali v2.0 + USB persistence. But i got a problem with "msfdb init" that i'm unable to fix.

    I've got latest version from all modules
    - armitage150813
    - postgresql 9.4

    Code:
    root@kali:~# apt-get clean && apt-get update && apt-get upgrade
    ...
    root@kali:~# /etc/init.d/postgresql start
    [ ok ] Starting postgresql (via systemctl): postgresql.service.
    
    root@kali:~# msfdb reinit
    psql: could not connect to server: No such file or directory
            Is the server running locally and accepting
            connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
    
    root@kali:~# netstat -nlp | grep 5432
    root@kali:~#
    
    root@kali:~# armitage[*] Starting msfrpcd for you.
    [*] MSGRPC starting on 127.0.0.1:55553 (NO SSL):Msg...
    Anyone knows how to fix this ?

    Armitage Error.jpg
    hi :-)
    if this can be a little input for help(i'm not expert)
    I THINK try to delete database.yml(/usr/share/metasploit-framework/config/database.yml) && create a new one with msfdb command:
    root@kali:~# msfdb

    Manage a metasploit framework database

    msfdb init # initialize the database
    msfdb reinit # delete and reinitialize the database
    msfdb delete # delete database and stop using it
    msfdb start # start the database
    msfdb stop # stop the database

    root@kali:~#

    OR:
    IF YOU launch msfconsole && type db_status ..you GET postgresql SELECTION but NO connection???
    if yes && if you want && if it work in kali2.0 :
    create manually "based on postgresql" && connect to metasploit && armitage
    my OLD video"test in kali 1.1.a"....around 7' minute & 38 sec
    https://vimeo.com/124689095
    OR :
    reinstall all packages && RE msfdbinit

    NORMAL work in kali-sana:
    http://postimg.org/image/fd5n7tvot/full/
    Last edited by zimmaro; 2015-12-30 at 06:19.
    I'm a g0at

  3. #3
    Thank you very much @zimmaro !!!

    Seems that the "purge" option when uninstalling modules + the manual remove of "/usr/share/metasploit-framework" folder did the job !

    Code:
    root@kali:~# apt-get purge postgresql-9.4 metasploit-framework -y
    
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    The following packages will be REMOVED:
      armitage* metasploit-framework* postgresql* postgresql-9.4*
    0 upgraded, 0 newly installed, 4 to remove and 2 not upgraded.
    After this operation, 191 MB disk space will be freed.
    (Reading database ... 349720 files and directories currently installed.)
    Removing armitage (20150812-1kali1) ...
    Removing metasploit-framework (4.11.5-2015121501-0kali1~r1u1) ...
    Removing postgresql (9.4+165) ...
    Removing postgresql-9.4 (9.4.5-0+deb8u1) ...
    Purging configuration files for postgresql-9.4 (9.4.5-0+deb8u1) ...
    Dropping cluster main...
    Processing triggers for man-db (2.7.0.2-5) ...
    Processing triggers for postgresql-common (165) ...
    supported-versions: WARNING! Unknown distribution: kali
    debian found in ID_LIKE, treating as Debian
    supported-versions: WARNING: Unknown Debian release: 2.0
    Building PostgreSQL dictionaries from installed myspell/hunspell packages...
      en_us
    Removing obsolete dictionary files:
    
    root@kali:~# rm -rf /usr/share/metasploit-framework
    
    root@kali:~#
    Code:
    root@kali:~# apt-get install armitage -y
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    The following extra packages will be installed:
      metasploit-framework postgresql postgresql-9.4
    Suggested packages:
      postgresql-doc oidentd ident-server
    The following NEW packages will be installed:
      armitage metasploit-framework postgresql postgresql-9.4
    0 upgraded, 4 newly installed, 0 to remove and 2 not upgraded.
    Need to get 0 B/66.1 MB of archives.
    After this operation, 191 MB of additional disk space will be used.
    Selecting previously unselected package postgresql-9.4.
    (Reading database ... 335652 files and directories currently installed.)
    Preparing to unpack .../postgresql-9.4_9.4.5-0+deb8u1_i386.deb ...
    Unpacking postgresql-9.4 (9.4.5-0+deb8u1) ...
    Selecting previously unselected package postgresql.
    Preparing to unpack .../postgresql_9.4+165_all.deb ...
    Unpacking postgresql (9.4+165) ...
    Selecting previously unselected package metasploit-framework.
    Preparing to unpack .../metasploit-framework_4.11.5-2015121501-0kali1~r1u1_i386.deb ...
    Unpacking metasploit-framework (4.11.5-2015121501-0kali1~r1u1) ...
    
    Selecting previously unselected package armitage.
    Preparing to unpack .../armitage_20150812-1kali1_all.deb ...
    Unpacking armitage (20150812-1kali1) ...
    Processing triggers for postgresql-common (165) ...
    supported-versions: WARNING! Unknown distribution: kali
    debian found in ID_LIKE, treating as Debian
    supported-versions: WARNING: Unknown Debian release: 2.0
    Building PostgreSQL dictionaries from installed myspell/hunspell packages...
      en_us
    Removing obsolete dictionary files:
    Processing triggers for man-db (2.7.0.2-5) ...
    Setting up postgresql-9.4 (9.4.5-0+deb8u1) ...
    Creating new cluster 9.4/main ...
      config /etc/postgresql/9.4/main
      data   /var/lib/postgresql/9.4/main
      locale en_US.UTF-8
      port   5432
    update-alternatives: using /usr/share/postgresql/9.4/man/man1/postmaster.1.gz to provide /usr/share/man/man1/postmaster.1.gz (postmaster.1.gz) in auto mode
    Setting up postgresql (9.4+165) ...
    Setting up metasploit-framework (4.11.5-2015121501-0kali1~r1u1) ...
    update-alternatives: using /usr/share/metasploit-framework/msfbinscan to provide /usr/bin/msfbinscan (msfbinscan) in auto mode
    update-alternatives: using /usr/share/metasploit-framework/msfconsole to provide /usr/bin/msfconsole (msfconsole) in auto mode
    update-alternatives: using /usr/share/metasploit-framework/msfd to provide /usr/bin/msfd (msfd) in auto mode
    update-alternatives: using /usr/share/metasploit-framework/msfdb to provide /usr/bin/msfdb (msfdb) in auto mode
    update-alternatives: using /usr/share/metasploit-framework/msfelfscan to provide /usr/bin/msfelfscan (msfelfscan) in auto mode
    update-alternatives: using /usr/share/metasploit-framework/msfmachscan to provide /usr/bin/msfmachscan (msfmachscan) in auto mode
    update-alternatives: using /usr/share/metasploit-framework/msfpescan to provide /usr/bin/msfpescan (msfpescan) in auto mode
    update-alternatives: using /usr/share/metasploit-framework/msfrop to provide /usr/bin/msfrop (msfrop) in auto mode
    update-alternatives: using /usr/share/metasploit-framework/msfrpc to provide /usr/bin/msfrpc (msfrpc) in auto mode
    update-alternatives: using /usr/share/metasploit-framework/msfrpcd to provide /usr/bin/msfrpcd (msfrpcd) in auto mode
    update-alternatives: using /usr/share/metasploit-framework/msfupdate to provide /usr/bin/msfupdate (msfupdate) in auto mode
    update-alternatives: using /usr/share/metasploit-framework/msfvenom to provide /usr/bin/msfvenom (msfvenom) in auto mode
    Setting up armitage (20150812-1kali1) ...
    root@kali:~#
    Code:
    root@kali:~# service postgresql start
    root@kali:~# /etc/init.d/postgresql start
    [ ok ] Starting postgresql (via systemctl): postgresql.service.
    root@kali:~#
    Now finally i got the unix service running in /var/run/postgresql/.s.PGSQL.5432

    Code:
    root@kali:~# netstat -nlp | grep 5432
    tcp        0      0 127.0.0.1:5432          0.0.0.0:*               LISTEN      8122/postgres   
    tcp6       0      0 ::1:5432                :::*                    LISTEN      8122/postgres   
    unix  2      [ ACC ]     STREAM     LISTENING     33689    8122/postgres       /var/run/postgresql/.s.PGSQL.5432
    And finally

    Code:
    root@kali:~# msfdb init
    Creating database user 'msf'
    Enter password for new role: 
    Enter it again: 
    Creating databases 'msf' and 'msf_test'
    Creating configuration file in /usr/share/metasploit-framework/config/database.yml
    Creating initial database schema
    root@kali:~# msfconsole
                                                      
    
     ______________________________________________________________________________
    |                                                                              |
    |                   METASPLOIT CYBER MISSILE COMMAND V4                        |
    |______________________________________________________________________________|
          \                                  /                      /
           \     .                          /                      /            x
            \                              /                      /
             \                            /          +           /
              \            +             /                      /
               *                        /                      /
                                       /      .               /
        X                             /                      /            X
                                     /                     ###
                                    /                     # % #
                                   /                       ###
                          .       /
         .                       /      .            *           .
                                /
                               *
                      +                       *
    
                                           ^
    ####      __     __     __          #######         __     __     __        ####
    ####    /    \ /    \ /    \      ###########     /    \ /    \ /    \      ####
    ################################################################################
    ################################################################################
    # WAVE 4 ######## SCORE 31337 ################################## HIGH FFFFFFFF #
    ################################################################################
                                                               http://metasploit.pro
    
    
    Taking notes in notepad? Have Metasploit Pro track & report
    your progress and findings -- learn more on http://rapid7.com/metasploit
    
           =[ metasploit v4.11.5-2015121501                   ]
    + -- --=[ 1517 exploits - 871 auxiliary - 256 post        ]
    + -- --=[ 436 payloads - 37 encoders - 8 nops             ]
    + -- --=[ Free Metasploit Pro trial: http://r-7.co/trymsp ]
    
    msf > db_status
    [*] postgresql connected to msf
    msf >
    Thanks again !!!
    Last edited by brunoaduarte; 2015-12-30 at 12:49.

Similar Threads

  1. Issues starting Postgresql to run Armitage
    By cyberphreax in forum TroubleShooting Archive
    Replies: 0
    Last Post: 2014-09-19, 11:31
  2. Postgresql problem
    By charsta in forum TroubleShooting Archive
    Replies: 2
    Last Post: 2013-06-01, 16:14

Posting Permissions

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