1

I just installed metasploit. The issue is I can only run ./msfconsole in installation directory which is /opt/framework/metasploit-framework.

When I run msfconsole in another directory, I get this error:

Could not find rake-10.4.2 in any of the sources
Run `bundle install` to install missing gems.

In my .bashrc file :

export PATH="$PATH:$HOME/.rvm/bin" 
export PATH="$PATH:$HOME/.gem/ruby/2.3.0/bin"
export PATH="$(ruby -e 'print Gem.user_dir')/bin:$PATH"

export PATH=$PATH:/opt/framework/metasploit-framework
alias msfconsole="./msfconsole --quiet -x \"db_connect ${USER}@msf\""

My solution so far (I have to exit to /opt/framework/metasploit-framework though) :

alias msfconsole="cd /opt/framework/metasploit-framework && ./msfconsole --quiet -x \"db_connect ${USER}@msf\""
dr_
  • 28,763
  • 21
  • 89
  • 133

2 Answers2

0

Your alias is wrong. The leading ./ means "do this in the current directory". If you remove it it should work.

export PATH=$PATH:/opt/framework/metasploit-framework
alias msfconsole="msfconsole --quiet -x \"db_connect ${USER}@msf\""
runejuhl
  • 583
  • 3
  • 10
0

I managed to solve by adding this line to my .bashrc:

alias msfconsole="cd /opt/framework/metasploit-framework && ./msfconsole --quiet -x \"db_connect ${USER}@msf\ && cd -""
terdon
  • 234,489
  • 66
  • 447
  • 667
  • Please remember to come back and [accept](http://unix.stackexchange.com/help/someone-answers) this answer when the system allows you to by clicking on the check mark to the left. That will mark the question as answered. Και καλώς ήρθες! – terdon Jan 09 '16 at 18:00