[framework] Problem to connect to postgres with db_connect
nnp
version5 at gmail.com
Fri Dec 8 17:22:02 CST 2006
Have you tried dropping metasploitdb and creating it as follows
msf> db_create metasploitdb
That should connect you automatically. To test run
msf> db_hosts
That should return nothing but execute ok. To reconnect next time you
start msf just use db_connect metasploitdb.
Hope that helps,
nnp
On 12/8/06, FRANCIS PROVENCHER <francis.provencher at msp.gouv.qc.ca> wrote:
> Hi all,
>
> i try to test the automation of Msf3.
> (I will try to tell you the maximum information about my configuration)
>
> I create my db in Postgres its name is= metasploitdb
>
>
> Table Owner Tablespace Estimated row count Actions Comment
>
> hosts ****** 0 Browse Select Insert Empty Drop Vacuum
> refs ****** 0 Browse Select Insert Empty Drop Vacuum
> services ****** 0 Browse Select Insert Empty Drop Vacuum
> vulns ****** 0 Browse Select Insert Empty Drop Vacuum
> vulns_refs ****** 0 Browse Select Insert Empty Drop Vacuum
>
> **********# uname -a
> FreeBSD ******************* 6.1-SECURITY FreeBSD 6.1-SECURITY #0: Mon Dec 4 07:53:55 UTC 2006 root at builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC i386
>
>
> ****************$sudo cd /root/Metasploit/framework-3.0-beta-3
> password:***************
> ***************$ ./msfconsole
>
> _ _ _ _
> | | | | (_) |
> _ __ ___ ___| |_ __ _ ___ _ __ | | ___ _| |_
> | '_ ` _ \ / _ \ __/ _` / __| '_ \| |/ _ \| | __|
> | | | | | | __/ || (_| \__ \ |_) | | (_) | | |_
> |_| |_| |_|\___|\__\__,_|___/ .__/|_|\___/|_|\__|
> | |
> |_|
>
>
> =[ msf v3.0-beta-dev
> + -- --=[ 131 exploits - 99 payloads
> + -- --=[ 17 encoders - 4 nops
> =[ 27 aux
>
> msf > load db_postgres
> [*] Successfully loaded plugin: db_postgres
>
> msf > help
>
> Postgres Database Commands
> ==========================
>
> Command Description
> ------- -----------
> db_connect Connect to an existing database ( user:pass at host:port/db )
> db_create Create a brand new database ( user:pass at host:port/db )
> db_destroy Drop an existing database ( user:pass at host:port/db )
> db_disconnect Disconnect from the current database instance
>
> msf > db_connect Francis:*******@localhost:5432/metasploitdb
> [-] Error while running command db_connect: This plugin failed to load: Failed to connect to the database
>
> Call stack:
> /root/Metasploit/framework-3.0-beta-3/plugins/db_postgres.rb:67:in `cmd_db_connect'
> ./lib/rex/ui/text/dispatcher_shell.rb:229:in `send'
> ./lib/rex/ui/text/dispatcher_shell.rb:229:in `run_command'
> ./lib/rex/ui/text/dispatcher_shell.rb:196:in `run_single'
> ./lib/rex/ui/text/dispatcher_shell.rb:191:in `each'
> ./lib/rex/ui/text/dispatcher_shell.rb:191:in `run_single'
> ./lib/rex/ui/text/shell.rb:118:in `run'
> ./msfconsole:63
>
>
> **********# nmap -p 5432 localhost
>
> Starting Nmap 4.11 ( http://www.insecure.org/nmap/ ) at 2006-12-08 16:15 EST
> Interesting ports on localhost (127.0.0.1):
> PORT STATE SERVICE
> 5432/tcp open postgres
>
> Nmap finished: 1 IP address (1 host up) scanned in 0.051 seconds
>
>
> Some one can help me to understand what i do wrong?
>
> Thanks all for your support
>
> Francis Provencher
> Ministère de la Sécurité publique du Québec
> Direction des technologies de l'information
> Tél: 1 418 646-3258
> Courriel: Francis.provencher at Msp.gouv.qc.ca
>
> CEH - Certified Ethical Hackers
> SSCP - System Security Certified Practitionner
> Sec+ - Security +
>
--
http://silenthack.co.uk
More information about the framework
mailing list