程式扎記: [ Metasploit 常見問題 ] Database not connected or cache not built in Metasploit console

標籤

2014年10月4日 星期六

[ Metasploit 常見問題 ] Database not connected or cache not built in Metasploit console

Source From Here 
Preface 
When you start msfconsole: 
# msfconsole
[-] Fail to connect to the database...

Or you try to search in msfconsole: 
msf > search oracle
[!] Database not connected or cache not built, using slow search

Then you try to check with command db_status
msf > db_status
[*] postgresql selected, no connection

Then you can refer to blow on how to solve this issue. 

Solution 
In Kali, you will need to start up the postgresql server before using the database. 
root@kali:~# service postgresql start
[ ok ] Starting PostgreSQL 9.1 database server: main.

Once you start the metasploit service it will create a msf3 datauser user and database called msf3. 
root@kali:~# service metasploit start
Configuring Metasploit...
Creating metasploit database user 'msf3'...
Creating metasploit database 'msf3'...
...

When we load up msfconsole, and run "db_status", we can confirm that Metasploit is successfully connected to the database. 
msf > db_status 
[*] postgresql connected to msf3

To build/rebuild metasploit cache use db_rebuild_cache command: 
msf > db_rebuild_cache # It takes some time for the cache to be rebuild so be patient.


Supplement 
Metasploit unleashed - Using the Database 
Fix metasploit “Database not connected or cache not built”

沒有留言:

張貼留言

網誌存檔

關於我自己

我的相片
Where there is a will, there is a way!