Author Topic: How does metasploit locate the database.yml file in backbox?  (Read 10339 times)

nebula

  • Newbie
  • *
  • Posts: 6
    • View Profile
As the title already says, how is Metasploit locating the database.yml file in Backbox 3.05?




ZEROF

  • Hero Member
  • *****
  • Posts: 1247
    • View Profile
    • Pen Tester
Hi,

Check our wiki : http://wiki.backbox.org/index.php/Metasploit and check forum (search) topics.

Cheers !


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


nebula

  • Newbie
  • *
  • Posts: 6
    • View Profile
It indeed connects to psql, but my issue seems different:

Quote
Enable 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.
(
Quote
echo export MSF_DATABASE_CONFIG=/opt/backbox/config/database.yml >> /etc/profile
)

Maybe, as armitage requires root theres another place/solution i miss out.
« Last Edit: June 13, 2013, 01:17:18 AM by nebula »



ZEROF

  • Hero Member
  • *****
  • Posts: 1247
    • View Profile
    • Pen Tester
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

  • Newbie
  • *
  • Posts: 6
    • View Profile
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

  • Hero Member
  • *****
  • Posts: 737
    • View Profile
have you tried to search what you need here:
/opt/backbox/msf/data
Code: [Select]
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....
« Last Edit: June 13, 2013, 09:22:00 PM by weVeg »

una voce libera รจ sempre liberatrice
under_r00t


nebula

  • Newbie
  • *
  • Posts: 6
    • View Profile
Well, the issue was missed out files from a previous installation as it look now

what would have avoided the issue:

$
Code: [Select]
locate /usr | grep msf 
# /usr/local/bin/$msf links where outdated.


Code: [Select]
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

Code: [Select]
export MSF_DATABASE_CONFIG=/opt/backbox/config/database.yml
and finally

Code: [Select]
cat > ~/.msf4/msfconsole.rcdb_connect user:password@127.0.0.1:5432/msfdb

Anyways, got my backbox with GIT metasploit.