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.
Printable View
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.
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 root:password@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.
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 :)
whats the advantage of running your own POstgresql over the built in one please ?
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:
Any solution? db_destroy in metasploit doesn't work, too.Code:sudo su postgres
dropbdb metasploit
could not change the directory to "/root"
Thanks!
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.
.................................................. .................................................. ..............................
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
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
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!
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#