thanks for that
Great post and walk through. I was still having issues with it working after following the steps but here is what I did to get it to work for me.
in the file autopwn.py ( located /pentest/exploits/fasttrack/bin/ftsrc ) around line 83
change line 88
change line 90Code:child1.sendline ('db_destroy postgres:root@localhost/pentest')
NOTE: I am using BT4 R1 release but I didn't have to uninstall / reinstall postgreSQLCode:child1.sendline ('db_connect postgres:root@localhost/pentest')
hope this helps someone out there
thanks for that
Man, I had the same trouble... You need to install the following packets:
- ruby-dev
- build-essential
- libpq-dev
The packets above are necessary to GEM can install the postgresql drivers.
I installed this packets by using "apt-get" on Ubuntu, for example:
# apt-get install ruby-dev build-essential libpq-dev
Now you already can install the GEM packets to perform postgres driver on metasploit:
# gem install activerecord
Successfully installed activesupport-2.3.8
Successfully installed activerecord-2.3.8
2 gems installed
Installing ri documentation for activesupport-2.3.8...
Installing ri documentation for activerecord-2.3.8...
Installing RDoc documentation for activesupport-2.3.8...
Installing RDoc documentation for activerecord-2.3.8...
# gem install postgres
Building native extensions. This could take a while...
Successfully installed postgres-0.7.9.2008.01.28
1 gem installed
Installing ri documentation for postgres-0.7.9.2008.01.28...
Installing RDoc documentation for postgres-0.7.9.2008.01.28...
I am sure it will work, with me it worked...
After you just need run msfconsole e type the db_driver command, it should to show something like that:
msf > db_driver
[*] Active Driver: postgresql[*] Available: postgresql
Done...
PS: I am sorry for my bad English, I am from Brazil, I am still studing English...
This is a very useless question. Why do you have to type db_drive sqlite3 and db_connect "db name" everytime you enter metasploit if you use sqlite3 ?
Back|track giving machine guns to monkeys since 2007 !
Do not read the Wiki, most your questions will not be answered there !
Do not take a look at the: Forum Rules !
???? but check these line below :
msf > db_autopwn
[-] Database not connected
msf > db_driver[*] Active Driver: postgresql[*] Available: postgresql, sqlite3
[*] DB Support: Enable the mysql driver with the following command:[*] $ gem install mysql[*] This gem requires mysqlclient headers, which can be installed on Ubuntu with:[*] $ sudo apt-get install libmysqlclient-dev
msf > db_connect postgres
[-] Error while running command db_connect: Failed to connect to the database: FATAL: role "root" does not exist
Call stack:
/opt/metasploit3/msf3/lib/msf/ui/console/command_dispatcher/db.rb:1594:in `db_connect_postgresql'
/opt/metasploit3/msf3/lib/msf/ui/console/command_dispatcher/db.rb:1262:in `send'
/opt/metasploit3/msf3/lib/msf/ui/console/command_dispatcher/db.rb:1262:in `cmd_db_connect'
/opt/metasploit3/msf3/lib/rex/ui/text/dispatcher_shell.rb:246:in `send'
/opt/metasploit3/msf3/lib/rex/ui/text/dispatcher_shell.rb:246:in `run_command'
/opt/metasploit3/msf3/lib/rex/ui/text/dispatcher_shell.rb:208:in `run_single'
/opt/metasploit3/msf3/lib/rex/ui/text/dispatcher_shell.rb:202:in `each'
/opt/metasploit3/msf3/lib/rex/ui/text/dispatcher_shell.rb:202:in `run_single'
/opt/metasploit3/msf3/lib/rex/ui/text/shell.rb:141:in `run'
./msfconsole:112
msf > db_driver postgresql[*] Using database driver postgresql
msf > db_autopwn
[-] Database not connected
msf > db_connect postgres:"postgreSQL password"@127.0.0.1/metasploit
msf > db_autopwn[*] Usage: db_autopwn [options]
-h Display this help text
-t Show all matching exploit modules
-x Select modules based on vulnerability references
-p Select modules based on open ports
-e Launch exploits against all matched targets
-r Use a reverse connect shell
-b Use a bind shell on a random port (default)
-q Disable exploit module output
-R [rank] Only run modules with a minimal rank
-I [range] Only exploit hosts inside this range
-X [range] Always exclude hosts inside this range
-PI [range] Only exploit hosts with these ports open
-PX [range] Always exclude hosts with these ports open
-m [regex] Only run modules whose name matches the regex
-T [secs] Maximum runtime for any exploit in seconds
msf >
so what's my problem ?
Dude did you even read my tutorial ? Next time when asking questions please take the time to read the tutorial first:
The commands are:
Code:db_drive postgresql db_connect postgres:"db password"@127.0.0.1/"db name" (cerate the database manually and start postgresql) db_autopwn
Back|track giving machine guns to monkeys since 2007 !
Do not read the Wiki, most your questions will not be answered there !
Do not take a look at the: Forum Rules !
Well you must manually create the postgreSQL database, for example your postgresql user is "postgres"(default user) and the password toor, you log in your postgresql you manually create the database named "metasploit".
The first thing you do it start postgreSQL
Than you log in Metasploit and type:Code:/etc/init.d/postgresql start
Now remember this example is based on the credentials I've told you in this post, just associate them with your credentials and it should work.Code:db_drive postgresql db_connect postgres:toor@127.0.0.1/metasploit db_autopwn
Back|track giving machine guns to monkeys since 2007 !
Do not read the Wiki, most your questions will not be answered there !
Do not take a look at the: Forum Rules !
Sorry for post an image, but i don't know how copy text from the fast track terminal (no scroll bar)
It's this ok?
http://i46.tinypic.com/30az5hi.jpg