Results 1 to 17 of 17

Thread: Metasploit starting issue

  1. #1
    Join Date
    2013-Aug
    Posts
    5

    Metasploit starting issue

    Greeting everyone, I'm new Kali linux and Metasploit, and every time I try to access the msf3 database, I get the following error?
    Code:
    msf > db_connect msf3:[email protected]/metasploit3
    [-] Error while running command db_connect: Failed to connect to the database: PG::Error: ERROR:  permission denied to create database
    : CREATE DATABASE "metasploit3" ENCODING = 'utf8'
    
    Call stack:
    /opt/metasploit/apps/pro/msf3/lib/msf/ui/console/command_dispatcher/db.rb:1725:in `db_connect_postgresql'
    /opt/metasploit/apps/pro/msf3/lib/msf/ui/console/command_dispatcher/db.rb:1565:in `cmd_db_connect'
    /opt/metasploit/apps/pro/msf3/lib/rex/ui/text/dispatcher_shell.rb:427:in `run_command'
    /opt/metasploit/apps/pro/msf3/lib/rex/ui/text/dispatcher_shell.rb:389:in `block in run_single'
    /opt/metasploit/apps/pro/msf3/lib/rex/ui/text/dispatcher_shell.rb:383:in `each'
    /opt/metasploit/apps/pro/msf3/lib/rex/ui/text/dispatcher_shell.rb:383:in `run_single'
    /opt/metasploit/apps/pro/msf3/lib/rex/ui/text/shell.rb:200:in `run'
    /opt/metasploit/apps/pro/msf3/msfconsole:169:in `<main>'
    What do I have to do so I can connect to the database?

  2. #2
    Have you started up the two services first?
    Code:
    service postgresql start
    service metasploit start
    Source & more information: Starting Metasploit Framework

  3. #3
    http://forums.kali.org/showthread.ph...tarting-issue&
    Then run metasploit and type
    db_status
    To check if you're connected
    Last edited by Lordx19; 2013-09-04 at 11:42. Reason: Adding

  4. #4
    Join Date
    2013-Aug
    Posts
    5
    Quote Originally Posted by Lordx19 View Post
    http://forums.kali.org/showthread.ph...tarting-issue&
    Then run metasploit and type
    db_status
    To check if you're connected
    I'm now connected, but I still can't login without getting the same and I still can't acces the msf3 database. I ran
    service postgresql start, service metasploit start and the went to application → System Service → Metasploit → community/pro start and still got the same output:
    Code:
    msf > db_connect msf3:[email protected]/metasploit3
    [-] Error while running command db_connect: Failed to connect to the database: PG::Error: ERROR:  permission denied to create database
    : CREATE DATABASE "metasploit3" ENCODING = 'utf8'
    
    Call stack:
    /opt/metasploit/apps/pro/msf3/lib/msf/ui/console/command_dispatcher/db.rb:1725:in `db_connect_postgresql'
    /opt/metasploit/apps/pro/msf3/lib/msf/ui/console/command_dispatcher/db.rb:1565:in `cmd_db_connect'
    /opt/metasploit/apps/pro/msf3/lib/rex/ui/text/dispatcher_shell.rb:427:in `run_command'
    /opt/metasploit/apps/pro/msf3/lib/rex/ui/text/dispatcher_shell.rb:389:in `block in run_single'
    /opt/metasploit/apps/pro/msf3/lib/rex/ui/text/dispatcher_shell.rb:383:in `each'
    /opt/metasploit/apps/pro/msf3/lib/rex/ui/text/dispatcher_shell.rb:383:in `run_single'
    /opt/metasploit/apps/pro/msf3/lib/rex/ui/text/shell.rb:200:in `run'
    /opt/metasploit/apps/pro/msf3/msfconsole:169:in `<main>'
    msf > db_status[*] postgresql connected to msf3
    What do I do about it?

  5. #5
    I see a permission denied error. Not sure what to do for that. I never got that. I couldn't get rid of the error either so I purged metasploit, once it was purged I reinstalled it. Before I even opened metasploit I ran both services. Afterwards I added them to post.d like I said earlier. Then finally open metasploit and check the data base

  6. #6
    Join Date
    2013-Sep
    Posts
    2
    i got this error
    Code:
    # msfconsole -q
    /opt/metasploit/apps/pro/msf3/lib/msf/core/db.rb:22:in `require': cannot load such file -- packetfu (LoadError)
    	from /opt/metasploit/apps/pro/msf3/lib/msf/core/db.rb:22:in `<top (required)>'
    	from /opt/metasploit/apps/pro/msf3/lib/msf/core/db_manager.rb:5:in `require'
    	from /opt/metasploit/apps/pro/msf3/lib/msf/core/db_manager.rb:5:in `<top (required)>'
    	from /opt/metasploit/apps/pro/msf3/lib/msf/core/framework.rb:69:in `require'
    	from /opt/metasploit/apps/pro/msf3/lib/msf/core/framework.rb:69:in `<class:Framework>'
    	from /opt/metasploit/apps/pro/msf3/lib/msf/core/framework.rb:13:in `<module:Msf>'
    	from /opt/metasploit/apps/pro/msf3/lib/msf/core/framework.rb:5:in `<top (required)>'
    	from /opt/metasploit/apps/pro/msf3/lib/msf/core.rb:34:in `require'
    	from /opt/metasploit/apps/pro/msf3/lib/msf/core.rb:34:in `<top (required)>'
    	from /opt/metasploit/apps/pro/msf3/lib/msf/ui/console/driver.rb:2:in `require'
    	from /opt/metasploit/apps/pro/msf3/lib/msf/ui/console/driver.rb:2:in `<top (required)>'
    	from /opt/metasploit/apps/pro/msf3/lib/msf/ui/console.rb:11:in `require'
    	from /opt/metasploit/apps/pro/msf3/lib/msf/ui/console.rb:11:in `<top (required)>'
    	from /opt/metasploit/apps/pro/msf3/lib/msf/ui.rb:11:in `require'
    	from /opt/metasploit/apps/pro/msf3/lib/msf/ui.rb:11:in `<top (required)>'
    	from /opt/metasploit/apps/pro/msf3/msfconsole:157:in `require'
    	from /opt/metasploit/apps/pro/msf3/msfconsole:157:in `<main>'

  7. #7
    Join Date
    2013-Sep
    Posts
    2
    i got this error
    Code:
    # msfconsole -q
    /opt/metasploit/apps/pro/msf3/lib/msf/core/db.rb:22:in `require': cannot load such file -- packetfu (LoadError)
    	from /opt/metasploit/apps/pro/msf3/lib/msf/core/db.rb:22:in `<top (required)>'
    	from /opt/metasploit/apps/pro/msf3/lib/msf/core/db_manager.rb:5:in `require'
    	from /opt/metasploit/apps/pro/msf3/lib/msf/core/db_manager.rb:5:in `<top (required)>'
    	from /opt/metasploit/apps/pro/msf3/lib/msf/core/framework.rb:69:in `require'
    	from /opt/metasploit/apps/pro/msf3/lib/msf/core/framework.rb:69:in `<class:Framework>'
    	from /opt/metasploit/apps/pro/msf3/lib/msf/core/framework.rb:13:in `<module:Msf>'
    	from /opt/metasploit/apps/pro/msf3/lib/msf/core/framework.rb:5:in `<top (required)>'
    	from /opt/metasploit/apps/pro/msf3/lib/msf/core.rb:34:in `require'
    	from /opt/metasploit/apps/pro/msf3/lib/msf/core.rb:34:in `<top (required)>'
    	from /opt/metasploit/apps/pro/msf3/lib/msf/ui/console/driver.rb:2:in `require'
    	from /opt/metasploit/apps/pro/msf3/lib/msf/ui/console/driver.rb:2:in `<top (required)>'
    	from /opt/metasploit/apps/pro/msf3/lib/msf/ui/console.rb:11:in `require'
    	from /opt/metasploit/apps/pro/msf3/lib/msf/ui/console.rb:11:in `<top (required)>'
    	from /opt/metasploit/apps/pro/msf3/lib/msf/ui.rb:11:in `require'
    	from /opt/metasploit/apps/pro/msf3/lib/msf/ui.rb:11:in `<top (required)>'
    	from /opt/metasploit/apps/pro/msf3/msfconsole:157:in `require'
    	from /opt/metasploit/apps/pro/msf3/msfconsole:157:in `<main>'

  8. #8
    Join Date
    2013-Aug
    Posts
    5
    Okay, I'll give this a shot, but I have a few questions. Wha's the absolute path to post.d in this case, and foremostly, I'm not quite that experienced with editing configuration files and all that, so could you show me how post.d should look, and what lines must be pasted in, thanks a lot?

  9. #9
    sorry it's not post.d, I wasn't at my computer when I wrote that. It's rc.d
    You don't need to edit any config file.
    you just open a terminal and type these 2 lines
    service postgresql start

    service metasploit start

    afterwards, open metasploit and run db_status
    it should say connected to postgresql

    those 2 commands earlier start the services. You can make it so they ran automatically at startup by typing

    after you do those steps and confirm it's connected to a db run

    update-rc.d postgresql enable

    update-rc.d metasploit enable

    that will make them run at start up

    if that does not work

    uninstall metasploit and reinstall it

    on a fresh install DO NOT RUN METASPLOIT

    run all of those steps first before opening it

    that's what I had to do

    let me know how it goes

    it could of had a bad install, which is what happened to me. The purge and fresh install worked, seeing how it creates a whole new db

    http://docs.kali.org/general-use/sta...mework-in-kali

  10. #10
    Join Date
    2013-Aug
    Posts
    5
    K, so I did everything you said, I ran apt-get remove --purge, apt-get install, then service postgresql start && service metasploit start, and got a new error while attempting to log in:
    Code:
    msf > db_connect msf3:[email protected]:1500/metasploit3
    [-] Error while running command db_connect: Failed to connect to the database: could not connect to server: Connection timed out
    	Is the server running on host "192.168.0.2" and accepting
    	TCP/IP connections on port 1500?
    
    
    Call stack:
    /opt/metasploit/apps/pro/msf3/lib/msf/ui/console/command_dispatcher/db.rb:1725:in `db_connect_postgresql'
    /opt/metasploit/apps/pro/msf3/lib/msf/ui/console/command_dispatcher/db.rb:1565:in `cmd_db_connect'
    /opt/metasploit/apps/pro/msf3/lib/rex/ui/text/dispatcher_shell.rb:427:in `run_command'
    /opt/metasploit/apps/pro/msf3/lib/rex/ui/text/dispatcher_shell.rb:389:in `block in run_single'
    /opt/metasploit/apps/pro/msf3/lib/rex/ui/text/dispatcher_shell.rb:383:in `each'
    /opt/metasploit/apps/pro/msf3/lib/rex/ui/text/dispatcher_shell.rb:383:in `run_single'
    /opt/metasploit/apps/pro/msf3/lib/rex/ui/text/shell.rb:200:in `run'
    /opt/metasploit/apps/pro/msf3/msfconsole:169:in `<main>'
    What's my next step?
    Last edited by Quizmaster; 2013-09-07 at 08:58.

  11. #11
    Join Date
    2013-Aug
    Posts
    2
    Quote Originally Posted by rep0 View Post
    i got this error
    Code:
    # msfconsole -q
    /opt/metasploit/apps/pro/msf3/lib/msf/core/db.rb:22:in `require': cannot load such file -- packetfu (LoadError)
    	from /opt/metasploit/apps/pro/msf3/lib/msf/core/db.rb:22:in `<top (required)>'
    	from /opt/metasploit/apps/pro/msf3/lib/msf/core/db_manager.rb:5:in `require'
    	from /opt/metasploit/apps/pro/msf3/lib/msf/core/db_manager.rb:5:in `<top (required)>'
    	from /opt/metasploit/apps/pro/msf3/lib/msf/core/framework.rb:69:in `require'
    	from /opt/metasploit/apps/pro/msf3/lib/msf/core/framework.rb:69:in `<class:Framework>'
    	from /opt/metasploit/apps/pro/msf3/lib/msf/core/framework.rb:13:in `<module:Msf>'
    	from /opt/metasploit/apps/pro/msf3/lib/msf/core/framework.rb:5:in `<top (required)>'
    	from /opt/metasploit/apps/pro/msf3/lib/msf/core.rb:34:in `require'
    	from /opt/metasploit/apps/pro/msf3/lib/msf/core.rb:34:in `<top (required)>'
    	from /opt/metasploit/apps/pro/msf3/lib/msf/ui/console/driver.rb:2:in `require'
    	from /opt/metasploit/apps/pro/msf3/lib/msf/ui/console/driver.rb:2:in `<top (required)>'
    	from /opt/metasploit/apps/pro/msf3/lib/msf/ui/console.rb:11:in `require'
    	from /opt/metasploit/apps/pro/msf3/lib/msf/ui/console.rb:11:in `<top (required)>'
    	from /opt/metasploit/apps/pro/msf3/lib/msf/ui.rb:11:in `require'
    	from /opt/metasploit/apps/pro/msf3/lib/msf/ui.rb:11:in `<top (required)>'
    	from /opt/metasploit/apps/pro/msf3/msfconsole:157:in `require'
    	from /opt/metasploit/apps/pro/msf3/msfconsole:157:in `<main>'
    Also get this error since I just updated, what's the go? was working fine before, just installed the latest update after it popped up saying there were updates, now I get this when I try and start msfconsole

  12. #12
    What are you logging into?all you have to do is run those commands and then run metasploit. Then run db_status. On a fresh install, when starting the services, you should have seen it building a database.

  13. I have same problem too.

  14. #14
    you just open a terminal and type these 2 lines
    service postgresql start

    service metasploit start

    afterwards, open metasploit and run db_status
    it should say connected to postgresql

    those 2 commands earlier start the services. You can make it so they ran automatically at startup by typing

    after you do those steps and confirm it's connected to a db run

    update-rc.d postgresql enable

    update-rc.d metasploit enable

    that will make them run at start up

    if that does not work

    uninstall metasploit and reinstall it

    on a fresh install DO NOT RUN METASPLOIT

    run all of those steps first before opening it

    that's what I had to do

  15. #15
    Join Date
    2013-Oct
    Posts
    1
    Try to update with :
    msfupdate

  16. #16
    Join Date
    2014-Feb
    Posts
    4
    The above (LORDx19) doesn't work, still getting Op's errror and it's 2/26/2014!

    msf > db_connect postgres:[email protected]/msfbook
    [-] Error while running command db_connect: Failed to connect to the database: PG::InvalidParameterValue: ERROR: new encoding (UTF8) is incompatible with the encoding of the template database (SQL_ASCII)
    HINT: Use the same encoding as in the template database, or use template0 as template.
    : CREATE DATABASE "msfbook" ENCODING = 'utf8'

    Call stack:
    /opt/metasploit/apps/pro/msf3/lib/msf/ui/console/command_dispatcher/db.rb:1758:in `db_connect_postgresql'
    /opt/metasploit/apps/pro/msf3/lib/msf/ui/console/command_dispatcher/db.rb:1598:in `cmd_db_connect'
    /opt/metasploit/apps/pro/msf3/lib/rex/ui/text/dispatcher_shell.rb:427:in `run_command'
    /opt/metasploit/apps/pro/msf3/lib/rex/ui/text/dispatcher_shell.rb:389:in `block in run_single'
    /opt/metasploit/apps/pro/msf3/lib/rex/ui/text/dispatcher_shell.rb:383:in `each'
    /opt/metasploit/apps/pro/msf3/lib/rex/ui/text/dispatcher_shell.rb:383:in `run_single'
    /opt/metasploit/apps/pro/msf3/lib/rex/ui/text/shell.rb:200:in `run'
    /opt/metasploit/apps/pro/msf3/msfconsole:148:in `<main>'
    msf > Interrupt: use the 'exit' command to quit
    msf > Interrupt: use the 'exit' command to quit
    msf > Interrupt: use the 'exit' command to quit
    msf > Interrupt: use the 'exit' command to quit
    msf > db_status[*] postgresql connected to postgres
    msf > Interrupt: use the 'exit' command to quit
    msf > Interrupt: use the 'exit' command to quit
    msf > db_connect postgres:[email protected]/msfbook
    [-] Error while running command db_connect: Failed to connect to the database: PG::InvalidParameterValue: ERROR: new encoding (UTF8) is incompatible with the encoding of the template database (SQL_ASCII)
    HINT: Use the same encoding as in the template database, or use template0 as template.
    : CREATE DATABASE "msfbook" ENCODING = 'utf8'

    Call stack:
    /opt/metasploit/apps/pro/msf3/lib/msf/ui/console/command_dispatcher/db.rb:1758:in `db_connect_postgresql'
    /opt/metasploit/apps/pro/msf3/lib/msf/ui/console/command_dispatcher/db.rb:1598:in `cmd_db_connect'
    /opt/metasploit/apps/pro/msf3/lib/rex/ui/text/dispatcher_shell.rb:427:in `run_command'
    /opt/metasploit/apps/pro/msf3/lib/rex/ui/text/dispatcher_shell.rb:389:in `block in run_single'
    /opt/metasploit/apps/pro/msf3/lib/rex/ui/text/dispatcher_shell.rb:383:in `each'
    /opt/metasploit/apps/pro/msf3/lib/rex/ui/text/dispatcher_shell.rb:383:in `run_single'
    /opt/metasploit/apps/pro/msf3/lib/rex/ui/text/shell.rb:200:in `run'
    /opt/metasploit/apps/pro/msf3/msfconsole:148:in `<main>'


    linux fully updated: Linux version 3.12-kali1-686-pae ([email protected]) (gcc version 4.7.2 (Debian 4.7.2-5) ) #1 SMP Debian 3.12.6-2kali1 (2014-01-06)

  17. #17
    Join Date
    2015-Feb
    Posts
    1
    try going to
    vim /opt/metasploit/properties.ini

    view the name of the database
    db_connect <userindb>:<passwordindb>@localhost:5432<nameofdbi nproperties>

    Quote Originally Posted by kalig View Post
    The above (LORDx19) doesn't work, still getting Op's errror and it's 2/26/2014!

    msf > db_connect postgres:[email protected]/msfbook
    [-] Error while running command db_connect: Failed to connect to the database: PG::InvalidParameterValue: ERROR: new encoding (UTF8) is incompatible with the encoding of the template database (SQL_ASCII)
    HINT: Use the same encoding as in the template database, or use template0 as template.
    : CREATE DATABASE "msfbook" ENCODING = 'utf8'

    Call stack:
    /opt/metasploit/apps/pro/msf3/lib/msf/ui/console/command_dispatcher/db.rb:1758:in `db_connect_postgresql'
    /opt/metasploit/apps/pro/msf3/lib/msf/ui/console/command_dispatcher/db.rb:1598:in `cmd_db_connect'
    /opt/metasploit/apps/pro/msf3/lib/rex/ui/text/dispatcher_shell.rb:427:in `run_command'
    /opt/metasploit/apps/pro/msf3/lib/rex/ui/text/dispatcher_shell.rb:389:in `block in run_single'
    /opt/metasploit/apps/pro/msf3/lib/rex/ui/text/dispatcher_shell.rb:383:in `each'
    /opt/metasploit/apps/pro/msf3/lib/rex/ui/text/dispatcher_shell.rb:383:in `run_single'
    /opt/metasploit/apps/pro/msf3/lib/rex/ui/text/shell.rb:200:in `run'
    /opt/metasploit/apps/pro/msf3/msfconsole:148:in `<main>'
    msf > Interrupt: use the 'exit' command to quit
    msf > Interrupt: use the 'exit' command to quit
    msf > Interrupt: use the 'exit' command to quit
    msf > Interrupt: use the 'exit' command to quit
    msf > db_status[*] postgresql connected to postgres
    msf > Interrupt: use the 'exit' command to quit
    msf > Interrupt: use the 'exit' command to quit
    msf > db_connect postgres:[email protected]/msfbook
    [-] Error while running command db_connect: Failed to connect to the database: PG::InvalidParameterValue: ERROR: new encoding (UTF8) is incompatible with the encoding of the template database (SQL_ASCII)
    HINT: Use the same encoding as in the template database, or use template0 as template.
    : CREATE DATABASE "msfbook" ENCODING = 'utf8'

    Call stack:
    /opt/metasploit/apps/pro/msf3/lib/msf/ui/console/command_dispatcher/db.rb:1758:in `db_connect_postgresql'
    /opt/metasploit/apps/pro/msf3/lib/msf/ui/console/command_dispatcher/db.rb:1598:in `cmd_db_connect'
    /opt/metasploit/apps/pro/msf3/lib/rex/ui/text/dispatcher_shell.rb:427:in `run_command'
    /opt/metasploit/apps/pro/msf3/lib/rex/ui/text/dispatcher_shell.rb:389:in `block in run_single'
    /opt/metasploit/apps/pro/msf3/lib/rex/ui/text/dispatcher_shell.rb:383:in `each'
    /opt/metasploit/apps/pro/msf3/lib/rex/ui/text/dispatcher_shell.rb:383:in `run_single'
    /opt/metasploit/apps/pro/msf3/lib/rex/ui/text/shell.rb:200:in `run'
    /opt/metasploit/apps/pro/msf3/msfconsole:148:in `<main>'


    linux fully updated: Linux version 3.12-kali1-686-pae ([email protected]) (gcc version 4.7.2 (Debian 4.7.2-5) ) #1 SMP Debian 3.12.6-2kali1 (2014-01-06)

Similar Threads

  1. Metasploit starting issue
    By HDD2 in forum General Archive
    Replies: 7
    Last Post: 2015-04-27, 09:15
  2. Question about starting Metasploit pro (web GUI)
    By zerone.v01d in forum NetHunter General Questions
    Replies: 3
    Last Post: 2014-11-14, 16:57
  3. Do not use Adblock Plus when starting MetaSploit
    By NewNick in forum NetHunter General Questions
    Replies: 0
    Last Post: 2014-10-05, 19:56
  4. Metasploit starting issue
    By Quizmaster in forum TroubleShooting Archive
    Replies: 2
    Last Post: 2013-09-04, 11:41

Posting Permissions

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