1

I have Metasploit installed on OSX in /usr/local/share/msf

Metasploit's executables can't be run outside it's directory thus would give a command not found error.

msfbinscan
msfconsole
msfd
msfelfscan
msfmachscan
msfpescan
msfrop
msfrpc 
msfrpcd
msfupdate
msfvenom

For me, only msfconsole runs without having a ./ prefix but the rest executes but gives no output unless I add ./msfupdate for example.

How would I run msf* files with the prefix as if I was running a built in command? I've tried symlinking the directory as a $MSF enviroment to /usr/local/bin but that never worked and it's also a known issue.

For example:

$: ./msfvenom works but $: msfvenom runs but doesn't output anything thus doesn't do anything.

All my msf* files are -rwxr-xr-x

Is there some sort of way to fix this or similar?

Gilles 'SO- stop being evil'
  • 807,993
  • 194
  • 1,674
  • 2,175

2 Answers2

0

To run a command by typing its name, the command must be in one of the directories listed in the PATH environment variable. Being in the current directory is not good enough. Being in a subdirectory of a directory in PATH is not good enough.

So edit /etc/profile to add the full path to the directory where the Metasploit binaries are. On OSX, the change will take effect in new terminals that you open.

Gilles 'SO- stop being evil'
  • 807,993
  • 194
  • 1,674
  • 2,175
0

After messing around i've finally got them working. One simple command was all it took:

sudo ln -s /usr/local/share/msf/msf* /usr/local/sbin