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”

沒有留言:

張貼留言

[ Java 文章收集 ] An Introduction to Functional Programming in Java 8: Part 3 - Streams

Source From  Here   Preface   In the  last part , we’ve learned about the  Optional  type and how to use it correctly. Today, we will lear...