And this lecture, I'd like to introduce you to a really cool framework called beef.
Beef is short for the browser exploitation framework.
It allows us to run a number of attacks on hooked browsers that would allow us to further exploit the
target system to steal passwords or even gain full access or full control over the system.
So right here, I might.
My Karley machine.
And we can go ahead and start.
We have to do that.
I'm going to click on all my applications.
I'm gonna type beef.
And I'm going to click on the first icon in here.
Beef start, you can use the beef stop to stop it.
But right now, we just want to start the framework.
So we're going to click on the start now, because this is the first time we are on the framework.
It's asking us to set a password for the default user.
So go ahead and pick any password you want.
And note, when you type the password, you will not see the characters on screen.
This is a security feature so that the people around you will not see your password.
So right now I actually typed my password, which you can't see anything on screen.
I'm just going to hit enter and then it'll automatically start the beef framework for me and it will
automatically start Firefox and go to the web interface that we can use to access beef and control the
hooked browsers.
As you can see, the first thing that they'll ask us is a user name and a password to log in to this
web interface.
The default user is beef B, E, F, and the password is the password that we just set in terminal.
I'm going to hit enter to log in, and as you can see, we have the main user interface of beef.
The main thing you can see here on the left is the online and the offline browsers and the online browsers,
you'll see the browsers that are hooked to be afraid.
Now that you can control and in the offline browsers, you'll see the browsers that you previously were
able to control.
So browsers that you previously hooked to beef.
Now, in order to hook a browser to beef and be able to control it and run commands on it, you have
to get that browser to execute a specific JavaScript code.
So if we go back to the terminal window here that started before us and just scroll up, you'll see
that it's given us the JavaScript code that we need to use to hook browsers to beef.
As soon as this piece of code gets executed on a Web browser, you will see that Web browser here in
the online browsers and you'll be able to execute a lot of really cool commands that will allow you
to show Feek log in pages.
It will allow you to show FEC updates and even gain full control over the target system.
Now, because beef uses JavaScript, it'll work on any Web browser that supports JavaScript, regardless
of what device this Web browser is running on.
So it'll basically work on all modern browsers.
So it'll work against phones, tablets.
Smart TV is all operating systems used on PCs such as Linux, Windows, OS, X and so on.
Literally, any browser that can run JavaScript will be able to run this code and therefore we'll be
able to hook that browser to beef and do all of the cool things that you will learn and the next lectures.
So right now, it really depends on you and your imagination on how you're going to get this piece of
code to run on our Web browser.
If you're able to become the man in the middle, you can do DNS spoofing and redirect requests to a
page that contains this code.
Or you can inject this JavaScript in any Web page that the target loads using the JavaScript injection
methods that we learned once you become the man in the middle.
You can also exploit an ex, assess vulnerability and inject this code in a vulnerable Web page and
you will learn how to do that.
And the Web site hacking section.
Or you can use social engineering and social engineer a target into loading a web page that contains
our code.
So all you'll need to do is think of a way to get a target to load a page that contains the Hook JavaScript
code.
Now, in this lecture, I'm gonna show you a very basic hook method that is really good for us to make
sure that our system is working as expected.
And this very page can also be used with method number one and method number four, because we're gonna
have a demo page that contains the whole code.
Therefore, you can either DNS pouffe targets to this page or social engineered them to this page.
And once they load this page, the hook code will be executed on their browser and therefore they will
be hooked to beef and we'll be able to run all of the commands that allow us to run.
So let's go back to beef.
And like I said, this is the code that we want our target browsers to load or execute.
So I'm gonna copy it and I'm gonna go and open my file manager.
And I want to go to my Web route so you can either press control L from your keyboard or click in here
at the Path Bar and just press the forward slash.
This will open a path text box where you can type the path that you want to go to.
And I want to go to var w w w Hastey AML.
Now as we learned before.
This is the location.
Where are the files for your web server are stored and the indexed that hasti email is the file that
gets loaded by default.
When someone loads your IP in their web browser.
So I'm going to right.
Click the indexed thirtyish email and I'm going to choose to open it with a text editor.
And I'm simply going to remove all of this and piece the whole code in here.
There is one thing that I want to modify is the IP in here.
I'm going to replace this IP with the IP of my Karlee machine.
As we learned before, you can get the IP using the conflict command.
So I'm not going to do it right now.
You should already know this by now.
So I know my IP is 10, 20, 14 to 07 and that's it.
We're ready to go.
So if anybody now loads my IP address, which is 10 2014 to 07, I will have a Web server working on
it which will load the index that takes them all by default.
And when this file is loaded, it'll load the beef hook code and it'll hook that browser to beef, which
will allow me to run a number of really cool commands.
Now, before loading this page, we need to start our Web server and as we learned before we can do
this by doing service Apache to start and now my Apache Web server is running.
And if I go to my Windows machine in here and simply just go to the address of my Web server, which
is 10, 20, 14, two oh seven.
Now, as you can see, we'll get a blank page.
That's fine, because our page contains nothing but the code.
You could actually have a proper Hastey airmail page and just put the whole code at the end or at the
start.
But this will do for testing for now.
And if we go back here and go to the beef interface, if we look at the online browsers, you'll see
we have the IP address of my target, which is 10 2014 to 06.
This is the IP address of the Windows machine.
And right now, if I click on it, you'll see I'll have a number of tabs in here which will allow us
to do various things in the home.
And the details you'll see, we have information about the browser of the target.
For example, you can see that it doesn't have a VLCC plugin installed.
It supports WebSocket.
If you scroll down, you can see the user agent, which is Mozilla five.
It's running on Windows and A. 64 bit architecture.
Again, if you keep going down, you can see the cookies.
You can see the hostname.
You can see the screen size and a lot of other information that can be useful when it comes to exploit.
And a target of the lock step in here.
You'll see logs of all the events that happened in the browser.
And if you execute commands, you'll see logs in here for these commands.
The command stub is the one that we're going to be using the most and the next lectures.
This will allow you to run various commands on the target.
Like I said, you can run information gathering commands.
You can run commands to inject other JavaScript codes.
You can run commands to steal passwords using fake Loggins.
You can run fake updates and get your target to download the backdoor and hack their computer.
There are a lot of really cool things that you can do, and I will walk you through some of the best
ones and the next lecture's.
And the proxy tab, you can configure and use a browser as a proxy.
The x x rays will show you off the hook page contains any X assess vulnerabilities and the network tab
will give you an overview of the current network.
So right now, you can see we have the target running windows.
We have his browser, which is hooked to be it to us.
And then from here, we'll be able to, like I said, launch a number of really cool commands that can
be used to do so many things and further exploit the target system.
Wants done with using beef, you can click on log out to log out and then go to your all applications,
look for beef and click on Beef, Stop to stop the service from running in the background.
So that's it for this lecture.
I just wanted to give you a quick overview on beef and in the next lectures we'll see how we can use
it to steal credentials, get screen shots, gather information, and even gain full control over hooked
browser's.