Collecting information with BeEF
Once we have successfully hooked a browser, we are ready to use BeEF to exploit it. This recipe covers how we can use some basic BeEF commands to collect information and exploit a victim's browser.
Getting ready
BeEF comes preinstalled on Kali Linux. In the examples provided, an instance of Metasploitable2 is used to demonstrate hooking a browser via XSS. For more information on how to set up systems in a local lab environment, refer to the Installing Metasploitable2 and Installing Windows Server recipes in Chapter 1, Getting Started. Additionally, this section will require a script to be written to the filesystem using a text editor, such as Vim or GNU nano. For more information on how to write scripts, refer to the Using text editors (Vim and GNU nano) recipe in Chapter 1, Getting Started.
How to do it…
Now let's get started and learn to collect information with BeEF:
- Returning to the previous recipe, let's take a look at the BeEF console. We once again see...