Results 1 to 11 of 11

Thread: Metasploit Broke with Update.

  1. #1
    Join Date
    2013-Mar
    Posts
    20

    Metasploit Broke with Update.

    Well just ran the update for Kali and notice there was an update for 94.6 mb... Well after the upgrade metasploit broke... ugh!!!!!!!!


    I did stop and start the postgresql service.

    =[ metasploit v4.6.0-dev [core:4.6 api:1.0]
    + -- --=[ 1053 exploits - 590 auxiliary - 174 post
    + -- --=[ 275 payloads - 28 encoders - 8 nops

    msf > db_status[*] postgresql selected, no connection
    msf > db_connect root@metasploit
    [-] Error while running command db_connect: Failed to connect to the database: FATAL: role "root" does not exist


    Call stack:
    /opt/metasploit/apps/pro/msf3/lib/msf/ui/console/command_dispatcher/db.rb:1600:in `db_connect_postgresql'
    /opt/metasploit/apps/pro/msf3/lib/msf/ui/console/command_dispatcher/db.rb:1438:in `cmd_db_connect'
    /opt/metasploit/apps/pro/msf3/lib/rex/ui/text/dispatcher_shell.rb:427:in `run_command'
    /opt/metasploit/apps/pro/msf3/lib/rex/ui/text/dispatcher_shell.rb:389:in `block in run_single'
    /opt/metasploit/apps/pro/msf3/lib/rex/ui/text/dispatcher_shell.rb:383:in `each'
    /opt/metasploit/apps/pro/msf3/lib/rex/ui/text/dispatcher_shell.rb:383:in `run_single'
    /opt/metasploit/apps/pro/msf3/lib/rex/ui/text/shell.rb:200:in `run'
    /opt/metasploit/apps/pro/msf3/msfconsole:168:in `<main>'
    msf > exit
    root@Matrix:~# msfupdate[*][*] Attempting to update the Metasploit Framework...[*]
    [*] Checking for updates[*] No updates available



    other thing also when you do the msfupdate it doesn't pick up any updates. But if you're in metasploit and run the msfpro you will see new updates.. weird how that works.

    Has anyone had this problem?

  2. #2
    Join Date
    2013-Mar
    Posts
    10
    I have had the problem with msfupdate not pulling any updates. But haven't had time yet to figure out a fix.

    About your error, I had this once when I forgot to start the metasploit service before running msfconsole. Did you by any chance forget to start the service? But if the service was started and you are still getting the error I would probably start by uninstalling metasploit and pulling it again from the repo's.

  3. #3
    Join Date
    2013-Mar
    Posts
    20
    Nope still the same issue i'm having... I'm going to try to download it again and install it.

  4. #4
    Join Date
    2013-Mar
    Posts
    4
    Hi Malachai - I have not seen this issue. Was there an error message above the msfconsole banner? If you don't care about your current database, you can wipe the whole thing by reinstalling:

    apt-get purge metasploit && apt-get install metasploit

    Also what do you mean by "if you're in metasploit and run the msfpro"?

  5. #5
    Join Date
    2013-Mar
    Posts
    4
    Quote Originally Posted by Su1ph3r View Post
    I have had the problem with msfupdate not pulling any updates. But haven't had time yet to figure out a fix.
    On Kali, msfupdate pulls weekly updates rather than bleeding edge updates from git. This may be why you haven't seen an update yet.

  6. #6
    Join Date
    2013-Mar
    Posts
    12
    Quote Originally Posted by Malachai View Post
    Well just ran the update for Kali and notice there was an update for 94.6 mb... Well after the upgrade metasploit broke... ugh!!!!!!!!


    I did stop and start the postgresql service.

    =[ metasploit v4.6.0-dev [core:4.6 api:1.0]
    + -- --=[ 1053 exploits - 590 auxiliary - 174 post
    + -- --=[ 275 payloads - 28 encoders - 8 nops

    msf > db_status[*] postgresql selected, no connection
    msf > db_connect root@metasploit
    [-] Error while running command db_connect: Failed to connect to the database: FATAL: role "root" does not exist


    Call stack:
    /opt/metasploit/apps/pro/msf3/lib/msf/ui/console/command_dispatcher/db.rb:1600:in `db_connect_postgresql'
    /opt/metasploit/apps/pro/msf3/lib/msf/ui/console/command_dispatcher/db.rb:1438:in `cmd_db_connect'
    /opt/metasploit/apps/pro/msf3/lib/rex/ui/text/dispatcher_shell.rb:427:in `run_command'
    /opt/metasploit/apps/pro/msf3/lib/rex/ui/text/dispatcher_shell.rb:389:in `block in run_single'
    /opt/metasploit/apps/pro/msf3/lib/rex/ui/text/dispatcher_shell.rb:383:in `each'
    /opt/metasploit/apps/pro/msf3/lib/rex/ui/text/dispatcher_shell.rb:383:in `run_single'
    /opt/metasploit/apps/pro/msf3/lib/rex/ui/text/shell.rb:200:in `run'
    /opt/metasploit/apps/pro/msf3/msfconsole:168:in `<main>'
    msf > exit
    root@Matrix:~# msfupdate[*][*] Attempting to update the Metasploit Framework...[*]
    [*] Checking for updates[*] No updates available



    other thing also when you do the msfupdate it doesn't pick up any updates. But if you're in metasploit and run the msfpro you will see new updates.. weird how that works.

    Has anyone had this problem?
    This has been answered elsewhere but with Kali, many of the services that started on login with Backtrack 5 no longer start automatically.

    Run the following:

    service postgresql start

    service metasploit start

    or, make a script and put it in /etc/init.d

    Example

    Code:
    #!/bin/bash
    
    service postgresql start;
    service metasploit start;
    save the file as msf or something other than metasploit, and put the file in /etc/init.d/


    Another option, and the way I do it is the following:

    Code:
    #!/bin/bash
    
    service postgresql start;
    service metasploit start;
    msfconsole;
    I then save the above as metasploit.sh and put it in root's home folder.

    Make sure to chmod +x the file.

    then, ./metasploit.sh to start the services AND start msfconsole. Again, there are several options. The point being, make sure to start the postgresql service AND the metasploit service BEFORE staring msfconsole.

  7. #7
    Join Date
    2013-Mar
    Posts
    4
    The easiest way I've found to start Metasploit automatically at boot is this:

    Code:
    update-rc.d postgresql enable
    update-rc.d metasploit enable
    And if you want to start metasploit now:

    Code:
    service postgresql start
    service metasploit start

  8. #8
    Join Date
    2013-Nov
    Posts
    3
    When I type try to start the service, Kali says metasploit does not exist.

    root@Imperiax:~# service postgresql start
    [ ok ] Starting PostgreSQL 9.1 database server: main.

    root@Imperiax:~# service metasploit start
    metasploit: unrecognized service


    However, if I click on Applications > Kali Linux > Top 10 Security Tools > Metasploit Framework...then metasploit launches. But inside of metasploit it is broken. When I try to run 'db_status' I get the following error:
    msf > db_status[*] postgresql selected, no connection

    So I try to reconnect the postgresql database using the default credentials Kali creates:
    msf > db_connect msf3:msf3@localhost:5432/metasploit3
    [-] Error while running command db_connect: Failed to connect to the database: FATAL: password authentication failed for user "msf3"
    FATAL: password authentication failed for user "msf3"


    Call stack:
    /usr/share/metasploit-framework/lib/msf/ui/console/command_dispatcher/db.rb:1600:in `db_connect_postgresql'
    /usr/share/metasploit-framework/lib/msf/ui/console/command_dispatcher/db.rb:1438:in `cmd_db_connect'
    /usr/share/metasploit-framework/lib/rex/ui/text/dispatcher_shell.rb:427:in `run_command'
    /usr/share/metasploit-framework/lib/rex/ui/text/dispatcher_shell.rb:389:in `block in run_single'
    /usr/share/metasploit-framework/lib/rex/ui/text/dispatcher_shell.rb:383:in `each'
    /usr/share/metasploit-framework/lib/rex/ui/text/dispatcher_shell.rb:383:in `run_single'
    /usr/share/metasploit-framework/lib/rex/ui/text/shell.rb:200:in `run'
    /usr/bin/msfconsole:168:in `<main>'
    msf >


    I am not sure where to start with fixing this...the missing service? How do I find what the postgresql usermame & password is?

  9. #9
    Join Date
    2013-Oct
    Posts
    16
    Quote Originally Posted by Imperiax View Post
    When I type try to start the service, Kali says metasploit does not exist.

    root@Imperiax:~# service postgresql start
    [ ok ] Starting PostgreSQL 9.1 database server: main.

    root@Imperiax:~# service metasploit start
    metasploit: unrecognized service


    However, if I click on Applications > Kali Linux > Top 10 Security Tools > Metasploit Framework...then metasploit launches. But inside of metasploit it is broken. When I try to run 'db_status' I get the following error:
    msf > db_status[*] postgresql selected, no connection

    So I try to reconnect the postgresql database using the default credentials Kali creates:
    msf > db_connect msf3:msf3@localhost:5432/metasploit3
    [-] Error while running command db_connect: Failed to connect to the database: FATAL: password authentication failed for user "msf3"
    FATAL: password authentication failed for user "msf3"


    Call stack:
    /usr/share/metasploit-framework/lib/msf/ui/console/command_dispatcher/db.rb:1600:in `db_connect_postgresql'
    /usr/share/metasploit-framework/lib/msf/ui/console/command_dispatcher/db.rb:1438:in `cmd_db_connect'
    /usr/share/metasploit-framework/lib/rex/ui/text/dispatcher_shell.rb:427:in `run_command'
    /usr/share/metasploit-framework/lib/rex/ui/text/dispatcher_shell.rb:389:in `block in run_single'
    /usr/share/metasploit-framework/lib/rex/ui/text/dispatcher_shell.rb:383:in `each'
    /usr/share/metasploit-framework/lib/rex/ui/text/dispatcher_shell.rb:383:in `run_single'
    /usr/share/metasploit-framework/lib/rex/ui/text/shell.rb:200:in `run'
    /usr/bin/msfconsole:168:in `<main>'
    msf >


    I am not sure where to start with fixing this...the missing service? How do I find what the postgresql usermame & password is?
    Your metasploit database information:
    /opt/metasploit/apps/pro/ui/config/database.yml

    And You must connect from msfconsole like this:
    db_connect USERNAME_from_file:Pass_from_file@localhost/msf3

    Regards

  10. #10
    Join Date
    2014-Jan
    Posts
    3
    I'm having a similar issue, once I ran msfconsole it seemed to have modified the postgresql port from 5432 to 5433 as I learned from running an ss -ant. what was odd is the fact that my database.yml file says it's set to the proper port of 5432. Has anyone found a solution?
    The problem seems to repeat itself any time I run msfupdate, so simply re-installing doesn't really fix the issue.

    I'm running the Kali 1.0.6 vm available on kali.org

  11. #11
    Join Date
    2014-Feb
    Posts
    4
    You can change the port of postgresql after the msfupdate in /etc/postgresql/....../postgresql.conf from 5433 to 5432

    Dunno why this configuration has changed.

    But i'm working on an issue to this problem of login on msf to postgresql when starting ...

Similar Threads

  1. Metasploit broke after attempting to update
    By ModernTech in forum TroubleShooting Archive
    Replies: 3
    Last Post: 2016-09-30, 11:34
  2. Replies: 0
    Last Post: 2016-04-21, 17:20
  3. Update broke armitage/metasploit
    By R1v3r in forum TroubleShooting Archive
    Replies: 0
    Last Post: 2015-06-29, 23:18
  4. Update this morning broke something?
    By 11552 in forum TroubleShooting Archive
    Replies: 10
    Last Post: 2014-04-09, 22:17

Posting Permissions

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