|
| ||||||||||
| Tags: backtrack 5, howto, linux, metasploit, postgresql, ruby |
![]() |
| | Thread Tools | Search this Thread |
|
#1
| |||
| |||
| How to install metasploit and postgresql in backtrack 5?
Code: apt-get install postgresql libpq-dev sudo su postgres -c psql ALTER USER postgres WITH PASSWORD ‘your password’; \q sudo passwd -d postgres sudo su postgres -c passwd gem install pg msfconsole db_driver postgresql db_connect postgres:”postgreSQL password”@127.0.0.1/metasploit (“metasploit” being the name of the database) Code: db_driver postgresql db_connect postgres:”postgreSQL password”@127.0.0.1:5432/metasploit db_workspace -a PWBv3 |
|
#2
| ||||
| ||||
| re: How to install metasploit and postgresql in backtrack 5?
when i try to install postgresql.i get following output Code: root@root:~# 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 root123
postgres-# \q
could not save history to file "/home/postgres/.psql_history": No such file or directory
root@root:~# sudo passwd -d postgres
passwd: password expiry information changed.
root@root:~# sudo su postgres -c passwd
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
root@root:~# 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:
root@root:~#
root@root:~# gem install postgres
ERROR: http://rubygems.org/ does not appear to be a repository
ERROR: Could not find a valid gem 'postgres' (>= 0) in any repository
root@root:~# gem install postgres
Building native extensions. This could take a while...
ERROR: Error installing postgres:
ERROR: Failed to build gem native extension.
/usr/bin/ruby1.8 extconf.rb
extconf.rb:46: command not found: pg_config --includedir
extconf.rb:53: command not found: pg_config --libdir
checking for main() in -lpq... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/usr/bin/ruby1.8
--with-pgsql-dir
--without-pgsql-dir
--with-pgsql-include
--without-pgsql-include=${pgsql-dir}/include
--with-pgsql-lib
--without-pgsql-lib=${pgsql-dir}/lib
--with-pqlib
--without-pqlib
Could not find PostgreSQL build environment (libraries & headers): Makefile not created |
|
#3
| ||||
| ||||
| re: How to install metasploit and postgresql in backtrack 5? Quote:
Code: ALTER USER postgres WITH PASSWORD ‘your password’; |
|
#4
| ||||
| ||||
| re: How to install metasploit and postgresql in backtrack 5?
working mode code Code: root@bt:~# apt-get install postgresql root@bt:~# sudo apt-get install libpgsql-ruby root@bt:~# sudo su postgres sh-4.1$ createuser root -P could not change directory to "/root" Enter password for new role: Enter it again: Shall the new role be a superuser? (y/n) n Shall the new role be allowed to create databases? (y/n) n Shall the new role be allowed to create more new roles? (y/n) n sh-4.1$ createdb --owner=root metasploit could not change directory to "/root" exit sh-4.1$ exit exit root@bt:~# msfconsole msf > db_driver postgresql[*] Using database driver postgresql msf > db_connect root:toor@127.0.0.1:5432/metasploit db_workspace -a MyProject *] Added workspace: MyProject msf > db_nmap 192.168.1.165 -sS -O[*] Nmap: Starting Nmap 5.51SVN ( http://nmap.org ) at 2011-05-14 15:27 CEST[*] Nmap: Nmap scan report for hackdany-cecb3e.homenet.telecomitalia.it (192.168.1.165)[*] Nmap: Host is up (0.00055s latency).[*] Nmap: Not shown: 997 closed ports[*] Nmap: PORT STATE SERVICE[*] Nmap: 135/tcp open msrpc[*] Nmap: 139/tcp open netbios-ssn[*] Nmap: 445/tcp open microsoft-ds[*] Nmap: MAC Address: 08:00:27:F1:F2:8F (Cadmus Computer Systems)[*] Nmap: Device type: general purpose[*] Nmap: Running: Microsoft Windows XP[*] Nmap: OS details: Microsoft Windows XP SP2 or SP3[*] Nmap: Network Distance: 1 hop[*] Nmap: OS detection performed. Please report any incorrect results at http://nmap.org/submit/ .[*] Nmap: Nmap done: 1 IP address (1 host up) scanned in 3.56 seconds msf > db_autopwn -p -e -q[*] (1/51 [0 sessions]): Launching exploit/windows/dcerpc/ms03_026_dcom against 192.168.1.165:135...[*] (2/51 [0 sessions]): Launching exploit/freebsd/samba/trans2open against 192.168.1.165:139...[*] (3/51 [0 sessions]): Launching exploit/linux/samba/chain_reply against 192.168.1.165:139...[*] (4/51 [0 sessions............................etc...etc...et c the work is perfect (FOR ME) |
|
#5
| |||
| |||
| re: How to install metasploit and postgresql in backtrack 5?
I've been trying to get this job for about 2 weeks. Thank you a lot of study and documentation postgresql, finally understand my problem. I had to install postgresql database that runs from the Metasploit Framework. No configuration files for him than I can find. However it is running in the background. The disabled with 'service postgresql-8.3 stop' postgresql installed and configured for 9.1 postgresql start on port the standard port. I think the port is like 5432. 9.1 default start 5433, so I changed the postgresql.conf and pg_hba.conf to enable my password. Restart the server and load the connect command to MSF. Here is my output after. Code: msf > db_driver[*] Active Driver: postgresql[*] Available: postgresql, mysql msf > db_connect postgres:redhat590@127.0.0.1/metasploit NOTICE: CREATE TABLE will create implicit sequence "hosts_id_seq" for serial column "hosts.id" NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "hosts_pkey" for table "hosts" NOTICE: CREATE TABLE will create implicit sequence "clients_id_seq" for serial column "clients.id" NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "clients_pkey" for table "clients" NOTICE: CREATE TABLE will create implicit sequence "services_id_seq" for serial column "services.id" NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "services_pkey" for table "services" NOTICE: CREATE TABLE will create implicit sequence "vulns_id_seq" for serial column "vulns.id" NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "vulns_pkey" for table "vulns" NOTICE: CREATE TABLE will create implicit sequence "refs_id_seq" for serial column "refs.id" |
|
#6
| |||
| |||
| re: How to install metasploit and postgresql in backtrack 5?
can anyone tell me how to fix this error? Code: postgres=# ALTER USER postgres WITH PASSWORD root123; ERROR: syntax error at or near "root123" LINE 1: ALTER USER postgres WITH PASSWORD root123; |
|
#7
| |||
| |||
| re: How to install metasploit and postgresql in backtrack 5?
You need to use the surround your password with an apostrophe at each side of it:: Code: <..SNIP..> <..SNIP..> sudo su postgres -c psql ALTER USER postgres WITH PASSWORD ’your password’; /g |
|
#8
| |||
| |||
Re: How to install metasploit and postgresql in backtrack 5?
alright guys im kind of stumped here, can you please help. I am trying to run install postgresql because it is necessary to run armitage. i keep getting error codes left and right after following each of these installation codes. Now in armitage i get this message that it failed to connect bla bla bla, then it has something like this. Code: Call Stack: /opt/framework/msf3/lib/msf/ui/console/command_dispatcher/db.rb:1908:in 'db_connect_postgresql /opt/framework/msf3/lib/msf/ui/console/command_dispatcher/db.rb:1716:in 'cmd_db_connect' |
|
#9
| ||||
| ||||
| Re: How to install metasploit and postgresql in backtrack 5?
To get metasploit up and running, it is NOT required to disable ssl in the postgresql.conf, as the server works without trouble simply be installing postgresql from package. Code: apt-get install postgresql libpq-dev sudo su postgres -c psql ALTER USER postgres WITH PASSWORD 'your password'; \q sudo passwd -d postgres sudo su postgres -c passwd <type the password for postgres account> update-alternatives --config ruby choose 0 for "auto-mode" gem install pg msfconsole db_driver postgresql db_connect postgres:”postgreSQL_password”@127.0.0.1/metasploit (“metasploit” being the name of the database) workspace -a <workspace> Code: db_driver postgresql db_connect postgres:”postgreSQL_password”@127.0.0.1/metasploit workspace PWBv3 |
![]() |
|
| Thread Tools | Search this Thread |
| |
Similar Threads for: "How to install metasploit and postgresql in backtrack 5?" | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Backtrack 5 – No database in metasploit, when followed proposed steps | Habiba22 | Windows Software | 5 | 05-08-2011 09:21 AM |
| BackTrack 5: Getting call stack error on metasploit drivers | Aag-Man | Windows Software | 5 | 09-07-2011 10:36 AM |
| Unable to execute metasploit in backtrack 5 after updating db_driver sqlite 3 | Gaganvihari | Windows Software | 5 | 06-07-2011 07:40 PM |
| Can’t get metasploit working in backtrack 5 | Baijayanthi | Operating Systems | 4 | 20-06-2011 06:34 AM |
| Metasploit pcaprub solution for Backtrack 5 | Farzana | Operating Systems | 4 | 19-06-2011 01:31 AM |