PDA

View Full Version : Metasploit Broke with Update.



Malachai
2013-03-19, 23:49
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?

Su1ph3r
2013-03-20, 02:06
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.

Malachai
2013-03-20, 05:00
Nope still the same issue i'm having... I'm going to try to download it again and install it.

brandont
2013-03-20, 15:10
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"?

brandont
2013-03-20, 15:12
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.

blu3gl0w13
2013-03-20, 21:23
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



#!/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:



#!/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.

brandont
2013-03-21, 15:16
The easiest way I've found to start Metasploit automatically at boot is this:



update-rc.d postgresql enable
update-rc.d metasploit enable


And if you want to start metasploit now:



service postgresql start
service metasploit start

Imperiax
2013-11-14, 22:39
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?

Anh3doX
2013-11-15, 09:12
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 :)

JHolister
2014-01-27, 22:11
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

FUSHIA
2014-02-04, 18:00
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 ...