Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Metasploit fail to connect to database
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Fulgurance
Guru
Guru


Joined: 15 Feb 2017
Posts: 421

PostPosted: Thu May 31, 2018 7:49 pm    Post subject: Metasploit fail to connect to database Reply with quote

Hello, i have problem, when i start msfconsole, i have this error:

Code:
[-] Failed to connect to the database: ActiveRecord::ConnectionNotEstablished


Strange, because i'm connected to internet...
Back to top
View user's profile Send private message
Maxxx
Guru
Guru


Joined: 12 Jan 2016
Posts: 503
Location: Italia

PostPosted: Mon Jun 04, 2018 6:44 am    Post subject: Reply with quote

Did you start /etc/init.d/postgresql service?
Back to top
View user's profile Send private message
Fulgurance
Guru
Guru


Joined: 15 Feb 2017
Posts: 421

PostPosted: Mon Jun 04, 2018 11:14 pm    Post subject: Reply with quote

Normally, yes. I have added this with rc-update when my computer start.But it's strange, when i would like to start manually postgresql, terminal ask me to enter root password ! He ignore my sudo command... And i have disabled root account for security...

Code:
zohran@msi-gs73vr-6rf ~ % sudo rc-service postgresql-10 restart
Authenticating root.
Password:
zohran@msi-gs73vr-6rf ~ % rc-update show
               binfmt | boot                                   
             bootmisc | boot                                   
            bumblebee |      default                           
              cgroups |                                 sysinit
                devfs |                                 sysinit
               dhcpcd |      default                           
                dmesg |                                 sysinit
                 fsck | boot                                   
             hostname | boot                                   
              hwclock | boot                                   
              keymaps | boot                                   
            killprocs |                        shutdown       
    kmod-static-nodes |                                 sysinit
                local |      default nonetwork                 
           localmount | boot                                   
             loopback | boot                                   
              modules | boot                                   
             mount-ro |                        shutdown       
                 mtab | boot                                   
             netmount |      default                           
     opentmpfiles-dev |                                 sysinit
        postgresql-10 |      default                           
               procfs | boot                                   
                 root | boot                                   
            savecache |                        shutdown       
                 swap | boot                                   
               sysctl | boot                                   
                sysfs |                                 sysinit
             sysklogd |      default                           
         termencoding | boot                                   
                 udev |                                 sysinit
         udev-trigger |                                 sysinit
              urandom | boot                                   
       wpa_supplicant |      default
Back to top
View user's profile Send private message
Fulgurance
Guru
Guru


Joined: 15 Feb 2017
Posts: 421

PostPosted: Fri Sep 07, 2018 8:14 am    Post subject: Reply with quote

No more idea ? I have updated to the last version of postgresql (11), but the same problem ...
Back to top
View user's profile Send private message
n05ph3r42
Tux's lil' helper
Tux's lil' helper


Joined: 11 Jul 2016
Posts: 86

PostPosted: Fri Oct 12, 2018 6:44 pm    Post subject: Reply with quote

did you configured database.yml correctly?
did you set MSF_DATABASE_CONFIG variable?
Back to top
View user's profile Send private message
Fulgurance
Guru
Guru


Joined: 15 Feb 2017
Posts: 421

PostPosted: Sat Oct 27, 2018 8:58 pm    Post subject: Reply with quote

Where i configure this variable ? What file ?
Back to top
View user's profile Send private message
Muso
l33t
l33t


Joined: 22 Oct 2002
Posts: 746
Location: The Holy city of Honolulu

PostPosted: Sat Oct 27, 2018 11:10 pm    Post subject: Reply with quote

Code:
/etc/init.d/postgresql-11 start


Then launch msfconsole, and inside of msfconsole do this :

Code:
db_rebuild_cache


This will eliminate the "using slow search" issue.

Fulgurance wrote:
And i have disabled root account for security...


Odd choice. Many pentest tools play better as root.
_________________
People Of Love

Kindness Evokes Kindness

Peace Emits Positive Energy
Back to top
View user's profile Send private message
Fulgurance
Guru
Guru


Joined: 15 Feb 2017
Posts: 421

PostPosted: Sun Nov 11, 2018 11:52 am    Post subject: Reply with quote

I have found the true problem:

Code:
fulgurance@msi-gs73vr-6rf ~ $ pg_ctl start
pg_ctl: no database directory specified and environment variable PGDATA unset
Try "pg_ctl --help" for more information.


Where i configure this variable ? With what metasploit configuration file ?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum