SlideShare a Scribd company logo
Browser Hacker's Handbook
Chapter 5
Tutorial on
Browser Exploitation Framework (BeEF)
Laurel Marotta
Laurel.Marotta@IntentionalPrivacy.com
http://intentionalprivacy.com/
2
BeEF
Browser Exploitation Framework
Project: http://beefproject.com/
Wiki: https://github.com/beefproject/beef/wiki
FAQ: https://github.com/beefproject/beef/wiki/FAQ
Blog: http://blog.beefproject.com
YouTube: https://www.youtube.com/user/TheBeefproject
Authors:
Wade Alcorn – creator of BeEF
Christian Frichot – lead developer of BeEF
Michele Orrù – lead core developer of BeEF
3
BeEF
● Written in Ruby and JavaScript
https://github.com/beefproject/beef
4
Installation
● Installed by default on Kali
Directions for installing on other types of systems:
● https://github.com/beefproject/beef/wiki/Installation
● http://resources.infosecinstitute.com/beef-part-1/
[see section 2.1]
5
Update / Upgrade
apt-get update
apt-get upgrade
gem install bundler
6
Method: Beef.net.send()
https://github.com/beefproject/beef/blob/master/core/main/client/net.js#L110
https://github.com/beefproject/beef/blob/master/core/main/client/dom.js#L377
7
Password
● The default user name / password is beef
● To change the user name / password
cd /etc/beef-xss/
vi config.yaml
# Credentials to authenticate in BeEF. Used by both the
RESTful API and the Admin_UI extension credentials:
user: "beef"
passwd: "beef"
8
Starting BeEF
cd /usr/share/beef-xss
./beef
You will see ==>
● To stop the BeEF server,
press Control+C
● To start the BeEF console,
open a browser
and type one of the IPs
ending in /ui/panel:
http://192.168.15.129:3000/ui/panel
9
BeEF user interface
10
BeEF user interface
11
BeEF “hooks”
12
Restful API
https://github.com/beefproject/beef/wiki/BeEF-RESTful-API
From version 0.4.3.3, BeEF exposes a RESTful API allowing
scripting BeEF through HTTP/JSON requests.
You can find the necessary token (which changes each time
BeEF is loaded)
by looking for the
Restful API key
13
Adding the key
14
Command Line
If you want to write automated scripts that uses the RESTful API, you can issue a POST request to
/api/admin/login using the BeEF credentials you will find in the main config.yaml file, like this curl example:
curl -H "Content-Type: application/json" -X POST -d '{"username":"beefy", "password":"beefy"}'
http://127.0.0.1:3000/api/admin/login
Result shown below (notice token is returned)
15
Running a command
● In the Hooked Browser window, click on an online browser
● Then click on the Commands tab
● Choose a folder in the Module Tree pane, i.e., click the
folder Debug
● Click an action that has a green traffic light in front of it,
i.e., Return Ascii Chars
● In the right-hand pane, click Execute
● Click in the Module Results History pane—the results will
take a minute to show up in Command Results
16
Running a command
17
BeEF server
18
Altoromutual.com demo
19
Get Page HTML BeEF Module
20
Replace Content (Deface)
21
Chapter 5
Week 2
22
BeEF service
Starting BeEF service from the command line:
service beef-xss start
Stopping BeEF service manually:
service beef-xss stop
23
Configuring Metasploit
Configuration files:
/etc/beef-xss/config.yaml
/usr/share/beef-xss/extensions/metasploit/config.yaml
Host and callback_host parameters should have the host IP address
Change passwords if necessary
https://github.com/beefproject/beef/wiki/Configuration
https://github.com/beefproject/beef/wiki/Metasploit
24
Configuring Metasploit
Configuration files:
/etc/beef-xss/config.yaml
/usr/share/beef-xss/extensions/metasploit/config.yaml
Host and callback_host parameters should have the IP address of
your external interface
Change passwords if necessary
https://github.com/beefproject/beef/wiki/Configuration
https://github.com/beefproject/beef/wiki/Metasploit
25
beef.rc
load msgrpc ServerHost=192.168.15.129 Pass=abc123
26
Starting Metasploit
service postgresql start
ss -ant ==> what's running
service metasploit start
msfconsole -r /usr/share/beef-xss/beef.rc
==>Maps BeEF to Metasploit
db_status
27
Starting BeEF with Metasploit
● Start Metasploit first
● Open a new terminal window
cd /usr/share/beef-xss
./beef
28
BeEF not connected to Metasploit
correctly
29
BeEF connected to Metasploit
Notice password
30
Start beef
31
XssRays
BeEF's approach results in false-positive free findings
for cross-site scripting because BeEF must exploit the
XSS to discover the vulnerability.
32
BeEF exploits
http://resources.infosecinstitute.com/beef-part-2/
Shows some neat exploits
33
Resources
How to Enable Autorun Modules in BeEF
http://www.subliminalhacking.net/2013/01/03/how-to-autorun-modules-in-beef-
browser-exploitation-framework/
https://www.youtube.com/watch?v=qATHn_iKCas
However: not all modules will autorun

More Related Content

PPTX
Advanced Client Side Exploitation Using BeEF
 
PDF
Understanding PHP memory
PDF
Google Analytics for Dummies
PPTX
Digital Marketing Plan by Vicky Deshmukh
PPT
Affiliate marketing
PPT
Working with WebSPHINX Web Crawler
PPTX
Web scraping with BeautifulSoup, LXML, RegEx and Scrapy
Advanced Client Side Exploitation Using BeEF
 
