Behave fella im trying to help!
Originally Posted by Lordx19
You say you have installed postgresql yourself multiple times!!! Could be your problem if you have installed it as its own instance and you havent issued a password and user.
Kali comes with postgresql in metaploit bundled.
BTW Metasploit and postgres work fine without the need to install separate instance of posgreqsl.
HOW ABT POST SOME COMMAND OUTPUT!!!
Last edited by pentest09; 2013-05-10 at 04:47 PM.
I have just run the following after clean install:
root@kali:~# service postgresql start
root@kali:~# service metasploit start (the first time this is run before msfconsole it creates the database)
Creating metasploit database user 'msf3'...
Creating metasploit database 'msf3'...
insserv: warning: current start runlevel(s) (empty) of script `metasploit' overrides LSB defaults (2 3 4 5).
insserv: warning: current stop runlevel(s) (0 1 2 3 4 5 6) of script `metasploit' overrides LSB defaults (0 1 6).
[ ok ] Starting Metasploit rpc server: prosvc.
[ ok ] Starting Metasploit web server: thin
service postgresql status
service metasploit status
update-rc.d postgresql enable && update-rc.d metasploit enable
RANDOM PASSWORD FOR POSTGRES DATABASE:
kate /opt/metasploit/apps/pro/ui/config/database.yml (copy password)
Hope this helps,
Kind Regards Dee
None of that worked ): so i did a fresh quick kali install (had nothing to lose) and everything is working perfect now. Thanks for your help though!
I know how frustrating it can be....believe me!
Kind Regards DEE
please note: running the msf update before creating the database for the first time corrupted mine.
look inside the file located at /etc/postgresql/9.1/main/pg_hba.conf
and modify those lines where METHOD can be indicated as "password","trust","md5"
I changed mine from password to trust and were able to login at db with that parameters
# TYPE DATABASE USER ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all trust
# IPv4 local connections:
host all all 127.0.0.1/32 trust
# IPv6 local connections:
host all all ::1/128 trust
# Allow replication connections from localhost, by a user with the
# replication privilege.
local replication postgres trust
host replication postgres 127.0.0.1/32 trust
host replication postgres ::1/128 trust
Should work with that, or at least it worked for me
Last edited by johnjohnsp1; 2013-05-27 at 12:51 PM.
Reason: correction text
Originally Posted by pentest09
Thanks I had connect_db error and after reading this rhread it's solved now.By the way what kind of hashing is being used for this password ?
Ok I got my response:MD5
Thank you All.
Last edited by xerxes; 2013-08-02 at 07:55 AM.
After searching solution, that's my solution to this problem :
Launched kali properly and without upadtes
Starting service postgresql
No msf3 user in database ...
No msf3 database exist ...
Starting metasploit -> database.yml created and the password is visible in this file but didn't work when trying to connect (db_connect msf3:*****@127.0.0.1/msf3)
Normal ... no user and no database ....
I created the user and the database :
sudo -i -u postgresql
then go to psql application by typing "psql"
and now see that you don't have user "msf3" and databse to connect by these commands (you can have these commands typing \?) :
Let's create the user :
CREATE USER msf3 WITH PASSWORD 'yourpassword';
and create the database
CREATE DATABASE yourdatabse OWNER msf3;
Now you have your database and your user for metasploit.
Then modify the database.yml file about the user and password to the future connection with metasploit ...
Hope this can help you !
Have a nice day !
Originally Posted by FUSHIA
Same issue for me, but even with the previous explanation it was not working. Maybe be because my fat fingers.
But If you edit the file postgresql.conf somewhere in /etc/postgresql/ you can change the port to 5432. The port was set to 5433. Strange because you can find a sample of the "conf" file somewhere in /usr/share with the port set to 5432.
Anyway, problem solved.
The best solution to this problem is to edit /etc/postgresql/9.1/main/postgresql.conf BEFORE you start the postgresql and metasploit services to change the port from 5433 to 5432
If when you start the postgresql service and see that it is listening on port 5433 (using "ss -ant") then you should stop the service and edit /etc/postgresql/9.1/main/postgresql.conf to change the port. Then start postgresql again and then start metasploit.
metasploit will configure itself on the first run and create the users and datbases it needs and populate database.yml with the passwords for the accounts it created.
But it would seem if you have already started metasploit while postgresql was listening on the wrong port it will fail to configure itself properly the second time after you have changed the listening point. My solution for this was to restore a virtual machine snapshot