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 https://raw.github.com/xntrik/beefcloud/master/beef-installer)

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.
Profit!

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.

65 comments:

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

    ReplyDelete
  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 :(

    ReplyDelete
    Replies
    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

      Delete
  3. This comment has been removed by the author.

    ReplyDelete
  4. This comment has been removed by the author.

    ReplyDelete


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

    ReplyDelete
  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

    ReplyDelete
  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

    ReplyDelete
  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.

    ReplyDelete

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

    ReplyDelete
  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

    ReplyDelete
  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

    ReplyDelete
  12. This comment has been removed by the author.

    ReplyDelete
  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. www.appslure.com

    ReplyDelete
  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.

    ReplyDelete
  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.

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

    ReplyDelete
  17. Thank you for that information you article
    red ball

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

    ReplyDelete
  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

    ReplyDelete
  20. เล่นเกม joker123สล็อตออนไลน์ slot online ฟรีเครดิต
    https://www.slot4u.com/joker123

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

    ReplyDelete
  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. essaytonibandh.com

    ReplyDelete
  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

    ReplyDelete
  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 ilearnrscit.com

    ReplyDelete
  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.
    source

    ReplyDelete
  26. https://www.cratoswin.com/

    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

    ReplyDelete
  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

    ReplyDelete
  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

    ReplyDelete
  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

    ReplyDelete
  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.

    ReplyDelete
  31. PassFab Android Unlocker
    Is a useful new software for unlocking Android devices. With this app, users can unlock both their Android device and FRP lock Samsung devices with just a few clicks.

    ReplyDelete
  32. Loaris Trojan Remover Crack
    Loaris Trojan Remover Crack is the best software. You can use this software to remove Trojans or malware from your PC or laptop. Even if you are already using an extremely reliable antivirus, you can usually find a Trojan that sticks to your computer.

    ReplyDelete
  33. Loaris Trojan Remover Crack
    Loaris Trojan Remover Serial Key Full Version searches for all framework documents, Windows registry, projects, and logs accumulated at boot time. Most malicious projects (once activated) are loaded according to these principles. Loaris Trojan Remover Serial Code Download all documents stacked at startup time for adware, spyware, remote access Trojans, webworms, and other malware.

    ReplyDelete
  34. SmartFTP Enterprise Crack
    SmartFTP Enterprise Crack is one of the best and most powerful FTP management programs. Software is very fast when connecting to the server and also provides you with a stable connection between the client and the server. With the help of SmartFTP, you can easily upload files to your website very quickly.

    ReplyDelete
  35. ScreenHunter Pro Crack
    ScreenHunter Pro Crack is a complete screen recording and screen capture software for Windows for screen capture, printing, and editing. It is the perfect app for all users who need to take and edit images and screenshots. This is paid software, but don’t worry, we provide the Crack version of ScreenHunter Pro Crack Software For Windows which you can download from our software library. ScreenHunter Pro license key is fully compatible with Microsoft Windows 10. The use of this application is very simple and straightforward.

    ReplyDelete
  36. Freemake Video Converter Crack
    Freemake Video Converter Crack as its name sounds, program is used to convert videos for free to AVI, DVD, WKV, MP4, 3GP and FLV, SWF iPod, iPhone, and Android. In addition, Freemake Video Converter Download can rip and burn DVD-like formats, and it also supports downloading online video content from 40+ giant platforms, online uploading, and converting directly from 40+ sites to burn to Blu-ray to upload them to the server. Freemake Video Converter Crack It puts full control over the output at your fingertips as users customize their output result by putting desired values.

    ReplyDelete
  37. If you are connected by link have a go at utilizing the finish of the printer offline link in numerous ports or attachments on your gadget. In case you're on an organization or remote gadget a straightforward check is append a link to your PC/or gadget to ensure your printer is working. Thusly the shortcoming could be with your organization association.

    ReplyDelete
  38. If you are connected by link have a go at utilizing the finish of the why is my printer offline link in numerous ports or attachments on your gadget. In case you're on an organization or remote gadget a straightforward check is append a link to your PC/or gadget to ensure your printer is working. Thusly the shortcoming could be with your organization association.

    ReplyDelete
  39. Excellent content, Thanks for sharing this. It's pretty nice and very helpful content in this article.
    Leanpitch provides online training in CSPO, everyone can use it wisely.

    Product owner certification
    Product owner training

    ReplyDelete
  40. Thanks for sharing this.,
    Leanpitch provides online training in Scrum Master, everyone can use it wisely.
    Join Leanpitch 2 Days CSM Certification Workshop in different cities.

    Scrum master certification
    csm certification

    ReplyDelete
  41. Thanks for sharing this.,
    Leanpitch provides online training in Agile coach certification, everyone can use it wisely.

    agile coach certification
    icp acc certification

    ReplyDelete