Understanding PHP memory
Google Analytics for Dummies
Digital Marketing Plan by Vicky Deshmukh
Affiliate marketing
Working with WebSPHINX Web Crawler
Web scraping with BeautifulSoup, LXML, RegEx and Scrapy

What's hot (20)

PPTX
FRONT-END WEB DEVELOPMENT-Intro.pptx
PPTX
이더리움 스마트계약 보안지침 가이드 2. 솔리디티 권고안
PPT
Search Engine Optimization
PDF
Online Display Advertising
PDF
Spring Boot
PPTX
Cookies and sessions
PDF
Laravel Lab
PPTX
Directory Traversal & File Inclusion Attacks
PPTX
Google Keyword Planner Tool
PDF
GA4 LAND - Trendigital 2023
PDF
PLAYBOOK FULL FUNNEL FACEBOOK ADS FOR ECOMMERCE MARKETERS
PDF
Web Application Frameworks - Web Technologies (1019888BNR)
PDF
Comparing Native Java REST API Frameworks - Seattle JUG 2022
PPTX
A Brief of Google AdWords Pay Per Click
PPTX
Bootstrap
PPTX
Learn to pen-test with OWASP ZAP
PPTX
The new repository in AEM 6
PDF
웹 Front-End 실무 이야기
PDF
Incent V2E - A Marketing Layer for Web3
PPT
Apache
FRONT-END WEB DEVELOPMENT-Intro.pptx
이더리움 스마트계약 보안지침 가이드 2. 솔리디티 권고안
Search Engine Optimization
Online Display Advertising
Spring Boot
Cookies and sessions
Laravel Lab
Directory Traversal & File Inclusion Attacks
Google Keyword Planner Tool
GA4 LAND - Trendigital 2023
PLAYBOOK FULL FUNNEL FACEBOOK ADS FOR ECOMMERCE MARKETERS
Web Application Frameworks - Web Technologies (1019888BNR)
Comparing Native Java REST API Frameworks - Seattle JUG 2022
A Brief of Google AdWords Pay Per Click
Bootstrap
Learn to pen-test with OWASP ZAP
The new repository in AEM 6
웹 Front-End 실무 이야기
Incent V2E - A Marketing Layer for Web3
Apache
Ad

Similar to Browser Exploitation Framework Tutorial (20)

DOC
Installation instructions p8p bb bridge
PDF
Oracle business intelligence enterprise edition 11g
DOCX
CodeShip
PDF
What's New in Java 9 KCDC
PDF
Why it's dangerous to turn off automatic updates and here's how to do it
PDF
A Continuous Packaging Pipeline
PPT
Behat sauce
PDF
All the Laravel things: up and running to making $$
PPT
Introduction to python scrapping
PDF
Manual 5
PDF
Badge Poser v3.0 - A DevOps Journey
PDF
9 steps to awesome with kubernetes
PDF
WordPress Plugin Development 201
PPTX
Agile Workflows
PDF
Owasp AppSecEU 2015 - BeEF Session
PDF
Blockchain Hyperledger Lab
PDF
Joomlatools Platform v2.0
PDF
Magento 2: New and Innovative? - php[world] 2015
PDF
Introduction to yocto
PDF
Gitflow with FME and Autobuilding a Project with the Gitlab Build Pipeline
Installation instructions p8p bb bridge
Oracle business intelligence enterprise edition 11g
CodeShip
What's New in Java 9 KCDC
Why it's dangerous to turn off automatic updates and here's how to do it
A Continuous Packaging Pipeline
Behat sauce
All the Laravel things: up and running to making $$
Introduction to python scrapping
Manual 5
Badge Poser v3.0 - A DevOps Journey
9 steps to awesome with kubernetes
WordPress Plugin Development 201
Agile Workflows
Owasp AppSecEU 2015 - BeEF Session
Blockchain Hyperledger Lab
Joomlatools Platform v2.0
Magento 2: New and Innovative? - php[world] 2015
Introduction to yocto
Gitflow with FME and Autobuilding a Project with the Gitlab Build Pipeline
Ad

Recently uploaded (20)

PDF
Approach and Philosophy of On baking technology
PPTX
Cloud computing and distributed systems.
PDF
Machine learning based COVID-19 study performance prediction
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
NewMind AI Monthly Chronicles - July 2025
PDF
Spectral efficient network and resource selection model in 5G networks
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Electronic commerce courselecture one. Pdf
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PPT
Teaching material agriculture food technology
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
KodekX | Application Modernization Development
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Unlocking AI with Model Context Protocol (MCP)
Approach and Philosophy of On baking technology
Cloud computing and distributed systems.
Machine learning based COVID-19 study performance prediction
Chapter 3 Spatial Domain Image Processing.pdf
NewMind AI Monthly Chronicles - July 2025
Spectral efficient network and resource selection model in 5G networks
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Dropbox Q2 2025 Financial Results & Investor Presentation
Building Integrated photovoltaic BIPV_UPV.pdf
Per capita expenditure prediction using model stacking based on satellite ima...
20250228 LYD VKU AI Blended-Learning.pptx
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Electronic commerce courselecture one. Pdf
The Rise and Fall of 3GPP – Time for a Sabbatical?
Teaching material agriculture food technology
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
KodekX | Application Modernization Development
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Unlocking AI with Model Context Protocol (MCP)

Browser Exploitation Framework Tutorial