Friday, April 13, 2012

Cloudy with a chance of BeEF

Running BeEF from a local workstation poses some problems during a penetration test: it doesn't have a static IP address, the workstation gets turned on and off, and it really doesn't demonstrate the impact of Internet-borne threats. Pentesters have been turning more and more to online VPS services, or Amazon's EC2. For example, check out the lightning talk that I did at CloudCamp: leveraging the "cloud" during penetration tests 

This is where the idea of running BeEF on an Amazon EC2 instance started to simmer.

These days, the BeEF project uses IaaS and other cloud-esque services for a lot of the work. We have our continuous integration server running tests against our github hosted source code, heck, even this blog utilises SaaS (note to readers: if you think *aaS isn't already used throughout your organisation, you are sorely mistaken).

So here's a quick and dirty method to get you running the latest version of BeEF with an Amazon EC2 instance in no time. Before we begin though, this installation method is heavily inspired from RVM's installation method, so this will look familiar to RVM users.

You might be thinking, why not just create a canned Amazon Machine Image (AMI) of BeEF? When we considered all the different Amazon regions in which we'd have to host an AMI image, this method was just as simple, especially when dealing with all the changes to the framework over time. This process is still in its infancy though, so expect it to change in the future as the framework matures.

Step 1:
Create a fresh "Amazon Linux AMI" instance (if you're impatient the c1.xlarge can be up and running in about 5 mins, otherwise you can use the smaller instances).

Step 2.
SSH into the instance

Step 3.
At the prompt:
$ bash < <(curl -s

Step 4.
Re-activate rvm:
$ source ~/.bash_profile

Step 5.
Change into the beef folder:
$ cd beef

Step 6.
Run beef:
$ ./beef

Step 7.

Step 8.

Under the hood, the beef-installer script is simply:
  1. Installing dependencies with yum
  2. Downloading RVM
  3. Installing RVM
  4. Using RVM to install OpenSSL and Ruby 1.9.2
  5. Installing the 'bundler' gem (required for BeEF)
  6. Cloning the latest BeEF from github
  7. Going into the beef folder
  8. Running bundler to install BeEF's gem dependencies
Hope you guys find this useful.


  1. Profit! .. we find that's many people's favourite step.

  2. This is a really good idea and I've been running BeEF on a Amazon Linux AMI for a week or so. Inevitably I lose the SSH terminal sometimes so I can no longer monitor the beef activity. More serious than that, How do I gently stop beef from a new terminal window without leaving a whole bunch of stuff hanging. 'kill beef' causes a whole bunch of problems :(

    1. Ok got it. Start BeEF with
      screen ./beef
      Then ctrl-d to quit the screen session. To get it back use
      screen -r
      Stopping BeEF gently is
      kill -sigint
      And restart cleanly
      ./beef --reset

  3. This comment has been removed by the author.

  4. This comment has been removed by the author.


  5. Thanks for posting this useful content, Good to know about new things here, Let me share this, . CCNA training in pune

  6. I have read your article, it make t shirts is very informative and helpful for me.I admire the valuable information you offer in your articles. Thanks for posting it

  7. Hats off to your presence of mind..I really enjoyed reading your blog. I really appreciate your information which you shared with us.
    Aws Online Training

  8. The first time I saw this website, I was immediately attracted to zoom. Moreover, all the information is in my opinion quite interesting and intriguing. I hope you also visit my website and pass judgment on Costa Calida my website. Thanks.


  9. A really good post,Its really very informative and answers multiple questions that I had.Thanks a lot for sharing valuable information with us.
    aws online training

  10. Good Post! Thank you so much for sharing this pretty post, it was so good to read and useful to improve my knowledge as updated one, keep blogging.

    Selenium with python Training in Electronic City

  11. You won't believe me, but I was planning to write a blog very similar to the one you have posted here. Great work!

    AWS Training In Chennai

    Hadoop Training In Chennai

  12. This comment has been removed by the author.

  13. It's interesting that many of the bloggers your tips helped to clarify a few things for me as well as giving.. very specific niche content.

  14. Special thanks to the amazing team Rankmywriter service behind this company, I would never get to where I am now if not for your determination and professionalism. Not only they proofread my application and made necessary alterations, but I also received a list of suggestions on how to improve my sample to better adjust it to APA style.

  15. We are the best Online Essay Editing Service company providing College Essay Services written by highly skilled writers. Our writers are skillful in their areas of expertise since they have years of experience in their subject areas.

  16. The information you have shared is very helpful to us.
    strike force kitty 2

  17. Thank you for that information you article
    red ball

  18. อยู่ที่ไหนก็เล่นได้ง่ายๆ สล็อตออนไลน์ live22 เครดิตฟรี

  19. The content of your article page y8 Return Man 3, I find the content quite interesting and useful to me, thank you for sharing

  20. เล่นเกม joker123สล็อตออนไลน์ slot online ฟรีเครดิต

  21. ดูหนังออนไลน์ฟรี หนังดี หนังดัง ระดับ 4K HD Premium ง่ายๆ ได้ที่ Doonung1234 หลากหลายเรื่อง กับเรื่อง Ip Man 4: The Finale ยิปมัน 4 (2019) [ ซูม ]

  22. Really this is very good information, the website I visited just 5 minutes ago and the message is the best website I found and this article contains all the information that I needed.

    If you also want to read Hindi essays or use Hindi essays for your school project, then you can visit our website.

  23. Really this is very good information, the website I visited just 5 minutes ago and the message is the best website.

    read about ccc on CCC Online Tayari

  24. The information given here is very good to some extent, but there is still some update in this information, please do update this information.

    We have brought every thing related to RCIT, so if you also want RSCIT Online Test, RSCIT Previous Paper and everything related to RSCIT, then visit

  25. It's very good post which I really enjoyed reading. It is not everyday that I have the possibility to see something like this.


    Canlı bahis sitesi

    Vip casino sitesi Cratosslot

    Egt slot oyunları

    Online canlı bahis sitesi Cratossporting

    Online casino Cratosslot

    En iyi oyunlar 

    Tüm radyo frekansları için

  27. this game is good สมัครpg
    this game is good joker123
    this game is good pg slot ทดลองเล่น
    this game is good pg auto
    this game is good joker gaming
    this game is good pgslot

  28. New online slots game Online slot betting
    Get free bonus. Apply JOKER auto
    this game is amazing slotxo
    This game is very good PGSLOT
    This game is very good UFABET

  29. New online slots game Online slot betting
    This game is very good Super slot
    Get free bonus. Apply Pgslot
    this game is amazing Joker auto
    This game is very good UFABET auto
    This game is very good Dinosaur Tycoon

  30. ShowBizClan is your news, entertainment, music fashion website. We provide you with the latest breaking news and videos straight from the people. Moreover, we have also cover 20 best korean movies full of thriller, action,romance and much more. Your visit can enhance our potential to write more amazingly.