Running BeEF in Windows 7


Posted on July 26, 2012 by

I was installing BeEF (The Browser Exploitation Framework) on Windows 7 and ran into a couple of problems.  I eventually got all of them fixed, so I thought I would write up a proper installation guide for future reference.

First, download all of the stuff you will need:

Once all of that has been downloaded, install Ruby using the RubyInstaller and install the Ruby Dev Kit.  I am running Ruby version 1.9.3 and Ruby Development Kit 4.5.2.  Be sure to use the Ruby Dev Kit Installation Instructions.

Next, drop the SQLLite DLL file in your <rubyInstall>\bin directory.

Now, install bundler for Ruby by running the command:

rubyInstall\bin\gem install bundler

The next step is to install the pre-release version of eventmachine.  Run the command:

rubyInstall\bin\gem install eventmachine --pre

This installs eventmachine version 1.0.0.rc.4.

Now to install and configure BeEF.  If you downloaded the ZIP file from GitHub, extract that to C:\BeEF.  From the C:\BeEF directory, run the command:

rubyInstall\bin\bundle install

This installs all of the necessary Ruby gems for BeEF.

Now, we need to make sure BeEF uses eventmachine version 1.0.0.rc.4 and not any other version.  This was my biggest problem getting BeEF to run on Windows 7.  To do this, open C:\BeEF\Gemfile.  Change the version of eventmachine used for Windows from version 1.0.0.beta.4.1 to 1.0.0.rc.4.  After you are done, it should look something like this:

Change eventmachine version in Gemfile

In the example above, I have commented out the version of eventmachine (1.0.0.beta.4.1) that doesn’t work with Windows 7.

Finally, run a gem update command from the C:\BeEF folder to make sure it is calling the right version of eventmachine:

rubyInstall\bin\bundle update eventmachine

You an also run the next command to ensure that BeEF is using the right version of eventmachine, 1.0.0.rc.4.

rubyInstall\bin\bundle show eventmachine

Now you should be able to run “ruby beef” and start testing.

Response to Running BeEF in Windows 7

Leave a Reply

Your email address will not be published. Required fields are marked *