Metasploit with postgresql

Metasploitversion 3.7.0 is available for download, this new release comes with a significant number of improvements. One of the most important updates is the session management, now metasploit is capable to handle hundreds of  sessions, this come handy when running large-scale social engineering engagements. Along with this update, other long-awaited features has been added, pass-the-hash and stolen password attacks against Windows 2008 and NTLM authentication support to the Microsoft SQL Server driver are the most important. As bonus, this release is shipped with 35 new remote exploits, check it out.

Here you can see how to install Metasploit and Armitage from scratch with the postgresql support on Ubuntu 11.04.

Metasploit installation

install the metasploit framework
chmod +x
./ --help
#run the metasploit update

Postgresql and dependencies installation

apt-get install postgresql pgadmin3 libpq-dev sun-java6-plugin ruby rubygems libreadline-dev libssl-dev libpq5 ruby-dev nmap
gem install pg

#Metasploit database and a user creation

su postgres
createuser metasploit -P
Enter password for new role:
Enter it again:
Shall the new role be a superuser? (y/n) n
Shall the new role be allowed to create databases? (y/n) n
Shall the new role be allowed to create more new roles? (y/n) n
createdb --owner=metasploit metasploit
#Run the msfconsole  and run the following commands
msf> db_driver postgresql
msf> db_connect metasploit:metasploit@

The msfrpcd must be started,

msfrpcd -f -U metasploit -P metasploit -t Basic

And now is time to start armitage:


Please check the correct postgresql credential, and press connect.

User: metasploit
Password: metasploit
DB connect string: metasploit:metasploit@

In a in a couple of seconds Armitage  should appear.

On Armitage, go to Hosts > Nmap scan > Intense Scan > Input a subnet of interest and happy hunting !

Note: In case you get the error: The address is already in use ( , please check the process that is keeping the port 55553 busy. You can do it easily running the command lsof -i :55553 .

.ruby.bin 5538 root    4u  IPv4 154865      0t0  TCP *:55553 (LISTEN)

At this point you need to kill the process by his own PID, in this case kill -9 5538, and restart again the msfrpcd with “msfrpcd -f -U metasploit -P metasploit -t Basic“

本文转自国外黑客网由网络安全攻防研究室( 信息安全小组收集整理。