How does metasploit locate the database.yml file in backbox?

Started by nebula, June 13, 2013, 12:02:16 AM

Previous topic - Next topic

nebula

As the title already says, how is Metasploit locating the database.yml file in Backbox 3.05?


ZEROF


Don't ask, read : http://wiki.backbox.org
or just run sudo rm -rf /*

nebula

It indeed connects to psql, but my issue seems different:

QuoteEnable the database on startup

cat > ~/.msf4/msfconsole.rc
db_connect backbox:[password]@127.0.0.1:5432/metasploit4

I intended to remove the package reposity and replace it against a git reposity.

Sadly, when i do so, armitage stops working. (It breaks when establishing the db connection and complains that it is unable to locate database.yml. (This happens as sudo, root and even when launching ./ from folder, the proposed fix didnt solved the issue.

Updating /etc/profile as proposed in different other places didnt worked too.
(
Quoteecho export MSF_DATABASE_CONFIG=/opt/backbox/config/database.yml >> /etc/profile
)

Maybe, as armitage requires root theres another place/solution i miss out.

ZEROF

Hi again,

[password] need to be replaced with your own password. 2nd, if you try to use non supported version, then i can't help you, because i don't know how metasploit version from your new install will work with our system. I can make small video to show you how to set all, but i don't see what you can learn from it, because i will only use our wiki informations.

And pls check other forum topics with same issue. If you can't start metasploit at all, then try to reinstall.

Cheers and good luck !

Don't ask, read : http://wiki.backbox.org
or just run sudo rm -rf /*

nebula

To nail it down, running metasploit form git has the advantage for me to be able to switch between commits.

Concerning the issue itself. If metasploit in backbox doesent utilize ~/.msf4/msfconsole.rc or /etc/profile , where is this information stored?

However, my guess, the error has something todo with root priviledges. So there might be a similar file in root like /etc/profile. Ill figure that later on today if nobody in meantime comes up with the solution.

weVeg

have you tried to search what you need here:
/opt/backbox/msf/data
backbox/msf [ l+ | grep .yml                                     master ] 9:49
config/database.yml.example
config/database.yml.travis
data/mime.yml
test_lab.yml
test_targets.yml


l+ is an alias for recorsive listing....
una voce libera รจ sempre liberatrice
under_r00t

nebula

Well, the issue was missed out files from a previous installation as it look now

what would have avoided the issue:

$ locate /usr | grep msf 

# /usr/local/bin/$msf links where outdated.


sudo bash -c 'for MSF in $(ls msf*); do ln -s /opt/backbox/msf/$MSF /usr/local/bin/$MSF;done'


of course also set /etc/profile with the database.yml location

export MSF_DATABASE_CONFIG=/opt/backbox/config/database.yml

and finally

cat > ~/.msf4/msfconsole.rc
db_connect user:password@127.0.0.1:5432/msfdb

Anyways, got my backbox with GIT metasploit.