Welcome Guest [Log In] [Register]
Welcome to Pwnie Express. We hope you enjoy your visit.

You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Please note you need to use a valid email address to register for member access.

Get your questions answered by other members, share your ideas and feedback, get your problems solved, and give back by helping others! It only takes a minute to get started. Registration is simple, fast, and completely free!

Join our community!


If you're already a member please log in to your account to access all of our features:

Username:   Password:
Add Reply
Metasploit "Database not connected"; When I use a database command within Metasploit (msfconsole, i.e. "db_nmap -A <subnet>", i get "[*] Database not connected"
Topic Started: Feb 25 2014, 01:19 PM (6,400 Views)
cv1

Hi community,

Just got this awesome pad and am learning tools one by one. I started with nmap, and now moving onto Metasploit. I will appreciate any help on a few issues I'm having:

Scenario: When I use a database command within Metasploit (msfconsole, i.e. "db_nmap -A <subnet>", i get an error message that says "[*] Database not connected".

Questions:
Is there a database installed on pwn pad 2014? If so, which one? How do I get it to connect to metasploit? Is the database username "msf"? How about the password?
If no database is installed, has anyone tried installing postgresql and configuring it to work with Metasploit on the pwn pad 2013/2014?

Thanks,
Carlos

Offline Profile Quote Post Goto Top
 
Replies:
cv1

cLeAv0,

After editing /var/lib/dpkg/info/tzdata.postinst and replacing the second line

'set -e'

with

'set -x'

When I run

'dpkg --configure tzdata'

I get the following error:

'dpkg: error processing tzdata (--configure):
package tzdata is already installed and configured
Errors were encountered while processing:
tzdata'

Everything else ran good up until 'apt-get install metasploit' which gave me the following error about ~20min into the install:

'Setting up tzdata (2013i-Owheezy1) ...
file_context_open: Error getting file context handle (No such file or directory)
Could not load file_contexts: No such file or directory
dpkg: error processing tzdata (--configure):
supbrocess installed post-installation script returned error exit status 255
Errors were encountered while processing:
tzdata
E: Sub-process /usr/bin/dpkg returned an error code (1)'

Let me know if I interpreted this step correctly:
"Try putting 'set -x' on the second line of the script,"

Thanks,
Carlos
Offline Profile Quote Post Goto Top
 
cLeAv0

@cv1 try adding set -x without removing set -e. just add set -x to the second line.
Edited by cLeAv0, Mar 1 2014, 01:21 AM.
Offline Profile Quote Post Goto Top
 
cv1

cLeAv0,

All good now. :) Apparently it was a little hickup, just retraced your steps and all good now. Thank you.
Offline Profile Quote Post Goto Top
 
securemaryland

I tried this and got an two errors:
1. dpkg --congiure tzdata throws an errordpkg: error processing tzdata (--configure):
package tzdata is already installed and configured
Errors were encountered while processing:
tzdata
2. I get an error with apt-get install metasploit:Errors were encountered while processing:
metasploit
E: Sub-process /usr/bin/dpkg returned an error code (1)

So I guess I jacked up something with the set -x stuff so can you post the first few lines of tzdata.postinst so I can see what I jacked up. My first few lines are:
1 #! /bin/sh
2 set -e set -x
3
4 LANG=C
5 unset TZ
6 umask 022
7
8 . /usr/share/debconf/confmodule
9 db_version 2.0

***Update: I have another problem too - when I issue service postgresql start - it doesn't so me thinks I am having more issue than the above.
Edited by securemaryland, Mar 5 2014, 12:12 AM.
Offline Profile Quote Post Goto Top
 
cLeAv0

securemaryland
Mar 4 2014, 09:33 PM
I tried this and got an two errors:
1. dpkg --congiure tzdata throws an errordpkg: error processing tzdata (--configure):
package tzdata is already installed and configured
Errors were encountered while processing:
tzdata
2. I get an error with apt-get install metasploit:Errors were encountered while processing:
metasploit
E: Sub-process /usr/bin/dpkg returned an error code (1)

So I guess I jacked up something with the set -x stuff so can you post the first few lines of tzdata.postinst so I can see what I jacked up. My first few lines are:
1 #! /bin/sh
2 set -e set -x
3
4 LANG=C
5 unset TZ
6 umask 022
7
8 . /usr/share/debconf/confmodule
9 db_version 2.0

***Update: I have another problem too - when I issue service postgresql start - it doesn't so me thinks I am having more issue than the above.
Should be

1 #! /bin/sh
2 set -x
3 set -e

I think. If it still doesn't work i have no idea.
Offline Profile Quote Post Goto Top
 
securemaryland

Ok, I have gotten a little further than I did before - I was able to get postgresql to install and run. I am hoping that this will "fix" the metasploit stuff as well. In case others are having problems i wanted to share my results:

1. I had to force remove all of postgresql = apt-get --remove purge postgresql\*
2. I then removed the postgres user and groups = userdel postgres goupdel (not sure the actual command) posgres
3. Deleted every directory associated with postges
4. Reinstalled postgresql = apt-get install postgresql
5. Went to start postgresql with the service postgresql start command and ran into a "permissions error"
6. Had to mod the user so they have correct group rights. usermod -a -G aid_inet postgres

Update-rc.d as previously discussed and whamo postgresql now starts. Trying Metasploit tonight.
***UPDATE*** I ran apt-get install metasploit and npw that ppstgreaql was working it finished w/o error and I now have metasploit working with postgresql WOOT.
Edited by securemaryland, Mar 5 2014, 07:23 PM.
Offline Profile Quote Post Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · Pwn Pad Community Edition Support Forum · Next Topic »
Add Reply