A Taste of the Browser Exploitation Framework (BeEF)

What is BeEF?
BeEF (Browser Exploitation Framework) is a powerful tool that allows penetration testers to assess the security of browser clients. It uses XSS (Cross-Site Scripting) vulnerabilities to hook the target's browser and control it remotely.
Using BeEF to Exploit a XSS Vuln
This walkthrough will use BeEF to exploit the XSS vulnerability outlined here.
- ATTACK_IP: 10.1.1.5
- pfSense: 10.1.1.40
- TARGET_IP (web server): 172.16.5.5
Configure and Start BeEF
1. View BeEF Configuration
$ less /opt/beef/config.yaml
Why?
Viewing the configuration file helps understand how BeEF is set up and configured, ensuring that it operates correctly within your network.
2. Modify the value for permitted_hooking_subnet
- Value:
10.1.1.40/32
Why?
This setting restricts which IP addresses can be hooked by BeEF. It ensures only devices within the specified subnet are targeted, enhancing security by limiting exposure.
3. Modify the value for permitted_ui_subnet
- Value:
127.0.0.1/32
Why?
This restricts access to the BeEF UI to the local machine, preventing unauthorized remote access to the control panel.










