Page 1 of 2 12 LastLast
Results 1 to 10 of 19

Thread: metasploit and postgresql help

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Member
    Join Date
    Mar 2013
    Posts
    71

    metasploit and postgresql help

    I can't get metasploit to connect to the DB. I run all the things that previous threads have said to do, such as start postgresql and metasploit and adding it to the startup, but when I run metasploit I get password auth failed, password failed for user msf3, and to make that better, I run db_status and it says postgresql is not connected. I'm not understanding this. I've reinstalled both metasploit and postgresql several times. I'm running the gnome 64bit of kali. so my questions are basically, how do I remove the password failed for msf3 and how can I connect the postgresql to metasploit since obviously nothing is working

  2. #2
    Member
    Join Date
    Apr 2013
    Posts
    32
    check you database.yml file located in :

    /opt/metasploit/apps/pro/ui/config/database.yml

    it may be corrupted but i reckon that your using the wrong password as its created randomly.

    it should look like this:
    database.yml:

    development:
    adapter: postgresql
    database: "msf3"
    username: "msf3"
    password: "zFhyomTtRt4P8ZF868KUyhmKvqQkvjE" (changed)
    host: localhost
    port: 5432
    pool: 5
    timeout: 5

    ################################################
    below that you should have the same for production.

    service postgresql start

    service metasploit start


    Kind Regards Dee

  3. #3
    Member
    Join Date
    Mar 2013
    Posts
    71
    How do I use the correct password if Its randomly created?

  4. #4
    Member
    Join Date
    Apr 2013
    Posts
    32
    Hi ,

    Its in the databae.yml file. open it up and copy the password in the file .

    for location see above post....earlier


    db_connect msf:zFhyomTtRt4P8ZF868KUyhmKvqQkvjE@127.0.0.1/msf3 for example...

    Kind regards dee

  5. #5
    Member
    Join Date
    Mar 2013
    Posts
    71
    Did that. When I do db_connect msf3assword and the rest of the command, it tells me password auth fail. I'm copying and pasting the exact password from the .yml file. I'm not understanding why this isn't working

  6. #6
    Member
    Join Date
    Apr 2013
    Posts
    32
    Have you installed postgres yourself at all?

    I know its been stated before but again ....

    service postgreql status
    service metasploit status
    msfconsole

    cat /opt/metasploit/apps/pro/ui/config/database.yml

    check your database name=msf3
    check your user name=msf3
    #########################################
    development:
    adapter: "postgresql"
    database: "msf3"
    username: "msf3"
    password: "9hMj2yrZ62r3cynWh***************"
    port: 5432
    host: "localhost"
    pool: 256
    timeout: 5

    production:
    adapter: "postgresql"
    database: "msf3"
    username: "msf3"
    password: "9hMj2yrZ62r3cynWh***************"
    port: 5432
    host: "localhost"
    pool: 256
    timeout: 5

    =========================================

    Make sure its just like that. I had errors before with armitage connecting due to this being changed somehow to below:

    development:
    adapter: "postgresql"
    database: "msf3"
    username: "msf3"
    password: "9hMj2yrZ62r3cynWh***************"
    port: 5432
    host: "localhost"
    pool: 256
    timeout: 5


    # Warning: The database defined as "test" will be erased and
    # re-generated from your development database when you run "rake".
    # Do not set this db to the same as development or production.
    #
    # Note also, sqlite3 is totally unsupported by Metasploit now.
    test:
    adapter: sqlite3
    database: "msf3"
    pool: 5
    timeout: 5


    Also try using your ip instead of localhost or 127.0.0.1

    db_connect msf:msf@192.168.0.5/msf3

  7. #7
    Member
    Join Date
    Mar 2013
    Posts
    71
    it says the "metasplot web server is not running ... failed!"

  8. #8
    Member
    Join Date
    Apr 2013
    Posts
    32
    Quote Originally Posted by Lordx19 View Post
    it says the "metasplot web server is not running ... failed!"
    service metasploit start

    msfconsole............

  9. #9
    Member
    Join Date
    Jul 2013
    Posts
    44
    Quote Originally Posted by pentest09 View Post
    Have you installed postgres yourself at all?

    I know its been stated before but again ....

    service postgreql status
    service metasploit status
    msfconsole

    cat /opt/metasploit/apps/pro/ui/config/database.yml

    check your database name=msf3
    check your user name=msf3
    #########################################
    development:
    adapter: "postgresql"
    database: "msf3"
    username: "msf3"
    password: "9hMj2yrZ62r3cynWh***************"
    port: 5432
    host: "localhost"
    pool: 256
    timeout: 5

    production:
    adapter: "postgresql"
    database: "msf3"
    username: "msf3"
    password: "9hMj2yrZ62r3cynWh***************"
    port: 5432
    host: "localhost"
    pool: 256
    timeout: 5

    =========================================

    Make sure its just like that. I had errors before with armitage connecting due to this being changed somehow to below:

    development:
    adapter: "postgresql"
    database: "msf3"
    username: "msf3"
    password: "9hMj2yrZ62r3cynWh***************"
    port: 5432
    host: "localhost"
    pool: 256
    timeout: 5


    # Warning: The database defined as "test" will be erased and
    # re-generated from your development database when you run "rake".
    # Do not set this db to the same as development or production.
    #
    # Note also, sqlite3 is totally unsupported by Metasploit now.
    test:
    adapter: sqlite3
    database: "msf3"
    pool: 5
    timeout: 5


    Also try using your ip instead of localhost or 127.0.0.1

    db_connect msf:msf@192.168.0.5/msf3

    Thanks I had connect_db error and after reading this rhread it's solved now.By the way what kind of hashing is being used for this password ?

    Best,

    Ok I got my response:MD5

    Thank you All.
    Last edited by xerxes; 2013-08-02 at 07:55 AM.

  10. #10
    Member
    Join Date
    Mar 2013
    Posts
    71
    Yup, I've checked all of this and I've reinstalled postgresql multiple times. Everything is correct

Posting Permissions

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