Wednesday, March 25, 2015

Metasploit: Database not connected or cache not built, using slow search

We can search metasploit modules using search command with various options but we frequently come accross error "Database not connected or cache not built, using slow search". Follow below steps to solve the issue.

msf > search cve:2015-0255                                                                      
[!] Database not connected or cache not built, using slow search

Postgresql service status when not running
root@kali-praveend:/# service postgresql status
Running clusters:

root@kali-praveend:/# service metasploit status
[FAIL] Metasploit rpc server is not running ... failed!
[FAIL] Metasploit web server is not running ... failed!
[FAIL] Metasploit worker is not running ... failed!

root@kali-praveend:/# service metasploit start                                                    
[FAIL] Postgresql must be started before Metasploit ... failed!

root@kali-praveend:/# service postgresql start                                                    
[ ok ] Starting PostgreSQL 9.1 database server: main.

root@kali-praveend:/# service postgresql status                                                                                       Running clusters: 9.1/main

root@kali-praveend:/# service metasploit start
[ ok ] Starting Metasploit rpc server: prosvc.
[ ok ] Starting Metasploit web server: thin.
[ ok ] Starting Metasploit worker: worker.

msf > db_status                                                                                      
[*] postgresql connected to msf3

msf > db_rebuild_cache            
[*] Purging and rebuilding the module cache in the background...
msf >

Now we should not see the error.

No comments:

Post a Comment