- Install Xcode - http://developer.apple.com/tools/xcode/
- Install PostgreSQL - http://www.enterprisedb.com/products-services-training/pgdownload#osx
Open pgAdmin III.app
, connect to the local postgresql server (user postgres, if it asks, & whatever password from above), right-click on Login Roles
and select New Login Role...
Set the role name (this will be the username) to whatever you want or use msfuser Under the definition tab, set the password to whatever you want or use msfpassword
Still in pgAdmin III.app
, right-click on Databases
and select New Database...
Set the database Name to whatever you want or use metasploitdb
Set the database Owner to the new user from above (msfuser in the example above)
Install MacPorts - http://www.macports.org/
Add /opt/local
to your spotlight privacy settings to avoid excessive compile times & unnecessary indexing by spotlight.
Go to: System Preferences->Spotlight->Privacy->"+"
Press command+shift+G
and type in /opt/local
Update with sudo port selfupdate
Quit terminal & relaunch to accept new path settings added by MacPorts
sudo port install ruby19 +nosuffix
sudo mv /opt/local/bin/ruby /opt/local/bin/ruby20
sudo ln -s /opt/local/bin/ruby1.9 /opt/local/bin/ruby
sudo gem update --system
sudo gem install pg -- --with-opt-include=/Library/PostgreSQL/9.3/include/ --with-opt-lib=/Library/PostgreSQL/9.3/lib/
Install the gsm msgpack with: sudo gem install msgpack
sudo bash
cd /opt
git clone https://github.com/rapid7/metasploit-framework.git
mv metasploit-framework msf && cd msf
export PATH=/Library/PostgreSQL/9.3/bin/:$PATH # change to your postgresql version
bundle
ln -s /opt/msf/* /opt/local/bin
ln -s /opt/msf/armitage /opt/local/bin
mkdir -p /opt/local/config
cat > /opt/local/config/database.yml
Add this:
# These settings are for the database used by the Metasploit Framework
# unstable tree included in this installer, not the commercial editions.
#
production:
adapter: "postgresql"
database: "metasploitdb"
username: "msfuser"
password: "msfpassword"
port: 5432
host: "localhost"
pool: 256
timeout: 5
Launch daemons, and connect to DB:
export MSF_DATABASE_CONF=/opt/local/config/database.yml
msfrpcd -U msfuser2 -P msfpassword2 -S -a 127.0.0.1 -t Msg
msfconsole # open msf console and connect to db
msf> db_connect -y /opt/local/config/database.yml
msf> exit
Create msfrpcd a launchd service:
/Library/LaunchDaemons/org.metasploitframework.rpcd.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Disabled</key>
<false/>
<key>Label</key>
<string>org.metasploitframework.rpcd</string>
<key>RunAtLoad</key>
<true/>
<key>Debug</key>
<false/>
<key>ProgramArguments</key>
<array>
<string>export MSF_DATABASE_CONF=/opt/local/config/database.yml</string>
<string>/opt/local/bin/ruby</string>
<string>/opt/local/msf/msfrpcd</string>
<string>-f</string>
<string>-U</string>
<string>msfuser2</string>
<string>-P</string>
<string>msfpassword2</string>
<string>-S</string>
<string>-a</string>
<string>127.0.0.1</string>
<string>-t</string>
<string>Msg</string>
</array>
<key>WorkingDirectory</key>
<string>/opt/local/bin/</string>
</dict>
</plist>
Start the msfrpcd launchd with sudo launchctl load /Library/LaunchDaemons/org.metasploitframework.rpcd.plist
Version mac from here: http://www.fastandeasyhacking.com/download doesn't work for me. The only way I Armitage worked for me, is to launch it from command line with this:
MSF_DATABASE_CONFIG=/opt/local/config/database.yml open /Applications/Armitage.app
Although I've tried to put it to ~/.zshrc and /etc/bashrc and ~/.profile, variable is visible only for me, but not visible for armitage so whatever.. it works.
If you have problem like this: java.net.SocketException: Unexpected end of file from server
You probably forgot to include -S
param when starting msfrpcd
, this one disables SSL.
cd /opt
svn checkout http://armitage.googlecode.com/svn/trunk/ armitage-read-only
mv armitage-read-only armitage && cd armitage
port -v install apache-ant
./package.sh
java -C "armitage.jar"
bash-3.2# java -C "armitage.jar"
Unrecognized option: -C
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
what am i doing wrong