Page 3 of 4 FirstFirst 1234 LastLast
Results 21 to 30 of 37

Thread: BT5 + Metasploit + PostgreSQL

  1. #21
    Just burned his ISO
    Join Date
    Jun 2011
    Posts
    2

    Default Re: BT5 + Metasploit + PostgreSQL

    New here, just did a fresh install of BT5 having the same issue but on GNOME apt-update && apt-upgrade is all I have done getting the same errors.

  2. #22
    Just burned his ISO
    Join Date
    Jul 2009
    Posts
    19

    Default Re: BT5 + Metasploit + PostgreSQL

    Hello all, having major issues, im a very quick learner, and have searched the forums aswell for similar issues,

    seems i cannot for the life of me delete my Databases via Postgres-msfconsole

    i use db_destroy and also used db_destroy rootassword@127.0.0.1/database (tried both)

    and i get this (even after changing both root and the postgres password)

    -----------------------------------------------------------------------------------------------------------------------------[*] Warning: You will need to enter the password at the prompts below
    Password:
    dropdb.bin: could not connect to database postgres: FATAL: password authentication failed for user "root"
    ------------------------------------------------------------------------------------------------------------------------------

    could not change directory to "/root"
    psql (8.4.8)
    Type "help" for help.

    postgres=#
    postgres=# ALTER USER root WITH PASSWORD 'Password';
    ALTER ROLE
    postgres=# \q
    could not save history to file "/home/postgres/.psql_history": No such file or directory
    root@bt:~# sudo passwd -d root
    passwd: password expiry information changed.
    root@bt:~# sudo su root -c passwd
    Enter new UNIX password:
    Retype new UNIX password:
    passwd: password updated successfully
    root@bt:~# clear
    --------------------------------------------------------

    also did the same to postgres ect ect aswel. seems it spits out errors, also tried deleting the database with the postgres GUI, is there anyone whom can help me please?


    thanks all.

  3. #23
    Just burned his ISO
    Join Date
    Jul 2009
    Posts
    19

    Cool Re: BT5 + Metasploit + PostgreSQL

    Ok Found a fix to my problem for those that run into to the same issues,

    To delete databases, i had to run my commands via a seperate Shell and run it through via the sudo su postgres ect

    then type dropdb, then you will need to make another via createdb --owner=root NAMEOFDATABASE,

    Worked a charm

  4. #24
    Just burned his ISO
    Join Date
    Apr 2011
    Posts
    5

    Default Re: BT5 + Metasploit + PostgreSQL

    whats the advantage of running your own POstgresql over the built in one please ?

  5. #25
    Just burned his ISO
    Join Date
    Aug 2011
    Posts
    1

    Default AW: Re: BT5 + Metasploit + PostgreSQL

    Quote Originally Posted by Stan464 View Post
    Ok Found a fix to my problem for those that run into to the same issues,

    To delete databases, i had to run my commands via a seperate Shell and run it through via the sudo su postgres ect

    then type dropdb, then you will need to make another via createdb --owner=root NAMEOFDATABASE,

    Worked a charm

    Can you explain your solution a bit better pls? I have the same problem like you had, but can't fix it.

    I'm getting this error:
    Code:
    sudo su postgres
    dropbdb metasploit
    could not change the directory to "/root"
    Any solution? db_destroy in metasploit doesn't work, too.

    Thanks!

  6. #26
    Just burned his ISO
    Join Date
    Jul 2009
    Posts
    19

    Smile Re: BT5 + Metasploit + PostgreSQL

    Good Question, i find using the more up to date one you find less errors and problems, i had trouble with the inbuilt postgresql.

    Seems to now work fine for me.

  7. #27
    Just burned his ISO
    Join Date
    Aug 2011
    Posts
    3

    Question Re: BT5 + Metasploit + PostgreSQL

    Quote Originally Posted by fnord0 View Post
    backtrack 5 does not come with a stand-alone postgresql server out-of-the box. metasploit 3.7 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/framework3/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
    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'

    -fnord0
    .................................................. .................................................. ..............................
    before starting i want to thanks sickness and fnord0 4 such a gr8 post and tutorial...
    believe me i've read all the post related to "msf connecting database"

    and believe me im trying very hard to solve this problem in my box...
    i'm using BT5 KDE with kernel 2.6.38

    sincerely i hve tried as said by sickness in his howto tutorial


    root@bt:~# /etc/init.d/postgresql-8.4 start
    * Starting PostgreSQL 8.4 database server [ OK ]
    root@bt:~# sudo su postgres -c psql
    could not change directory to "/root"
    psql (8.4.8)
    Type "help" for help.

    postgres=# ALTER USER postgres WITH PASSWORD 'suraj@kumar';
    ALTER ROLE
    postgres=# \q
    could not save history to file "/home/postgres/.psql_history": No such file or directory
    root@bt:~# sudo passwd -d postgres
    passwd: password expiry information changed.
    root@bt:~# sudo su postgres -c passwd
    Enter new UNIX password:
    Retype new UNIX password:
    passwd: password updated successfully
    root@bt:~# msfconsole
    [-] Failed to connect to the database: could not connect to server: Connection refused
    Is the server running on host "127.0.0.1" and accepting
    TCP/IP connections on port 7175?
    {"adapter"=>"postgresql", "database"=>"msf3", "username"=>"msf3", "password"=>"7f878914", "host"=>"127.0.0.1", "port"=>7175, "pool"=>75, "timeout"=>5} ["/opt/framework3/msf3/lib/active_record/connection_adapters/postgresql_adapter.rb:968:in `initialize'", "/opt/framework3/msf3/lib/active_record/connection_adapters/postgresql_adapter.rb:968:in `new'", "/opt/framework3/msf3/lib/active_record/connection_adapters/postgresql_adapter.rb:968:in `connect'", "/opt/framework3/msf3/lib/active_record/connection_adapters/postgresql_adapter.rb:217:in `initialize'", "/opt/framework3/msf3/lib/active_record/connection_adapters/postgresql_adapter.rb:37:in `new'", "/opt/framework3/msf3/lib/active_record/connection_adapters/postgresql_adapter.rb:37:in `postgresql_connection'", "/opt/framework3/msf3/lib/active_record/connection_adapters/abstract/connection_pool.rb:223:in `new_connection'", "/opt/framework3/msf3/lib/active_record/connection_adapters/abstract/connection_pool.rb:245:in `checkout_new_connection'", "/opt/framework3/msf3/lib/active_record/connection_adapters/abstract/connection_pool.rb:188:in `block (2 levels) in checkout'", "/opt/framework3/msf3/lib/active_record/connection_adapters/abstract/connection_pool.rb:184:in `loop'", "/opt/framework3/msf3/lib/active_record/connection_adapters/abstract/connection_pool.rb:184:in `block in checkout'", "/opt/framework3/ruby/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'", "/opt/framework3/msf3/lib/active_record/connection_adapters/abstract/connection_pool.rb:183:in `checkout'", "/opt/framework3/msf3/lib/active_record/connection_adapters/abstract/connection_pool.rb:98:in `connection'", "/opt/framework3/msf3/lib/active_record/connection_adapters/abstract/connection_pool.rb:326:in `retrieve_connection'", "/opt/framework3/msf3/lib/active_record/connection_adapters/abstract/connection_specification.rb:123:in `retrieve_connection'", "/opt/framework3/msf3/lib/active_record/connection_adapters/abstract/connection_specification.rb:115:in `connection'", "/opt/framework3/msf3/lib/active_record/base.rb:1271:in `columns'", "/opt/framework3/msf3/lib/active_record/base.rb:1284:in `column_names'", "/opt/framework3/msf3/lib/active_record/base.rb:1297:in `column_methods_hash'", "/opt/framework3/msf3/lib/active_record/base.rb:1986:in `block in all_attributes_exists?'", "/opt/framework3/msf3/lib/active_record/base.rb:1986:in `each'", "/opt/framework3/msf3/lib/active_record/base.rb:1986:in `all?'", "/opt/framework3/msf3/lib/active_record/base.rb:1986:in `all_attributes_exists?'", "/opt/framework3/msf3/lib/active_record/base.rb:1842:in `method_missing'", "/opt/framework3/msf3/lib/msf/core/model/workspace.rb:69:in `default'", "/opt/framework3/msf3/lib/msf/core/db.rb:189:in `default_workspace'", "/opt/framework3/msf3/lib/msf/core/db_manager.rb:166:in `connect'", "/opt/framework3/msf3/lib/msf/ui/console/driver.rb:186:in `initialize'", "/opt/framework3/msf3/msfconsole:130:in `new'", "/opt/framework3/msf3/msfconsole:130:in `<main>'"]

    ######## #
    ################# #
    ###################### #
    ######################### #
    ############################
    ##############################
    ###############################
    ###############################
    ##############################
    # ######## #
    ## ### #### ##
    ### ###
    #### ###
    #### ########## ####
    ####################### ####
    #################### ####
    ################## ####
    ############ ##
    ######## ###
    ######### #####
    ############ ######
    ######## #########
    ##### ########
    ### #########
    ###### ############
    #######################
    # # ### # # ##
    ########################
    ## ## ## ##



    =[ metasploit v4.0.1-dev [core:4.0 api:1.0]
    + -- --=[ 721 exploits - 367 auxiliary - 74 post
    + -- --=[ 226 payloads - 27 encoders - 8 nops
    =[ svn r13543 updated yesterday (2011.08.12)

    msf > db_driver postgresql [*] Using database driver postgresql
    msf > db_connect postgres:"suraj@kumar"@127.0.0.1/metasploit
    [-] Error while running command db_connect: Failed to connect to the database: FATAL: Ident authentication failed for user "postgres"


    Call stack:
    /opt/framework3/msf3/lib/msf/ui/console/command_dispatcher/db.rb:1903:in `db_connect_postgresql'
    /opt/framework3/msf3/lib/msf/ui/console/command_dispatcher/db.rb:1711:in `cmd_db_connect'
    /opt/framework3/msf3/lib/rex/ui/text/dispatcher_shell.rb:376:in `run_command'
    /opt/framework3/msf3/lib/rex/ui/text/dispatcher_shell.rb:338:in `block in run_single'
    /opt/framework3/msf3/lib/rex/ui/text/dispatcher_shell.rb:332:in `each'
    /opt/framework3/msf3/lib/rex/ui/text/dispatcher_shell.rb:332:in `run_single'
    /opt/framework3/msf3/lib/rex/ui/text/shell.rb:199:in `run'
    /opt/framework3/msf3/msfconsole:130:in `<main>'
    msf >

    .................................................. .................................................. .................................................. ...........
    plz help me.....and i'm very sry if i've done any silly mistake as i'm new to backtrack....im still learning.......
    thank q

  8. #28
    Just burned his ISO metacom's Avatar
    Join Date
    Jun 2008
    Posts
    14

    Default Re: BT5 + Metasploit + PostgreSQL

    BT5 32bit

    root@bt:~#apt-get install postgresql libpq-dev
    root@bt:~#sudo su postgres -c psql
    CREATE USER root WITH SUPERUSER password 'toor';
    CREATE DATABASE msf3db;
    root@bt:~#postgres-# \q
    root@bt:~# update-alternatives --config ruby
    There are 2 choices for the alternative ruby (providing /usr/bin/ruby).

    Selection Path Priority Status
    ------------------------------------------------------------
    * 0 /usr/bin/ruby1.8 500 auto mode
    1 /usr/bin/ruby1.8 500 manual mode
    2 /usr/bin/ruby1.9.2 400 manual mode

    Press enter to keep the current choice[*], or type selection number: 0

    root@bt:~#gem install postgres

    --------------------------------------------------
    msfconsole
    db_driver postgresql
    db_connect root:toor@127.0.0.1/msf3db
    or
    db_connect root:toor@127.0.0.1/postgres

  9. #29
    Senior Member lund99's Avatar
    Join Date
    Feb 2010
    Posts
    142

    Default Re: BT5 + Metasploit + PostgreSQL

    metacom: thank you for that last post - after executing the ruby config command and reinstalling postgres using gem I finally got it working.

    big thanks to sickness and fnord0 as well!

  10. #30
    Just burned his ISO metacom's Avatar
    Join Date
    Jun 2008
    Posts
    14

    Default AW: Re: BT5 + Metasploit + PostgreSQL

    error update

    svn: /opt/framework/lib/libssl.so.0.9.8: no version information available (required by /opt/framework/lib/libserf-0.so.0)


    root@bt:~# cd /opt/framework/lib/
    root@bt:/opt/framework/lib# sudo mv libcrypto.so.0.9.8 libcrypto.so.0.9.8.bak
    root@bt:/opt/framework/lib# sudo mv libssl.so.0.9.8 libssl.so.0.9.8.bak
    root@bt:/opt/framework/lib# sudo ln -s /usr/lib/libcrypto.so.0.9.8 ./
    root@bt:/opt/framework/lib# sudo ln -s /usr/lib/libssl.so.0.9.8 ./
    root@bt:/opt/framework/lib#
    Last edited by metacom; 09-09-2011 at 09:39 AM.

Page 3 of 4 FirstFirst 1234 LastLast

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
  •