Results 1 to 10 of 37

Thread: BT5 + Metasploit + PostgreSQL

Threaded View

  1. #1
    Senior Member fnord0's Avatar
    Join Date
    Jul 2008
    Posts
    144

    Thumbs up BT5 + Metasploit + PostgreSQL

    backtrack 5 does not come with a stand-alone postgresql server out-of-the box (R1 as well). metasploit though, comes with it's own built-in postgresql server and by-default connects to it on BT5 (type 'db_driver' on a fresh BT5 install or live boot, within msfconsole to see this in action -- note that /opt/framework/postgresql/data/ is where all the configs reside)! this HOWTO details how you can run your OWN postgresql server and get metasploit to interact with it.

    right off the bat I want to thank sickness for his excellent tutorial => Metasploit db_autopwn using PostgreSQL which alot of this doc is sourced (verbatim) to get metasploit up and running. he is the person to be thanked here, I only tweaked things a little to work with BT5.
    NOTE: it is NOT required to disable ssl in the postgresql.conf, as the server works without trouble simply be installing postgresql from package.
    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
    <type the password for postgres account>
    update-alternatives --config ruby
    choose 0 for "auto-mode"
    gem install pg
    msfconsole
    db_driver postgresql
    db_connect postgres:”postgreSQL_password”@127.0.0.1/metasploit (“metasploit” being the name of the  database)
    workspace -a <workspace>
    from there your good to go... I created the file /root/.msf4/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/metasploit
    workspace 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'

    -fnord0
    (PS: the above works on BT5 R1 as well)
    Last edited by fnord0; 09-10-2011 at 07:10 AM.
    'see the fnords!'

Similar Threads

  1. Metasploit db_autopwn using PostgreSQL
    By sickness in forum BackTrack Howtos
    Replies: 53
    Last Post: 03-28-2011, 03:22 AM
  2. [Video] Metasploitable - PostgreSQL
    By g0tmi1k in forum BackTrack Videos
    Replies: 0
    Last Post: 07-01-2010, 01:22 PM
  3. Nexpose Postgresql error
    By WolverineOD in forum Beginners Forum
    Replies: 1
    Last Post: 05-02-2010, 04:45 PM
  4. errore: postgresql-8.3
    By xanders in forum Supporto Software
    Replies: 10
    Last Post: 11-21-2009, 09:34 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •