[Fixed] Failed to Connect to the Database Metasploit
#1
Sblum nya mohon maaf klo repsol Big Grin
maklum ilmu ku blom tinggi \m/

oke,langsung aja
Mungkin dari beberapa orang yg baru belajar Metasploit, pernah ngalamain error database metasploit seperti ini

[Image: 1.png]
Failed to connect to the database: could not connect to server: connection refused


Udah Jelas banget dari Pesan nya, Database nya gak connected Smile
[hide]
Ok, Bgini cara Fix nya
1. Pastikan service postgresql, kalian berjalan
2. cek file config database metasploit nya ( /opt/metasploit-4.4.0/config/database.yml )


Jalankan Service Postgresql nya.
$ service postgresql start

Masih ada error ??
bisa jadi itu karna masalah config dengan dengan database msf kalian,
dan ini cara untuk setup new database msf dengan postgresql
Quote:[email protected]:# su - postgres

[email protected]~$ createuser [Nama User] -P
[email protected]~$ [Enter password]
[email protected]~$ Validate password
[email protected]~$ Shall the new role be a superuser? n
[email protected]~$ Shall the new role be allowed to create databases? n
[email protected]~$ Shall the new role be allowed to create new roles? n
[email protected]~$ createdb --owner=[Nama User] [Name_Database]
[email protected]~$ exit

setelah membuat user di posgresql

next kita membuat file configure database Metasploiut nya.
kalian bisa liat contoh file nya di
"/usr/share/metasploit-framework/config/database.yml.example"

edit aja langsung itu file example nya..

[Image: 1.png]

kemudian save
copy dan rename file tersebut Big Grin

$ sudo cp database.yml.example database.yml


Ok, Next.. Buka msfconsole

Jika masih belum connected.. coba di connect'kan langsung di metasploit console nya
msf > db_connect NamaUserTongue[email protected]:5432/name_database


Ok,Done.. :-bd
[/hide]

Postingan ini boleh di share/di perbanyak,dengan menyertai link sumber dibawah :
http://carbelius.blogspot.com/2014/06/fi...abase.html

ok,thank all :-bd

#2
nice share om. kebetulan dulu ane pernah ngalamin hal yang sama waktu gagal upgrade Big Grin
Information Is The Most Dangerous Weapon In The World

#3
thanks bro ilmunya hehehe..... :-bd

#4
nice share bro, +1 dari gw Big Grin

biasanya errornya ini abis update OS, kemudian metasploitnya kena update dan file database.yml-nya ketimpa.

#5
(06-06-2014, 07:11 AM)iKONspirasi Wrote: nice share bro, +1 dari gw Big Grin

biasanya errornya ini abis update OS, kemudian metasploitnya kena update dan file database.yml-nya ketimpa.

iyap..bener banget om :-bd

#6
Deleted

#7
wah mantep nih post, ane sering gini waktu pake metasploit di ubuntu raring ane,,
" In the DARK, I can SEE you "

#8
(06-08-2014, 11:53 AM)Rvz_Venom Wrote: wah mantep nih post, ane sering gini waktu pake metasploit di ubuntu raring ane,,

hehehe :d
sama" om, skarang msh error ndak ?

#9
Solusinya dong bro, punya ane muncul gini

Quote:[[email protected]][~]
[>] service postgresql start
[....] Starting PostgreSQL 9.3 database server: main[....] The PostgreSQL server failed to start. Please check the log output: 2014-06-08 21:37:29 UTC LOG: could not bind IPv4 socket: Tidak dapat menempatkan permintaan alamat 2014-06-08 21:37:29 UTC HINT: Is another postmaster already running on port 5432? If not, wait a few seconds and retry. 2014-06-08 21:37:29 UTC WARNING: could not create listen socket for "localhost" 2014-06-08 21:37:29 UTC FATAL: could not create any TC[FAILsockets ... failed!
failed!
[[email protected]][~]
[>] service postgresql stop
[ ok ] Stopping PostgreSQL 9.3 database server: main.
[[email protected]][~]
[>] msfconsole
[-] Failed to connect to the database: 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"?

Punya ane udah solved bro ternaya cara nya cuman edit /etc/postgresql/9.3/main/postgresql.conf trs search "localhost" yang ada di listen_addresses ganti jadi "127.0.0.1"

#10
weleh karena saya sering ngalamin jadi penasaran juga, hehehhe
ijin baca-baca mas Clound
Jayalah Indonesiaku

Follow my Twitter Account : @Bintang_Persada






Users browsing this thread: 1 Guest(s)