So far, we've seen how to discover Accessors vulnerabilities.
We had the look on reflected, stored and on base, and we also seen a few ways on how to bypass security
and how to edit our payload so that it works on different situations.
We still haven't seen any good way of exploiting these vulnerabilities, though.
All we did was run code saying alert access or alert any message that we want.
So in this lecture and the next few lectures, we're actually going to see how we can exploit machines
that visit these vulnerable Web pages.
And we're going to do that using a framework called beef framework.
What beef does?
It allows us to run a large number of commands to hooked browsers and to hook a browser to be if a JavaScript
code has to be executed on that browser.
And because beef uses JavaScript, it's very easy for us to inject code into Accessors vulnerable Web
pages, and that code will be executed every time a person runs that page.
So all of this is going to become more clear.
Let us just run beef and get it set up and get someone hooked to it in this video.
And in the next videos will be running our commands and you'll see it will become much more clear on
how to use beef.
So I'm going to go to my calendar next.
And the first thing I'm going to do is just run beef here from its icon.
Give it some time and it'll start it'll automatically start the browser for you.
So now to log in, the username is beef.
And the password is beef as well.
So this is the main screen of beef you can see here on the left, you have online browsers and this
will basically list all the browsers that are hooked to beef.
At the moment.
You can see that we have nothing hooked to it.
And on the right, once you click on a hooked browser, you'll be able to run your commands in here
again.
And this lecture and future lectures will be running some commands, so it will become more clear to
you.
So right now, let's go ahead and try to go and get some people hooked to beef.
Now, there's a number of methods that you can do to hook people to beef.
What we're interested in is how to hook them through access vulnerabilities.
So the main thing that we're going to be using is the code given to us by beef itself.
So it's actually telling us what code to use.
And as you can see now, this is a JavaScript code similar to the alert code that we were using.
So the first thing I'm going to do is copy this.
And we're going to start in a live path just so that I can show you how to modify it.
So all they have to do is just inject this code into the vulnerable pages, one thing that you have
to modify is that you have to add your IP in here.
So to get your own IP, all you have to do is run it config.
So I'm just going to get a terminal and I'm going to run if config.
And as you can see now, my ipe is this, so it's 10 2014 to 08.
And that's it.
Now the code is ready to be executed.
So I'm going to close this.
And let's go to one of our vulnerable Web pages that we were using before.
So used to go let's go to the.
So first, let's just go and set the security to low.
We still have to bypass the security.
So I don't want to make this video too complicated.
And let's have a look on example, unreflected one, so if we go unreflected access and remember when
we used to put the name here and the name gets displayed, so we used to just put our script instead
of the name and that gets executed as well.
So instead of doing an alert, we're actually going to run it like this.
So this was our code.
And we used to do this to get our code to be executed, so let's just have an example on it as well.
And as you can see, you get access.
So we're using exactly the same code or exactly the same concept, except we're changing the payload
instead of saying alert, we're actually going to put this code.
We're going to ask for this code to be executed.
So we're just going to modify that and put it in here.
So this year, all is ready now and you can send it to any person, and once they execute this Yahel,
they will be hooked to beef and then you'll be able to run all the commands that allow you to run.
Now, you can go ahead and change this year old using ARRL shortening service just to make it look less
suspicious.
So let's just have an example.
I'm actually going to execute this code in my in the same browser, which I shouldn't I should probably
do it on a different machine, but we'll do it just here just to show you the proof of concept.
So we run this here and if we go to beef now.
Now, I've actually missed out my IP here.
It's 10, 2014, not 10, 15, 20.
So this is my ipe.
I'm just going to fix that pasted here.
And if we go to beef, you'll see that we have an online browser and a person is hooked, now we can
click on this and run the commands, but I'm going to leave that for a different lecture.