Backtrack 5 does not come with a postgresql server independently outside of the box. metasploit 3.7, however, comes with its own built-in PostgreSQL server and default connects to it in the back 5 (type 'db_driver' a new install or live back five starters, in msfconsole to see this in action - please that / opt/framework3/postgresql/data / is where all settings)! This HOWTO details how to run the PostgreSQL server and gets it.Right metasploit to interact with the bat I want to thank for his excellent tutorial disease => Metasploit db_autopwn using PostgreSQL you get a lot of this paper (literally) to metasploit get up and running. He is the person who thanked here; I just set things up a bit to work with Backtrack 5.
Code:
apt-get install postgresql libpq-dev
sudo su postgres -c psql
ALTER USER postgres WITH PASSWORD ‘your password’;
\q
sudo passwd -d postgres
sudo su postgres -c passwd
gem install pg
msfconsole
db_driver postgresql
db_connect postgres:”postgreSQL password”@127.0.0.1/metasploit (“metasploit” being the name of the database)
from there your good to go... I created the file /root/.msf3/msfconsole.rc with the following so I don't have to type the db_* commands each time ::
Code:
db_driver postgresql
db_connect postgres:”postgreSQL password”@127.0.0.1:5432/metasploit
db_workspace -a PWBv3
lastly if you want to change the port postgresql runs on, change the 'port =' setting in the file/etc/postgresql/8.4/main/postgresql.conf then restart the server via '/etc/init.d/postgresql-8.4 restart'
Bookmarks