
00:00:00,060 --> 00:00:04,620
Hey guys, hackers, Floyd here. And in this&nbsp;
video, we're going to get started with the web&nbsp;&nbsp;

00:00:04,620 --> 00:00:09,180
application penetration testing series. Alright,&nbsp;
so a lot of you guys have been asking for this,&nbsp;&nbsp;

00:00:09,180 --> 00:00:15,000
mostly because you want to learn the art of bug&nbsp;
bounty. And here is the series. So have worked&nbsp;&nbsp;

00:00:15,000 --> 00:00:19,770
really, really hard on, you know, making it as&nbsp;
comprehensive as possible, we're going to get&nbsp;&nbsp;

00:00:19,770 --> 00:00:24,180
started with setting up burp suite. So for those&nbsp;
of you who don't know, what works, who it is,&nbsp;&nbsp;

00:00:24,180 --> 00:00:28,860
burp suite is essentially an integrated&nbsp;
platform for performing security testing&nbsp;&nbsp;

00:00:28,860 --> 00:00:34,800
of web applications. Alright, so the first thing&nbsp;
you need to understand is that it will allow us to&nbsp;&nbsp;

00:00:34,800 --> 00:00:40,920
intercept the data being sent between your browser&nbsp;
and the web application. So it's, it's a great way&nbsp;&nbsp;

00:00:40,920 --> 00:00:46,140
of understanding how data is being transferred,&nbsp;
and how data can be manipulated, be manipulated,&nbsp;&nbsp;

00:00:46,140 --> 00:00:52,260
between the client, and obviously, the web&nbsp;
application. Okay, so the tool we're going to be&nbsp;&nbsp;

00:00:52,260 --> 00:00:57,330
using, as I said, is burp suite. And I'm currently&nbsp;
running power to us. So don't worry, if you're&nbsp;&nbsp;

00:00:57,330 --> 00:01:01,830
running Windows or Kali Linux, it doesn't really&nbsp;
matter, all we need to do is just download and&nbsp;&nbsp;

00:01:01,830 --> 00:01:06,810
install burp suite, it's pretty simple to get set&nbsp;
up, you don't have to register, you just download&nbsp;&nbsp;

00:01:06,810 --> 00:01:12,270
the free community version. Now, obviously down&nbsp;
the line, you might choose to buy the professional&nbsp;&nbsp;

00:01:12,270 --> 00:01:18,990
version, which I do recommend and I have used,&nbsp;
but I don't use it as often I'm not, you know,&nbsp;&nbsp;

00:01:18,990 --> 00:01:28,170
specifically a web penetration tester, I'm more of&nbsp;
a more of an of a web server penetration tester.&nbsp;&nbsp;

00:01:28,170 --> 00:01:34,350
So I really work with a different vectors. So&nbsp;
by default, you can choose to bite that one to&nbsp;&nbsp;

00:01:34,350 --> 00:01:39,150
become experienced. And you know, you've chosen&nbsp;
whether this is the path that you want to pursue,&nbsp;&nbsp;

00:01:39,150 --> 00:01:44,460
it's a fantastic path. I know a lot of people who&nbsp;
you know, make good money with bug bounty. So you&nbsp;&nbsp;

00:01:44,460 --> 00:01:48,480
know, it's something that you can look into&nbsp;
as well. Alright, so let's get started with&nbsp;&nbsp;

00:01:48,480 --> 00:01:53,730
setting up the proxy. Alright, so this is the&nbsp;
intercepting proxy that allows us to, obviously,&nbsp;&nbsp;

00:01:53,730 --> 00:02:01,050
to intercept the data being sent to and from the&nbsp;
client and the, the web, the web application.&nbsp;&nbsp;

00:02:01,050 --> 00:02:05,670
So to do that, we need we can just do it through&nbsp;
Firefox. So the browser I'll be using is Firefox,&nbsp;&nbsp;

00:02:05,670 --> 00:02:10,320
you can use whatever you want. And by default, you&nbsp;
want to go into your preferences that can be found&nbsp;&nbsp;

00:02:10,320 --> 00:02:16,980
here preferences, there we are. And you want to&nbsp;
go all the way into the bottom here. That way it&nbsp;&nbsp;

00:02:16,980 --> 00:02:22,110
has the network proxy, and make sure you go into&nbsp;
settings, and you want to go into manual proxy&nbsp;&nbsp;

00:02:22,110 --> 00:02:27,060
configuration. Alright, so this is where we're&nbsp;
going to configure it to be the localhost with&nbsp;&nbsp;

00:02:27,060 --> 00:02:33,510
the port set at 8080. All right, and then you want&nbsp;
to make sure that this, you use the server proxy&nbsp;&nbsp;

00:02:33,510 --> 00:02:38,550
for all protocols. So that is the proxy we're&nbsp;
going to be using and just hit OK. Alright, and&nbsp;&nbsp;

00:02:38,550 --> 00:02:43,590
once that's done, you should be good there. Now&nbsp;
what you want to do is just open up burp suite, so&nbsp;&nbsp;

00:02:43,590 --> 00:02:49,890
you can search for it, or I have it already on my&nbsp;
on my little Taskbar here. And I don't think I've&nbsp;&nbsp;

00:02:49,890 --> 00:02:54,990
updated it for a while. So I probably need to do&nbsp;
that later. But for now, I'll just close that the&nbsp;&nbsp;

00:02:54,990 --> 00:03:01,230
update prompt and it's going to prompt you Welcome&nbsp;
to burp suite. And it's going to say not depending&nbsp;&nbsp;

00:03:01,230 --> 00:03:05,640
on the version that you've chosen to select&nbsp;
whether you've chosen the community version,&nbsp;&nbsp;

00:03:05,640 --> 00:03:10,470
which is what I have here, or the free version, as&nbsp;
it's called, and you then have the pro version. So&nbsp;&nbsp;

00:03:10,470 --> 00:03:16,770
by default, the community version only allows&nbsp;
you to use a temporary project, if you have the&nbsp;&nbsp;

00:03:16,770 --> 00:03:21,390
professional version that allows you to save your&nbsp;
project, which is, you know, great functionality&nbsp;&nbsp;

00:03:21,390 --> 00:03:27,480
as well. So just hit next and you just want&nbsp;
to use the verb defaults. And just hit start.&nbsp;&nbsp;

00:03:27,480 --> 00:03:32,520
And just give that a few seconds to start it up.&nbsp;
Alright, and I'll explain the interface generally,&nbsp;&nbsp;

00:03:32,520 --> 00:03:37,200
but we'll be looking more into how burp works.&nbsp;
In the next video, I just want to get you set up&nbsp;&nbsp;

00:03:37,200 --> 00:03:42,930
with birth in this video, and you understand what&nbsp;
exactly is going on. Alright, so welcome to birth.&nbsp;&nbsp;

00:03:42,930 --> 00:03:48,120
Now by default. Again, it may seem a little bit&nbsp;
intimidating mostly because if you're a beginner,&nbsp;&nbsp;

00:03:48,120 --> 00:03:53,310
you have not heard of any of these of these words&nbsp;
here and you don't really know what they're doing.&nbsp;&nbsp;

00:03:53,310 --> 00:03:58,620
Alright, so by default, you have your target proxy&nbsp;
spider scan into the repeater, sequencer, decoder,&nbsp;&nbsp;

00:03:58,620 --> 00:04:03,450
compare extender, your project options, your user&nbsp;
options, and alerts, we'll be going through all&nbsp;&nbsp;

00:04:03,450 --> 00:04:10,920
of this as we as we, you know, perform real&nbsp;
world testing on our on our vulnerable on our&nbsp;&nbsp;

00:04:10,920 --> 00:04:15,360
vulnerable target, I'll be showing you how to&nbsp;
set up a dam vulnerable web application soon,&nbsp;&nbsp;

00:04:15,360 --> 00:04:21,180
and many others but for now just focus on burp&nbsp;
suite. Alright, so by default, you want to just&nbsp;&nbsp;

00:04:21,180 --> 00:04:27,770
go into proxy. Alright, and for some reason, I&nbsp;
already have some data here. So you know what, I'm&nbsp;&nbsp;

00:04:27,770 --> 00:04:32,810
just going to leave that as it is, I just want to&nbsp;
turn our intercept off. So we're not intercepting&nbsp;&nbsp;

00:04:32,810 --> 00:04:39,230
any traffic as of yet. And you want to go into&nbsp;
your options. And you want to make sure that your&nbsp;&nbsp;

00:04:39,230 --> 00:04:44,660
proxy listeners, as you can see, burp proxy uses&nbsp;
listeners to receive incoming HTTP requests from&nbsp;&nbsp;

00:04:44,660 --> 00:04:50,450
your browser. So you want to make sure that your&nbsp;
proxy is set as the as the one we set in Firefox,&nbsp;&nbsp;

00:04:50,450 --> 00:04:56,660
which is the localhost 120 7.0 point 0.1 and the&nbsp;
port is 8080 and make sure that that is running.&nbsp;&nbsp;

00:04:56,660 --> 00:05:01,280
Alright, you can also create your own and add it&nbsp;
here and you're going to To remove it, so you get&nbsp;&nbsp;

00:05:01,280 --> 00:05:07,490
the idea. Now by default, if I just go back to&nbsp;
my intercept, if I just go back to my browser,&nbsp;&nbsp;

00:05:07,490 --> 00:05:12,170
and this is where the real magic happens,&nbsp;
if I just, you know, if I just open this,&nbsp;&nbsp;

00:05:12,170 --> 00:05:18,620
and I type in a simple test site example.com, and&nbsp;
I just hit enter, alright, it's going to load it&nbsp;&nbsp;

00:05:18,620 --> 00:05:24,050
up here. But if we're going to burp suite, and I&nbsp;
go into HTTP history, you can see that by default,&nbsp;&nbsp;

00:05:24,050 --> 00:05:30,350
there are some Firefox portals. You know, some&nbsp;
get methods here. But we'll be looking at all of&nbsp;&nbsp;

00:05:30,350 --> 00:05:38,710
these methods or requests. By default, you can see&nbsp;
that the example.com, the example.com, one would,&nbsp;&nbsp;

00:05:38,710 --> 00:05:42,830
you know, that we ended, you can see there is a&nbsp;
get request. And furthermore, if you go down to&nbsp;&nbsp;

00:05:42,830 --> 00:05:48,200
the bottom here, you can see there is some more&nbsp;
information regarding now what a request are sent&nbsp;&nbsp;

00:05:48,200 --> 00:05:56,300
to the web application. Or so by default, you can&nbsp;
see that the host was example.com. And it gives&nbsp;&nbsp;

00:05:56,300 --> 00:06:02,060
you more information, like the Accept language,&nbsp;
the encoding, the connection. And if you look at&nbsp;&nbsp;

00:06:02,060 --> 00:06:08,240
the headers, you can see that the header shows,&nbsp;
you know very clearly, you have your get host,&nbsp;&nbsp;

00:06:08,240 --> 00:06:15,020
use agent accept language, the Accept encoding,&nbsp;
connection, etc, etc. So you might be a little bit&nbsp;&nbsp;

00:06:15,020 --> 00:06:20,030
confused if this is your first time hearing about,&nbsp;
you know, headers, and the request and response&nbsp;&nbsp;

00:06:20,030 --> 00:06:25,430
pairs. But don't worry about that we'll get to all&nbsp;
of this for now, if I just go back into intercept,&nbsp;&nbsp;

00:06:25,430 --> 00:06:33,170
and let me just open up my browser here. And&nbsp;
we open something like the my web, my website,&nbsp;&nbsp;

00:06:33,170 --> 00:06:39,080
would you say it just like.com. So before we do&nbsp;
that, I just want to hit intercept on. Alright,&nbsp;&nbsp;

00:06:39,080 --> 00:06:45,110
so now it's going to intercept actively. And we&nbsp;
just go into Hs pro.com. And I hit go. Alright,&nbsp;&nbsp;

00:06:45,110 --> 00:06:50,900
now by default is going to tell me that&nbsp;
essentially, the mic connection is not secure,&nbsp;&nbsp;

00:06:50,900 --> 00:06:56,750
don't worry about this, just go into your and&nbsp;
just add this as an exception. There we are&nbsp;&nbsp;

00:06:56,750 --> 00:07:02,240
made confirm exception. And now it's still not&nbsp;
going to load the website. And the reason being&nbsp;&nbsp;

00:07:02,240 --> 00:07:07,280
is we have not forwarded the request. And they are&nbsp;
being intercepted by burp suite. Alright, so if I&nbsp;&nbsp;

00:07:07,280 --> 00:07:13,430
go into back into burp suite, you can see that it&nbsp;
has started the intercept process. And by default,&nbsp;&nbsp;

00:07:13,430 --> 00:07:20,660
you can see that we need to forward we need to&nbsp;
forward the request here. So if I just forward it,&nbsp;&nbsp;

00:07:21,290 --> 00:07:25,520
let me just for that again, there we are, let&nbsp;
me just for them for hackers out there. Yeah,&nbsp;&nbsp;

00:07:25,520 --> 00:07:31,190
that's the correct one. So all for this again.&nbsp;
And there. We also know hackers blade should&nbsp;&nbsp;

00:07:31,190 --> 00:07:35,870
be up and running. And as you can see, I should&nbsp;
have loaded the site. Give that a few seconds.&nbsp;&nbsp;

00:07:35,870 --> 00:07:41,090
There we are. Alright, so as you can see, that&nbsp;
is how you intercept the data that is being sent&nbsp;&nbsp;

00:07:41,090 --> 00:07:46,580
from the client to the web application. And&nbsp;
furthermore, that's how you, you can analyze&nbsp;&nbsp;

00:07:46,580 --> 00:07:51,830
the data being sent, and furthermore manipulated&nbsp;
to obviously find vulnerabilities within the web&nbsp;&nbsp;

00:07:51,830 --> 00:07:56,780
application. Alright, so irregardless of all&nbsp;
of this, I know, this was very, very basic,&nbsp;&nbsp;

00:07:56,780 --> 00:08:01,640
and it's not really covered anything in terms&nbsp;
of web application penetration testing. But&nbsp;&nbsp;

00:08:01,640 --> 00:08:05,990
don't worry about that, you know, we start off&nbsp;
really, really simple. And we build on that.&nbsp;&nbsp;

00:08:09,730 --> 00:08:14,170
We're going to get started with spidering, more&nbsp;
specifically spidering, with burp suite. And,&nbsp;&nbsp;

00:08:14,170 --> 00:08:18,670
you know, the purpose of this video or this&nbsp;
tutorial, is to help you understand the&nbsp;&nbsp;

00:08:18,670 --> 00:08:23,470
spidering process and how to go about doing&nbsp;
it with a burp suite. Alright, so there's&nbsp;&nbsp;

00:08:23,470 --> 00:08:27,760
going to be a little bit of theory here, but&nbsp;
I'll be explaining a lot of things. So again,&nbsp;&nbsp;

00:08:27,760 --> 00:08:33,580
this video is really focused on understanding&nbsp;
spidering. Now, before we get started with that, I&nbsp;&nbsp;

00:08:33,580 --> 00:08:38,560
just wanted to let you know that the target or our&nbsp;
web application that we're going to be targeting,&nbsp;&nbsp;

00:08:38,560 --> 00:08:43,870
we're going to be attacking is the damn vulnerable&nbsp;
web application. Now, if you don't know what the&nbsp;&nbsp;

00:08:43,870 --> 00:08:47,890
damn vulnerable web application is, that's fine,&nbsp;
you can just Google it. And I'll probably make a&nbsp;&nbsp;

00:08:47,890 --> 00:08:52,990
video on how to get it installed on Kali Linux.&nbsp;
But what I would recommend if you're, you know,&nbsp;&nbsp;

00:08:52,990 --> 00:08:57,370
beginner, or even if you're a professional in&nbsp;
hacking, probably one of the best things that you&nbsp;&nbsp;

00:08:57,370 --> 00:09:02,920
need to have, you know, in your kit is Metasploit&nbsp;
able to write and for the simple reason that it&nbsp;&nbsp;

00:09:02,920 --> 00:09:07,720
contains, first and foremost a vulnerable&nbsp;
operating system. And secondly, it contains&nbsp;&nbsp;

00:09:07,720 --> 00:09:14,440
all the vulnerable web applications that we will&nbsp;
be using at one stage during this series. Okay,&nbsp;&nbsp;

00:09:14,440 --> 00:09:18,550
so we're going to be starting off with the&nbsp;
damn vulnerable web application. As I said,&nbsp;&nbsp;

00:09:18,550 --> 00:09:23,530
it comes pre installed with meta splittable, too.&nbsp;
So all you need to do is get the local IP address&nbsp;&nbsp;

00:09:23,530 --> 00:09:28,090
on your mat, exploitable to virtual machine,&nbsp;
which in my case is 190 2.1 68 point 1.1 a dupe.&nbsp;&nbsp;

00:09:29,740 --> 00:09:33,550
So what I'm going to do is I'm going to open up&nbsp;
my browser, and I'm just going to open up that&nbsp;&nbsp;

00:09:33,550 --> 00:09:40,090
webs that IP address point 1.1 or two, and just&nbsp;
give it a few seconds to load up. As you can see,&nbsp;&nbsp;

00:09:40,090 --> 00:09:45,550
there we are, that's made exploitable too. And&nbsp;
it's going to prompt us to select what vulnerable&nbsp;&nbsp;

00:09:45,550 --> 00:09:51,430
web app we want to use. In this case, we're going&nbsp;
to select the DV w A, which is the dam vulnerable&nbsp;&nbsp;

00:09:51,430 --> 00:09:56,260
web application. So just click on that and it's&nbsp;
going to ask you for your admin and password in&nbsp;&nbsp;

00:09:56,260 --> 00:10:01,090
this case for your username and password Sorry&nbsp;
about that, in this case Your username is admin&nbsp;&nbsp;

00:10:01,090 --> 00:10:06,280
and the password is password. Alright, so just&nbsp;
hit login, and it's going to log you into the&nbsp;&nbsp;

00:10:06,280 --> 00:10:12,430
damn vulnerable web application. Now we'll be&nbsp;
looking at this at a more in a later video. And&nbsp;&nbsp;

00:10:12,430 --> 00:10:17,470
the reason is we have to go through all of these&nbsp;
options. But for now, if you go to the login,&nbsp;&nbsp;

00:10:17,470 --> 00:10:22,330
just remember where it was, if I can just go&nbsp;
to the security, so to the dam vulnerable web&nbsp;&nbsp;

00:10:22,330 --> 00:10:26,990
application security, at the moment, it was high,&nbsp;
because I was actually performing some tests on&nbsp;&nbsp;

00:10:26,990 --> 00:10:31,460
it, but just change it to medium or low. But for&nbsp;
now, you wouldn't be using it. I was just letting&nbsp;&nbsp;

00:10:31,460 --> 00:10:36,680
you know what web application we're going to be&nbsp;
using. Alright, that being said, let's move on&nbsp;&nbsp;

00:10:36,680 --> 00:10:41,750
to burp suite. All right, and we can I can start&nbsp;
explaining the spidering process. Right. So let&nbsp;&nbsp;

00:10:41,750 --> 00:10:46,460
me just open up burp suite. So I've updated it to&nbsp;
the latest version. I think I'm running Catalina&nbsp;&nbsp;

00:10:46,460 --> 00:10:51,140
next now in the previous video, I was running&nbsp;
parrot. So I think there should be an update,&nbsp;&nbsp;

00:10:51,140 --> 00:10:56,330
but I could be wrong. So let's just give that a&nbsp;
few seconds to start up yet there is an update. So&nbsp;&nbsp;

00:10:56,330 --> 00:11:01,760
I'll do that later. And we'll just click on create&nbsp;
our temporary project and use the bap default and&nbsp;&nbsp;

00:11:01,760 --> 00:11:07,310
start that. Okay, so once that starting, let&nbsp;
me explain what spidering is right now the&nbsp;&nbsp;

00:11:07,310 --> 00:11:14,480
purpose of spidering is to identify our scope,&nbsp;
alright, or what, what we want to scan. Now this&nbsp;&nbsp;

00:11:14,480 --> 00:11:19,340
is not exactly scanning, and we'll be looking at&nbsp;
scanning. But essentially spidering is the process&nbsp;&nbsp;

00:11:19,340 --> 00:11:25,400
of mapping out our web application, and is very,&nbsp;
very useful for finding links and and web forms,&nbsp;&nbsp;

00:11:25,400 --> 00:11:31,070
which is also very important because it will&nbsp;
allow us to then furthermore, attack the web forms&nbsp;&nbsp;

00:11:31,070 --> 00:11:36,830
manipulate headers, etc, etc. Right now, when you&nbsp;
talk about automatic spidering with burp suite,&nbsp;&nbsp;

00:11:36,830 --> 00:11:43,400
it essentially when when burp is spidering,&nbsp;
it follows links and it will, it will start&nbsp;&nbsp;

00:11:43,400 --> 00:11:48,920
following links and it will start identifying for&nbsp;
files, folders and forms from the web application.&nbsp;&nbsp;

00:11:48,920 --> 00:11:55,070
And it will, the great thing about this is it will&nbsp;
record all the requests and responses while it's&nbsp;&nbsp;

00:11:55,070 --> 00:12:02,090
performing the the old spidering process. Okay,&nbsp;
so once you have a burp suite opened up here, you&nbsp;&nbsp;

00:12:02,090 --> 00:12:07,160
can let me just expand it. So we have a greater&nbsp;
picture of what's going on exactly. Sorry, if my&nbsp;&nbsp;

00:12:07,160 --> 00:12:12,380
virtual machine is a little bit slow, I need to&nbsp;
configure it correctly. Anyway, what you want to&nbsp;&nbsp;

00:12:12,380 --> 00:12:17,150
do is we have looked at the proxy check section,&nbsp;
let's look at the spider section. And in here,&nbsp;&nbsp;

00:12:17,150 --> 00:12:21,230
this is a very, very simple menu and to understand&nbsp;
it, you can see that we have two tabs available,&nbsp;&nbsp;

00:12:21,230 --> 00:12:27,320
we have the control tab and we have the options&nbsp;
tab. Alright, the control tab. Essentially,&nbsp;&nbsp;

00:12:27,320 --> 00:12:31,340
if we just click if I just look, if we look at it,&nbsp;
as you can see, these settings are used to monitor&nbsp;&nbsp;

00:12:31,340 --> 00:12:37,700
and control the web spider. So it allows you to&nbsp;
stop to start and stop the burp spidering. And&nbsp;&nbsp;

00:12:37,700 --> 00:12:43,100
you can also clear the cues. Alright, when you&nbsp;
look at the options, which is right here, sorry&nbsp;&nbsp;

00:12:43,100 --> 00:12:46,760
about that, when you look at the options, there&nbsp;
are a lot of options, we'll be looking at them,&nbsp;&nbsp;

00:12:46,760 --> 00:12:52,850
I will be looking at them in a second. Sorry&nbsp;
about that, I actually got an email, apologies&nbsp;&nbsp;

00:12:52,850 --> 00:12:58,550
that. Let's get started. Now with the control&nbsp;
section. So the control section, it will all&nbsp;&nbsp;

00:12:58,550 --> 00:13:04,430
we are able to control the spider status where we&nbsp;
can stop it and started and you know, furthermore,&nbsp;&nbsp;

00:13:04,430 --> 00:13:10,460
we can clear the cues that already exists there.&nbsp;
Alright, we then have the spider scope where we&nbsp;&nbsp;

00:13:10,460 --> 00:13:16,010
can, we can define our own scope. And depending&nbsp;
on what we want to spider, we look at that in a&nbsp;&nbsp;

00:13:16,010 --> 00:13:23,660
few seconds. And finally, we look at the well if&nbsp;
we look in the Options section here, we have the&nbsp;&nbsp;

00:13:23,660 --> 00:13:29,450
crawler settings which allow us to specify the way&nbsp;
the spider is going to crawl for the web content&nbsp;&nbsp;

00:13:29,450 --> 00:13:34,160
on the web application, we'll be looking at the&nbsp;
maximum link depth and what that means passive&nbsp;&nbsp;

00:13:34,160 --> 00:13:40,790
spidering that allows us to essentially spider to&nbsp;
continue spidering when we are looking through or&nbsp;&nbsp;

00:13:40,790 --> 00:13:46,430
we're going through the web application, we're&nbsp;
performing requests and responses when we're&nbsp;&nbsp;

00:13:46,430 --> 00:13:50,720
performing requests. As for the form submission,&nbsp;
this is probably something that we'll be looking&nbsp;&nbsp;

00:13:50,720 --> 00:13:55,340
at in the next video and we'll be doing this.&nbsp;
Practically we will be actually performing the&nbsp;&nbsp;

00:13:55,340 --> 00:14:02,180
we'll be performing the spidering process. But&nbsp;
for now, let me see what else Yes, the request&nbsp;&nbsp;

00:14:02,180 --> 00:14:09,170
headers. The request headers are used to you can&nbsp;
manipulate essentially the headers. If you've&nbsp;&nbsp;

00:14:09,170 --> 00:14:13,880
learned about HTTP headers, by the way, I really&nbsp;
want to cover HTTP because it's very important&nbsp;&nbsp;

00:14:13,880 --> 00:14:18,050
that you understand how the ad is work. But we'll&nbsp;
be looking at this all in advance. But now let's&nbsp;&nbsp;

00:14:18,050 --> 00:14:25,430
start off with the spider status. Well, not really&nbsp;
with the spider status. But looking at the control&nbsp;&nbsp;

00:14:25,430 --> 00:14:30,170
tab. If you look at the spider scope, you can see&nbsp;
that you can it will use the default suite scope,&nbsp;&nbsp;

00:14:30,170 --> 00:14:35,120
which is defined in the target tab. If you just&nbsp;
click on use a custom scope, you can see that&nbsp;&nbsp;

00:14:35,120 --> 00:14:41,000
Okay, first, you over, if you just click on this&nbsp;
little cog here, you can restore the default, you&nbsp;&nbsp;

00:14:41,000 --> 00:14:45,680
can load your own and you can save the options.&nbsp;
So that's just to do with that. Now when you talk&nbsp;&nbsp;

00:14:45,680 --> 00:14:52,740
about using the advanced scope here is where you&nbsp;
can essentially this is where you specify what you&nbsp;&nbsp;

00:14:52,740 --> 00:14:59,520
want to map so you can specify a host, the port,&nbsp;
etc, etc. Okay, again, we'll be looking at all&nbsp;&nbsp;

00:14:59,520 --> 00:15:04,620
of this as We move along. But for now, we're just&nbsp;
going to use the default suite scope, we can just,&nbsp;&nbsp;

00:15:04,620 --> 00:15:09,060
if once you click on that, it's going to start the&nbsp;
spidering process, but we don't need it right now.&nbsp;&nbsp;

00:15:09,060 --> 00:15:13,380
So I'm just going to come just going to pause&nbsp;
it. And if we move on to the options now the&nbsp;&nbsp;

00:15:13,380 --> 00:15:18,270
Options tab has a lot of stuff that we need to&nbsp;
look into. First and foremost, we have the CRO,&nbsp;&nbsp;

00:15:18,270 --> 00:15:23,940
the crawler settings. Alright. So when you're&nbsp;
talking about the basic options, for example,&nbsp;&nbsp;

00:15:23,940 --> 00:15:30,270
we can specify what the spider will crawl for.&nbsp;
So it you can choose to select for robots,&nbsp;&nbsp;

00:15:30,270 --> 00:15:34,980
the robots dot txt file, which is very important&nbsp;
because it shows you, you know, exclusions,&nbsp;&nbsp;

00:15:34,980 --> 00:15:41,220
you then can detect, you can ignore the links to&nbsp;
non text content, you can request the root of all&nbsp;&nbsp;

00:15:41,220 --> 00:15:45,270
directories very important stuff. But again,&nbsp;
you can customize this to your liking. Now,&nbsp;&nbsp;

00:15:45,270 --> 00:15:48,870
one of the things I would recommend that you'd&nbsp;
not touch with, if you do not know what you're&nbsp;&nbsp;

00:15:48,870 --> 00:15:55,830
doing yet is the maximum link. That's right, the&nbsp;
maximum link depth is essentially the number of&nbsp;&nbsp;

00:15:55,830 --> 00:16:03,720
links you want the spider to, to essentially, to&nbsp;
crawl or to map. Now by default five is in my,&nbsp;&nbsp;

00:16:03,720 --> 00:16:09,510
in my, in my situation, or in my case, what I&nbsp;
like doing is alternating between three to five,&nbsp;&nbsp;

00:16:09,510 --> 00:16:15,360
anything higher than that will usually overload&nbsp;
the web application, and it will cause it to lag&nbsp;&nbsp;

00:16:15,360 --> 00:16:21,060
or to respond very, very slowly. And, you know,&nbsp;
again, that might not mean a lot right now,&nbsp;&nbsp;

00:16:21,060 --> 00:16:25,440
but trust me, when you'll actually be performing&nbsp;
the penetration test on the web application,&nbsp;&nbsp;

00:16:25,440 --> 00:16:32,790
you really need a good response. Otherwise,&nbsp;
you have your time to live, etc, etc. Okay,&nbsp;&nbsp;

00:16:32,790 --> 00:16:36,450
so let's look at what passive spidering is,&nbsp;
alright, so as passive spidering. And said,&nbsp;&nbsp;

00:16:36,450 --> 00:16:42,720
is essentially just, it allows you to continue&nbsp;
scanning, you know, or going through, or&nbsp;&nbsp;

00:16:42,720 --> 00:16:50,160
actually performing your requests how as as it, it&nbsp;
essentially allows you to continue the spidering&nbsp;&nbsp;

00:16:50,160 --> 00:16:54,900
process as you're performing any other tasks.&nbsp;
So as you can see, passes by during monitors,&nbsp;&nbsp;

00:16:54,900 --> 00:17:00,180
monitors traffic through the burp proxy to update&nbsp;
the sitemap without making any new requests,&nbsp;&nbsp;

00:17:00,180 --> 00:17:05,610
right. So passively spiders you browse, you can&nbsp;
also select the link depth associated with proxy&nbsp;&nbsp;

00:17:05,610 --> 00:17:09,390
requests now this, I would recommend keeping&nbsp;
it at zero to two. And that's because again,&nbsp;&nbsp;

00:17:09,390 --> 00:17:14,490
you do not want a very, very deep alert link&nbsp;
depth in the sense that you're also going to&nbsp;&nbsp;

00:17:14,490 --> 00:17:18,750
be performing your own requests, and you'll be&nbsp;
doing many other things you could be looking&nbsp;&nbsp;

00:17:18,750 --> 00:17:22,590
at the decoder or you could be looking&nbsp;
at, you could be focusing on the target,&nbsp;&nbsp;

00:17:22,590 --> 00:17:28,050
and you don't want it again to to slow&nbsp;
down the web application. Alright,&nbsp;&nbsp;

00:17:28,050 --> 00:17:32,310
so form submission. Again, this is something that&nbsp;
I said we'll be talking about in the next video,&nbsp;&nbsp;

00:17:32,310 --> 00:17:36,750
because it is quite advanced. And we'll get&nbsp;
started with the damn vulnerable web application&nbsp;&nbsp;

00:17:36,750 --> 00:17:42,900
there. Moving on to the spider engine, we'll be&nbsp;
looking at application login as well. But for now,&nbsp;&nbsp;

00:17:42,900 --> 00:17:50,010
just we'll just keep over that when we talk&nbsp;
about the spider engine. Alright, these settings&nbsp;&nbsp;

00:17:50,010 --> 00:17:55,710
control the engineers for making HTTP requests one&nbsp;
spidering. Right. So this allows you to change the&nbsp;&nbsp;

00:17:55,710 --> 00:18:01,740
number of threads you want to use. And as I said,&nbsp;
using more than we can see right now it's at 10,&nbsp;&nbsp;

00:18:01,740 --> 00:18:06,840
what I would recommend is still keeping it within&nbsp;
the range of two to five are all you might,&nbsp;&nbsp;

00:18:06,840 --> 00:18:11,940
you might cause the web application to slow&nbsp;
down. And these are more advanced settings that&nbsp;&nbsp;

00:18:11,940 --> 00:18:15,930
you can use dependent on timing. All right,&nbsp;
and we've talked about the request headers,&nbsp;&nbsp;

00:18:15,930 --> 00:18:22,170
they allow you to modify the way the spider will&nbsp;
we look towards the web applications, for example,&nbsp;&nbsp;

00:18:22,170 --> 00:18:28,350
you could you could edit the the device that is&nbsp;
being used. And you could change it, for example,&nbsp;&nbsp;

00:18:28,350 --> 00:18:33,990
into a mobile device and you get the idea you you&nbsp;
essentially allows you to to change the request&nbsp;&nbsp;

00:18:33,990 --> 00:18:39,750
headers. And from that, obviously, you'll get&nbsp;
a response back, dependent on what you changed.&nbsp;&nbsp;

00:18:39,750 --> 00:18:46,170
Alright, so that was the spidering, or actually&nbsp;
the theory revolving on spidering. Now we'll&nbsp;&nbsp;

00:18:46,170 --> 00:18:51,420
be looking at how spidering really works in the&nbsp;
next video. I know some of you may not like this&nbsp;&nbsp;

00:18:51,420 --> 00:18:56,040
that I actually went through through theory, and I&nbsp;
haven't talked about doing anything. But remember,&nbsp;&nbsp;

00:18:56,040 --> 00:19:00,390
it's very, very important to understand what&nbsp;
exactly is happening behind spidering. And&nbsp;&nbsp;

00:19:00,390 --> 00:19:03,660
in the next video, we'll actually get&nbsp;
started with the spidering process.&nbsp;&nbsp;

00:19:07,920 --> 00:19:13,530
Get started with brute forcing with the rates&nbsp;
or our vulnerable web application of choice is&nbsp;&nbsp;

00:19:13,530 --> 00:19:18,000
going to be the damn vulnerable web application,&nbsp;
as we discussed in the previous video, alright,&nbsp;&nbsp;

00:19:18,000 --> 00:19:21,660
and I'm going to be using meta exploitable&nbsp;
to as our as my server. By default,&nbsp;&nbsp;

00:19:21,660 --> 00:19:26,100
you can install medispa, you can install the damn&nbsp;
vulnerable web application on your Kali Linux,&nbsp;&nbsp;

00:19:26,100 --> 00:19:31,770
and you can host it on your local on your local&nbsp;
server. And you can you can then perform your&nbsp;&nbsp;

00:19:31,770 --> 00:19:36,330
attacks. But I like running it from another&nbsp;
virtual machine. And as you can see, I'm running&nbsp;&nbsp;

00:19:36,330 --> 00:19:41,100
it on the Metasploit able to virtual machine. And&nbsp;
by default, it's connected to my local network&nbsp;&nbsp;

00:19:41,100 --> 00:19:47,520
and it's bridged. So you can see that my local IP&nbsp;
address is 190 2.168 point 1.1 or two. Alright, so&nbsp;&nbsp;

00:19:47,520 --> 00:19:52,260
I already have the damn vulnerable web application&nbsp;
open as you can see it is running on the that IP&nbsp;&nbsp;

00:19:52,260 --> 00:19:58,230
address of the meta splittable to virtual machine&nbsp;
on the the damn vulnerable web application. So for&nbsp;&nbsp;

00:19:58,230 --> 00:20:02,220
those of you asking why I'm using Metasploit able&nbsp;
to instead of meta splittable. Three, it's because&nbsp;&nbsp;

00:20:02,220 --> 00:20:07,860
Metasploit able to has a much larger choice in&nbsp;
terms of vulnerable web applications. And it's&nbsp;&nbsp;

00:20:07,860 --> 00:20:12,180
really good for practicing. Alright, so make&nbsp;
sure you're logged into your damn vulnerable&nbsp;&nbsp;

00:20:12,180 --> 00:20:17,250
web application, you need the default username&nbsp;
is admin and the password is password. Alright,&nbsp;&nbsp;

00:20:17,250 --> 00:20:21,660
it's really very simple. Alright, by default, In&nbsp;
this video, we're going to set our security level&nbsp;&nbsp;

00:20:21,660 --> 00:20:25,500
too low. If you don't know how to do that, you can&nbsp;
go into your deverbal web application security.&nbsp;&nbsp;

00:20:25,500 --> 00:20:30,660
And you can set that too low, and you can just&nbsp;
hit submit. The reason we're setting it too low is&nbsp;&nbsp;

00:20:30,660 --> 00:20:35,580
because most logins Are you know, if you look at&nbsp;
the real world, if you're talking about big sites,&nbsp;&nbsp;

00:20:35,580 --> 00:20:39,810
this attack may very well work on sites that&nbsp;
are older, or sites that have not been updated,&nbsp;&nbsp;

00:20:39,810 --> 00:20:44,670
or sites that don't have good security, you'll&nbsp;
be shocked to find some really big companies&nbsp;&nbsp;

00:20:44,670 --> 00:20:50,370
that actually don't have any login protection,&nbsp;
or brute force protection for that matter. Now,&nbsp;&nbsp;

00:20:50,370 --> 00:20:54,420
that being said, what I was talking about is if&nbsp;
we go to brute force, you can see that we have&nbsp;&nbsp;

00:20:54,420 --> 00:20:58,800
a login prompt here. Now I forgotten the username&nbsp;
and password, and we're going to be brute forcing&nbsp;&nbsp;

00:20:58,800 --> 00:21:03,420
it live. Alright, but before we do that, we&nbsp;
need to actually start our birth. Alright, so&nbsp;&nbsp;

00:21:03,420 --> 00:21:08,190
start up that suite. And you can see I'm using the&nbsp;
Community Edition. And it is the latest version,&nbsp;&nbsp;

00:21:08,190 --> 00:21:12,270
right? So make sure that yours is the latest&nbsp;
version, obviously, for obvious reasons. And&nbsp;&nbsp;

00:21:12,270 --> 00:21:17,130
we're just going to start a temporary project&nbsp;
because I don't use the pro version. And we're&nbsp;&nbsp;

00:21:17,130 --> 00:21:22,320
going to hit use the birth defaults when you start&nbsp;
work. Alright, give that a few seconds to start&nbsp;&nbsp;

00:21:22,320 --> 00:21:27,180
the to start back. And now you want to make sure&nbsp;
you you're using the proxy. So we're going to go&nbsp;&nbsp;

00:21:27,180 --> 00:21:33,630
into preferences, and advanced and whoops, burp&nbsp;
is oh opened up, let me just go into my proxies,&nbsp;&nbsp;

00:21:33,630 --> 00:21:37,380
network settings. And we make sure that&nbsp;
it's using the manual proxy configuration,&nbsp;&nbsp;

00:21:37,380 --> 00:21:45,480
which is the localhost 120 7.0 point 0.1. And&nbsp;
the port is 8080. We're gonna hit OK, excellent.&nbsp;&nbsp;

00:21:45,480 --> 00:21:49,860
Now we need to move into burp back again. And&nbsp;
we want to make sure that we go into proxy,&nbsp;&nbsp;

00:21:49,860 --> 00:21:53,820
and the intercept is set to off. All right,&nbsp;
the reason we're setting the intercept off,&nbsp;&nbsp;

00:21:53,820 --> 00:21:59,490
is because I just want to show you something&nbsp;
first. Now by default intercept essentially just&nbsp;&nbsp;

00:21:59,490 --> 00:22:04,620
means that you're not intercepting the request,&nbsp;
the requests and the responses being sent from&nbsp;&nbsp;

00:22:04,620 --> 00:22:09,510
the web application to your browser. Okay, so&nbsp;
we have already set the proxy for the browser,&nbsp;&nbsp;

00:22:09,510 --> 00:22:16,260
but we're not intercepting. So if we just test a&nbsp;
random username like test, and we say a password&nbsp;&nbsp;

00:22:16,260 --> 00:22:21,360
like 12345, you can see if I hit login, it's&nbsp;
going to tell me that that is incorrect. Now,&nbsp;&nbsp;

00:22:21,360 --> 00:22:27,300
if I set the intercept to on to see the request,&nbsp;
let me just turn it on. And we can now reload this&nbsp;&nbsp;

00:22:27,300 --> 00:22:34,710
we can say test and the password 12345. We can&nbsp;
see that now it's for some reason, let me just&nbsp;&nbsp;

00:22:34,710 --> 00:22:41,220
forward that after actually just turn that off.&nbsp;
And we now see log in. And for some reason that&nbsp;&nbsp;

00:22:41,220 --> 00:22:46,590
is not allowing us because you have to reload.&nbsp;
Alright, so now if I hit intercept on, and whoops,&nbsp;&nbsp;

00:22:46,590 --> 00:22:53,760
let me just open up my browser and hit the parcel&nbsp;
1345. Log In. For some reason it's going to,&nbsp;&nbsp;

00:22:53,760 --> 00:22:58,710
it's going to slowly reloading here. I probably&nbsp;
there we are. Alright, so I've reloaded the page.&nbsp;&nbsp;

00:22:58,710 --> 00:23:04,710
And as you can see, now the intercept is on and&nbsp;
we go back to burp, you can see that we got the&nbsp;&nbsp;

00:23:04,710 --> 00:23:10,470
get request being sent by the web application.&nbsp;
Now let's inspect it for a while now we'll be&nbsp;&nbsp;

00:23:10,470 --> 00:23:15,540
looking at what all of this really means but by By&nbsp;
default, the most important thing right now is the&nbsp;&nbsp;

00:23:15,540 --> 00:23:20,250
get request. Alright, so you can see that the get&nbsp;
request has two values here. It has the username&nbsp;&nbsp;

00:23:20,250 --> 00:23:25,530
and the and the password. Now the values again are&nbsp;
not important we're going to be brute forcing the&nbsp;&nbsp;

00:23:25,530 --> 00:23:30,330
values but it's very important to get the fields&nbsp;
that we're using here. Now what am I talking about&nbsp;&nbsp;

00:23:30,330 --> 00:23:35,150
if you look at the cookie you can see the security&nbsp;
is low. And if you were to edit the value and for&nbsp;&nbsp;

00:23:35,150 --> 00:23:40,220
the package, you can set it too high that is basic&nbsp;
stuff that's good stuff right? But now we want to&nbsp;&nbsp;

00:23:40,220 --> 00:23:45,530
brute force this login. Alright, and how do we do&nbsp;
that you can see the first thing we need to do is&nbsp;&nbsp;

00:23:45,530 --> 00:23:49,850
we're going to be using the intruder alright so&nbsp;
if you're a bit confused about what the in today's&nbsp;&nbsp;

00:23:49,850 --> 00:23:56,330
Don't be worried intruder is essentially allow&nbsp;
allows us to edit the parameters, it allows us to&nbsp;&nbsp;

00:23:56,330 --> 00:24:01,790
edit the requests and then obviously edit them and&nbsp;
manipulate them so we can get the desired results.&nbsp;&nbsp;

00:24:01,790 --> 00:24:06,350
Now the great thing about there in the intruder&nbsp;
is it allows us to perform attacks like the brute&nbsp;&nbsp;

00:24:06,350 --> 00:24:13,070
force, etc, etc. Alright, but now what we need&nbsp;
to do is we need to send this request into the&nbsp;&nbsp;

00:24:13,070 --> 00:24:17,480
intruder so that we can send our own response.&nbsp;
Alright, so we're going to right click and send&nbsp;&nbsp;

00:24:17,480 --> 00:24:21,950
to intruder. So we just send it to intruder. And&nbsp;
once it's sent to the intruder, you can just hit&nbsp;&nbsp;

00:24:21,950 --> 00:24:26,390
forward. Alright, we don't need window, we don't&nbsp;
need that GET request anymore. So now you want to&nbsp;&nbsp;

00:24:26,390 --> 00:24:31,880
go into the intruder and you want going to your&nbsp;
positions. And as you can see in your positions&nbsp;&nbsp;

00:24:31,880 --> 00:24:39,500
you have got you have got the get request that&nbsp;
we were we just intercepted. And now you can&nbsp;&nbsp;

00:24:39,500 --> 00:24:45,230
see something really interesting. It's highlighted&nbsp;
for you all the different payloads. Okay, all the&nbsp;&nbsp;

00:24:45,230 --> 00:24:50,300
different fields that we can brute force for. By&nbsp;
default we have the username value, the password&nbsp;&nbsp;

00:24:50,300 --> 00:24:56,960
value, the login value, we have the F the SF ID&nbsp;
value, we have the the cookie value, no No, no,&nbsp;&nbsp;

00:24:56,960 --> 00:25:02,360
we don't need all of these The only values that we&nbsp;
need The username and the password value. So the&nbsp;&nbsp;

00:25:02,360 --> 00:25:07,550
most important thing you need to do right now is&nbsp;
you need to clear just hit clear. Alright, oops,&nbsp;&nbsp;

00:25:07,550 --> 00:25:15,110
sorry, not that clear. I beg, I beg your apology&nbsp;
there. I sorry, I didn't mean that what I'm trying&nbsp;&nbsp;

00:25:15,110 --> 00:25:19,850
to say is I'm sorry, just clear, just hit clear.&nbsp;
And as you can see, now, no values are being&nbsp;&nbsp;

00:25:19,850 --> 00:25:24,230
selected to be brute force against. So now we need&nbsp;
to select them manually. But before that, we're&nbsp;&nbsp;

00:25:24,230 --> 00:25:28,790
going to be using the the cluster bomb attack&nbsp;
type. Alright, the reason we're using the cluster&nbsp;&nbsp;

00:25:28,790 --> 00:25:32,870
bomb attack type is because we are going to be&nbsp;
using two values, we are brute forcing against&nbsp;&nbsp;

00:25:32,870 --> 00:25:39,110
two values. Remember that, okay, and these need to&nbsp;
be set in, in combination. So that means it's much&nbsp;&nbsp;

00:25:39,110 --> 00:25:44,960
better to use a cluster bomb because essentially,&nbsp;
you're clustering to values that need to be that&nbsp;&nbsp;

00:25:44,960 --> 00:25:51,080
need to be tested against the login, the login&nbsp;
application, or the login form together, alright,&nbsp;&nbsp;

00:25:51,080 --> 00:25:56,150
so in a combination, so we need to select cluster&nbsp;
bomb. And now we need to select the values because&nbsp;&nbsp;

00:25:56,150 --> 00:26:00,830
those are the those are that is what we want to&nbsp;
brute force again. So just highlight the value,&nbsp;&nbsp;

00:26:00,830 --> 00:26:05,720
it doesn't matter the password or the username&nbsp;
is just highlight it, and you want to hit Add.&nbsp;&nbsp;

00:26:05,720 --> 00:26:09,710
Alright, so just hit Add. And as you can see,&nbsp;
we have selected that, you know, going to the&nbsp;&nbsp;

00:26:09,710 --> 00:26:13,700
password, and you want to highlight that as well.&nbsp;
And you just want to add that, as you can see&nbsp;&nbsp;

00:26:13,700 --> 00:26:17,360
now once you have added that those are the two&nbsp;
values we're going to be brute forcing against,&nbsp;&nbsp;

00:26:17,360 --> 00:26:22,340
make sure that none of the others are selected&nbsp;
none of the other values. Once that is done,&nbsp;&nbsp;

00:26:22,340 --> 00:26:27,020
you're you're almost there now. Now you want to&nbsp;
go into your payloads. Right now in your payloads,&nbsp;&nbsp;

00:26:27,020 --> 00:26:31,400
you want to make sure that your payload set is set&nbsp;
to two, which is your username and your password.&nbsp;&nbsp;

00:26:31,400 --> 00:26:37,310
So let's start off with your payload set as&nbsp;
payload one, all right as your payload type,&nbsp;&nbsp;

00:26:37,310 --> 00:26:42,470
make sure that that is a simple list. Because&nbsp;
you can see we were only targeting usernames&nbsp;&nbsp;

00:26:42,470 --> 00:26:46,580
and passwords. So we don't need, you know, a&nbsp;
runtime file, or we're not changing anything,&nbsp;&nbsp;

00:26:47,240 --> 00:26:52,655
you know, dependent on Unicode etc, you get the&nbsp;
idea. Okay, so simple list. And now you're going&nbsp;&nbsp;

00:26:52,655 --> 00:26:57,170
to your payload options, which is where you select&nbsp;
your user list or your password list or your word&nbsp;&nbsp;

00:26:57,170 --> 00:27:02,090
list. Now, we're not using a word list. But if&nbsp;
you want to, you can if you're performing this&nbsp;&nbsp;

00:27:02,090 --> 00:27:06,620
on a real site, which I don't recommend unless&nbsp;
you have written permission. Now since we're&nbsp;&nbsp;

00:27:06,620 --> 00:27:12,470
using this in our penetration testing lab, we are&nbsp;
going to just add the default usernames and said&nbsp;&nbsp;

00:27:12,470 --> 00:27:18,260
the security of the site is low. And it's not&nbsp;
really a complex a brute force to crack. Okay,&nbsp;&nbsp;

00:27:18,260 --> 00:27:23,600
so what we want to do is, we want to make sure&nbsp;
we have set payload set to one, which is going&nbsp;&nbsp;

00:27:23,600 --> 00:27:28,910
to be for our usernames. So now we can go into&nbsp;
load where you can load your default usernames&nbsp;&nbsp;

00:27:28,910 --> 00:27:33,320
and your passwords or your word lists, but by&nbsp;
default, we're going to add our own Alright,&nbsp;&nbsp;

00:27:33,320 --> 00:27:40,070
so we're gonna say, whoops, we, for some, we're&nbsp;
just gonna say, we're going to type in a now like&nbsp;&nbsp;

00:27:40,070 --> 00:27:46,610
the commonly used usernames, alright, so something&nbsp;
like admin, administrator whoops, for some reason,&nbsp;&nbsp;

00:27:46,610 --> 00:27:52,250
actually, let me just remove these blank values&nbsp;
there. admin now administrator, administrator, let&nbsp;&nbsp;

00:27:52,250 --> 00:27:59,960
me just type that back in. administrator, like, so&nbsp;
administrator, for those of you telling me that my&nbsp;&nbsp;

00:27:59,960 --> 00:28:03,070
typing is bad. That's because my microphone&nbsp;
is right in front of me, and I can't really&nbsp;&nbsp;

00:28:03,070 --> 00:28:08,440
see what I'm typing administrator. Let's see what&nbsp;
else what are the default ones like we have root,&nbsp;&nbsp;

00:28:08,440 --> 00:28:14,470
we have password. Actually, we're not setting&nbsp;
the passwords right now. So we can just type in&nbsp;&nbsp;

00:28:14,470 --> 00:28:19,330
the default ones like this. All right, so we can&nbsp;
say test, you know, the default ones, user one,&nbsp;&nbsp;

00:28:19,330 --> 00:28:25,030
whatever you think could be the most commonly used&nbsp;
ones, okay? Or if you know what the username is,&nbsp;&nbsp;

00:28:25,030 --> 00:28:29,530
that is even better. So we're gonna add all the&nbsp;
usernames. Alright, so we've added the usernames&nbsp;&nbsp;

00:28:29,530 --> 00:28:33,640
that we want to use. Now by default, again, I'm&nbsp;
saying you can use a word list if you want to just&nbsp;&nbsp;

00:28:33,640 --> 00:28:38,530
go into load and select the word list. Now we want&nbsp;
to select our passwords, right? So we can go into&nbsp;&nbsp;

00:28:38,530 --> 00:28:43,720
the payload set to. And as you can see, now we&nbsp;
can add our own values. Now we can use the default&nbsp;&nbsp;

00:28:43,720 --> 00:28:50,950
word lists that come with Kali Linux. So if I go&nbsp;
into my root, and I'm going to use them, share and&nbsp;&nbsp;

00:28:50,950 --> 00:28:56,170
reselect word lists, let me just find where word&nbsp;
lists are. If I can find them, there we are word&nbsp;&nbsp;

00:28:56,170 --> 00:29:01,060
lists. And they are the ones that work great for&nbsp;
me in the Metasploit folder. And you can look for&nbsp;&nbsp;

00:29:01,060 --> 00:29:05,530
the default passwords. As you can see, you have&nbsp;
your database default passwords, you have your&nbsp;&nbsp;

00:29:05,530 --> 00:29:11,620
default, user password for services, that's also&nbsp;
great. It has a great list of of default usernames&nbsp;&nbsp;

00:29:11,620 --> 00:29:15,580
and passwords that you can use. But for me, I'm&nbsp;
not going to use this because we are sticking&nbsp;&nbsp;

00:29:15,580 --> 00:29:20,290
to the basics. And now you want to add your own&nbsp;
password. So we can select again, some randomly,&nbsp;&nbsp;

00:29:20,290 --> 00:29:27,850
you know, commonly used passwords. So pass, you&nbsp;
can say password. Let's see what else admin, you&nbsp;&nbsp;

00:29:27,850 --> 00:29:36,220
know, admin again, whoops, let me just remove that&nbsp;
one admin. Route, you can use route. Let's see,&nbsp;&nbsp;

00:29:36,220 --> 00:29:41,560
let me think 12345. That was the one that I've&nbsp;
seen many network administrators using 12345.&nbsp;&nbsp;

00:29:42,310 --> 00:29:47,560
And you get the idea. All right, so we've set our&nbsp;
two payloads. payload one is set for usernames.&nbsp;&nbsp;

00:29:47,560 --> 00:29:52,930
payload two is set for passwords. Excellent. All&nbsp;
right now, we have selected our payload types we&nbsp;&nbsp;

00:29:52,930 --> 00:29:58,690
have selected we have added our payload options.&nbsp;
We don't need to look at payload processing that&nbsp;&nbsp;

00:29:58,690 --> 00:30:03,190
is advanced once That's done, what you want to&nbsp;
do is going to intruder and start the attack.&nbsp;&nbsp;

00:30:03,190 --> 00:30:07,360
Alright, and now it's going to tell you that the&nbsp;
Community Edition of burp contains a demo version,&nbsp;&nbsp;

00:30:07,360 --> 00:30:11,920
but it's essentially telling you that the process&nbsp;
is going to be slow. Alright, so we're gonna hit&nbsp;&nbsp;

00:30:11,920 --> 00:30:16,060
OK. And it's going to start at the attack. As you&nbsp;
can see, it's going through all the combinations.&nbsp;&nbsp;

00:30:16,060 --> 00:30:20,470
And as you can see, the combinations that we&nbsp;
have here are 25, and is going to go through&nbsp;&nbsp;

00:30:20,470 --> 00:30:25,420
all of them. Now, one great thing that you need to&nbsp;
do here or one important thing that you need to do&nbsp;&nbsp;

00:30:25,420 --> 00:30:30,730
is you need to understand the the the status codes&nbsp;
that the server or the web application is sending&nbsp;&nbsp;

00:30:30,730 --> 00:30:38,410
back. Now, that's a good way of, of understanding&nbsp;
what password is correct? And what what username&nbsp;&nbsp;

00:30:38,410 --> 00:30:45,910
is correct and what password is not correct.&nbsp;
Okay. So if we look now, at the, at the results,&nbsp;&nbsp;

00:30:45,910 --> 00:30:49,330
as you can see that it's finished, it's going&nbsp;
through the brute force attack, we check the&nbsp;&nbsp;

00:30:49,330 --> 00:30:54,820
status, the status is still the same, we have a&nbsp;
status to 200. If we look at the length, right,&nbsp;&nbsp;

00:30:54,820 --> 00:30:59,740
the length is going to be still the same. But you&nbsp;
have to look for things that are not that are not&nbsp;&nbsp;

00:30:59,740 --> 00:31:05,800
matching. So for example, you can see that the&nbsp;
length here that was returned was 4948. And it's&nbsp;&nbsp;

00:31:05,800 --> 00:31:10,510
not, it's not following the format of the others.&nbsp;
So that means that this could be the username&nbsp;&nbsp;

00:31:10,510 --> 00:31:15,460
and password, don't worry about the status, the&nbsp;
status will still remain the same, regardless of&nbsp;&nbsp;

00:31:15,460 --> 00:31:19,600
that. But when we'll be looking at Advanced Server&nbsp;
penetration testing, that's something important.&nbsp;&nbsp;

00:31:19,600 --> 00:31:25,930
So you can see that the get that we've got here is&nbsp;
very important. Now if we look at the if we look&nbsp;&nbsp;

00:31:25,930 --> 00:31:31,870
at the response that will be sent. Right there,&nbsp;
you can see the response. And if we render it,&nbsp;&nbsp;

00:31:31,870 --> 00:31:36,970
you can see that if it was successful, it will&nbsp;
tell us that we've logged in successfully. So let&nbsp;&nbsp;

00:31:36,970 --> 00:31:40,990
me just browse down all the way as you can see,&nbsp;
welcome to the password protected area admin.&nbsp;&nbsp;

00:31:40,990 --> 00:31:46,780
And there you go, that is the username and the&nbsp;
password is admin and password. Now again, this&nbsp;&nbsp;

00:31:46,780 --> 00:31:52,210
was really simple. Again, you can you can increase&nbsp;
the security if you're practicing on your own. But&nbsp;&nbsp;

00:31:52,210 --> 00:31:56,860
you can see that this really works. And this is&nbsp;
how to utilize burp for advanced stuff like brute&nbsp;&nbsp;

00:31:56,860 --> 00:32:03,370
forcing. Now again, most of the advanced websites&nbsp;
nowadays have great content management systems&nbsp;&nbsp;

00:32:03,370 --> 00:32:07,780
that have the security plugins that essentially&nbsp;
prevent you from brute forcing or lock you out.&nbsp;&nbsp;

00:32:07,780 --> 00:32:12,115
But most of the oldest sites, you'll be, you'll&nbsp;
be actually quite shocked to find out that they&nbsp;&nbsp;

00:32:12,115 --> 00:32:17,680
are brute forces, they are log informed sorry,&nbsp;
are not protected. Now we've already logged in,&nbsp;&nbsp;

00:32:17,680 --> 00:32:22,960
and you can see that the default username is&nbsp;
admin, and the password is password. Okay, so you&nbsp;&nbsp;

00:32:22,960 --> 00:32:29,620
can look at the role. The raw HTTP here, you can&nbsp;
look at the request and the response. Or you can&nbsp;&nbsp;

00:32:29,620 --> 00:32:33,700
look at them and you can inspect them, if that's&nbsp;
what you do. And you can look at the headers,&nbsp;&nbsp;

00:32:33,700 --> 00:32:38,200
what's being sent, all that good stuff. But that&nbsp;
was going to be it for this video. And now if we&nbsp;&nbsp;

00:32:38,200 --> 00:32:43,600
just go back into burp, let me just go into my&nbsp;
proxy. And I'm going to disable intercept. And&nbsp;&nbsp;

00:32:43,600 --> 00:32:47,290
we can try and log in here. So we know that&nbsp;
the admin username is admin and the password&nbsp;&nbsp;

00:32:47,290 --> 00:32:54,700
is password. So let me log in. And welcome to&nbsp;
the password protected admin area fantastic.&nbsp;&nbsp;

00:32:58,280 --> 00:33:02,630
In this video, we're going to be looking at&nbsp;
selecting our verbs with our target in web suite,&nbsp;&nbsp;

00:33:02,630 --> 00:33:08,750
adding it to our scope, and then finally spidering&nbsp;
it as my vulnerable operating system, I'm going to&nbsp;&nbsp;

00:33:08,750 --> 00:33:15,740
be using the Matilda de which comes pre installed&nbsp;
on Metasploit able to so you should download Well,&nbsp;&nbsp;

00:33:15,740 --> 00:33:20,390
I would recommend that you download Metasploit&nbsp;
able to, it's a fantastic option for any of you&nbsp;&nbsp;

00:33:20,390 --> 00:33:25,760
who are just getting into penetration testing&nbsp;
offers multiple vulnerable web applications&nbsp;&nbsp;

00:33:25,760 --> 00:33:29,720
and vulnerable systems that you can practice&nbsp;
with. So again, it's something that I really,&nbsp;&nbsp;

00:33:29,720 --> 00:33:36,470
really recommend. That being said, as you can&nbsp;
see, I have made exploitable to virtual machine&nbsp;&nbsp;

00:33:36,470 --> 00:33:42,860
running. And I have already looked at my local IP&nbsp;
address, you can do that by typing in if config&nbsp;&nbsp;

00:33:42,860 --> 00:33:49,940
that will display to you your your current network&nbsp;
interface and your local IP address. Because we&nbsp;&nbsp;

00:33:49,940 --> 00:33:55,670
are doing this in our virtual penetration testing&nbsp;
lab. Alright, so let's go back to Kali Linux now.&nbsp;&nbsp;

00:33:55,670 --> 00:34:00,470
And I'm going to open up my browser, make sure&nbsp;
you get your IP address. And as I said, again,&nbsp;&nbsp;

00:34:00,470 --> 00:34:04,580
we're going to be using motility. So if you don't&nbsp;
know what Mattila day is Mattila day is simply a&nbsp;&nbsp;

00:34:04,580 --> 00:34:09,650
vulnerable web application. And the reason I'm&nbsp;
switching I'm switching from the damn vulnerable&nbsp;&nbsp;

00:34:09,650 --> 00:34:14,120
web application is because I want to show you&nbsp;
a few, I really want to make it a bit diverse&nbsp;&nbsp;

00:34:14,120 --> 00:34:21,050
in terms of the web applications that we use.&nbsp;
Alright, so let's get started now. Now I already&nbsp;&nbsp;

00:34:21,050 --> 00:34:25,850
have the IP address of my virtual machine opened&nbsp;
up here in my browser, as you can see, 190 2.1&nbsp;&nbsp;

00:34:25,850 --> 00:34:32,630
68 point 1.14. So if I reload this, you can see&nbsp;
that it indeed is the meta splittable to server&nbsp;&nbsp;

00:34:32,630 --> 00:34:38,990
and I can just go ahead and click on Mattila&nbsp;
day. Alright, now what I should do now is go&nbsp;&nbsp;

00:34:38,990 --> 00:34:45,020
into my preferences, you can do that by opening a&nbsp;
new tab. So let me just open a new tab here going&nbsp;&nbsp;

00:34:45,020 --> 00:34:51,560
into preferences, and then selecting advanced and&nbsp;
network and finally settings. And then you want to&nbsp;&nbsp;

00:34:51,560 --> 00:34:57,440
make sure you select a manual proxy configuration.&nbsp;
And then make sure it's using the localhost proxy,&nbsp;&nbsp;

00:34:57,440 --> 00:35:03,800
which is wondering 7.0 point 0.1 Port 8080 and&nbsp;
hit OK. Once that's done, we know that burp suite&nbsp;&nbsp;

00:35:03,800 --> 00:35:09,220
can intercept. Not that we want to do that in this&nbsp;
video, we just want to, we want to have a look at,&nbsp;&nbsp;

00:35:09,220 --> 00:35:13,360
we want to map the web, the web application.&nbsp;
Alright, so we're not going to change anything&nbsp;&nbsp;

00:35:13,360 --> 00:35:17,680
in Mattila day. But I'm going to be showing you&nbsp;
some pretty interesting things in this video.&nbsp;&nbsp;

00:35:17,680 --> 00:35:23,650
So now we should start up burp suite community.&nbsp;
Now I'm going to be explaining something at the&nbsp;&nbsp;

00:35:23,650 --> 00:35:28,630
end of the video that is really important. And it&nbsp;
is in regards to the community version, and the&nbsp;&nbsp;

00:35:28,630 --> 00:35:34,720
professional version of burp suite and what what&nbsp;
the differences are and why you will need at some&nbsp;&nbsp;

00:35:34,720 --> 00:35:40,390
point to get the professional version. Okay, so&nbsp;
I'm going to select a temporary project, I'm using&nbsp;&nbsp;

00:35:40,390 --> 00:35:45,760
the community version as of right now, hit Next,&nbsp;
use the bird default, and I'm going to start up.&nbsp;&nbsp;

00:35:45,760 --> 00:35:51,310
Alright, so it's going to start burp suite. And&nbsp;
let me just minimize the browser here. So give&nbsp;&nbsp;

00:35:51,310 --> 00:35:56,740
that a few seconds to start up. And once it starts&nbsp;
up, what you want to do immediately is turn off&nbsp;&nbsp;

00:35:56,740 --> 00:36:02,650
the proxy, we want to stop in the intercepting&nbsp;
because we are not intercepting any requests,&nbsp;&nbsp;

00:36:02,650 --> 00:36:09,340
or we are not inserting any responses. So go back&nbsp;
into your target. And now we can get started with&nbsp;&nbsp;

00:36:09,340 --> 00:36:15,190
with actually reloading the page right here. So&nbsp;
let's reload that. And we should be able to see&nbsp;&nbsp;

00:36:15,190 --> 00:36:22,510
what's going on. And we should have the sitemap.&nbsp;
Alright, so let me just open up the burp suite&nbsp;&nbsp;

00:36:22,510 --> 00:36:28,120
here. Fantastic. Alright, so now you can see&nbsp;
something very interesting has happened here.&nbsp;&nbsp;

00:36:28,120 --> 00:36:33,820
In our target. And sitemap, we have the files that&nbsp;
were discovered here. Well, essentially, we have&nbsp;&nbsp;

00:36:33,820 --> 00:36:39,250
the web server that then has the modality folder,&nbsp;
which is our target. Now before I get into any of&nbsp;&nbsp;

00:36:39,250 --> 00:36:43,510
that, the site map will show you the current&nbsp;
site map. Obviously a site map is essentially&nbsp;&nbsp;

00:36:43,510 --> 00:36:49,510
sorry about that a site site map is essentially&nbsp;
the structure or the format of the webpage,&nbsp;&nbsp;

00:36:49,510 --> 00:36:55,060
and how the web page was constructed and how it&nbsp;
will function in regards to every other piece of&nbsp;&nbsp;

00:36:55,060 --> 00:37:00,730
content. Okay, so the first thing that we need to&nbsp;
do, or we'll be looking at is actually selecting&nbsp;&nbsp;

00:37:00,730 --> 00:37:04,630
our target, which in this case, again, is Mattila&nbsp;
day. And you can do that by right clicking and&nbsp;&nbsp;

00:37:04,630 --> 00:37:09,730
hitting add to scope. All right, so you might&nbsp;
be asking what exactly the scope means? Well,&nbsp;&nbsp;

00:37:09,730 --> 00:37:15,130
a scope essentially allows us to define our&nbsp;
automated spidering. And what this means is&nbsp;&nbsp;

00:37:15,130 --> 00:37:19,660
we are focusing our only on our target, we're&nbsp;
not going to focus on the reference links,&nbsp;&nbsp;

00:37:19,660 --> 00:37:24,880
like you can see here, for example, we have to&nbsp;
it as a reference link, backtrack, dynamic drive,&nbsp;&nbsp;

00:37:24,880 --> 00:37:30,760
Eclipse, etc, etc, you get the idea. So scoping&nbsp;
is essentially selecting our target, isolating it,&nbsp;&nbsp;

00:37:30,760 --> 00:37:35,920
so that we only see what we need to see. And&nbsp;
the obviously the results that we want to see.&nbsp;&nbsp;

00:37:35,920 --> 00:37:40,450
So I'm going to right click on Mattila day,&nbsp;
and I'm going to hit Add to scope. Alright,&nbsp;&nbsp;

00:37:40,450 --> 00:37:46,480
so now it's going to say you've added an item to&nbsp;
to the target scope, do you want that proxy to to&nbsp;&nbsp;

00:37:46,480 --> 00:37:52,120
stop sending out scope items out of scope items&nbsp;
to the history of the other bedtools? Yes, again,&nbsp;&nbsp;

00:37:52,120 --> 00:37:56,410
we want to make sure that we are we clear out all&nbsp;
the junk that we don't need. Now you might have&nbsp;&nbsp;

00:37:56,410 --> 00:38:02,500
noticed? Well, that's essentially happened, but&nbsp;
nothing is really changed. And as you can see,&nbsp;&nbsp;

00:38:02,500 --> 00:38:07,000
it's gonna tell you here logging of out of scope,&nbsp;
proxy traffic is disabled, don't worry about that,&nbsp;&nbsp;

00:38:07,000 --> 00:38:10,840
just leave it as it is, if you want to re&nbsp;
enable it, you can go ahead but right now you&nbsp;&nbsp;

00:38:10,840 --> 00:38:15,850
don't need to do that. Okay, so we've looked&nbsp;
at how to add our target to the scope. Now,&nbsp;&nbsp;

00:38:15,850 --> 00:38:22,750
let's look at spidering is essentially the&nbsp;
the first and the most important step of web&nbsp;&nbsp;

00:38:22,750 --> 00:38:27,820
application penetration testing. Alright,&nbsp;
it is it deals with or it is in it is in&nbsp;&nbsp;

00:38:27,820 --> 00:38:33,250
relation with footprinting. And this is why I&nbsp;
bring the comparison from penetration testing&nbsp;&nbsp;

00:38:33,250 --> 00:38:38,560
to obviously web application penetration testing&nbsp;
it is to deal it essentially deals with crawling&nbsp;&nbsp;

00:38:38,560 --> 00:38:43,870
through the website. And then it records all the&nbsp;
files, the links and the methods and the methods&nbsp;&nbsp;

00:38:43,870 --> 00:38:49,000
that it can get. And that helps us build an idea&nbsp;
of how the web application is structured, how it&nbsp;&nbsp;

00:38:49,000 --> 00:38:55,180
works. And then finally, we can learn how we can&nbsp;
break through it. What we need to do is we need to&nbsp;&nbsp;

00:38:55,180 --> 00:38:59,320
spider our target. Well, we have added it to the&nbsp;
scope, which is great. And now we need to spider&nbsp;&nbsp;

00:38:59,320 --> 00:39:03,160
it. So what we're going to do is we're going to&nbsp;
we're going to use spider and this will help us&nbsp;&nbsp;

00:39:03,160 --> 00:39:08,290
identify all the links and the parameters that we&nbsp;
need. Again, as I said, it's like footprinting. So&nbsp;&nbsp;

00:39:08,290 --> 00:39:11,410
what you want to do is right click on your&nbsp;
target, which in this case is Mattila day,&nbsp;&nbsp;

00:39:11,410 --> 00:39:17,350
and you want to spider this branch. Alright,&nbsp;
so I'm going to spider this branch. And no,&nbsp;&nbsp;

00:39:17,350 --> 00:39:20,530
something interesting is going to start happening.&nbsp;
As you can see, it's going to start getting all&nbsp;&nbsp;

00:39:20,530 --> 00:39:27,100
the links all the resources that it can, and it's&nbsp;
going to prompt you with here a submit form. Okay,&nbsp;&nbsp;

00:39:27,100 --> 00:39:31,390
now, what you can do is just ignore the form,&nbsp;
there'll be quite a few essentially, these are&nbsp;&nbsp;

00:39:31,390 --> 00:39:36,040
default login forms where it's asking you to&nbsp;
enter credentials that you might want to enter,&nbsp;&nbsp;

00:39:36,040 --> 00:39:40,510
let's say you, you're performing whitebox, then&nbsp;
Richard testing and you have the details. You&nbsp;&nbsp;

00:39:40,510 --> 00:39:45,280
can again log in like this and perform internal&nbsp;
penetration tests. But we're going to assume&nbsp;&nbsp;

00:39:45,280 --> 00:39:50,560
that you're you do not know your penetration,&nbsp;
you're essentially performing a penetration&nbsp;&nbsp;

00:39:50,560 --> 00:39:54,850
test on the security. So I'm going to ignore&nbsp;
all of these forms. Okay. And as you can see,&nbsp;&nbsp;

00:39:54,850 --> 00:39:58,930
there's another one right there and the spidering&nbsp;
is probably continuing. Now if you want to view&nbsp;&nbsp;

00:39:58,930 --> 00:40:03,370
the status of these By doing, you can go into&nbsp;
spider. And as you can see you have the status&nbsp;&nbsp;

00:40:03,370 --> 00:40:08,650
of the spider. And once it's done, you will see&nbsp;
that the requests made will stop changing. And&nbsp;&nbsp;

00:40:08,650 --> 00:40:14,710
the bytes transferred, will also stop changing so&nbsp;
we can stop the spider. Now you noticed something&nbsp;&nbsp;

00:40:14,710 --> 00:40:20,680
that we were faced with those are form login&nbsp;
prompts. Now, you can choose to enter them as&nbsp;&nbsp;

00:40:20,680 --> 00:40:26,920
a prompt or as you're prompted, but the better&nbsp;
way of doing this is to actually you actually do&nbsp;&nbsp;

00:40:26,920 --> 00:40:32,350
this automatically. And you can do this by going&nbsp;
into spider. And you want to go into options,&nbsp;&nbsp;

00:40:32,350 --> 00:40:40,060
and you want to go in to your application login.&nbsp;
Alright. Now, if you look at the form submission,&nbsp;&nbsp;

00:40:40,060 --> 00:40:45,820
it is essentially what it's doing is is going to&nbsp;
use the default form submissions that you would&nbsp;&nbsp;

00:40:45,820 --> 00:40:50,950
find in a database. So for example, we have male,&nbsp;
first name, last name, surname, name, address,&nbsp;&nbsp;

00:40:51,460 --> 00:40:56,470
you get the idea. So those are default values&nbsp;
that one would, one would be expected to find. Now&nbsp;&nbsp;

00:40:56,470 --> 00:41:02,770
we're looking at the application login. As you can&nbsp;
see, its option is set to prompt for guidance, we&nbsp;&nbsp;

00:41:02,770 --> 00:41:07,810
want to change this to automatically submit these&nbsp;
credentials. Now in here you can enter default&nbsp;&nbsp;

00:41:07,810 --> 00:41:13,060
credentials. Or if you have an idea of what the&nbsp;
credentials you might expect to find. Now, this is&nbsp;&nbsp;

00:41:13,060 --> 00:41:18,700
where creativity and sheer information gathering&nbsp;
comes into play. So if you need a new the default,&nbsp;&nbsp;

00:41:18,700 --> 00:41:22,990
you know, usernames and passwords, you can enter&nbsp;
them here. Now what I'm going to do is I'm going&nbsp;&nbsp;

00:41:22,990 --> 00:41:28,690
to enter a string that is, well, I've used it&nbsp;
before in performing SQL injection, and we'll talk&nbsp;&nbsp;

00:41:28,690 --> 00:41:35,530
about SQL injection because it is very advanced.&nbsp;
If you know SQL injection, or you have you have&nbsp;&nbsp;

00:41:35,530 --> 00:41:41,860
an idea or experience with the databases, you&nbsp;
might understand what this string means. Alright,&nbsp;&nbsp;

00:41:41,860 --> 00:41:49,340
so for my username, I'm going to change that to&nbsp;
admin, quotation mark and say, or one equal one,&nbsp;&nbsp;

00:41:49,340 --> 00:41:54,890
and two dashes. All right space and a dash. Now&nbsp;
you don't need to worry what this means for now,&nbsp;&nbsp;

00:41:54,890 --> 00:42:00,800
please do not stress about this, I will explain&nbsp;
it when the time is right. All right. So leave&nbsp;&nbsp;

00:42:00,800 --> 00:42:04,790
the password as it is. And don't worry about that.&nbsp;
Now, we had, we don't need to change anything in&nbsp;&nbsp;

00:42:04,790 --> 00:42:09,590
terms of these tabs, we talked about these tabs&nbsp;
in the theory section. And now we can go back into&nbsp;&nbsp;

00:42:09,590 --> 00:42:15,560
our control and target. And finally, we can spider&nbsp;
the application again, once more so that we can&nbsp;&nbsp;

00:42:15,560 --> 00:42:21,380
enter the we can essentially process the strings&nbsp;
that we that we just entered in terms of the user&nbsp;&nbsp;

00:42:21,380 --> 00:42:27,020
name, so I'm going to right click and spider this&nbsp;
branch. Okay, so it's going to start spidering.&nbsp;&nbsp;

00:42:27,020 --> 00:42:32,600
And if we look at the spider, you can see that the&nbsp;
the spidering is complete. And you can essentially&nbsp;&nbsp;

00:42:32,600 --> 00:42:38,360
clear the cues if you want to clear the clear them&nbsp;
like so. And you can keep on running it depending&nbsp;&nbsp;

00:42:38,360 --> 00:42:42,380
on what you want to do. Okay, so I'm just&nbsp;
going to pause it. And now we have essentially&nbsp;&nbsp;

00:42:42,380 --> 00:42:47,570
spidered the web application. And you might be&nbsp;
asking, well, I've seen a few reference sites,&nbsp;&nbsp;

00:42:47,570 --> 00:42:53,270
that's not helping much, you know, we don't need&nbsp;
twitter.com or you know, sizzle js, this might&nbsp;&nbsp;

00:42:53,270 --> 00:42:59,270
give us a basic idea of what types of sites are&nbsp;
linked to to the web application. But in reality,&nbsp;&nbsp;

00:42:59,270 --> 00:43:05,390
you can see we have hackers.org not not very&nbsp;
important information at all. Now, what if&nbsp;&nbsp;

00:43:05,390 --> 00:43:10,460
we click on the Mattila day folder? Oh, look at&nbsp;
that. That's really interesting. Now that is very,&nbsp;&nbsp;

00:43:10,460 --> 00:43:15,800
very important. What has happened here is it's&nbsp;
given us the structure of the web application,&nbsp;&nbsp;

00:43:15,800 --> 00:43:22,610
this is vitally important. All right now, again,&nbsp;
as I'm saying, you can look at how the website&nbsp;&nbsp;

00:43:22,610 --> 00:43:26,960
or the web application is structured. So in&nbsp;
documentation, you can see you can go ahead&nbsp;&nbsp;

00:43:26,960 --> 00:43:31,580
and read the documentation, you can look at&nbsp;
the images that the website has the styles,&nbsp;&nbsp;

00:43:31,580 --> 00:43:36,770
so you can inspect the entire site and understand&nbsp;
what exactly is going on here or get an idea of&nbsp;&nbsp;

00:43:36,770 --> 00:43:41,510
what the person who developed the website was&nbsp;
thinking. And then finally, out of experience,&nbsp;&nbsp;

00:43:41,510 --> 00:43:47,030
or as we'll be looking at out of knowledge, you&nbsp;
can actually understand how to exploit the system.&nbsp;&nbsp;

00:43:47,030 --> 00:43:52,160
And that we will be talking about discovering&nbsp;
hidden files, hidden files, like admin pages,&nbsp;&nbsp;

00:43:52,160 --> 00:43:57,110
login pages, you know, that really juicy stuff.&nbsp;
And we'll be talking about that in the next video.&nbsp;&nbsp;

00:43:57,110 --> 00:44:02,750
And that's because that sweet Community Edition&nbsp;
does not support or have allow you to use that&nbsp;&nbsp;

00:44:02,750 --> 00:44:06,230
feature. So what I'm going to do in the next&nbsp;
video, I'm going to be using burp suite Pro,&nbsp;&nbsp;

00:44:06,230 --> 00:44:12,020
and also show you an alternative program. I'm sure&nbsp;
you've heard of it. That also works on Windows.&nbsp;&nbsp;

00:44:12,020 --> 00:44:16,340
Of course, that's how it works on Windows. But&nbsp;
I'm not really a Windows fan when it comes down&nbsp;&nbsp;

00:44:16,340 --> 00:44:22,460
to penetration testing. So that being said, we&nbsp;
have essentially spider the application we have&nbsp;&nbsp;

00:44:22,460 --> 00:44:27,560
the structure of the web application. And now we&nbsp;
need to look at something also very interesting&nbsp;&nbsp;

00:44:27,560 --> 00:44:33,950
as we have already talked about it. Let me just&nbsp;
complete. Let me just show you how to get rid of&nbsp;&nbsp;

00:44:33,950 --> 00:44:39,980
all of these reference links and to essentially&nbsp;
show the items in the scope only. So what you&nbsp;&nbsp;

00:44:39,980 --> 00:44:45,080
can do is just click on filter right here, this&nbsp;
little bar here is the filter bar. So click on it,&nbsp;&nbsp;

00:44:45,080 --> 00:44:49,700
and it's going to show you bring up this smaller&nbsp;
window and you want to focus on the filter by&nbsp;&nbsp;

00:44:49,700 --> 00:44:55,580
request type and make sure you check show only in&nbsp;
scope items. This will essentially filter all the&nbsp;&nbsp;

00:44:55,580 --> 00:45:02,660
results to show you only links or resources or&nbsp;
files that are within the scope. So once that's&nbsp;&nbsp;

00:45:02,660 --> 00:45:07,550
done, just click back on the filter. And as you&nbsp;
can see it has got rid of all the junk that you do&nbsp;&nbsp;

00:45:07,550 --> 00:45:12,560
not need whatsoever. And now you can essentially&nbsp;
look at the, the requests and the responses and&nbsp;&nbsp;

00:45:12,560 --> 00:45:19,040
analyze them accurately defined to your scope. And&nbsp;
this will essentially, it will stop confusing you,&nbsp;&nbsp;

00:45:19,040 --> 00:45:24,230
I've seen many beginners make this mistake where&nbsp;
they don't define the scope. They do not know&nbsp;&nbsp;

00:45:24,230 --> 00:45:29,150
what the target is, and they're getting links that&nbsp;
are not even relate to the website that they're,&nbsp;&nbsp;

00:45:29,150 --> 00:45:33,320
they're trying to perform the penetration test&nbsp;
on. Now, since you know this knowledge, this&nbsp;&nbsp;

00:45:33,320 --> 00:45:39,140
will help you get a solid foundation. And again,&nbsp;
you can start logging out of skip out of scope&nbsp;&nbsp;

00:45:39,140 --> 00:45:43,700
proxy traffic when you want. Again, that's very&nbsp;
nice that they add that button right over there.&nbsp;&nbsp;

00:45:43,700 --> 00:45:48,590
Alright, so now you only have the files that&nbsp;
you require, or the files that you're currently&nbsp;&nbsp;

00:45:48,590 --> 00:45:54,080
performing the penetration test only. Now I know&nbsp;
this, this video was slightly, there was not a&nbsp;&nbsp;

00:45:54,080 --> 00:45:58,100
lot of action. But again, it is very important&nbsp;
that you get this in the next video, we'll be&nbsp;&nbsp;

00:45:58,100 --> 00:46:04,160
looking at how to how to discover hidden files&nbsp;
or files in general that you are not supposed to&nbsp;&nbsp;

00:46:04,160 --> 00:46:09,200
find. Okay. And that can be done by right clicking&nbsp;
and going into engagement tools. As you can see,&nbsp;&nbsp;

00:46:09,200 --> 00:46:14,870
it is defined to the professional version of burp&nbsp;
suite. And we will be going into discover content&nbsp;&nbsp;

00:46:14,870 --> 00:46:19,520
where I'll be explaining to you how to find&nbsp;
things like the login page or the configuration&nbsp;&nbsp;

00:46:19,520 --> 00:46:26,510
page. Some things that web developers, you know,&nbsp;
actually just may try to hide them. But if it's&nbsp;&nbsp;

00:46:26,510 --> 00:46:31,490
actually found, can really exploit the website&nbsp;
or can lead to the exploitation of the website.&nbsp;&nbsp;

00:46:35,690 --> 00:46:41,600
We're going to start looking at how to discover&nbsp;
hidden files. But before that, I just want to take&nbsp;&nbsp;

00:46:41,600 --> 00:46:48,260
you through a few things. Alright, so let's start&nbsp;
off with what OS base or o w SP. Alright, so what&nbsp;&nbsp;

00:46:48,260 --> 00:46:52,460
does that mean? Well, essentially what it means,&nbsp;
or what it stands for is the open web application&nbsp;&nbsp;

00:46:52,460 --> 00:46:57,560
security project. Alright, and its goal. Well,&nbsp;
essentially, it is a nonprofit organization&nbsp;&nbsp;

00:46:57,560 --> 00:47:04,010
whose goal is focused on improving the security of&nbsp;
software. All right, so its job is to improve the&nbsp;&nbsp;

00:47:04,010 --> 00:47:10,700
security of software. Now this project, the O w&nbsp;
SP, or the open web application security project,&nbsp;&nbsp;

00:47:10,700 --> 00:47:18,500
created a tool called as the Zed attack proxy. Or&nbsp;
as you know, it the zap, many people like calling&nbsp;&nbsp;

00:47:18,500 --> 00:47:22,820
it zap. And I'm sure most of you have heard&nbsp;
of it. And you might have been, you might be&nbsp;&nbsp;

00:47:22,820 --> 00:47:28,790
leaning towards burp suite a little bit more. But&nbsp;
I can guarantee you that zap is one of my favorite&nbsp;&nbsp;

00:47:28,790 --> 00:47:34,310
tools. And I use it because firstly, it's free.&nbsp;
And for the people like for the students I teach,&nbsp;&nbsp;

00:47:34,310 --> 00:47:39,260
I usually tell them to start with zap because if&nbsp;
you get zap, you'll automatically get burp suite.&nbsp;&nbsp;

00:47:39,260 --> 00:47:43,850
And you only need burp suite when you're moving&nbsp;
into an enterprise environment where you know,&nbsp;&nbsp;

00:47:43,850 --> 00:47:49,640
burpsuite is the recommended tool. And it is the&nbsp;
tool that you must use to adhere to certain rules&nbsp;&nbsp;

00:47:49,640 --> 00:47:54,680
and ethics. That being said zap is a fantastic&nbsp;
tool. It's absolutely free. As you can see the&nbsp;&nbsp;

00:47:54,680 --> 00:48:00,170
old w SP Zed attack proxy proxy, which is,&nbsp;
you know, abbreviated as zap is one of the&nbsp;&nbsp;

00:48:00,170 --> 00:48:04,670
world's most popular free security tools and is&nbsp;
actively maintained by hundreds of international&nbsp;&nbsp;

00:48:04,670 --> 00:48:09,320
volunteers, right. So it helps you find security&nbsp;
vulnerabilities in your web applications while&nbsp;&nbsp;

00:48:09,320 --> 00:48:13,700
you're developing and testing applications. So&nbsp;
again, if you're a web application developer,&nbsp;&nbsp;

00:48:13,700 --> 00:48:18,230
this is also a fantastic tool for you. And as I&nbsp;
said, it's going to be a fantastic alternative&nbsp;&nbsp;

00:48:18,230 --> 00:48:25,010
to do burp suite. All right now that's not&nbsp;
to say that burp is bad. burp is more of a&nbsp;&nbsp;

00:48:25,010 --> 00:48:30,890
enterprise an enterprise developed software.&nbsp;
As I've mentioned in the for the first video&nbsp;&nbsp;

00:48:30,890 --> 00:48:36,980
of this series, burp is focused on professionals.&nbsp;
Now that's not to say that zap isn't, but you'll&nbsp;&nbsp;

00:48:36,980 --> 00:48:42,140
get the idea. Alright, so I'm going to be making&nbsp;
a separate video on installing zap and I'm going&nbsp;&nbsp;

00:48:42,140 --> 00:48:46,610
to make a video on how to get accustomed to the&nbsp;
interface because it is slightly different. And&nbsp;&nbsp;

00:48:46,610 --> 00:48:53,420
the language or English used for the interface is&nbsp;
again very well obviously very different but it is&nbsp;&nbsp;

00:48:53,420 --> 00:48:58,190
quite different. So again, getting used to it was&nbsp;
also something that is quite helpful because we'll&nbsp;&nbsp;

00:48:58,190 --> 00:49:04,310
be needing some of the enterprise features and on&nbsp;
only a tool like zap will be a great alternative.&nbsp;&nbsp;

00:49:04,310 --> 00:49:09,650
However, if you do have burp suite Pro, go ahead,&nbsp;
it will it will just be the same thing. As I&nbsp;&nbsp;

00:49:09,650 --> 00:49:14,090
mentioned in the previous video, it's really&nbsp;
very easy to to follow up where we left. Okay,&nbsp;&nbsp;

00:49:14,090 --> 00:49:19,490
that being said, it runs on the same network&nbsp;
proxy, it runs on the localhost. So make sure&nbsp;&nbsp;

00:49:19,490 --> 00:49:24,800
you're running it on the localhost and on port&nbsp;
8080. I'll be showing you how to change the port&nbsp;&nbsp;

00:49:24,800 --> 00:49:30,950
if you so feel you want to. That's also another&nbsp;
great thing about us as AP is it allows you to&nbsp;&nbsp;

00:49:30,950 --> 00:49:36,410
change the proxies. So I have Mattila day opened&nbsp;
up here and it is again running on my Metasploit&nbsp;&nbsp;

00:49:36,410 --> 00:49:40,670
able to virtual machine and it's running&nbsp;
on the IP address my local IP address 190&nbsp;&nbsp;

00:49:40,670 --> 00:49:47,360
2.1 68 point 1.104 as you can see Mattila day.&nbsp;
Alright, so that's working perfectly. So let me&nbsp;&nbsp;

00:49:47,360 --> 00:49:53,810
just leave those other tabs open because again,&nbsp;
there's no there's no real harm. Okay, so, again,&nbsp;&nbsp;

00:49:53,810 --> 00:49:59,360
you can configure the material at a security level&nbsp;
if that's what you want, you know to do to make&nbsp;&nbsp;

00:49:59,360 --> 00:50:04,070
things harder. But I'm just going to be showing&nbsp;
you the focus of this video, which is how to find&nbsp;&nbsp;

00:50:04,070 --> 00:50:10,370
hidden files. Now, you might be asking, why do&nbsp;
we need to find hidden files? Or why do we need&nbsp;&nbsp;

00:50:10,370 --> 00:50:15,170
to discover these hidden files or hidden files?&nbsp;
Firstly, are the files like admin login pages,&nbsp;&nbsp;

00:50:15,170 --> 00:50:21,410
you know, maybe a robots dot txt, but that's not&nbsp;
really something that's hidden nowadays. It could&nbsp;&nbsp;

00:50:21,410 --> 00:50:27,410
be a txt containing maybe usernames, you know,&nbsp;
something really weird, or, you know, pardon&nbsp;&nbsp;

00:50:27,410 --> 00:50:33,260
my English or pardon my language, something dumb&nbsp;
that the web developers left behind, or, you know,&nbsp;&nbsp;

00:50:33,260 --> 00:50:38,570
just not configured correctly. And you'll see&nbsp;
what I mean in a few seconds. All right. So again,&nbsp;&nbsp;

00:50:38,570 --> 00:50:42,200
these are the files that are hidden, and&nbsp;
you will not find them after spidering,&nbsp;&nbsp;

00:50:42,200 --> 00:50:48,440
your web application or website. Alright, so let's&nbsp;
get started with zap. As you can see, I have the&nbsp;&nbsp;

00:50:48,440 --> 00:50:53,270
logo right here on my it's added to my favorites,&nbsp;
let me just launch it, give it a few seconds, and&nbsp;&nbsp;

00:50:53,270 --> 00:50:58,790
it should start up. There we are, the zap, give it&nbsp;
a few seconds again, and make sure you update it&nbsp;&nbsp;

00:50:58,790 --> 00:51:03,830
usually the updates for the modules very, very&nbsp;
regularly. So make sure you update them to the&nbsp;&nbsp;

00:51:03,830 --> 00:51:09,260
latest version, as they improve the speed and so&nbsp;
on and so forth. Alright, so it's going to prompt&nbsp;&nbsp;

00:51:09,260 --> 00:51:13,760
you here, do you want to persist the substation,&nbsp;
that means Do you want to save this app session,&nbsp;&nbsp;

00:51:13,760 --> 00:51:20,060
I don't, I do not want to persist the session at&nbsp;
this moment in time. So I'm going to start. Again,&nbsp;&nbsp;

00:51:20,060 --> 00:51:24,380
don't worry, if you're not familiar with the&nbsp;
interface, I'll be going through it in another&nbsp;&nbsp;

00:51:24,380 --> 00:51:29,720
video because it deserves Now you might be a&nbsp;
little bit overwhelmed. But do not worry, do&nbsp;&nbsp;

00:51:29,720 --> 00:51:34,880
not stop going to you know URLs to attack that may&nbsp;
seem really really tempting. But again, you know,&nbsp;&nbsp;

00:51:34,880 --> 00:51:41,330
let's take it nice and easy. So let's talk about&nbsp;
the proxy, how to change the proxies. So to do&nbsp;&nbsp;

00:51:41,330 --> 00:51:46,340
that, you can go into your cog right here, as&nbsp;
you can see, or you can go into tools and go&nbsp;&nbsp;

00:51:46,340 --> 00:51:52,370
into options. Alright, but I like going into this&nbsp;
little cog here. And once you press on, once you&nbsp;&nbsp;

00:51:52,370 --> 00:51:57,110
click on the cog, let me just enlarge that, you&nbsp;
will see that you have this huge menu. And again,&nbsp;&nbsp;

00:51:57,110 --> 00:52:04,640
as I said, zap is a really advanced tool, and in&nbsp;
some cases can totally replace burp suite. Now,&nbsp;&nbsp;

00:52:04,640 --> 00:52:09,620
looking at the proxies, you want to go for&nbsp;
the local proxies right here. It's obviously&nbsp;&nbsp;

00:52:09,620 --> 00:52:14,810
starting with L. So local proxies, and make&nbsp;
sure that the address is hosted on localhost.&nbsp;&nbsp;

00:52:14,810 --> 00:52:19,970
And you can change the port if you're using burp&nbsp;
suite and stuff, like you're just using both the&nbsp;&nbsp;

00:52:19,970 --> 00:52:25,010
applications at the same time, or you're running&nbsp;
something on localhost already. So you can change&nbsp;&nbsp;

00:52:25,010 --> 00:52:30,140
it to something like 8081, whatever you feel&nbsp;
is comfortable for you. Okay, so that's how to&nbsp;&nbsp;

00:52:30,140 --> 00:52:35,810
change your proxies. And if you're running the&nbsp;
ad net, you can also go check this and that you&nbsp;&nbsp;

00:52:35,810 --> 00:52:41,510
should be good there, if you don't find that the&nbsp;
proxy is working. So just hit OK. Alright, now,&nbsp;&nbsp;

00:52:41,510 --> 00:52:46,970
you see that there is no draya We are not going to&nbsp;
be looking at intercepting right now, but we will&nbsp;&nbsp;

00:52:46,970 --> 00:52:52,310
be looking at that in a few in probably the next&nbsp;
videos, the advanced videos with SAP. Alright,&nbsp;&nbsp;

00:52:52,310 --> 00:52:57,260
so let me just reload the material a page. And&nbsp;
as you can see, I'm running the proxy. So I'm&nbsp;&nbsp;

00:52:57,260 --> 00:53:02,570
just going to reload the page. And as you can&nbsp;
see, we are not intercepting actively. So Whoa,&nbsp;&nbsp;

00:53:02,570 --> 00:53:08,180
what's this? Well, we got some files here. Let me&nbsp;
just reload the page one more time. And there we&nbsp;&nbsp;

00:53:08,180 --> 00:53:14,930
are, we are getting some results. So we get the IP&nbsp;
190 2.1 68 point 1.14. That's the server and if we&nbsp;&nbsp;

00:53:14,930 --> 00:53:21,350
just click on this drop down here, we get request.&nbsp;
So you can analyze the get request. If that's what&nbsp;&nbsp;

00:53:21,350 --> 00:53:26,540
you want, you can right click, and then analyze.&nbsp;
All right now will we not be looking at that right&nbsp;&nbsp;

00:53:26,540 --> 00:53:31,790
now because I want to focus on finding the or&nbsp;
discovering the hidden files. So what we'll do&nbsp;&nbsp;

00:53:31,790 --> 00:53:36,920
is we want to click on the utility folder. Now one&nbsp;
of the great things I like about zap is it already&nbsp;&nbsp;

00:53:36,920 --> 00:53:41,810
gives you the file structure or the website&nbsp;
structure immediately here. Alright, so again,&nbsp;&nbsp;

00:53:41,810 --> 00:53:47,360
so you have your images folder, which has it,&nbsp;
the images there, you have JavaScript styles,&nbsp;&nbsp;

00:53:47,360 --> 00:53:54,140
and your all the resources in regards to the&nbsp;
website that it could find naturally. Alright.&nbsp;&nbsp;

00:53:54,140 --> 00:54:01,910
So if we, if we just look at the bottom here, you&nbsp;
can see that it it's showing you a timestamp with&nbsp;&nbsp;

00:54:01,910 --> 00:54:07,400
the method that the URL, and it gives you the&nbsp;
the code which means the pages in this case,&nbsp;&nbsp;

00:54:07,400 --> 00:54:14,510
the 200 code means the page was found, you have&nbsp;
the reason you have the RTT, the size, the alert,&nbsp;&nbsp;

00:54:14,510 --> 00:54:18,080
as you can see, it's telling us we have a high&nbsp;
alert here. Now don't worry about that. Again,&nbsp;&nbsp;

00:54:18,080 --> 00:54:23,180
these are things that you know will be will&nbsp;
really be tempting, but again, let's take it slow.&nbsp;&nbsp;

00:54:23,180 --> 00:54:28,220
Alright, so the first thing you want to do or you&nbsp;
need to do is to right click here, and you want to&nbsp;&nbsp;

00:54:28,220 --> 00:54:33,800
go to attack and hit spider. Alright, so we want&nbsp;
to spider the website or the web application and&nbsp;&nbsp;

00:54:33,800 --> 00:54:39,530
start scan Do not touch anything here. Just make&nbsp;
sure it's using the appropriate server address&nbsp;&nbsp;

00:54:39,530 --> 00:54:43,940
and just hit scan. Right now it's going to spider&nbsp;
the entire web application and it's going to give&nbsp;&nbsp;

00:54:43,940 --> 00:54:48,710
you a little progress bar here. You can pause&nbsp;
it or stop it which is also great to see at the&nbsp;&nbsp;

00:54:48,710 --> 00:54:52,760
bottom you should have also noticed that you have&nbsp;
your tabs here that work really really well. And&nbsp;&nbsp;

00:54:52,760 --> 00:55:00,410
as you can see the the website now is completely&nbsp;
spidered. And if we just check all the files that&nbsp;&nbsp;

00:55:00,410 --> 00:55:05,720
we can find now you can see that we have some more&nbsp;
JavaScript files. And essentially what's happened&nbsp;&nbsp;

00:55:05,720 --> 00:55:12,170
here is the entire site has been, has been&nbsp;
spidered. Okay, now we already did this with burp.&nbsp;&nbsp;

00:55:12,170 --> 00:55:16,640
And the you know, you've you're probably really&nbsp;
bored of this right now. So what we're going to do&nbsp;&nbsp;

00:55:16,640 --> 00:55:22,010
now is we need to, we need to start discovering&nbsp;
the hidden content, right. So let me just close&nbsp;&nbsp;

00:55:22,010 --> 00:55:27,320
all of this up. There we are. Fantastic. Now,&nbsp;
let me just open that up. And let's go to Mattel&nbsp;&nbsp;

00:55:27,320 --> 00:55:33,110
today. Oops, my bad Sorry about that, guys.&nbsp;
And we want to right click on Mattila day,&nbsp;&nbsp;

00:55:33,110 --> 00:55:39,860
and you want to go to attack and you want to go&nbsp;
to first browse directory and children that's very&nbsp;&nbsp;

00:55:39,860 --> 00:55:44,390
important. First browse directory will not display&nbsp;
everything, we'll also be looking at fuzzing,&nbsp;&nbsp;

00:55:44,390 --> 00:55:49,040
but that's for later. Alright, so you want to make&nbsp;
sure you hit forced browse directory, just click&nbsp;&nbsp;

00:55:49,040 --> 00:55:53,420
on that. And it's going to open up this tab here.&nbsp;
So you can see we are despite the tab open, which&nbsp;&nbsp;

00:55:53,420 --> 00:55:57,980
you can close read if you're not using it, which&nbsp;
is also great. I really like the management of&nbsp;&nbsp;

00:55:57,980 --> 00:56:03,590
zap, you then have output for your outputs alerts.&nbsp;
As you can see, you have some alerts here that&nbsp;&nbsp;

00:56:03,590 --> 00:56:08,120
will alert you on some potential vulnerabilities.&nbsp;
So for example, APPLICATION ERROR, disclose,&nbsp;&nbsp;

00:56:08,120 --> 00:56:14,570
you have some cookies, a noise GTP flag. So again,&nbsp;
awesome stuff there. We have to get requests,&nbsp;&nbsp;

00:56:14,570 --> 00:56:20,630
all that good stuff, which is again focused on a&nbsp;
different type of attack. And as you can see, by&nbsp;&nbsp;

00:56:20,630 --> 00:56:26,750
default, we've got the robots. txt here, which you&nbsp;
can analyze if you want to, by clicking and going&nbsp;&nbsp;

00:56:26,750 --> 00:56:33,020
ahead and doing that. So you can copy the URL to&nbsp;
the browser. So again, copy the URL to clipboard,&nbsp;&nbsp;

00:56:33,020 --> 00:56:38,360
alright, and if we just try and explore this,&nbsp;
let me just paste and go here. As you can see,&nbsp;&nbsp;

00:56:38,360 --> 00:56:44,750
we're for some reason, we're not actually getting&nbsp;
robots to txt. Let me use the motility date. Till&nbsp;&nbsp;

00:56:44,750 --> 00:56:50,690
today, or actually, you know what, let's not do&nbsp;
that right now, because I really want to stay&nbsp;&nbsp;

00:56:50,690 --> 00:56:55,460
on topic here. So I'm just gonna go back into&nbsp;
that. Again, I always love going off topic,&nbsp;&nbsp;

00:56:55,460 --> 00:57:01,070
fourth topic for some reason. Okay, so make sure&nbsp;
you click on motility and you want to right click&nbsp;&nbsp;

00:57:01,070 --> 00:57:07,010
on it. And now Oh, sorry, we already did the&nbsp;
first browser, right click, go to attack and&nbsp;&nbsp;

00:57:07,010 --> 00:57:12,110
first browse, directory and children. Alright,&nbsp;
now it's going to open up this tab here. And&nbsp;&nbsp;

00:57:12,110 --> 00:57:17,360
it's going to, it's going to make you choose the&nbsp;
site. As you can see, you have your site IP here.&nbsp;&nbsp;

00:57:17,360 --> 00:57:21,260
Now you need to select the default directory&nbsp;
list to it's going to use this list here, this&nbsp;&nbsp;

00:57:21,260 --> 00:57:27,470
default list that comes already with zap. And now&nbsp;
it's going to try and use it in a sort of a brute&nbsp;&nbsp;

00:57:27,470 --> 00:57:32,480
force way to try and detect the hidden files and&nbsp;
folders. And once it gets the result, it's going&nbsp;&nbsp;

00:57:32,480 --> 00:57:37,520
to enumerate them. Okay, so now you want to right&nbsp;
click again on it, after you've selected the list&nbsp;&nbsp;

00:57:37,520 --> 00:57:42,170
and hit attack. And you want to go to force browse&nbsp;
directory and children. And once you hit that,&nbsp;&nbsp;

00:57:42,170 --> 00:57:46,760
it's going to start the process. Now again, this&nbsp;
is going to take a long, while not a long time,&nbsp;&nbsp;

00:57:46,760 --> 00:57:51,410
depending on this the size of the website,&nbsp;
if the site is huge, then again, it's gonna&nbsp;&nbsp;

00:57:51,410 --> 00:57:57,110
take a while. And as you can see, immediately&nbsp;
we're getting some submitted files. So let's,&nbsp;&nbsp;

00:57:57,110 --> 00:58:02,960
let's wait for this call to complete. And I know&nbsp;
motility has some very, very interesting files&nbsp;&nbsp;

00:58:02,960 --> 00:58:08,810
here that I'm sure will be happy to get. Alright,&nbsp;
so just let it go through this. As you can see,&nbsp;&nbsp;

00:58:08,810 --> 00:58:15,410
you can check the progress as you're going here.&nbsp;
And again, the the if you look at the status code,&nbsp;&nbsp;

00:58:15,410 --> 00:58:20,240
you can see 200 means the pages were found. So&nbsp;
you can just go ahead and look for things that&nbsp;&nbsp;

00:58:20,240 --> 00:58:25,370
are irregular. And I'm sure we can find something&nbsp;
here that we haven't found before. Or you can&nbsp;&nbsp;

00:58:25,370 --> 00:58:35,120
look at the at the file form the website directory&nbsp;
here. So um, Mattila day, let's see if we can find&nbsp;&nbsp;

00:58:35,120 --> 00:58:39,350
something that is really, really interesting year.&nbsp;
So we have the includes we have the get index of&nbsp;&nbsp;

00:58:39,350 --> 00:58:43,940
PHP, we get regressed, sorry for the index dot&nbsp;
o we have something interesting here we have a&nbsp;&nbsp;

00:58:43,940 --> 00:58:50,840
notes folder. Aha, now we're talking now this&nbsp;
is where stuff gets really exciting. Alright,&nbsp;&nbsp;

00:58:50,840 --> 00:58:56,840
so we have whoops, where'd it go? There we are.&nbsp;
So in notes, we have some very interesting files&nbsp;&nbsp;

00:58:56,840 --> 00:59:02,990
in notes. So we have a get passwords. Now&nbsp;
what happens? What's this about? Alright,&nbsp;&nbsp;

00:59:02,990 --> 00:59:08,240
so what if what what if we just open this URL&nbsp;
in the browser? Alright, so let me just try and&nbsp;&nbsp;

00:59:08,240 --> 00:59:12,530
open that in Firefox, I just want to see what&nbsp;
it's going to be all about. So hopefully, it's&nbsp;&nbsp;

00:59:12,530 --> 00:59:18,440
opened up in my browser. If it's not, I'll have to&nbsp;
copy the URL, probably because I haven't set any,&nbsp;&nbsp;

00:59:18,440 --> 00:59:26,120
any default. Alright, so copy URLs to clipboard.&nbsp;
And let me just paste that in there, paste and go.&nbsp;&nbsp;

00:59:26,120 --> 00:59:31,340
There we are Mattila day and passwords. Alright,&nbsp;
so you can see that this folder or this file was&nbsp;&nbsp;

00:59:31,340 --> 00:59:38,150
hidden. And we have an interesting txt file here,&nbsp;
which again is quite scary to go we did open&nbsp;&nbsp;

00:59:38,150 --> 00:59:44,090
Firefox. Well, don't doesn't look like we need&nbsp;
that instance. So getting back to the topic here,&nbsp;&nbsp;

00:59:44,090 --> 00:59:50,360
for some reason, process unexpectedly closed&nbsp;
with. Alright, so that looks like we have a&nbsp;&nbsp;

00:59:50,360 --> 00:59:58,680
Java error there. So let me just go back in over&nbsp;
here. So again, we found an accounts dot txt file,&nbsp;&nbsp;

00:59:58,680 --> 01:00:05,940
what could that be? be caring. Let's click on&nbsp;
that. Oh boy. So again, we have accounts here.&nbsp;&nbsp;

01:00:05,940 --> 01:00:12,570
And well, I'm pretty sure you will know what this&nbsp;
means. This is just bad practice from the website&nbsp;&nbsp;

01:00:12,570 --> 01:00:17,100
developer, where he wrote notes. And essentially,&nbsp;
these are the accounts. Now let's see what else we&nbsp;&nbsp;

01:00:17,100 --> 01:00:22,980
can find. Let's see accounts. Nothing interesting&nbsp;
in accounts, because we now have the account. So&nbsp;&nbsp;

01:00:22,980 --> 01:00:28,530
that makes our brute force much easier. You then&nbsp;
have, let's see if we can find any passwords if&nbsp;&nbsp;

01:00:28,530 --> 01:00:33,960
they were ever saved here. I'm pretty sure they&nbsp;
are not. But we can also look for some interesting&nbsp;&nbsp;

01:00:33,960 --> 01:00:39,120
files here. That can be really interesting. Or you&nbsp;
can look at the sitemap if you want to. So let's&nbsp;&nbsp;

01:00:39,120 --> 01:00:43,680
also copy that. Let's see if it gives us access to&nbsp;
the sitemap also very, very important stuff there.&nbsp;&nbsp;

01:00:43,680 --> 01:00:50,520
Oh, yeah, so the sitemap, for some reason, we were&nbsp;
not able to process it. Alright, let's look for&nbsp;&nbsp;

01:00:50,520 --> 01:00:59,010
some other files here. Let me just open up Mattila&nbsp;
day again. So we have the get images. Let's see if&nbsp;&nbsp;

01:00:59,010 --> 01:01:04,170
we run the get images. Let's see what images we&nbsp;
can get. Again, I'm going pretty amateurish on&nbsp;&nbsp;

01:01:04,170 --> 01:01:07,470
this. I'm just clicking on everything. But I'm&nbsp;
just trying to show you the amount of files that&nbsp;&nbsp;

01:01:07,470 --> 01:01:12,930
you can find, as you can see, immediately, you&nbsp;
can find that the refresh button, you know all&nbsp;&nbsp;

01:01:12,930 --> 01:01:18,960
the icons related to the website. You have the&nbsp;
I hack banner. Oh, yeah, hackers for charity,&nbsp;&nbsp;

01:01:18,960 --> 01:01:26,670
man. So I'm talking about YouTube. Oh my god, what&nbsp;
an old logo that is the older BSP logo. Pretty&nbsp;&nbsp;

01:01:26,670 --> 01:01:32,010
cool. Pretty cool. And yeah, so you get the idea.&nbsp;
So this is how you actually go through website&nbsp;&nbsp;

01:01:32,010 --> 01:01:38,130
and find files that could contain you know, stuff&nbsp;
that is quite interesting, to be honest. So let's&nbsp;&nbsp;

01:01:38,130 --> 01:01:43,080
see what else we can find. I'm just going to go&nbsp;
to one more resource here that we've found, oh,&nbsp;&nbsp;

01:01:43,080 --> 01:01:49,200
we have to get register out. Now. That's what I'm&nbsp;
talking about copy URL to clipboard. It's actually&nbsp;&nbsp;

01:01:49,200 --> 01:01:54,150
it's actually quite fun. This why bug bounty&nbsp;
hunting is? Oh, yeah. Now this is what I'm told&nbsp;&nbsp;

01:01:54,150 --> 01:02:00,690
we can actually register. We can actually register&nbsp;
ourselves on the website. Now again, looking at&nbsp;&nbsp;

01:02:00,690 --> 01:02:07,030
the website from here, it doesn't look like we&nbsp;
can. Can we even register on this website? Not&nbsp;&nbsp;

01:02:07,030 --> 01:02:12,010
sure we can. For some reason, it's not actually&nbsp;
letting me scroll to the top. But hey, I don't&nbsp;&nbsp;

01:02:12,010 --> 01:02:16,720
really know what's going on there. So let's see&nbsp;
if we, yeah, we can definitely log in render and&nbsp;&nbsp;

01:02:16,720 --> 01:02:22,630
register. Sorry about that. We can register there.&nbsp;
So yes, it is the register. It does exist. So that&nbsp;&nbsp;

01:02:22,630 --> 01:02:29,890
wasn't actually hidden. But it was hidden. It was&nbsp;
hidden to the women when we spidered the website.&nbsp;&nbsp;

01:02:29,890 --> 01:02:34,630
So that means indeed, it was hidden, for obvious&nbsp;
reasons. Because the brute force for example,&nbsp;&nbsp;

01:02:34,630 --> 01:02:39,880
if you find the login, which is again here,&nbsp;
and again, if this is hidden, you can imagine&nbsp;&nbsp;

01:02:39,880 --> 01:02:47,440
the the damage that you can do so again, you can&nbsp;
log in from there. Set up database, whoo. Now,&nbsp;&nbsp;

01:02:47,440 --> 01:02:52,930
that's interesting. For some reason, it's not&nbsp;
letting me copy. Alright, so looks like we got&nbsp;&nbsp;

01:02:52,930 --> 01:03:00,790
set up database here. So yeah, we can Okay, I&nbsp;
do not want to manually edit the request. No,&nbsp;&nbsp;

01:03:00,790 --> 01:03:06,670
I do not want to manually edit the request. For&nbsp;
some reason my keyboard is being pressed here.&nbsp;&nbsp;

01:03:06,670 --> 01:03:12,280
While that's we admin, copy heroes to clipboard.&nbsp;
All right, sorry about that my spacebar was being&nbsp;&nbsp;

01:03:12,280 --> 01:03:19,480
mashed on by my tablet in front of me. Right.&nbsp;
So let me just there we are on. So no PHP MySQL&nbsp;&nbsp;

01:03:19,480 --> 01:03:24,220
errors, were resetting. So essentially reset the&nbsp;
database, and you can see the damage that this can&nbsp;&nbsp;

01:03:24,220 --> 01:03:29,740
do. So again, that is some good stuff that you can&nbsp;
have fun with, when especially with Mattila day,&nbsp;&nbsp;

01:03:29,740 --> 01:03:35,650
you can increase the security and find what other&nbsp;
files you can, you can find, you know, with zap,&nbsp;&nbsp;

01:03:35,650 --> 01:03:41,680
again, zap is a fantastic alternative that you can&nbsp;
use. If you know if you're not ready to invest in&nbsp;&nbsp;

01:03:41,680 --> 01:03:48,280
burp suite, that's totally fine. I used zap for&nbsp;
I think about three years, especially since 2014.&nbsp;&nbsp;

01:03:48,280 --> 01:03:55,060
I think I used it in till about I think 2016 or&nbsp;
17. I'm not too sure. And it worked great for me,&nbsp;&nbsp;

01:03:55,060 --> 01:04:00,280
I really enjoyed it. And I'm just getting back to&nbsp;
I'm just remembering all the tools used to work,&nbsp;&nbsp;

01:04:00,280 --> 01:04:04,928
it was actually quite a user intuitive&nbsp;
interface. Because I just remember right&nbsp;&nbsp;

01:04:04,928 --> 01:04:09,310
clicking means you can copy the URL, you&nbsp;
can inspect it, you can change the request,&nbsp;&nbsp;

01:04:09,310 --> 01:04:13,950
you can attack all that good stuff. And you know,&nbsp;
it's sorted out really, really well. Alright,&nbsp;&nbsp;

01:04:13,950 --> 01:04:17,430
and you can look at the requests here,&nbsp;
you can change them to whatever you want,&nbsp;&nbsp;

01:04:17,430 --> 01:04:23,640
and then send them you can intercept them. So&nbsp;
it essentially does whatever but a suite does.&nbsp;&nbsp;

01:04:27,730 --> 01:04:32,720
We're going to be looking at web application&nbsp;
firewalls, or waafs, as they're called. Now,&nbsp;&nbsp;

01:04:32,720 --> 01:04:38,570
this may be a new term for you and do not worry.&nbsp;
This is now when we move into a more professional&nbsp;&nbsp;

01:04:38,570 --> 01:04:44,420
level. And again, this is what I've been talking&nbsp;
about is most people out there or most documented&nbsp;&nbsp;

01:04:44,420 --> 01:04:49,880
documentation out there won't cover the most&nbsp;
important industry standards. You know, now when&nbsp;&nbsp;

01:04:49,880 --> 01:04:57,260
I'm talking about web application firewalls, what&nbsp;
I mean is, is these are the protection or these&nbsp;&nbsp;

01:04:57,260 --> 01:05:04,400
are the mitigation procedures. put in place to&nbsp;
protect a web application from attacks, obviously&nbsp;&nbsp;

01:05:04,400 --> 01:05:08,930
now as a penetration tester, or if you're&nbsp;
looking at it from a white hat, or a black hat&nbsp;&nbsp;

01:05:08,930 --> 01:05:13,400
perspective, from wider perspective, it's always&nbsp;
important to have a web application firewall. And&nbsp;&nbsp;

01:05:13,400 --> 01:05:16,970
I'll probably make another video showing you how&nbsp;
to set it up, it's really easy, and it's free,&nbsp;&nbsp;

01:05:16,970 --> 01:05:22,100
and it will probably removed about 20% of attacks.&nbsp;
Okay, so that's if you're a white hat. Now,&nbsp;&nbsp;

01:05:22,100 --> 01:05:27,020
if you're a black hat, and you're targeting, or&nbsp;
you're performing a penetration test legally on&nbsp;&nbsp;

01:05:27,020 --> 01:05:32,720
a website or web application, we usually what&nbsp;
the employer will tell you is they'll give you&nbsp;&nbsp;

01:05:32,720 --> 01:05:38,060
a scope of the project. And again, they might give&nbsp;
you the source code, etc, etc, you get the idea,&nbsp;&nbsp;

01:05:38,060 --> 01:05:43,730
you have your white box, testing, black box&nbsp;
and gray box. But coming back to the firewall,&nbsp;&nbsp;

01:05:43,730 --> 01:05:48,470
most of them will know that there is a firewall.&nbsp;
And that's because the person who set the website&nbsp;&nbsp;

01:05:48,470 --> 01:05:53,420
up for them in terms of hosting, or the web&nbsp;
application for them, will in most cases,&nbsp;&nbsp;

01:05:53,420 --> 01:05:58,760
on a professional level, have a web application&nbsp;
firewall. Now you might be a bit confused. And&nbsp;&nbsp;

01:05:58,760 --> 01:06:02,960
you might be saying, Well, why is this important&nbsp;
when performing a penetration test? Well, this&nbsp;&nbsp;

01:06:02,960 --> 01:06:08,060
is important because firstly, it's something that&nbsp;
most pen testers overlook. And if you know this,&nbsp;&nbsp;

01:06:08,060 --> 01:06:13,310
you've got an ace up your sleeve. Alright, so&nbsp;
essentially, what's happening is if it's being&nbsp;&nbsp;

01:06:13,310 --> 01:06:19,010
used, if a web application firewall is being&nbsp;
used, you obviously first need to detect it.&nbsp;&nbsp;

01:06:19,010 --> 01:06:23,090
And I'm going to show you how to detect it in&nbsp;
this video using a special tool that I don't&nbsp;&nbsp;

01:06:23,090 --> 01:06:28,100
think you've ever heard of. But it's also industry&nbsp;
standard. So this is a real secret, I don't know,&nbsp;&nbsp;

01:06:28,100 --> 01:06:33,290
for some reason, it's not just, it's something&nbsp;
that just hasn't caught up yet. But hopefully,&nbsp;&nbsp;

01:06:33,290 --> 01:06:38,180
after this video, you'll know about it. Alright,&nbsp;
so essentially, the purpose of a web application&nbsp;&nbsp;

01:06:38,180 --> 01:06:44,880
firewall is it protects the web application, you&nbsp;
know, from a firewall point of view in the sense&nbsp;&nbsp;

01:06:44,880 --> 01:06:51,120
that it blocks attacks, as one would expect them&nbsp;
to come. Now what does this mean for you? Well,&nbsp;&nbsp;

01:06:51,120 --> 01:06:57,690
this means that you will need to, you will&nbsp;
need to manipulate any type of data that is&nbsp;&nbsp;

01:06:57,690 --> 01:07:02,340
going to be encoded, alright. So what this&nbsp;
means is, if you're, if you're performing a&nbsp;&nbsp;

01:07:02,340 --> 01:07:06,630
penetration test that involves you manipulating&nbsp;
data and sending it back to the web application,&nbsp;&nbsp;

01:07:06,630 --> 01:07:12,870
then you need to encode it in a specific way to&nbsp;
bypass the firewall. Otherwise, it will be blocked&nbsp;&nbsp;

01:07:12,870 --> 01:07:17,490
by the firewall. And I'm sure most of you have&nbsp;
actually done this before. If you're just amateur&nbsp;&nbsp;

01:07:17,490 --> 01:07:22,140
penetration testers, and you've just begun, you'll&nbsp;
find that for some reason, your requests aren't&nbsp;&nbsp;

01:07:22,140 --> 01:07:27,660
being processed. And that's because they've, there&nbsp;
is a firewall set up to prevent these malicious&nbsp;&nbsp;

01:07:27,660 --> 01:07:32,910
requests from being processed. Okay, so again, web&nbsp;
application firewall is really, really important.&nbsp;&nbsp;

01:07:32,910 --> 01:07:38,790
Now, looking at the tool we'll be using, the tool&nbsp;
has actually a very, very funny name you for some&nbsp;&nbsp;

01:07:38,790 --> 01:07:43,530
of you might find it hilarious, it is called wolf&nbsp;
wolf. Now for those of you who have heard of it,&nbsp;&nbsp;

01:07:43,530 --> 01:07:48,900
you pretty much already know how to detect a web&nbsp;
application firewall, but it's really very, very&nbsp;&nbsp;

01:07:48,900 --> 01:07:54,720
simple. Alright, so just open up your terminal.&nbsp;
And what you want to do is you want to type in&nbsp;&nbsp;

01:07:54,720 --> 01:08:01,710
wolf wolf. Alright, so this is how it is going&nbsp;
to be spelt. So it's worth Wolf with a tooth with&nbsp;&nbsp;

01:08:01,710 --> 01:08:07,500
two zeros. And the syntax is pretty simple. If I&nbsp;
just hit enter, as you can see, we're forth a web&nbsp;&nbsp;

01:08:07,500 --> 01:08:12,570
application firewall detection tool. Alright, so&nbsp;
credit go to the author, it's actually it's a tool&nbsp;&nbsp;

01:08:12,570 --> 01:08:17,970
that's been there since the, I think almost the&nbsp;
last version of backtrack and the first version&nbsp;&nbsp;

01:08:17,970 --> 01:08:23,430
of Kali. So again, quite an old tool, I when I say&nbsp;
old, I mean, you know, I mean that with respect,&nbsp;&nbsp;

01:08:23,430 --> 01:08:28,770
given the fact that it's a really, really useful&nbsp;
and I've used it a lot because it saves you a lot&nbsp;&nbsp;

01:08:28,770 --> 01:08:36,540
of time. And what I'm talking about is, so let's&nbsp;
say we want to scan a website, okay. In this case,&nbsp;&nbsp;

01:08:36,540 --> 01:08:41,880
I have my WordPress server running here. And as&nbsp;
you can see, it's the site is being hosted on&nbsp;&nbsp;

01:08:41,880 --> 01:08:48,810
190 2.1 68 point 1.11. Alright, so I have that IP&nbsp;
opened up in my browser. And as you can see, it's&nbsp;&nbsp;

01:08:48,810 --> 01:08:52,380
a WordPress site. And this site is vulnerable.&nbsp;
And this is what we're going to be performing&nbsp;&nbsp;

01:08:52,380 --> 01:08:59,020
later on the penetration tests on. But for now, we&nbsp;
want to find out whether it has a firewall. Now by&nbsp;&nbsp;

01:08:59,020 --> 01:09:03,880
default, I know it doesn't have a firewall. But&nbsp;
let's see what we're for Fidelis, alright, so the&nbsp;&nbsp;

01:09:03,880 --> 01:09:08,680
syntax is very simple. As you can see, you just&nbsp;
type in wolf Wolf, and you enter your URL or your&nbsp;&nbsp;

01:09:08,680 --> 01:09:13,870
URL, so you can enter as many as you like. Okay,&nbsp;
so I'll give you an example of how to go about it,&nbsp;&nbsp;

01:09:13,870 --> 01:09:21,490
make sure you enter your HTTP or HTTPS protocol.&nbsp;
And we just, let's try that out. So Wolf, Wolf,&nbsp;&nbsp;

01:09:21,490 --> 01:09:29,560
and we specify our protocol HTTP in this case, and&nbsp;
the IP address 190 2.1 68 point 1.11. All right,&nbsp;&nbsp;

01:09:29,560 --> 01:09:34,570
now in this case, I'm pretty sure that it&nbsp;
won't detect any web application firewall.&nbsp;&nbsp;

01:09:34,570 --> 01:09:40,150
So let me just hit Enter. And as you can see,&nbsp;
no web application firewall detected by the&nbsp;&nbsp;

01:09:40,150 --> 01:09:44,920
generic detection. Alright, now this is very,&nbsp;
very advanced. And this tool is an industry&nbsp;&nbsp;

01:09:44,920 --> 01:09:49,960
standard. And if it does tell you that there is&nbsp;
no web application firewall, then by all means,&nbsp;&nbsp;

01:09:49,960 --> 01:09:55,720
I can guarantee that it will it does not have&nbsp;
a firewall. Now let's look at one of my sites&nbsp;&nbsp;

01:09:55,720 --> 01:10:02,950
that I currently own. It's a site that I use. It's&nbsp;
actually My web development company that obviously&nbsp;&nbsp;

01:10:02,950 --> 01:10:08,800
we use for web development now I've predicted this&nbsp;
site with a web application firewall provided by&nbsp;&nbsp;

01:10:08,800 --> 01:10:12,640
CloudFlare. Now, for those of you who are web&nbsp;
developers, and when you're performing your&nbsp;&nbsp;

01:10:12,640 --> 01:10:16,870
hosting, you know that using CloudFlare is awesome&nbsp;
because it allows you to optimize your site for&nbsp;&nbsp;

01:10:16,870 --> 01:10:22,900
speed. It allows you to purchase assets and make&nbsp;
your site faster, protected, and again, protected&nbsp;&nbsp;

01:10:22,900 --> 01:10:29,110
from DDoS attacks, etc, etc, all the good stuff.&nbsp;
So let's see if it will actually detect this. So&nbsp;&nbsp;

01:10:29,110 --> 01:10:35,170
I'm going to type in wolf wolf. I know that name&nbsp;
is really, really funny. The protocol is HTTPS,&nbsp;&nbsp;

01:10:35,170 --> 01:10:43,000
https like so and I'm going to specify the&nbsp;
site which is Elgon studios.com. Alright,&nbsp;&nbsp;

01:10:43,000 --> 01:10:48,280
Elgon studios.com. And if I enter, as you can&nbsp;
see, it's going to start checking the site, give&nbsp;&nbsp;

01:10:48,280 --> 01:10:53,740
it a few seconds, it shouldn't take any much. You&nbsp;
know, a lot of time, and as you can see the site,&nbsp;&nbsp;

01:10:53,740 --> 01:11:00,970
Elgon studios.com is behind CloudFlare. Right now,&nbsp;
what this means is that most of the most of the&nbsp;&nbsp;

01:11:00,970 --> 01:11:07,360
attacks that involve manipulation of data will&nbsp;
be in some way blocked. And you know, you won't&nbsp;&nbsp;

01:11:07,360 --> 01:11:12,530
get your response back the way you wanted it. And&nbsp;
the render wouldn't be the same. Right now. Again,&nbsp;&nbsp;

01:11:12,530 --> 01:11:16,550
as you can see, it detected that it is behind&nbsp;
a web application firewall. Now the next step&nbsp;&nbsp;

01:11:16,550 --> 01:11:23,570
is how to encode these, how to encode encode your&nbsp;
your requests that you're going to be sending to&nbsp;&nbsp;

01:11:23,570 --> 01:11:27,890
the web application. And that's what we'll be&nbsp;
looking at as we increase the security level,&nbsp;&nbsp;

01:11:27,890 --> 01:11:32,600
using the the dam vulnerable web application.&nbsp;
Alright, so I thought, this is something that&nbsp;&nbsp;

01:11:32,600 --> 01:11:37,160
I really need to share with you, again, it's&nbsp;
going to really help you. And I promise you, this&nbsp;&nbsp;

01:11:37,160 --> 01:11:41,930
is something that, you know, if you go for a job&nbsp;
interview, or you're performing a penetration test&nbsp;&nbsp;

01:11:41,930 --> 01:11:46,940
for a company, this is something that most of the&nbsp;
network or systems administrators are very keen&nbsp;&nbsp;

01:11:46,940 --> 01:11:51,890
on, they want to know whether you really know your&nbsp;
stuff, and whether you're really up to date with&nbsp;&nbsp;

01:11:51,890 --> 01:11:56,870
how to detect, first of all, because information&nbsp;
gathering is really important. And as you can see,&nbsp;&nbsp;

01:11:56,870 --> 01:12:01,640
this tool is fantastic. And once you know there's&nbsp;
a firewall, you then have a better idea of how to&nbsp;&nbsp;

01:12:01,640 --> 01:12:05,780
target and you won't be wasting time. Again,&nbsp;
that's something that most of the amateurs or&nbsp;&nbsp;

01:12:05,780 --> 01:12:11,270
beginners do. They waste a lot of time trying&nbsp;
different commands that they've seen, but they&nbsp;&nbsp;

01:12:11,270 --> 01:12:15,740
find the date and they see that it doesn't work.&nbsp;
And they're like, how is this possible? Am I doing&nbsp;&nbsp;

01:12:15,740 --> 01:12:22,340
something wrong? The truth is, the web application&nbsp;
is probably well protected. So again, you know,&nbsp;&nbsp;

01:12:22,340 --> 01:12:26,960
do not use this for any malicious purposes. Again,&nbsp;
this is simply an information gathering tool.&nbsp;&nbsp;

01:12:30,960 --> 01:12:36,600
I'm going to be showing you how to use der Buster&nbsp;
to discover directories and files on a website or&nbsp;&nbsp;

01:12:36,600 --> 01:12:41,940
a web application. You might be asking yourself,&nbsp;
what is der Buster? Or if you haven't heard of&nbsp;&nbsp;

01:12:41,940 --> 01:12:47,970
der buster, let me explain it to you. Alright,&nbsp;
so the airburst is essentially a tool that was&nbsp;&nbsp;

01:12:47,970 --> 01:12:54,090
developed by OS, the open web application security&nbsp;
project, and essentially uses a brute forcing to&nbsp;&nbsp;

01:12:54,090 --> 01:12:59,220
find commonly used directories and file names&nbsp;
on servers. Alright, so this tool is extremely&nbsp;&nbsp;

01:12:59,220 --> 01:13:03,810
useful for those of you who are doing CTF, for&nbsp;
those of you who are bug bounty hunters, because&nbsp;&nbsp;

01:13:03,810 --> 01:13:10,590
essentially, it allows you to understand the&nbsp;
structure of a web web application or a website in&nbsp;&nbsp;

01:13:10,590 --> 01:13:15,630
terms of the files and directories and how they're&nbsp;
structured. Alright, so why is this important?&nbsp;&nbsp;

01:13:15,630 --> 01:13:21,840
Well, this is important because this will help us&nbsp;
understand how we can attack a site or what type&nbsp;&nbsp;

01:13:21,840 --> 01:13:26,820
of attack vectors we can, we can we can find, you&nbsp;
know, so for example, if I the web application,&nbsp;&nbsp;

01:13:26,820 --> 01:13:31,920
and I'm going to demonstrate that right now, and&nbsp;
I scanned it with the bust, and we found some&nbsp;&nbsp;

01:13:31,920 --> 01:13:37,560
hidden directories and hidden files, we can use&nbsp;
these as attack vectors. Alright, so as I said,&nbsp;&nbsp;

01:13:37,560 --> 01:13:43,410
it also allows you to find hidden directories or&nbsp;
files that are hidden from the public. So this&nbsp;&nbsp;

01:13:43,410 --> 01:13:48,510
can also lead you to, to finding additional&nbsp;
resources that could have been hidden away&nbsp;&nbsp;

01:13:48,510 --> 01:13:55,230
by the devs that like for example, admin pages,&nbsp;
etc, etc. Alright, so how does it work? Well,&nbsp;&nbsp;

01:13:55,230 --> 01:14:00,960
really simply, once you start up there, Buster,&nbsp;
and again, as I mentioned, it uses brute forcing&nbsp;&nbsp;

01:14:00,960 --> 01:14:06,480
so I'll explain where wordless come into play.&nbsp;
So you open it up and you select the URL of the&nbsp;&nbsp;

01:14:06,480 --> 01:14:11,850
web application or the website and you specify&nbsp;
the port The port is is the is definitely going&nbsp;&nbsp;

01:14:11,850 --> 01:14:19,500
to be HTTP sewed a the a port 80 or Port 443. And&nbsp;
then you select the word list now, in this case,&nbsp;&nbsp;

01:14:19,500 --> 01:14:27,150
Cali annex already has a dub dub Buster word list&nbsp;
that that are designed, it has three of them that&nbsp;&nbsp;

01:14:27,150 --> 01:14:31,650
are designed for different types of scenarios.&nbsp;
And I'll explain them as we move along. All right,&nbsp;&nbsp;

01:14:31,650 --> 01:14:37,020
and essentially how it works is once you start&nbsp;
the brute force attack, it will send HTTP GET&nbsp;&nbsp;

01:14:37,020 --> 01:14:42,090
requests, and it will wait for the response from&nbsp;
the server or the web, the web application. If&nbsp;&nbsp;

01:14:42,090 --> 01:14:48,700
it gets a 200 response. That means that yes, that&nbsp;
directory exists. Alright, if it gets if it gets a&nbsp;&nbsp;

01:14:48,700 --> 01:14:54,490
bad response, meaning like 400 or four or three,&nbsp;
meaning no access, then it'll it will it will&nbsp;&nbsp;

01:14:54,490 --> 01:14:59,530
know that that directory of file doesn't exist. So&nbsp;
it's essentially testing directories on the server&nbsp;&nbsp;

01:14:59,530 --> 01:15:05,470
against This, this word list. So it will check,&nbsp;
for example, is there a temp folder, if it sends&nbsp;&nbsp;

01:15:05,470 --> 01:15:10,840
a temp request to the server, it gets a response,&nbsp;
a positive response, then it knows it's there,&nbsp;&nbsp;

01:15:10,840 --> 01:15:16,390
and then it will enumerate them. Alright, so let's&nbsp;
start off really, really simply. So I'm on Cali&nbsp;&nbsp;

01:15:16,390 --> 01:15:24,010
the next, I have the OS, broken web application,&nbsp;
right here. And I'm going to be demonstrating two&nbsp;&nbsp;

01:15:24,010 --> 01:15:27,640
scenarios. So you can see I'm running that&nbsp;
here. And that has a lot of vulnerable web&nbsp;&nbsp;

01:15:27,640 --> 01:15:33,100
applications. But the whole idea is to demonstrate&nbsp;
how directories can be found. Alright, and why&nbsp;&nbsp;

01:15:33,100 --> 01:15:38,650
this is extremely important, especially for a&nbsp;
web application penetration tester. Alright, so&nbsp;&nbsp;

01:15:38,650 --> 01:15:44,050
I'm gonna pull up Firefox. And as you can see, you&nbsp;
have the open web application project right here,&nbsp;&nbsp;

01:15:44,050 --> 01:15:51,850
the OS B web, as they call it, and it has plenty&nbsp;
of ways of me testing this. But what if I was to&nbsp;&nbsp;

01:15:51,850 --> 01:15:56,890
just test the entire server? Alright, so this is&nbsp;
a web server. What if I was to test the entire web&nbsp;&nbsp;

01:15:56,890 --> 01:16:02,560
so well, I'm guessing that there going to be a lot&nbsp;
of files and directories. So what we can do is,&nbsp;&nbsp;

01:16:02,560 --> 01:16:08,140
we can start off with a perfect example of how&nbsp;
this will work is let's say you're targeting a&nbsp;&nbsp;

01:16:08,140 --> 01:16:12,220
WordPress site. So I'm going to open up the broken&nbsp;
WordPress. Now, of course, this is an very old&nbsp;&nbsp;

01:16:12,220 --> 01:16:18,310
one, and we're not really exploiting anything. But&nbsp;
by using this example, it will let us understand&nbsp;&nbsp;

01:16:18,310 --> 01:16:24,940
how we can enumerate the different directories and&nbsp;
folders, you know, on this WordPress installation,&nbsp;&nbsp;

01:16:24,940 --> 01:16:29,440
or if you are target targeting a WordPress&nbsp;
site, this is the way you do it. So I'm going&nbsp;&nbsp;

01:16:29,440 --> 01:16:34,900
to copy the URL with the with the directory right&nbsp;
here. So it we know it's in the WordPress folder,&nbsp;&nbsp;

01:16:34,900 --> 01:16:39,760
because that is the root directory of the of&nbsp;
the web server and we're selecting the WordPress&nbsp;&nbsp;

01:16:39,760 --> 01:16:45,370
installation. But for the website, you will&nbsp;
select the URL. Alright. And that's for the port,&nbsp;&nbsp;

01:16:45,370 --> 01:16:50,650
we know that this is the default HTTP port, which&nbsp;
means it's Port 80. Alright, so I have doorbuster.&nbsp;&nbsp;

01:16:50,650 --> 01:16:55,630
Right here, if you can't find it, just you can use&nbsp;
the start menu and type in der buster, it's going&nbsp;&nbsp;

01:16:55,630 --> 01:17:00,630
to be like so just this click on it, and give it a&nbsp;
few seconds to start up. So again, it was designed&nbsp;&nbsp;

01:17:00,630 --> 01:17:06,390
by the OS team. So it works really, really well.&nbsp;
And again, this is something that I'm sure if you&nbsp;&nbsp;

01:17:06,390 --> 01:17:12,240
if you are a web application penetration tester,&nbsp;
or you do do the CTF challenges, then you will,&nbsp;&nbsp;

01:17:12,240 --> 01:17:18,180
you'll know that use this tool a lot. Alright, so&nbsp;
we in here, we have the target URL, and that will&nbsp;&nbsp;

01:17:18,180 --> 01:17:26,580
we will paste it Alright, so we can paste it right&nbsp;
here. So Ctrl V, and that is the URL. Now in the&nbsp;&nbsp;

01:17:26,580 --> 01:17:31,860
work method, if you want to, if you want the scan&nbsp;
to be faster, you can use the GET requests, but&nbsp;&nbsp;

01:17:31,860 --> 01:17:37,380
what we can do is auto switch them from the head&nbsp;
and get and that will give us a more robust or a&nbsp;&nbsp;

01:17:37,380 --> 01:17:42,690
more accurate response rate. Alright, so in terms&nbsp;
of the number of days, this is how fast you want,&nbsp;&nbsp;

01:17:42,690 --> 01:17:47,760
you want the scan or the brute force to be, so the&nbsp;
faster the better depending on your hardware. And&nbsp;&nbsp;

01:17:47,760 --> 01:17:52,740
of course, you don't want to overload the server,&nbsp;
so I'm just going to go hit click on Go faster,&nbsp;&nbsp;

01:17:52,740 --> 01:17:57,930
that's probably works the best for me. But if you&nbsp;
wanted to run faster, then that means it's gonna,&nbsp;&nbsp;

01:17:57,930 --> 01:18:02,550
it's gonna have multiple requests and threads&nbsp;
being sent from your computer. Alright,&nbsp;&nbsp;

01:18:02,550 --> 01:18:07,590
so I like keeping it at just 200 threads, which&nbsp;
is go faster. And because I'm testing my own web&nbsp;&nbsp;

01:18:07,590 --> 01:18:13,680
server, I can, you know, I can pretty much&nbsp;
increase it to whatever I want. So usually,&nbsp;&nbsp;

01:18:13,680 --> 01:18:18,600
if you're talking about a bigger server or a&nbsp;
bigger web application, then it doesn't really&nbsp;&nbsp;

01:18:18,600 --> 01:18:23,100
matter how many requests or many threads you use,&nbsp;
it will not really affect the performance of the&nbsp;&nbsp;

01:18:23,100 --> 01:18:28,020
web server. But if I was to run it at maybe a&nbsp;
maximum speed, you'd see that the web server&nbsp;&nbsp;

01:18:28,020 --> 01:18:34,590
would be lagging out, you know, out of the amount&nbsp;
of requests that are being sent. Because you know,&nbsp;&nbsp;

01:18:34,590 --> 01:18:39,210
you have to understand it from a fundamental point&nbsp;
of view, we are requesting different web pages,&nbsp;&nbsp;

01:18:39,210 --> 01:18:44,280
and the server has to process them. So if the if&nbsp;
the if the server is not running on on, you know,&nbsp;&nbsp;

01:18:44,280 --> 01:18:49,380
good resources, like it's running on one gigabyte&nbsp;
of RAM, it's very easy to make it lag out,&nbsp;&nbsp;

01:18:49,380 --> 01:18:54,450
and to actually cause some sort of a denial of&nbsp;
service just because of the amount of requests.&nbsp;&nbsp;

01:18:54,450 --> 01:18:59,700
But in this case, we are performing it you&nbsp;
know, with with an ethical perspective. So now,&nbsp;&nbsp;

01:18:59,700 --> 01:19:05,070
you want to select a list based brute force or you&nbsp;
can use a pure brute force. But I don't recommend&nbsp;&nbsp;

01:19:05,070 --> 01:19:10,740
that that doesn't really work. And you now need to&nbsp;
select your word list your doorbuster word list.&nbsp;&nbsp;

01:19:10,740 --> 01:19:16,020
Now by default on Kali Linux and on paradise,&nbsp;
these are found in the user share folder on the&nbsp;&nbsp;

01:19:16,020 --> 01:19:20,430
under word list. And you can find the doorbuster&nbsp;
word list right there. So I'm going to show you&nbsp;&nbsp;

01:19:20,430 --> 01:19:24,360
that right now. So I'm going to browse, I'm going&nbsp;
to go to my root and I'm going to go into user&nbsp;&nbsp;

01:19:24,360 --> 01:19:30,030
and I'm going to go into share. And let's go into&nbsp;
Word Lists here. Let's see if I can find it. It's&nbsp;&nbsp;

01:19:30,030 --> 01:19:38,160
obviously with a W. Where it Where is it? Let's&nbsp;
see. Let's see. Let's see where is wordless story&nbsp;&nbsp;

01:19:38,160 --> 01:19:42,180
if I can see this. Yeah, there we are. Sorry about&nbsp;
that. wordlist and you now want to go into der&nbsp;&nbsp;

01:19:42,180 --> 01:19:46,770
buster. Alright, so there is going to be a folder&nbsp;
called der buster. And now you might be a little&nbsp;&nbsp;

01:19:46,770 --> 01:19:52,470
bit confused. Well, really, you don't need to need&nbsp;
me to be confused. That's why I'm here. So as a&nbsp;&nbsp;

01:19:52,470 --> 01:19:58,050
beginner you might be wondering like which one&nbsp;
is better. Now as an advanced penetration test,&nbsp;&nbsp;

01:19:58,050 --> 01:20:03,000
I know which one is the best in Most cases,&nbsp;
it's going to be the medium the directory list&nbsp;&nbsp;

01:20:03,000 --> 01:20:09,120
2.3 medium dot txt. Now, if you're scanning a very&nbsp;
small web application that that's not that really&nbsp;&nbsp;

01:20:09,120 --> 01:20:16,350
complex, like a simple HTML site, you know, HTML,&nbsp;
CSS, whatever you want to call it, then I would&nbsp;&nbsp;

01:20:16,350 --> 01:20:21,060
recommend the smaller one. But if you're scanning&nbsp;
a big site, like a WordPress installation,&nbsp;&nbsp;

01:20:21,060 --> 01:20:27,390
or a Joomla installation, then you should use the&nbsp;
medium one, this will work 99% of the time unless&nbsp;&nbsp;

01:20:27,390 --> 01:20:33,120
your your, your requests are being blocked by&nbsp;
either a web application firewall or by the,&nbsp;&nbsp;

01:20:33,120 --> 01:20:38,760
the host. So I'm just going to select list.&nbsp;
Alright. And now in terms of these other options,&nbsp;&nbsp;

01:20:38,760 --> 01:20:42,450
you can see it's, it's going to essentially&nbsp;
brute force brute force the directories,&nbsp;&nbsp;

01:20:42,450 --> 01:20:47,160
the files, it's going to be recursive, which is&nbsp;
great. And the directory, you must specify the&nbsp;&nbsp;

01:20:47,160 --> 01:20:53,340
directory if it is if you are trying to perform&nbsp;
a scan that is directory sensitive. Alright,&nbsp;&nbsp;

01:20:53,340 --> 01:20:59,190
and standard start point, just leave it like&nbsp;
that. And you now want to hit start. Alright,&nbsp;&nbsp;

01:20:59,190 --> 01:21:03,720
so once you start is going to start brute forcing&nbsp;
the web server against, it's going to start&nbsp;&nbsp;

01:21:03,720 --> 01:21:09,270
sending the request. And if it gets the responses,&nbsp;
the positive responses is going to, it's going to&nbsp;&nbsp;

01:21:09,270 --> 01:21:14,460
understand that yes, that directory does exist.&nbsp;
Now you can see we have a response that is being&nbsp;&nbsp;

01:21:14,460 --> 01:21:20,370
sent here. And it's going to tell tell you that&nbsp;
it is unable to determine a consistent failed&nbsp;&nbsp;

01:21:20,370 --> 01:21:27,450
response, which means some directories and files&nbsp;
are being you're getting a negative or you're&nbsp;&nbsp;

01:21:27,450 --> 01:21:31,800
getting a no access response, meaning that that&nbsp;
directory doesn't exist. So what you can do is&nbsp;&nbsp;

01:21:31,800 --> 01:21:36,990
just hit Cancel to these ones in it Yes. And it's&nbsp;
going to continue scanning the other ones. Now of&nbsp;&nbsp;

01:21:36,990 --> 01:21:41,430
course down here you can see since it's performing&nbsp;
a brute force, you can look at the current speed,&nbsp;&nbsp;

01:21:41,430 --> 01:21:47,040
which varies dependent on the amount of&nbsp;
directories, the average speed, and it will&nbsp;&nbsp;

01:21:47,041 --> 01:21:52,021
tell you the total amount of requests done out of&nbsp;
the amount that could be done depending on on the&nbsp;&nbsp;

01:21:52,021 --> 01:21:56,341
word list that you have selected. And finally, you&nbsp;
have the time to finish. Now, of course, this will&nbsp;&nbsp;

01:21:56,340 --> 01:22:03,030
vary depending on a lot of factors. But mostly&nbsp;
it depends on the speed of the scan that you've&nbsp;&nbsp;

01:22:03,030 --> 01:22:07,290
selected, and the and the word list. So you have&nbsp;
your scan information here, it's going to tell you&nbsp;&nbsp;

01:22:07,291 --> 01:22:13,321
what folders and files it's testing. And in here,&nbsp;
you can see the results in terms of directories&nbsp;&nbsp;

01:22:13,320 --> 01:22:18,150
and files that it was able to find. And in the&nbsp;
results, this is going to give you the directory&nbsp;&nbsp;

01:22:18,150 --> 01:22:23,400
structure as to how files and folders are being&nbsp;
structured on the web application. Now by default,&nbsp;&nbsp;

01:22:23,400 --> 01:22:29,040
right now, you can see the amount of the&nbsp;
files and folders that it has found are,&nbsp;&nbsp;

01:22:29,041 --> 01:22:34,201
for example, the WordPress register dot php.&nbsp;
So if we open that, if you right click on it,&nbsp;&nbsp;

01:22:34,200 --> 01:22:39,270
you can open it in the URL, or you can view&nbsp;
the response that it gave. And you can copy it,&nbsp;&nbsp;

01:22:39,271 --> 01:22:43,711
you understand you get the basic functionality&nbsp;
here. And then you can open it in your browser.&nbsp;&nbsp;

01:22:43,710 --> 01:22:48,270
So again, you see that we are finding files that&nbsp;
we otherwise wouldn't have known existed. Now,&nbsp;&nbsp;

01:22:48,271 --> 01:22:53,551
of course, for a default WordPress installation,&nbsp;
you would have guessed that this does exist. But&nbsp;&nbsp;

01:22:53,550 --> 01:22:59,160
remember, most people are for volken, for most&nbsp;
other installations on configured figurations,&nbsp;&nbsp;

01:22:59,160 --> 01:23:05,490
this can be a great way of finding files and&nbsp;
folders that you didn't know existed. And again,&nbsp;&nbsp;

01:23:05,490 --> 01:23:09,720
discovering them is very, very important. And&nbsp;
this can give you different attack vectors. So&nbsp;&nbsp;

01:23:09,720 --> 01:23:14,760
for example, if I went to the admin dot php, and&nbsp;
it forced me to log in, that might be a good place&nbsp;&nbsp;

01:23:14,760 --> 01:23:20,460
to start brute forcing, if I had credentials, if&nbsp;
not, you can choose Select another attack vector.&nbsp;&nbsp;

01:23:20,460 --> 01:23:25,290
So let me just move back here you can see we have&nbsp;
the register page here, which we just clicked on.&nbsp;&nbsp;

01:23:25,291 --> 01:23:30,871
Let's look at the WordPress login dot php. So&nbsp;
I'm gonna open that up in the browser. Now you&nbsp;&nbsp;

01:23:30,870 --> 01:23:35,370
can see the server is not responding. And that's&nbsp;
another point that I wanted to point out. If you&nbsp;&nbsp;

01:23:35,370 --> 01:23:41,270
want to be as you know, right now we are being&nbsp;
as promiscuous as possible. Because we it's&nbsp;&nbsp;

01:23:41,270 --> 01:23:46,880
not really a web application that is delivering&nbsp;
service to other people. But because it's hosted&nbsp;&nbsp;

01:23:46,880 --> 01:23:51,740
on my local area network. So in this case, you&nbsp;
can do a performing a type of denial of service.&nbsp;&nbsp;

01:23:51,740 --> 01:23:57,170
And that's because the server is located very,&nbsp;
very minimal resources to this virtual machine.&nbsp;&nbsp;

01:23:57,170 --> 01:24:01,370
So that's why it's kind of lagging out. Alright,&nbsp;
so that's something to take into consideration.&nbsp;&nbsp;

01:24:01,370 --> 01:24:07,010
Now if I was to, to pause the attack, like so if I&nbsp;
was to just pause it, remember, you can pause it,&nbsp;&nbsp;

01:24:07,010 --> 01:24:12,470
and you can stop it. And let me just go back&nbsp;
here. And let's see if we can reload these pages,&nbsp;&nbsp;

01:24:12,470 --> 01:24:18,050
they should be able to, to be reloaded quick&nbsp;
enough. Let me let me just load that up. And&nbsp;&nbsp;

01:24:18,050 --> 01:24:24,980
we can close this one. Let's see if the WordPress&nbsp;
register page does open up. If this virtual, yeah,&nbsp;&nbsp;

01:24:24,980 --> 01:24:29,840
there we are. So you can see even though this&nbsp;
is a very old WordPress installation, that we&nbsp;&nbsp;

01:24:29,840 --> 01:24:35,090
were causing it to lag out. So always keep that in&nbsp;
mind that the amount of threads that you say can&nbsp;&nbsp;

01:24:35,090 --> 01:24:40,610
affect the performance of the website of or of the&nbsp;
web application and you don't want to cause any&nbsp;&nbsp;

01:24:40,610 --> 01:24:47,180
any impact to customers if you're performing the&nbsp;
test on a real world working web application or&nbsp;&nbsp;

01:24:47,180 --> 01:24:51,950
website. Alright, just something you might want to&nbsp;
take into consideration. So we're going to resume&nbsp;&nbsp;

01:24:51,950 --> 01:24:56,360
it and of course I'm not going to expect to find&nbsp;
anything we add here. Although this WordPress&nbsp;&nbsp;

01:24:56,360 --> 01:25:01,760
installation is designed to be vulnerable.&nbsp;
So you can also change the number of threads&nbsp;&nbsp;

01:25:01,760 --> 01:25:07,280
running right here. So if I wanted to run, you&nbsp;
know, maybe on 10 threads, which is quite slow,&nbsp;&nbsp;

01:25:07,280 --> 01:25:13,700
that means you will get, the enumeration process&nbsp;
will take longer. So it's all about balancing your&nbsp;&nbsp;

01:25:13,700 --> 01:25:18,950
resources and understanding what you're trying&nbsp;
to look for. And of course, this can be a very,&nbsp;&nbsp;

01:25:18,950 --> 01:25:26,510
very useful tool. When doing bug bounties, or,&nbsp;
or CTF for that matter, especially hack the box,&nbsp;&nbsp;

01:25:30,250 --> 01:25:34,459
we are going to be looking at something that is&nbsp;
extremely important and something that should be&nbsp;&nbsp;

01:25:34,459 --> 01:25:40,189
understood completely, and that is cross site&nbsp;
scripting. Alright, now before we get started,&nbsp;&nbsp;

01:25:40,189 --> 01:25:44,989
I'm just going to explain what we're going to&nbsp;
be looking at explain what we're going to be&nbsp;&nbsp;

01:25:44,990 --> 01:25:50,330
looking at in this video, we're going to start&nbsp;
off with explaining what cross site scripting is,&nbsp;&nbsp;

01:25:50,330 --> 01:25:55,340
I'm going to be showing you the environment&nbsp;
that we'll be using for testing any of these,&nbsp;&nbsp;

01:25:55,340 --> 01:26:01,250
any of these attacks just because they allow&nbsp;
us to illustrate or they allow me to explain&nbsp;&nbsp;

01:26:01,250 --> 01:26:05,930
how everything works, because that's the most&nbsp;
important thing for me is that you understand&nbsp;&nbsp;

01:26:05,930 --> 01:26:11,570
what you're you're listening to, and you have a&nbsp;
good representation of what's going on. Alright,&nbsp;&nbsp;

01:26:11,570 --> 01:26:18,410
so I'll be explaining stored. I'll be explaining&nbsp;
the reflected stored and Dom cross site scripting.&nbsp;&nbsp;

01:26:18,410 --> 01:26:24,080
Alright, so let's get started with me explaining&nbsp;
what environment I'm currently running. So you&nbsp;&nbsp;

01:26:24,080 --> 01:26:30,500
can see that I'm running Kali Linux right now.&nbsp;
But I am going to be using the OS broken web&nbsp;&nbsp;

01:26:30,500 --> 01:26:34,700
applications project. So I'll have this in&nbsp;
the description section, it is essentially&nbsp;&nbsp;

01:26:34,700 --> 01:26:40,220
a virtual machine, that you can easily just run&nbsp;
on VirtualBox or VMware. I'm currently running&nbsp;&nbsp;

01:26:40,220 --> 01:26:49,730
it here. As you can see, I just got the local&nbsp;
IP, it's 190 2.1 68 point 1.111. All right, so&nbsp;&nbsp;

01:26:49,729 --> 01:26:56,299
I have that running. And I'm running this on Kali&nbsp;
Linux, and I already have opened up the URL in my&nbsp;&nbsp;

01:26:56,300 --> 01:27:02,060
browser. So you can see from here, I've opened&nbsp;
up v whap. And I've opened up webgoat, because&nbsp;&nbsp;

01:27:02,060 --> 01:27:07,190
that's what I'm going to be using to explain each&nbsp;
of these cross site scripting attacks. So if I&nbsp;&nbsp;

01:27:07,189 --> 01:27:13,939
was to do that false to just open up 190 2.1 68&nbsp;
point 1.11, yours could be different, it should&nbsp;&nbsp;

01:27:13,939 --> 01:27:19,689
be different. Depending on your IP configuration,&nbsp;
and subnet, then it'll take you to the OS, b,&nbsp;&nbsp;

01:27:19,690 --> 01:27:25,760
w A, or the OS broken web applications project.&nbsp;
The latest version, as of recording this video&nbsp;&nbsp;

01:27:25,760 --> 01:27:34,550
is version 1.2. So we will be using webgoat and B&nbsp;
web, or the broken web application project for for&nbsp;&nbsp;

01:27:34,550 --> 01:27:41,240
this demonstration. So the default credentials for&nbsp;
webgoat are going to be guest for the username and&nbsp;&nbsp;

01:27:41,240 --> 01:27:47,770
guest for the password. And for B whap. It should&nbsp;
give you the prompt right over there. I think it's&nbsp;&nbsp;

01:27:47,770 --> 01:27:53,305
going to be bug app or something like that. But&nbsp;
irregardless, it will tell you what it is. All&nbsp;&nbsp;

01:27:53,305 --> 01:27:58,060
right. So make sure you open that up, and you have&nbsp;
that all set up. So I've logged in to be web and&nbsp;&nbsp;

01:27:58,060 --> 01:28:03,460
I have a web goat started up right here. Alright,&nbsp;
so let me close that up. And we are ready to go.&nbsp;&nbsp;

01:28:03,460 --> 01:28:08,410
Now before we even move on into performing these&nbsp;
attacks, it's very important to understand what's&nbsp;&nbsp;

01:28:08,410 --> 01:28:14,290
going on here with with cross site scripting,&nbsp;
what it is how it works. And what are you exactly&nbsp;&nbsp;

01:28:14,290 --> 01:28:19,540
taking advantage of right now, this is where a lot&nbsp;
of people make mistakes. And if you want to be a&nbsp;&nbsp;

01:28:19,540 --> 01:28:24,670
successful web application penetration tester, you&nbsp;
need to understand, you know, from a fundamental&nbsp;&nbsp;

01:28:24,670 --> 01:28:30,070
level, what's going on here. Alright, so let's&nbsp;
get started. What is cross site scripting? Well,&nbsp;&nbsp;

01:28:30,070 --> 01:28:38,200
simply put it is the process of injecting a script&nbsp;
into a into the parameter in a URL to attack&nbsp;&nbsp;

01:28:38,200 --> 01:28:44,890
a user of the site or to potentially attack the&nbsp;
server side of the website or the web application,&nbsp;&nbsp;

01:28:44,890 --> 01:28:49,840
right? So essentially, is the inject the&nbsp;
injection of a script into the parameter of&nbsp;&nbsp;

01:28:49,840 --> 01:28:54,910
a URL. All right, that's essentially what it is.&nbsp;
Now, of course, this may be quite confusing, but&nbsp;&nbsp;

01:28:54,910 --> 01:29:02,050
don't worry, I'll explain what's going on here. So&nbsp;
let's start off with with, first of all explaining&nbsp;&nbsp;

01:29:02,050 --> 01:29:07,960
the three types of cross site scripting. All&nbsp;
right, the first one is reflected and then&nbsp;&nbsp;

01:29:07,960 --> 01:29:14,680
we have stored and Dom. So with reflected what's&nbsp;
happening here is the data is inputted and then,&nbsp;&nbsp;

01:29:14,680 --> 01:29:20,260
you know, reflected directly back back on the&nbsp;
screen. So I'll explain this in a second. Alright,&nbsp;&nbsp;

01:29:20,260 --> 01:29:27,340
so if we are to look at this from a fundamental&nbsp;
perspective, I'll show you how to access this,&nbsp;&nbsp;

01:29:27,340 --> 01:29:32,320
you know how to navigate the view up. Just give&nbsp;
me a second, let me explain what's going on. So&nbsp;&nbsp;

01:29:32,320 --> 01:29:37,270
essentially, what's happening with reflected cross&nbsp;
site scripting is that the input is going to be&nbsp;&nbsp;

01:29:37,270 --> 01:29:42,280
stored in the parameter of the URL. All right,&nbsp;
and I'll explain how this differs with each type&nbsp;&nbsp;

01:29:42,280 --> 01:29:46,630
of attack. Because many of you will point out and&nbsp;
say, well, it's not only to do with parameters,&nbsp;&nbsp;

01:29:46,630 --> 01:29:52,450
and don't worry, I'll explain all of this.&nbsp;
Alright, so we can essentially manipulate the the&nbsp;&nbsp;

01:29:52,450 --> 01:29:58,511
parameter of the URL, so that we can essentially&nbsp;
run a script. Now what type of script we can run a&nbsp;&nbsp;

01:29:58,510 --> 01:30:02,710
malicious script that is based on in JavaScript,&nbsp;
and I'll explain that right now. So you can see&nbsp;&nbsp;

01:30:02,710 --> 01:30:07,420
with our portal, you don't want to touch anything&nbsp;
here, you can set the security level. But for now,&nbsp;&nbsp;

01:30:07,420 --> 01:30:12,580
I recommend setting it to lope. Not that that's&nbsp;
going to hurt anyone's ego. Because remember,&nbsp;&nbsp;

01:30:12,580 --> 01:30:18,280
you have to be humbled to begin, and you need to&nbsp;
understand what's going on first. So we will open&nbsp;&nbsp;

01:30:18,280 --> 01:30:23,440
up the Jews, the bugs section here, and we want&nbsp;
to go down into cross site scripting. And we want&nbsp;&nbsp;

01:30:23,440 --> 01:30:28,600
to go into reflected which essentially deals with&nbsp;
the get the get request. So we're going to start&nbsp;&nbsp;

01:30:28,600 --> 01:30:32,770
off with that. And this will really make you&nbsp;
understand what's going on here. So if I click&nbsp;&nbsp;

01:30:32,770 --> 01:30:39,610
on that, and I just hit hack. Alright, so now it's&nbsp;
going to give us a prompt here. And you might be&nbsp;&nbsp;

01:30:39,610 --> 01:30:45,220
asking, Well, what what do you mean, what exactly&nbsp;
is going on, if I was to not enter any details&nbsp;&nbsp;

01:30:45,220 --> 01:30:50,440
into the, you know, into these fields, right&nbsp;
here. So for example, you can see I just had a&nbsp;&nbsp;

01:30:50,440 --> 01:30:55,330
suggestion there, that's because I was testing it&nbsp;
out. But if I was to hit go, you can see that in&nbsp;&nbsp;

01:30:55,330 --> 01:31:01,300
the URL, we do have the input here. So you can see&nbsp;
the values can be edited directly into the form.&nbsp;&nbsp;

01:31:01,300 --> 01:31:07,240
So you can see first name has no value. And then&nbsp;
we have the last name, which again has no value,&nbsp;&nbsp;

01:31:07,240 --> 01:31:11,500
and you can see that it is submitting a form.&nbsp;
So what we can do is run some JavaScript code&nbsp;&nbsp;

01:31:11,500 --> 01:31:16,180
in here. And the most common way of explaining&nbsp;
what's going on here, of course, not running a&nbsp;&nbsp;

01:31:16,180 --> 01:31:21,100
very malicious code right now, it's essentially&nbsp;
explaining and demonstrating that it does work is&nbsp;&nbsp;

01:31:21,100 --> 01:31:26,530
I can run a piece of code here. Now, of course,&nbsp;
when you put this into a practical perspective,&nbsp;&nbsp;

01:31:26,530 --> 01:31:32,230
many sites are going to filter the content that&nbsp;
you can enter in these fields, all these forms,&nbsp;&nbsp;

01:31:32,230 --> 01:31:38,260
and will essentially will not allow you to&nbsp;
run JavaScript code and you know, obviously,&nbsp;&nbsp;

01:31:38,260 --> 01:31:45,220
to protect, protect the site from these type of&nbsp;
attacks. But what you can do is encapsulated to&nbsp;&nbsp;

01:31:45,220 --> 01:31:49,150
encode it in a different type of language.&nbsp;
Or, as I said, I'll show y'all everything,&nbsp;&nbsp;

01:31:49,150 --> 01:31:55,090
or how all of this works. So this right, right&nbsp;
now, being the current security level, as low,&nbsp;&nbsp;

01:31:55,090 --> 01:32:01,810
we are a lot a lot essentially encode, it will&nbsp;
not verify or validate what we're entering in&nbsp;&nbsp;

01:32:01,810 --> 01:32:07,720
here what input is being given. So if we were&nbsp;
to type in a script here, so we can say script,&nbsp;&nbsp;

01:32:07,720 --> 01:32:12,580
and you can see the recommendation there script,&nbsp;
that's mine. So if I was to type in alert, and&nbsp;&nbsp;

01:32:12,580 --> 01:32:17,560
this is JavaScript, so I'm pretty, I'm pretty sure&nbsp;
you can you know what's going on. So we can say,&nbsp;&nbsp;

01:32:17,560 --> 01:32:30,310
Hello world. This is an example of reflected&nbsp;
accesses, or cross site scripting, and we can&nbsp;&nbsp;

01:32:30,310 --> 01:32:35,200
close that operate now. And then we need to close&nbsp;
the script. So we can do that in the next field or&nbsp;&nbsp;

01:32:35,200 --> 01:32:39,850
the next parameter. Most people like doing it from&nbsp;
the start. But this is just to show you how robust&nbsp;&nbsp;

01:32:39,850 --> 01:32:45,970
this can be. So I type in I close the script and&nbsp;
hit go. And as you can see, it gives us the alert,&nbsp;&nbsp;

01:32:45,970 --> 01:32:52,240
which is what we and we which is what we used&nbsp;
as a form of, of me showing you that it does&nbsp;&nbsp;

01:32:52,240 --> 01:32:57,880
work and it will be processed, the input will be&nbsp;
processed and will be sent back to you, you being&nbsp;&nbsp;

01:32:57,880 --> 01:33:04,000
the client. And we can just hit OK. And that was&nbsp;
an example of reflected excess cross cross site&nbsp;&nbsp;

01:33:04,000 --> 01:33:08,260
scripting, using the get method. Now of course&nbsp;
we can, I can replicate this many, many times&nbsp;&nbsp;

01:33:08,260 --> 01:33:14,110
using the other types of cross site scripting, for&nbsp;
example, with the post, etc, etc. We'll be looking&nbsp;&nbsp;

01:33:14,110 --> 01:33:19,240
at all of that. But for now we need to understand&nbsp;
what's going on here. Now next, we need to look&nbsp;&nbsp;

01:33:19,240 --> 01:33:24,520
at stored cross site scripting, this is probably&nbsp;
my favorite because of the potential that it does&nbsp;&nbsp;

01:33:24,520 --> 01:33:30,250
have. Alright, so let's go into the juicy bug menu&nbsp;
here. And we want to go into cross site scripting,&nbsp;&nbsp;

01:33:30,250 --> 01:33:37,120
and we want to go we want to go for the blog,&nbsp;
cross site scripting stored cross site scripting,&nbsp;&nbsp;

01:33:37,120 --> 01:33:41,170
and we're gonna select blog, and I'll&nbsp;
explain why in a second. Alright, so first,&nbsp;&nbsp;

01:33:41,169 --> 01:33:46,599
let me explain what stored cross site scripting&nbsp;
is. So essentially, with this with the cross site&nbsp;&nbsp;

01:33:46,600 --> 01:33:52,030
scripting attacks, more specifically, these stored&nbsp;
attacks, essentially, what's happening is you're&nbsp;&nbsp;

01:33:52,030 --> 01:33:58,420
attacking the input. And you're essentially&nbsp;
attacking the input that is to be stored or&nbsp;&nbsp;

01:33:58,419 --> 01:34:03,039
you're attacking the data, or, essentially, I'll&nbsp;
explain this really simply, so you're attacking&nbsp;&nbsp;

01:34:03,040 --> 01:34:08,830
the input that is to be stored on a database. So&nbsp;
what you're doing is you're essentially injecting&nbsp;&nbsp;

01:34:08,830 --> 01:34:13,480
malicious code that will be saved into a database,&nbsp;
or that is going to be saved by the server,&nbsp;&nbsp;

01:34:13,479 --> 01:34:19,780
or the web application server. And then you can&nbsp;
definitely you since it's being stored, you can&nbsp;&nbsp;

01:34:19,780 --> 01:34:24,760
access it later on or other users can access it.&nbsp;
And for example, if it's running malicious code,&nbsp;&nbsp;

01:34:24,760 --> 01:34:29,290
it can trigger different things like opening&nbsp;
the webcam of a user stealing different type of&nbsp;&nbsp;

01:34:29,290 --> 01:34:34,540
information. I'm not going to go into what you can&nbsp;
do with it, but you can really do a lot of stuff,&nbsp;&nbsp;

01:34:34,540 --> 01:34:39,700
a lot of malicious stuff with code. Alright, so&nbsp;
let me explain what's going on here. So with this&nbsp;&nbsp;

01:34:39,700 --> 01:34:45,940
stored, cross site scripting, you can essentially&nbsp;
inject malicious code into the database again,&nbsp;&nbsp;

01:34:45,940 --> 01:34:51,850
that then that when accessed runs this&nbsp;
malicious code. Alright, so if you can see&nbsp;&nbsp;

01:34:51,850 --> 01:34:57,290
this is an example of a blog. Let me explain what&nbsp;
I mean the best places to implement stored cross&nbsp;&nbsp;

01:34:57,290 --> 01:35:04,510
site scripting is in places like means, you know&nbsp;
forums. And again, as you can see write your blog&nbsp;&nbsp;

01:35:04,510 --> 01:35:09,460
in the form of comments that you know, or pages&nbsp;
that can be accessed later, or data that is being&nbsp;&nbsp;

01:35:09,460 --> 01:35:15,010
stored in directly into the database, any database&nbsp;
for that matter as long as it's being stored,&nbsp;&nbsp;

01:35:15,010 --> 01:35:20,860
okay, so we can type in something like hello.&nbsp;
And we can submit that to the database. And&nbsp;&nbsp;

01:35:20,860 --> 01:35:25,600
you can see it's getting stored. And you have&nbsp;
the different tables, you have the the number,&nbsp;&nbsp;

01:35:25,600 --> 01:35:33,880
the owner, the date and the entry. So now we can&nbsp;
also run a script in here. Alright, so what if we&nbsp;&nbsp;

01:35:33,880 --> 01:35:39,640
were to enter Java scripts, and again, this data,&nbsp;
given our security level is any of the data that&nbsp;&nbsp;

01:35:39,640 --> 01:35:45,010
we're entering is not being validated. So you&nbsp;
can essentially enter it raw. Now in reality,&nbsp;&nbsp;

01:35:45,010 --> 01:35:49,900
if you go and try and enter a script in the&nbsp;
native will not be accepted, because, again,&nbsp;&nbsp;

01:35:49,900 --> 01:35:53,470
they're protecting their site against that.&nbsp;
That's one way of mitigation, very basic,&nbsp;&nbsp;

01:35:53,470 --> 01:35:58,480
I'm sure you know what I'm talking about. Alright,&nbsp;
so enough of me rambling on. So if we are doing&nbsp;&nbsp;

01:35:58,480 --> 01:36:04,990
enter the same script we entered, we are to say&nbsp;
script. And we then say, alert, for example,&nbsp;&nbsp;

01:36:04,990 --> 01:36:09,430
we can you can use any type of JavaScript code&nbsp;
you want here, and you can experiment, you know,&nbsp;&nbsp;

01:36:09,430 --> 01:36:15,040
you these web applications are there for you to&nbsp;
experiment and test your skills out. So first&nbsp;&nbsp;

01:36:15,040 --> 01:36:25,120
to say, Hello world. This is stored out stored&nbsp;
cross site scripting, and we just close that up&nbsp;&nbsp;

01:36:25,120 --> 01:36:29,980
there. And of course, we have to close the script,&nbsp;
because we know that that will not execute if we&nbsp;&nbsp;

01:36:29,980 --> 01:36:37,630
do not code it correctly. Okay, so now we can we&nbsp;
can add that. And if I was to just hit submit,&nbsp;&nbsp;

01:36:37,630 --> 01:36:43,060
right, now, you can see that it's going to store&nbsp;
and with that being the latest blog post, you can&nbsp;&nbsp;

01:36:43,060 --> 01:36:46,420
see it's going to tell you, it's going to execute&nbsp;
the script. And it's going to say hello world.&nbsp;&nbsp;

01:36:46,420 --> 01:36:52,420
This is stored cross site scripting. So an example&nbsp;
of a blog, if you're to post this on a page or a,&nbsp;&nbsp;

01:36:52,420 --> 01:36:58,780
you know, to make a blog post and inject this&nbsp;
script in, anyone opens that page will essentially&nbsp;&nbsp;

01:36:58,780 --> 01:37:04,630
run that malicious code. And whatever that code&nbsp;
does, can then furthermore, you know, cause damage&nbsp;&nbsp;

01:37:04,630 --> 01:37:09,880
to the user or to the server depending on what you&nbsp;
want it to do. So it's all dependent on what the&nbsp;&nbsp;

01:37:09,880 --> 01:37:14,200
attacker is to do. Remember what I told you in&nbsp;
the first video of this series, it's all about&nbsp;&nbsp;

01:37:14,200 --> 01:37:19,600
your mindset, and your your your willingness to&nbsp;
break things and to find out what does and doesn't&nbsp;&nbsp;

01:37:19,600 --> 01:37:27,040
work. Okay, so that was an example of stored&nbsp;
cross site scripting. And as I've mentioned,&nbsp;&nbsp;

01:37:27,040 --> 01:37:32,260
the most important thing to understand is this in&nbsp;
this scenario, the data is not being validated if&nbsp;&nbsp;

01:37:32,260 --> 01:37:37,750
it is being validated. And I'll show you that in&nbsp;
a second. Or probably in the next set of videos,&nbsp;&nbsp;

01:37:37,750 --> 01:37:43,210
we'll increase the security level, and I'll show&nbsp;
you how to get you know past this, you can see&nbsp;&nbsp;

01:37:43,210 --> 01:37:50,890
how things change as you move along in terms of&nbsp;
security levels. So I was going to use the V whap.&nbsp;&nbsp;

01:37:50,890 --> 01:37:55,960
This my first time using it. So I had to get a&nbsp;
bit of an introduction through the documentation.&nbsp;&nbsp;

01:37:55,960 --> 01:38:03,430
And I realize they don't have dumb cross site&nbsp;
scripting. So I that's why I had to use webgoat.&nbsp;&nbsp;

01:38:03,430 --> 01:38:08,740
They're the only ones I know who actually allow us&nbsp;
to run it. So as zoomed in right now, by the way,&nbsp;&nbsp;

01:38:08,740 --> 01:38:15,190
the credentials are guests for the username&nbsp;
and guest for the password. So essentially,&nbsp;&nbsp;

01:38:15,190 --> 01:38:20,140
I went through cross site scripting, and again,&nbsp;
they didn't have the DOM in here, all they were&nbsp;&nbsp;

01:38:20,140 --> 01:38:28,660
focusing on is stored and again, reflected. So I&nbsp;
found it to be in the eye x or Ajax or whatever&nbsp;&nbsp;

01:38:28,660 --> 01:38:34,360
you want to call it. And we have the the DOM&nbsp;
based cross site scripting, let me explain why&nbsp;&nbsp;

01:38:34,360 --> 01:38:41,260
it's in. This is based in Ajax security. This&nbsp;
is because Dom cross site scripting focuses on&nbsp;&nbsp;

01:38:41,260 --> 01:38:46,880
the client side. So any data or input that is&nbsp;
entered, whether it be a malicious code, etc,&nbsp;&nbsp;

01:38:46,880 --> 01:38:51,830
etc, is going to be processed by the client, not&nbsp;
the server. So any of the attacks will be based,&nbsp;&nbsp;

01:38:51,830 --> 01:38:58,190
of course, on the client. Now, let me explain&nbsp;
what I mean. If I am to run remember, JavaScript,&nbsp;&nbsp;

01:38:58,190 --> 01:39:05,570
server side, client side i x, for example.&nbsp;
So if I am to run, for example, a JavaScript&nbsp;&nbsp;

01:39:05,570 --> 01:39:10,940
code in this entry here, so script, and again, I&nbsp;
type in alert, just being the example and I say,&nbsp;&nbsp;

01:39:10,940 --> 01:39:16,610
Hello, let's keep that simple. And I close the&nbsp;
script here, you can see that we will probably&nbsp;&nbsp;

01:39:16,610 --> 01:39:21,440
not be left with anything will not get any result.&nbsp;
That's because it's being processed by the client,&nbsp;&nbsp;

01:39:21,440 --> 01:39:28,430
not by the server. So no, no result or no data&nbsp;
will be reflected back to us. If it was, you know,&nbsp;&nbsp;

01:39:28,430 --> 01:39:33,770
if it was reflected cross site, scripting it,&nbsp;
the server processes it, and then is reflected&nbsp;&nbsp;

01:39:33,770 --> 01:39:39,140
back to the client. So if I was to submit here,&nbsp;
you can see that nothing happens here. And that&nbsp;&nbsp;

01:39:39,140 --> 01:39:45,620
it is going to be taken as code. Now what if&nbsp;
we were to enter or use a language that that&nbsp;&nbsp;

01:39:45,620 --> 01:39:53,630
a client can understand? So let's say we want&nbsp;
to say, let's see, HTML, whatever to use HTML,&nbsp;&nbsp;

01:39:53,630 --> 01:40:00,530
so I can say in here, IMG, for example, that's a&nbsp;
very This is the way we learned it. So IMG See,&nbsp;&nbsp;

01:40:00,530 --> 01:40:05,870
and we don't have an image source. So we can leave&nbsp;
that like that. And then we can use the on error,&nbsp;&nbsp;

01:40:05,870 --> 01:40:12,590
in case we get an error of image which we will get&nbsp;
because the image has no source on error, we can&nbsp;&nbsp;

01:40:12,590 --> 01:40:21,620
say that is going to be, that is going to be equal&nbsp;
to alert. And then the alert we can input in here,&nbsp;&nbsp;

01:40:21,620 --> 01:40:28,820
we can say, Hello, whoops, hello world. And we&nbsp;
can close that up. And once we have closed it,&nbsp;&nbsp;

01:40:28,820 --> 01:40:34,940
you can see that we can, we can close that there.&nbsp;
And there you are. So it is great to be processed&nbsp;&nbsp;

01:40:34,940 --> 01:40:40,040
by the client, and you get the dialog box or the&nbsp;
alert with the message Hello world. So you can&nbsp;&nbsp;

01:40:40,040 --> 01:40:47,420
see that with Dom based cross site scripting, it&nbsp;
is all being processed all the input, whether it&nbsp;&nbsp;

01:40:47,420 --> 01:40:52,460
be malicious or not, is being processed by the&nbsp;
client. And Ei x is one of the largest languages&nbsp;&nbsp;

01:40:52,460 --> 01:40:57,260
that can be used. So you can also incorporate&nbsp;
a x if you wanted to test it out. Remember,&nbsp;&nbsp;

01:40:57,260 --> 01:41:02,390
it's all about experimentation and understanding,&nbsp;
I hope that you're you've got an understanding of&nbsp;&nbsp;

01:41:02,390 --> 01:41:07,070
what cross site scripting is, how it can be&nbsp;
used to manipulate data, whether it be on&nbsp;&nbsp;

01:41:07,070 --> 01:41:12,410
the client side on the database, and how you&nbsp;
can easily just transfer data with you know,&nbsp;&nbsp;

01:41:12,410 --> 01:41:17,000
bad security in place. Of course, this is&nbsp;
the these attacks will be a very uncommon&nbsp;&nbsp;

01:41:17,000 --> 01:41:20,960
now. But again, this was focused on more&nbsp;
on an explanation point of view. We're&nbsp;&nbsp;

01:41:25,260 --> 01:41:32,290
going to be looking at cross site request forgery,&nbsp;
or CSRF. Now, this is an extremely important topic&nbsp;&nbsp;

01:41:32,290 --> 01:41:37,660
and a big one that I cover it correctly. So for&nbsp;
the purpose of this video, I've set up a very&nbsp;&nbsp;

01:41:37,660 --> 01:41:43,870
unique environment that in at least in my opinion,&nbsp;
will demonstrate how to utilize or how to perform&nbsp;&nbsp;

01:41:43,870 --> 01:41:49,570
this attack. Alright, now I'm just going to give&nbsp;
you a brief overview of the environment that&nbsp;&nbsp;

01:41:49,570 --> 01:41:54,010
I have no, of course, you can see I have a few&nbsp;
files open here. Don't worry about them right now,&nbsp;&nbsp;

01:41:54,010 --> 01:41:59,260
just just remember that we'll be using them later&nbsp;
on. And I'll be using them really, really well to&nbsp;&nbsp;

01:41:59,260 --> 01:42:06,550
explain what's going on here. So you can see as my&nbsp;
target or as my vulnerable system I'm going to be&nbsp;&nbsp;

01:42:06,550 --> 01:42:12,160
using on my vulnerable web application, I should&nbsp;
say, I'm going to be using the OWASP juice shop&nbsp;&nbsp;

01:42:12,160 --> 01:42:19,150
now. Not actually no one actually recommended this&nbsp;
to me. But I remember that I performed this during&nbsp;&nbsp;

01:42:19,150 --> 01:42:25,990
a CTF challenge that I went to earlier, I think&nbsp;
late last year. I'm not too sure exactly when&nbsp;&nbsp;

01:42:25,990 --> 01:42:31,810
but the whole process was involved in exploiting&nbsp;
this web application. Alright, and in my opinion,&nbsp;&nbsp;

01:42:31,810 --> 01:42:38,470
this really outlined or really showed of how&nbsp;
to perform all of these various web application&nbsp;&nbsp;

01:42:38,470 --> 01:42:43,720
attacks. In this case, we're going to be&nbsp;
focusing on cross site request forgery. Alright,&nbsp;&nbsp;

01:42:43,720 --> 01:42:49,360
so I have the juice shop running it's, it's based&nbsp;
on a node.js. And it's running on my local host.&nbsp;&nbsp;

01:42:49,360 --> 01:42:53,170
Let me just show you that right now. There we&nbsp;
are. So I haven't logged in or done anything&nbsp;&nbsp;

01:42:53,170 --> 01:42:57,460
yet. And that's because I'm going to do that with&nbsp;
you. So I've set it up, it's running on my local&nbsp;&nbsp;

01:42:57,460 --> 01:43:05,560
host. Let's get started with this really, really&nbsp;
simple but sometimes complicated topic. Alright,&nbsp;&nbsp;

01:43:05,560 --> 01:43:12,340
so cross site request forgery CSRF. Now from&nbsp;
the name, you can already tell that it's split&nbsp;&nbsp;

01:43:12,340 --> 01:43:18,310
into two into two sections, you have your cross&nbsp;
site, and your request forgery. So from that,&nbsp;&nbsp;

01:43:18,310 --> 01:43:24,430
we can get a basic example of what's going on&nbsp;
here. We have cross site scripting, and we are&nbsp;&nbsp;

01:43:24,430 --> 01:43:30,610
going to be forging requests or we are going to be&nbsp;
manipulating requests. Hmm, interesting. So we are&nbsp;&nbsp;

01:43:30,610 --> 01:43:36,700
we are kind of understanding what's going on here.&nbsp;
Now the technical explanation for what CSRF is,&nbsp;&nbsp;

01:43:36,700 --> 01:43:43,730
is it is an attack that forces an end user to&nbsp;
executed unwanted actions on a web application&nbsp;&nbsp;

01:43:43,730 --> 01:43:50,000
in which they're currently authenticated. Alright,&nbsp;
so let me put that really, really simply, right,&nbsp;&nbsp;

01:43:50,000 --> 01:43:55,970
it's an attack that will force an end user to&nbsp;
execute unwanted actions on the web, on a web&nbsp;&nbsp;

01:43:55,970 --> 01:44:00,800
application, these actions can be anything, but in&nbsp;
this case, we're going to be looking at changing&nbsp;&nbsp;

01:44:00,800 --> 01:44:07,700
the password. And they have to be currently&nbsp;
authenticated to that web application, which means&nbsp;&nbsp;

01:44:07,700 --> 01:44:12,140
they have to be logged in to that web application&nbsp;
for this to work. Because if they're logged out,&nbsp;&nbsp;

01:44:12,140 --> 01:44:17,450
then you get the idea. It really doesn't help or&nbsp;
it doesn't work. Alright, so we use cross site&nbsp;&nbsp;

01:44:17,450 --> 01:44:23,360
scripting, in this case to perform the request&nbsp;
forgery, and to get either desired or undesired&nbsp;&nbsp;

01:44:23,360 --> 01:44:28,670
results. In our case, we're going to be looking&nbsp;
at how to to change the password of any user&nbsp;&nbsp;

01:44:28,670 --> 01:44:34,820
that's logged in to the to this web application.&nbsp;
And how will we How will we be doing that? Well,&nbsp;&nbsp;

01:44:34,820 --> 01:44:41,960
we are going to be using CSRF. But the first&nbsp;
thing you need to understand is how an HTML form&nbsp;&nbsp;

01:44:41,960 --> 01:44:48,260
works. Alright, and this is very important because&nbsp;
first of all, a client will request a page from a&nbsp;&nbsp;

01:44:48,260 --> 01:44:55,070
server. Alright, the server will then respond and&nbsp;
give the the client the HTML form. The client will&nbsp;&nbsp;

01:44:55,070 --> 01:45:02,390
then send back the form with the data back to the&nbsp;
server server will then authenticate and authorize&nbsp;&nbsp;

01:45:02,390 --> 01:45:08,990
the user and then will will perform the requested&nbsp;
action. And based on the request and the response,&nbsp;&nbsp;

01:45:08,990 --> 01:45:15,290
we are able to forge or to change the request&nbsp;
and get a desired response if you're looking at&nbsp;&nbsp;

01:45:15,290 --> 01:45:24,230
it from an attackers perspective. Alright, so,&nbsp;
the the way CRS CS CSRF works sorry about that&nbsp;&nbsp;

01:45:24,230 --> 01:45:29,690
is the attacker will manipulate the victim into&nbsp;
submitting the attackers form data to the victims&nbsp;&nbsp;

01:45:29,690 --> 01:45:36,770
web server, essentially, essentially performing&nbsp;
these these requests in the in our case, as I've&nbsp;&nbsp;

01:45:36,770 --> 01:45:42,500
mentioned, it will allow us to change the password&nbsp;
of any user on this web application, in this case,&nbsp;&nbsp;

01:45:42,500 --> 01:45:49,880
the OWASP juice shop web application. Alright,&nbsp;
so now you might be asking, Well, if I'm a bug&nbsp;&nbsp;

01:45:49,880 --> 01:45:54,830
bounty hunter, I'm practicing to become a bug&nbsp;
bounty hunter. How do I go about finding this&nbsp;&nbsp;

01:45:54,830 --> 01:45:58,760
vulnerability? Well, that's a very good question.&nbsp;
And that is the question you should be asking&nbsp;&nbsp;

01:45:58,760 --> 01:46:05,810
yourself when performing any penetration test.&nbsp;
Now, coming back to my environment, I'm running&nbsp;&nbsp;

01:46:05,810 --> 01:46:10,220
burp suite, the Community Edition, you you will&nbsp;
just need the Community Edition for this one,&nbsp;&nbsp;

01:46:10,220 --> 01:46:14,330
we're not performing any advanced techniques&nbsp;
here, because we're essentially just changing,&nbsp;&nbsp;

01:46:14,330 --> 01:46:21,080
we're just going to be changing the request to get&nbsp;
our desired responses. But once we move on to the&nbsp;&nbsp;

01:46:21,080 --> 01:46:27,350
advanced stuff, I'll then be using OS zap for&nbsp;
our attacks. Alright, so keeping things really,&nbsp;&nbsp;

01:46:27,350 --> 01:46:33,500
really simple, we, the way to look for these&nbsp;
vulnerabilities is to target the login pages,&nbsp;&nbsp;

01:46:33,500 --> 01:46:38,690
which we have right here, we then need to, we&nbsp;
can then create the account and log in. And&nbsp;&nbsp;

01:46:38,690 --> 01:46:44,630
then finally, we will be creating our own our&nbsp;
own script to perform the cross site scripting.&nbsp;&nbsp;

01:46:44,630 --> 01:46:50,480
And that will allow us to submit the data or&nbsp;
if we send the URL to another user of this&nbsp;&nbsp;

01:46:50,480 --> 01:46:55,400
web application who is currently authenticated,&nbsp;
it will allow the it will allow us to make them&nbsp;&nbsp;

01:46:55,400 --> 01:47:01,640
change their password, and then we can log into&nbsp;
their account. Alright, so this vulnerability&nbsp;&nbsp;

01:47:01,640 --> 01:47:08,570
is very common on sites with accounts, you know,&nbsp;
sites that have emails of passwords. And as you&nbsp;&nbsp;

01:47:08,570 --> 01:47:12,560
probably would have guessed, there are a lot&nbsp;
of sites that utilize this functionality. But&nbsp;&nbsp;

01:47:12,560 --> 01:47:16,610
remember, most of the sites out there will be&nbsp;
protected from this vulnerability. So it's up&nbsp;&nbsp;

01:47:16,610 --> 01:47:21,950
to you to find these vulnerabilities. Alright, so&nbsp;
as I've mentioned, we will be using OWASP juice&nbsp;&nbsp;

01:47:21,950 --> 01:47:27,500
shop as our target. And the reason is, is because&nbsp;
it will explain what I want to explain really,&nbsp;&nbsp;

01:47:27,500 --> 01:47:33,140
really well. Alright, and we'll be using the burp&nbsp;
suite Community Edition. Now, as you can see,&nbsp;&nbsp;

01:47:33,140 --> 01:47:38,120
I'm currently running the burp proxy, I'm not&nbsp;
intercepting any traffic, if I open up burp suite,&nbsp;&nbsp;

01:47:38,120 --> 01:47:42,680
I'm not intercepting any traffic. If I go to&nbsp;
the proxy, and intercept, I'm not intercepting&nbsp;&nbsp;

01:47:42,680 --> 01:47:48,650
anything. So it's currently just I'm just going&nbsp;
through the burp proxy and all the traffic and&nbsp;&nbsp;

01:47:48,650 --> 01:47:54,290
data is being logged through the proxy. So when&nbsp;
it comes down to this little data that I've&nbsp;&nbsp;

01:47:54,290 --> 01:47:58,010
saved here, I've already created an account.&nbsp;
The reason I've done that is to save time,&nbsp;&nbsp;

01:47:58,010 --> 01:48:04,130
because I don't want to explain everything about&nbsp;
it. So I've created, I've created a user with the&nbsp;&nbsp;

01:48:04,130 --> 01:48:10,730
email of test@test.com and a password of password.&nbsp;
So really simple. Again, there's nothing really&nbsp;&nbsp;

01:48:10,730 --> 01:48:15,590
complicated here. And if you want if you're&nbsp;
wondering what exactly does this mean? Well,&nbsp;&nbsp;

01:48:15,590 --> 01:48:21,650
this is a security question with the answer.&nbsp;
So the question was, what's my favorite pet,&nbsp;&nbsp;

01:48:21,650 --> 01:48:26,660
and I wrote in dog. So hopefully, that doesn't&nbsp;
scare you into thinking that I've gone completely&nbsp;&nbsp;

01:48:26,660 --> 01:48:32,300
crazy. And then in here we have the scripts that&nbsp;
we'll be using, or will be utilizing to perform&nbsp;&nbsp;

01:48:32,300 --> 01:48:38,150
the CSRF are on the site, I'll get to this in&nbsp;
a second. We don't need that right now. So if&nbsp;&nbsp;

01:48:38,150 --> 01:48:42,980
I want to log in, I know that the email is&nbsp;
test@test.com. And the password is password.&nbsp;&nbsp;

01:48:42,980 --> 01:48:49,220
Alright, so let me do that right now we need&nbsp;
to authenticate. So let me log in, like so. And&nbsp;&nbsp;

01:48:49,220 --> 01:48:55,700
I'm going to hit test@test.com. Alright, and I'm&nbsp;
going to write the password, which is password,&nbsp;&nbsp;

01:48:55,700 --> 01:48:59,990
and I'm going to log in. Alright, and I'm don't&nbsp;
want to save the password. And there you also&nbsp;&nbsp;

01:48:59,990 --> 01:49:05,810
have logged in now. Now as I said, this is very&nbsp;
this vulnerability works really, really well when&nbsp;&nbsp;

01:49:05,810 --> 01:49:09,980
you're talking about changing passwords, because&nbsp;
as you can probably guess, an attacker would would&nbsp;&nbsp;

01:49:09,980 --> 01:49:15,170
be looking to exploit this functionality because&nbsp;
imagine, if we were able to send a request a get&nbsp;&nbsp;

01:49:15,170 --> 01:49:21,110
request to our target with the URL encoded URL.&nbsp;
Of course, we can also use link shorteners,&nbsp;&nbsp;

01:49:21,110 --> 01:49:26,270
if we wanted to, to do that. And essentially,&nbsp;
if they authenticated, it will allow us to make&nbsp;&nbsp;

01:49:26,270 --> 01:49:30,920
them change their password simply by clicking&nbsp;
on the link, changing their password to whatever&nbsp;&nbsp;

01:49:30,920 --> 01:49:37,070
we specify. Alright, so how do we do this? Well,&nbsp;
the first thing we need to do is we need to look&nbsp;&nbsp;

01:49:37,070 --> 01:49:43,520
at how we get requests are being sent. And we can&nbsp;
do that using burp. So we're just going to change&nbsp;&nbsp;

01:49:43,520 --> 01:49:47,900
our password. So current password is password.&nbsp;
And what I'm going to do is I'm going to change&nbsp;&nbsp;

01:49:47,900 --> 01:49:59,150
my password into password. Oops, sorry, pass word&nbsp;
123. And I'm going to repeat it so fast word 123.&nbsp;&nbsp;

01:49:59,150 --> 01:50:05,180
And I'm going to hit Alright, so the password was&nbsp;
successfully changed. Okay, now let's look at how&nbsp;&nbsp;

01:50:05,180 --> 01:50:11,180
this was processed in burp, or how the request was&nbsp;
sent in burp. So I'm going to go into burp proxy&nbsp;&nbsp;

01:50:11,180 --> 01:50:15,860
and HTTP history. And I'm going to go all the way&nbsp;
to the bottom. And as you can see, we have the get&nbsp;&nbsp;

01:50:15,860 --> 01:50:21,670
request right over here. Okay, so the get request&nbsp;
is very interesting. You can see we have the get&nbsp;&nbsp;

01:50:21,670 --> 01:50:28,000
request, and it's targeting the the following URL.&nbsp;
And these are the parameters. So change password,&nbsp;&nbsp;

01:50:28,000 --> 01:50:34,090
the current password is password, new password&nbsp;
123. And we've repeated it. Alright. So now let&nbsp;&nbsp;

01:50:34,090 --> 01:50:39,220
us perform the forgery here. So I'm going&nbsp;
to send this in to the repeater. Alright,&nbsp;&nbsp;

01:50:39,220 --> 01:50:44,380
so I'm going to click on repeater. And in here, we&nbsp;
can manipulate the request and see what responses&nbsp;&nbsp;

01:50:44,380 --> 01:50:50,260
we get. All right, in case you, you did not know&nbsp;
about that. But again, let's start off really,&nbsp;&nbsp;

01:50:50,260 --> 01:50:55,600
really simply. So we are going to be working&nbsp;
with the raw request. We don't want to work&nbsp;&nbsp;

01:50:55,600 --> 01:51:00,100
with individual parameters, although you could&nbsp;
change it, but we are going to be manipulating&nbsp;&nbsp;

01:51:00,100 --> 01:51:05,410
the request entirely so that it performs what we&nbsp;
want to do. Alright, so what we can do first is&nbsp;&nbsp;

01:51:05,410 --> 01:51:13,420
we can test so let's change what if we were to&nbsp;
change the current password to something like,&nbsp;&nbsp;

01:51:13,420 --> 01:51:18,910
let's see test, let's change it to test and&nbsp;
then we hit go, you can see that the response&nbsp;&nbsp;

01:51:18,910 --> 01:51:24,730
we get is a is a 401 error, which means we are an&nbsp;
authorized to make that and it will give you the&nbsp;&nbsp;

01:51:24,730 --> 01:51:29,290
message right here. The current password is not&nbsp;
correct. All right, that's good. That is good from&nbsp;&nbsp;

01:51:29,290 --> 01:51:34,180
a web application perspective, which means that&nbsp;
this web application is performing validation.&nbsp;&nbsp;

01:51:34,180 --> 01:51:39,730
And it's not going to allow us to know to just go&nbsp;
in and start manipulating any requests and making&nbsp;&nbsp;

01:51:39,730 --> 01:51:45,820
changes. So from a security perspective, the web&nbsp;
application is doing really, really well. Alright,&nbsp;&nbsp;

01:51:45,820 --> 01:51:52,930
what if I was to change the new password? Let&nbsp;
me change this back to password to the current&nbsp;&nbsp;

01:51:52,930 --> 01:51:59,680
password, which is what we said and change the&nbsp;
new password to password pass 123. All right,&nbsp;&nbsp;

01:51:59,680 --> 01:52:07,720
and I hit go. Again, we get another error. Again,&nbsp;
the 401 unauthorized error telling us that the new&nbsp;&nbsp;

01:52:07,720 --> 01:52:13,330
and repeated password do not match. So yes, the&nbsp;
current password is correct. And the only thing&nbsp;&nbsp;

01:52:13,330 --> 01:52:17,650
that we're getting an error is the new password&nbsp;
and the repeated password are not correct. So&nbsp;&nbsp;

01:52:17,650 --> 01:52:24,610
interesting. What if we want to change the&nbsp;
password into password 123. And we can repeat that&nbsp;&nbsp;

01:52:24,610 --> 01:52:33,430
again. So we want to confirm this. So password&nbsp;
123 actually hold on. So I'm going to say password&nbsp;&nbsp;

01:52:33,430 --> 01:52:42,340
123. And now let's see what this tells us. This&nbsp;
should verify it. But let's see if this works.&nbsp;&nbsp;

01:52:42,340 --> 01:52:47,650
So you can see yes, that does work. And we know&nbsp;
that this works, because that's what we did that&nbsp;&nbsp;

01:52:47,650 --> 01:52:53,860
was the original request. But what if we do not&nbsp;
know the current password of the user? Remember,&nbsp;&nbsp;

01:52:53,860 --> 01:52:59,200
we're going to be targeting other users of this&nbsp;
web application. So what if we get rid of and this&nbsp;&nbsp;

01:52:59,200 --> 01:53:05,170
is very, very, this is the way penetration testers&nbsp;
go about it. What if we get rid of stuff? So what&nbsp;&nbsp;

01:53:05,170 --> 01:53:11,170
if we get rid of the current password? Alright,&nbsp;
and now essentially, they get his targeting Change&nbsp;&nbsp;

01:53:11,170 --> 01:53:17,050
Password with the question mark here, essentially&nbsp;
requesting and we're only entering the fields or&nbsp;&nbsp;

01:53:17,050 --> 01:53:22,480
parameters new. And repeat what if we do that&nbsp;
and we change them to password 123 I mean,&nbsp;&nbsp;

01:53:22,480 --> 01:53:30,220
pass 123 and pass 123. Let go. You can see yes,&nbsp;
it does work, we get the 200, the 200 response,&nbsp;&nbsp;

01:53:30,220 --> 01:53:35,350
which means everything was processed correctly.&nbsp;
And we were able to get a password that looks&nbsp;&nbsp;

01:53:35,350 --> 01:53:41,980
to be hash, that looks to be hashed. And we got&nbsp;
the email that we used. So yes, we do know that&nbsp;&nbsp;

01:53:41,980 --> 01:53:50,500
it is working. Alright, so we know that we know&nbsp;
that this worked. But we need to confirm that&nbsp;&nbsp;

01:53:50,500 --> 01:53:55,780
this has worked. So we can do this by going back&nbsp;
into our web application. And we can log out and&nbsp;&nbsp;

01:53:55,780 --> 01:53:59,920
we can try and log in again. So log in with our&nbsp;
new password. So we're gonna say test@test.com,&nbsp;&nbsp;

01:54:01,360 --> 01:54:07,270
and our new password was passed 123. Remember, we&nbsp;
changed it earlier. But again, I was demonstrating&nbsp;&nbsp;

01:54:07,270 --> 01:54:12,820
that we if we are to send this to our target, we&nbsp;
need to specify to make sure that it will work&nbsp;&nbsp;

01:54:12,820 --> 01:54:18,730
without any pre required information like their&nbsp;
current password. So I've manipulated the request&nbsp;&nbsp;

01:54:18,730 --> 01:54:25,480
there. So let's hit log in. And voila, you can see&nbsp;
it does work. Excellent. All right. So this is a&nbsp;&nbsp;

01:54:25,480 --> 01:54:32,080
fantastic example of so also CSRF can be utilized&nbsp;
or how it can be how you can find vulnerabilities&nbsp;&nbsp;

01:54:32,080 --> 01:54:39,130
for it. Alright, so this can allow us to change&nbsp;
or update anyone's password. anyone's accounts&nbsp;&nbsp;

01:54:39,130 --> 01:54:45,580
password that are currently logged into this web&nbsp;
application. Alright, so now what we what we need&nbsp;&nbsp;

01:54:45,580 --> 01:54:51,480
to do well, we can we can log in. As we've already&nbsp;
seen, we can log in and once you've logged in,&nbsp;&nbsp;

01:54:51,480 --> 01:54:58,080
we can we can test to see if cross site scripting&nbsp;
does work. And then of course utilizing it&nbsp;&nbsp;

01:54:58,080 --> 01:55:03,240
throughout the web application is very important.&nbsp;
So We can run a simple cross site script attack to&nbsp;&nbsp;

01:55:03,240 --> 01:55:08,820
see if it will work on the search bar right here.&nbsp;
So I'm going to type in script. And a simple one.&nbsp;&nbsp;

01:55:08,820 --> 01:55:16,320
So alert, just to test whether it works. And&nbsp;
in the alert, we can say, Hello, just something&nbsp;&nbsp;

01:55:16,320 --> 01:55:24,480
stupid hello world, you know, that's an I can't&nbsp;
even type man Come on world. And we've typed in&nbsp;&nbsp;

01:55:24,480 --> 01:55:29,520
the alert. And we can finally close the script&nbsp;
here. Script like so. And let's hit search.&nbsp;&nbsp;

01:55:29,521 --> 01:55:34,801
And voila, we can see that indeed, cross site&nbsp;
scripting work works, which means we can insert,&nbsp;&nbsp;

01:55:34,800 --> 01:55:42,570
we can insert our GET request inside a script and&nbsp;
use a cross site scripting to perform the CSRF.&nbsp;&nbsp;

01:55:42,570 --> 01:55:48,090
And now you can see them conjoining together,&nbsp;
cross site scripting with request forgery. Okay,&nbsp;&nbsp;

01:55:48,090 --> 01:55:52,620
so we now need to create our custom script&nbsp;
that will allow us to utilize the attack.&nbsp;&nbsp;

01:55:52,620 --> 01:55:57,810
And we will be using XML and HTTP. Now, you&nbsp;
might have seen this script right over here,&nbsp;&nbsp;

01:55:57,811 --> 01:56:02,611
let me just minimize this and open up leafpad, you&nbsp;
might have seen this script that I created. Now&nbsp;&nbsp;

01:56:02,610 --> 01:56:09,120
you can find many of these CSRS scripts are online&nbsp;
that utilize different languages. In my case,&nbsp;&nbsp;

01:56:09,120 --> 01:56:15,060
I find the one that works the best is the&nbsp;
is the one that works with x XML and HTTP&nbsp;&nbsp;

01:56:15,061 --> 01:56:22,381
and contains the get request in here. Okay, now,&nbsp;
you can see that the get request requires the URL&nbsp;&nbsp;

01:56:22,380 --> 01:56:28,140
in which we submit the the parameters without the&nbsp;
current password. So we need to go back into burp.&nbsp;&nbsp;

01:56:28,140 --> 01:56:38,010
And it needs to go back into proxy HTTP. Sorry&nbsp;
about that HTTP, we look to change the password.&nbsp;&nbsp;

01:56:38,010 --> 01:56:45,120
So if we go back into, sorry, the repeater. And&nbsp;
if we look at this now, we can see that the URL&nbsp;&nbsp;

01:56:45,120 --> 01:56:52,140
is right over here. So that's the get request. So&nbsp;
if we copy this localhost, obviously, and we are&nbsp;&nbsp;

01:56:52,140 --> 01:56:57,840
not using any current password field, so if we&nbsp;
can do that, really, really simply, you can see&nbsp;&nbsp;

01:56:57,840 --> 01:57:03,929
how this can be utilized really, really well. So&nbsp;
what we need to do now is understand how the URL&nbsp;&nbsp;

01:57:03,930 --> 01:57:08,130
will be format. And of course, the web application&nbsp;
is going to encode it, and I'll get to that in a&nbsp;&nbsp;

01:57:08,130 --> 01:57:13,290
second. So we need to copy this URL right here.&nbsp;
So I'm just going to copy the URL. And we can&nbsp;&nbsp;

01:57:13,290 --> 01:57:19,530
edit our our script. So HTTPS, and we paste it in&nbsp;
inside the URL, you can copy this script if you&nbsp;&nbsp;

01:57:19,530 --> 01:57:26,880
want to. Let's take a look at whether this script&nbsp;
is formatted correctly. So get HTTP new, that's&nbsp;&nbsp;

01:57:26,880 --> 01:57:33,480
not the way we want it. Let me get rid of the&nbsp;
pre pre determined HTTP there. So HTTP localhost,&nbsp;&nbsp;

01:57:33,480 --> 01:57:40,680
it's hosted on my localhost with the Port 3000&nbsp;
node, an OJS standard. And the we want to change&nbsp;&nbsp;

01:57:40,680 --> 01:57:45,870
the password, the new password is past 123 and&nbsp;
repeat his past 123, you can change that to&nbsp;&nbsp;

01:57:45,870 --> 01:57:52,080
whatever you want, if you want to, you know, play&nbsp;
around with the script. But in my case, I don't&nbsp;&nbsp;

01:57:52,080 --> 01:57:58,440
want to do any of that. So this is the script. So&nbsp;
what we can do is we can copy this now. And we can&nbsp;&nbsp;

01:57:58,440 --> 01:58:06,330
run this in the search bar. And that should, in&nbsp;
theory, and in practice, give us our first CSRF&nbsp;&nbsp;

01:58:06,330 --> 01:58:11,070
attack on the site. So I'm going to paste this in&nbsp;
here. And let's see whether it does this. So I'm&nbsp;&nbsp;

01:58:11,070 --> 01:58:17,550
gonna hit search. And you can see you successfully&nbsp;
solved the challenge error handling provoked an&nbsp;&nbsp;

01:58:17,550 --> 01:58:23,250
error that is not very gracefully handle. Again,&nbsp;
this is a fantastic web application vulnerable web&nbsp;&nbsp;

01:58:23,250 --> 01:58:28,620
application that is awesome for practicing your&nbsp;
your web application penetration testing skills.&nbsp;&nbsp;

01:58:28,620 --> 01:58:34,980
Now, I talked about the URL that you should send&nbsp;
to your target. And that is the URL that will&nbsp;&nbsp;

01:58:34,980 --> 01:58:40,800
essentially make them change their password or&nbsp;
without them knowing, given that they are logged&nbsp;&nbsp;

01:58:40,800 --> 01:58:46,320
in to the web application or they have an account,&nbsp;
it will not work if they have not logged in.&nbsp;&nbsp;

01:58:46,320 --> 01:58:50,640
Alright, so that's very important to understand.&nbsp;
And many people just you know, forget about this.&nbsp;&nbsp;

01:58:50,640 --> 01:58:59,700
Now. Again, if you could have done this, you I&nbsp;
can log out again, and I can log in try and log&nbsp;&nbsp;

01:58:59,700 --> 01:59:05,100
in now. And I can type in for example test I just&nbsp;
want to show you something very interesting here&nbsp;&nbsp;

01:59:05,100 --> 01:59:10,740
test. And I can change the password, we already&nbsp;
changed it to password 123. Now before I do that,&nbsp;&nbsp;

01:59:10,740 --> 01:59:14,990
I can just inspect the element here. And I'm&nbsp;
going to hit login. And I just wanted you to&nbsp;&nbsp;

01:59:14,990 --> 01:59:21,290
check something out. All right now, let me just&nbsp;
expand this a little bit here. If we were to&nbsp;&nbsp;

01:59:21,290 --> 01:59:25,940
look at the network, this will essentially shows&nbsp;
all the GET requests. So if I was to hit login,&nbsp;&nbsp;

01:59:25,940 --> 01:59:31,640
you can see that if we are to look at the&nbsp;
get request here the login GET request,&nbsp;&nbsp;

01:59:31,640 --> 01:59:38,570
you can go ahead and look at at the exact format&nbsp;
in which it was sent. You can look at the cookie&nbsp;&nbsp;

01:59:38,570 --> 01:59:44,750
the it should give you the the authentication&nbsp;
token not to show it should give you the authentic&nbsp;&nbsp;

01:59:44,750 --> 01:59:49,520
the authentication token. But that's something for&nbsp;
another day. Don't want to complicate you guys,&nbsp;&nbsp;

01:59:49,520 --> 01:59:53,960
you can look at the cookie if you want to. And&nbsp;
you have all the responses right here. So there we&nbsp;&nbsp;

01:59:53,960 --> 01:59:59,510
are. There's the authentication token and you can&nbsp;
see something very interesting in regards to the&nbsp;&nbsp;

01:59:59,510 --> 02:00:11,450
token. Alright, so let me show you this right now.&nbsp;
Alright, so as I was saying, you can see. Alright,&nbsp;&nbsp;

02:00:11,450 --> 02:00:16,550
so as I was saying, you can see that if we look&nbsp;
at the parameters, the password will be displayed&nbsp;&nbsp;

02:00:16,550 --> 02:00:21,530
there, and it will be updated to the one that&nbsp;
we selected or specified in the script. Alright,&nbsp;&nbsp;

02:00:21,530 --> 02:00:26,210
so remember, if you want to customize the cross&nbsp;
site scripting attack, you can do it through your&nbsp;&nbsp;

02:00:26,210 --> 02:00:31,790
script. And where is lifted here. So there we are.&nbsp;
So you can change the password. The as you see,&nbsp;&nbsp;

02:00:31,790 --> 02:00:36,920
we just got rid of the current password parameter,&nbsp;
which is a vulnerability on the site, but you can&nbsp;&nbsp;

02:00:36,920 --> 02:00:41,450
change the password to whatever you want. And&nbsp;
now you might be asking, as I've mentioned, what&nbsp;&nbsp;

02:00:41,450 --> 02:00:46,190
link do you send to the target and that is very,&nbsp;
very simple. If I was to run the script again,&nbsp;&nbsp;

02:00:46,190 --> 02:00:55,160
and I change the password to maybe something else&nbsp;
like password 124, or 345, sorry, 345. Let me just&nbsp;&nbsp;

02:00:55,160 --> 02:01:02,150
add that to the password. And I run the script on&nbsp;
an authenticated user, which is me. So let me copy&nbsp;&nbsp;

02:01:02,150 --> 02:01:07,040
that. And it should change my account password.&nbsp;
And you can see once I log in, log out and try&nbsp;&nbsp;

02:01:07,040 --> 02:01:11,990
logging in, it will have changed it successfully.&nbsp;
So let me just run it in here. So I'm going to&nbsp;&nbsp;

02:01:11,990 --> 02:01:16,490
paste the new one in here. And I'm going to search&nbsp;
and there we are. So now it's changed my password.&nbsp;&nbsp;

02:01:16,490 --> 02:01:25,761
And if I log out, and I try and log in with with&nbsp;
the old password, which is password 123, you can&nbsp;&nbsp;

02:01:25,760 --> 02:01:31,220
see whoops, sorry, I think I typed that in wrongly&nbsp;
123 like so, fight login, there we are, you can&nbsp;&nbsp;

02:01:31,220 --> 02:01:36,830
see that we entered the new password, and it did&nbsp;
work fantastic. So we were successfully able to&nbsp;&nbsp;

02:01:36,830 --> 02:01:42,680
execute the script. And again, when if I just run&nbsp;
the script, again, this is the URL that you will&nbsp;&nbsp;

02:01:42,680 --> 02:01:48,860
send to your target. Alright, so if I just copy&nbsp;
it, and I inspect it in my leafpad here, I really&nbsp;&nbsp;

02:01:48,860 --> 02:01:53,630
love leafpad. I don't know that you guys love it,&nbsp;
too. If I just inspect it, you can see that this&nbsp;&nbsp;

02:01:53,630 --> 02:01:59,270
indeed is a URL. And if the web application was&nbsp;
being hosted on a server, outside my local area&nbsp;&nbsp;

02:01:59,270 --> 02:02:04,850
network, it would give you the website name, the&nbsp;
port, if it is port specific, and the URL here,&nbsp;&nbsp;

02:02:04,850 --> 02:02:10,070
which as you can see is encoded. So what I&nbsp;
would recommend is that you copy this link here,&nbsp;&nbsp;

02:02:10,070 --> 02:02:15,980
and you use a link shortener like bit fly or any&nbsp;
of the other Google shorteners, and you send that&nbsp;&nbsp;

02:02:15,980 --> 02:02:20,780
to your target. And once they click on the link,&nbsp;
and if they already logged in to this specific&nbsp;&nbsp;

02:02:20,780 --> 02:02:26,120
web application, it will update their password.&nbsp;
And you can essentially, you have the password&nbsp;&nbsp;

02:02:26,120 --> 02:02:30,800
now because you've updated it. And you're all you&nbsp;
need is the email, which I'm pretty sure you must&nbsp;&nbsp;

02:02:30,800 --> 02:02:35,630
be knowing if you're performing this attack. Or&nbsp;
you could just be gathering passwords of users,&nbsp;&nbsp;

02:02:35,630 --> 02:02:41,990
all of which you can, you can send this link to&nbsp;
and are authenticated with the web application.&nbsp;&nbsp;

02:02:46,020 --> 02:02:50,720
We're going to be taking a look at session&nbsp;
management. And in this video, particularly,&nbsp;&nbsp;

02:02:50,720 --> 02:02:57,050
we'll be looking at cookie collection. Alright, so&nbsp;
as you know, you probably would have known what a&nbsp;&nbsp;

02:02:57,050 --> 02:03:03,020
cookie is. Now there are three types of cookies&nbsp;
that we really need to be focusing on in this&nbsp;&nbsp;

02:03:03,021 --> 02:03:10,551
section. And we will be focusing on in general.&nbsp;
The first one is the session cookies, which I'll&nbsp;&nbsp;

02:03:10,550 --> 02:03:15,830
discuss in a while we then have the permanent&nbsp;
cookies and the third party cookies. So third&nbsp;&nbsp;

02:03:15,831 --> 02:03:22,251
party cookies are really all to do with third&nbsp;
party API's that may be used. So for example,&nbsp;&nbsp;

02:03:22,250 --> 02:03:30,500
if you're on a website that utilizes flashplayer,&nbsp;
you may find some cookies, that that are in relate&nbsp;&nbsp;

02:03:30,500 --> 02:03:36,080
that are related to the Flash Player. So it's very&nbsp;
important that you understand how to collect these&nbsp;&nbsp;

02:03:36,081 --> 02:03:41,691
cookies. And as well, we'll be looking at reverse&nbsp;
engineering them, but not really tampering with&nbsp;&nbsp;

02:03:41,690 --> 02:03:46,940
them. Because I first want to explain to you guys&nbsp;
how everything is done. And then we can move on&nbsp;&nbsp;

02:03:46,940 --> 02:03:52,970
into into finally tampering with them and seeing&nbsp;
if we can change them to give us access to give us&nbsp;&nbsp;

02:03:52,970 --> 02:03:57,410
different type of of access. And where this comes&nbsp;
into play is when you're talking about session&nbsp;&nbsp;

02:03:57,411 --> 02:04:04,491
cookies. And in this session cookies, we have the&nbsp;
the auth, the authentication token, and the D and&nbsp;&nbsp;

02:04:04,490 --> 02:04:10,490
the unauthenticated token. So all to do with your&nbsp;
access on a web application or on a website. Okay,&nbsp;&nbsp;

02:04:10,490 --> 02:04:18,410
so essentially, all the cookies that you can&nbsp;
probably ever get when you visit or you get&nbsp;&nbsp;

02:04:18,411 --> 02:04:23,541
when you visit a website are they are generated&nbsp;
when you visit the website. And furthermore,&nbsp;&nbsp;

02:04:23,541 --> 02:04:28,911
the cookies change when you authenticate with&nbsp;
the website and you or you log out right so when&nbsp;&nbsp;

02:04:28,911 --> 02:04:33,591
you log in, you get a different set of cookies.&nbsp;
And when you log out, you get a different set of&nbsp;&nbsp;

02:04:33,590 --> 02:04:38,150
cookies. This is where the whole idea of session&nbsp;
management comes into play and how cookies are&nbsp;&nbsp;

02:04:38,150 --> 02:04:44,540
utilized for this system. So I'm currently running&nbsp;
OSU shop. So I showed you guys how to set that up.&nbsp;&nbsp;

02:04:44,541 --> 02:04:50,781
Let me know if you found it helpful. So I have&nbsp;
it set up and open as it opened up in my browser.&nbsp;&nbsp;

02:04:50,780 --> 02:04:55,160
Now what I'm going to be covering is how to&nbsp;
collect these cookies and understanding the&nbsp;&nbsp;

02:04:55,161 --> 02:05:00,670
difference between an unauthenticated cookie&nbsp;
and the authenticated cookie. So Usually,&nbsp;&nbsp;

02:05:01,480 --> 02:05:05,800
what I have, or what I use to my advantage&nbsp;
is if you're using Google Chrome or Firefox,&nbsp;&nbsp;

02:05:05,800 --> 02:05:12,790
you you can get a cookie collection or a cookie&nbsp;
editor add on that allows you to edit the cookies.&nbsp;&nbsp;

02:05:12,790 --> 02:05:16,750
But as I said, we're not going to be looking at&nbsp;
editing them right now, because we don't know&nbsp;&nbsp;

02:05:16,750 --> 02:05:21,130
what to change in them, this video is going to&nbsp;
be focused on collecting them and then analyzing&nbsp;&nbsp;

02:05:21,130 --> 02:05:27,250
them to see what information they have within&nbsp;
them. All right, so I've currently I reset this,&nbsp;&nbsp;

02:05:27,250 --> 02:05:33,340
the OWASP juice shop. And the reason I did that&nbsp;
is just to start off fresh. And I said, we're&nbsp;&nbsp;

02:05:33,340 --> 02:05:38,140
going to be using this for performing all of the&nbsp;
examples that we'll be showing you so that we can&nbsp;&nbsp;

02:05:38,140 --> 02:05:43,750
learn all the concepts. So I'm just gonna, before&nbsp;
we log in, I just want to show you the first set&nbsp;&nbsp;

02:05:43,750 --> 02:05:48,550
of cookies that we'll get once we were when we&nbsp;
visited the site. Don't worry about the other&nbsp;&nbsp;

02:05:48,550 --> 02:05:54,190
links, we'll get to them in a second. Alright, so&nbsp;
I'm using the cookie editor right here, you can&nbsp;&nbsp;

02:05:54,190 --> 02:06:00,610
find this same one for Firefox, that's what I'm&nbsp;
using. They are also other ones for Google Chrome,&nbsp;&nbsp;

02:06:00,610 --> 02:06:06,550
if you want to do that. And in addition, we're&nbsp;
not going to be using any proxy, like burp suite&nbsp;&nbsp;

02:06:06,550 --> 02:06:12,130
or the OWASP zap right now, because we're just&nbsp;
focused on using the browser tools. And of course,&nbsp;&nbsp;

02:06:12,130 --> 02:06:18,520
these add ons here. So what I can do now is if I&nbsp;
just go right click, and I hit Inspect Element, we&nbsp;&nbsp;

02:06:18,520 --> 02:06:25,210
have the, the developer tools right here. And if&nbsp;
we are to go into Once you've installed the cookie&nbsp;&nbsp;

02:06:25,210 --> 02:06:30,190
editor, you can directly go into storage. And in&nbsp;
storage, you will, you will begin you will get the&nbsp;&nbsp;

02:06:30,190 --> 02:06:35,680
cookies here and other values right here. But if&nbsp;
you it'll be better for you to understand what's&nbsp;&nbsp;

02:06:35,680 --> 02:06:40,780
going on if you go into the cookie editor. Now&nbsp;
in the cookie editor, you can see that we have&nbsp;&nbsp;

02:06:40,780 --> 02:06:46,780
two cookies that we've gathered here, and we have&nbsp;
the cookie consent status. And the the i o which&nbsp;&nbsp;

02:06:46,780 --> 02:06:52,810
I'm not sure really what it does input output,&nbsp;
output, I'm probably guessing. So when it comes&nbsp;&nbsp;

02:06:52,810 --> 02:07:00,010
down to the QB, consent status, we probably get an&nbsp;
idea of what of what this is. What this is asking&nbsp;&nbsp;

02:07:00,010 --> 02:07:05,800
us. So when I when I opened up the website, it&nbsp;
gave me a prompt asking me like all websites will&nbsp;&nbsp;

02:07:05,800 --> 02:07:12,550
ask you in 2018 to do is to accept their privacy&nbsp;
policy, in their privacy policies in regards to&nbsp;&nbsp;

02:07:12,550 --> 02:07:19,080
their use of personal data and cookies. And the&nbsp;
reason is, is because cookies can can log or have&nbsp;&nbsp;

02:07:19,080 --> 02:07:23,400
a lot of information about you. They contain a&nbsp;
lot of information about what your what you've&nbsp;&nbsp;

02:07:23,400 --> 02:07:28,710
been doing. So this is why I've created this right&nbsp;
now before we move along, it's very important to&nbsp;&nbsp;

02:07:28,710 --> 02:07:36,150
understand their role in session management. Okay,&nbsp;
so we need to look at the authentic authentication&nbsp;&nbsp;

02:07:36,150 --> 02:07:41,250
tokens because that's where most of the magic&nbsp;
happens, as you would expect. So let me just close&nbsp;&nbsp;

02:07:41,250 --> 02:07:46,530
this up. And let me just log in. So let me just&nbsp;
use the password there, the email that I used,&nbsp;&nbsp;

02:07:46,530 --> 02:07:53,040
and the password, like so. And let me just log in.&nbsp;
I don't want to save the password. So I've logged&nbsp;&nbsp;

02:07:53,040 --> 02:07:58,950
in now. And if I inspect the element, again,&nbsp;
you can see in the cookie editor, let that load,&nbsp;&nbsp;

02:07:58,950 --> 02:08:03,270
it usually takes a while to load. There we are,&nbsp;
we have the token. Now the token, this token is&nbsp;&nbsp;

02:08:03,270 --> 02:08:09,480
an authentication token. Alright, so when it comes&nbsp;
down, when it comes down to reverse engineering a&nbsp;&nbsp;

02:08:09,480 --> 02:08:14,880
token, for example, let's use this as our example.&nbsp;
We essentially testing it for vulnerabilities&nbsp;&nbsp;

02:08:14,880 --> 02:08:18,990
similar to a penetration test. Now you might be&nbsp;
a little bit confused. You might be asking, Well,&nbsp;&nbsp;

02:08:18,990 --> 02:08:24,510
what what what do you mean by this? How can we&nbsp;
perform a penetration test on this token? Well,&nbsp;&nbsp;

02:08:24,510 --> 02:08:31,470
this token is encoded. Alright. So this is if&nbsp;
we just copy this. I don't know whether you know&nbsp;&nbsp;

02:08:31,470 --> 02:08:37,560
about this, but this is a JSON web token. Alright.&nbsp;
So it is it is a JSON web token. And you can use&nbsp;&nbsp;

02:08:37,560 --> 02:08:42,510
the JSON Web Token decoder, I'll be posting this&nbsp;
link in the description. This is the one that&nbsp;&nbsp;

02:08:42,510 --> 02:08:50,040
I prefer to use. If I am to paste this in here.&nbsp;
And you can see once I've pasted it in here, it's&nbsp;&nbsp;

02:08:50,040 --> 02:08:54,780
going to give me all information. And I'm going&nbsp;
to help you understand what we've just done. So&nbsp;&nbsp;

02:08:54,780 --> 02:08:59,130
essentially, what we have done is we have reverse&nbsp;
engineered what this web token is all about. So&nbsp;&nbsp;

02:08:59,130 --> 02:09:05,010
now we need to look at what what it contains and&nbsp;
what type of authorities or privileges it's giving&nbsp;&nbsp;

02:09:05,010 --> 02:09:11,070
to us. Because remember, this is an authentication&nbsp;
token. And it is unique to us because this will,&nbsp;&nbsp;

02:09:11,070 --> 02:09:15,720
this will determine whether or not we're logged&nbsp;
into a site or we're logged out and what access&nbsp;&nbsp;

02:09:15,720 --> 02:09:20,460
we have on the website. I'm pretty sure you&nbsp;
already know that. All right. So when it comes to&nbsp;&nbsp;

02:09:20,460 --> 02:09:25,980
the header, now, this is very important. I've seen&nbsp;
many web people claiming to be bug bounty hunters&nbsp;&nbsp;

02:09:25,980 --> 02:09:31,170
and they don't understand how the the web token is&nbsp;
even structured. What is the header the header is&nbsp;&nbsp;

02:09:31,170 --> 02:09:36,540
separated from the payload. This is the header&nbsp;
right here, up until the first full stop that&nbsp;&nbsp;

02:09:36,540 --> 02:09:41,010
is the header it's very important to understand&nbsp;
that because they are separated from each other.&nbsp;&nbsp;

02:09:41,010 --> 02:09:45,900
In fact, the JSON web token is sorted into three&nbsp;
parts right here you have the you have the header,&nbsp;&nbsp;

02:09:45,900 --> 02:09:51,780
you then have the payload until here. And then&nbsp;
finally you have the signature which is right,&nbsp;&nbsp;

02:09:51,780 --> 02:09:57,480
right at the bottom here which is also separated&nbsp;
from the rest. Okay, so when it comes down to the&nbsp;&nbsp;

02:09:57,480 --> 02:10:02,790
header, alright, the header is going to give&nbsp;
you the of the of the token. In this case,&nbsp;&nbsp;

02:10:02,790 --> 02:10:07,830
we know it's a JSON web token, we then have the&nbsp;
algorithm, which is the hashing algorithm used,&nbsp;&nbsp;

02:10:07,830 --> 02:10:14,130
which is the RS 256. And then the payload&nbsp;
now in the payload, this is where things get&nbsp;&nbsp;

02:10:14,130 --> 02:10:19,320
really interesting as you would have expected, you&nbsp;
have the status, the status code here, the data,&nbsp;&nbsp;

02:10:19,320 --> 02:10:28,170
if any data was passed the ID, we can always use&nbsp;
the ID. Two, we can always edit the ID to see what&nbsp;&nbsp;

02:10:28,170 --> 02:10:33,060
else it can give us in terms of authentication,&nbsp;
because different types of identification or&nbsp;&nbsp;

02:10:33,060 --> 02:10:37,680
identification tokens give us different types&nbsp;
of access. So, as essentially this is what I was&nbsp;&nbsp;

02:10:37,680 --> 02:10:43,800
talking about, this is where you will scrutinize&nbsp;
the the the authentication token, and try and and&nbsp;&nbsp;

02:10:43,800 --> 02:10:49,290
tamper with it to to see what different results&nbsp;
you can you can get. So remember, we can edit this&nbsp;&nbsp;

02:10:49,290 --> 02:10:54,660
token, right, and we can edit anything about it.&nbsp;
And then we can finally copy it. And we can use&nbsp;&nbsp;

02:10:54,660 --> 02:11:01,380
that in the OSB shop and paste it right here and&nbsp;
re authenticate with that new token and see what&nbsp;&nbsp;

02:11:01,380 --> 02:11:05,100
results we can get. Now, of course, we're not&nbsp;
going to do that right now, because I wanted to&nbsp;&nbsp;

02:11:05,100 --> 02:11:10,800
introduce you as to what information you're going&nbsp;
to find and what exactly is going on here. Okay,&nbsp;&nbsp;

02:11:10,800 --> 02:11:17,610
so one step at a time. So you can see that&nbsp;
something interesting pops up here, something&nbsp;&nbsp;

02:11:17,610 --> 02:11:23,190
extremely interesting, we have the email which&nbsp;
for some reason, in this token, we can see that&nbsp;&nbsp;

02:11:23,190 --> 02:11:31,320
it's not very well designed because the email is&nbsp;
in plain text, which means which means if In any&nbsp;&nbsp;

02:11:31,320 --> 02:11:38,730
case, or in any scenario, someone is able to get&nbsp;
this token in which I authenticated within a site,&nbsp;&nbsp;

02:11:38,730 --> 02:11:44,520
they will have access to my email and my password.&nbsp;
But you must be saying, Well, I didn't see you&nbsp;&nbsp;

02:11:44,520 --> 02:11:50,040
type out all of these random passwords here. Well,&nbsp;
I can easily guess that this is an MD five hashed&nbsp;&nbsp;

02:11:50,040 --> 02:11:55,650
password, which means I can depending on the&nbsp;
on the strength of the password, I can decrypt&nbsp;&nbsp;

02:11:55,650 --> 02:12:00,630
online in a second using any of the decryption&nbsp;
tools. So if I was to just copy this right now,&nbsp;&nbsp;

02:12:00,630 --> 02:12:05,880
and I wanted to know the password, let's say this&nbsp;
wasn't even mine, this authentication token wasn't&nbsp;&nbsp;

02:12:05,880 --> 02:12:10,620
even mine, and I found the the email and password,&nbsp;
all I needed to do was unmatched the password,&nbsp;&nbsp;

02:12:10,620 --> 02:12:16,050
I can go to Mt five online.org, which is what I&nbsp;
use a lot. And I paste that hash right in here.&nbsp;&nbsp;

02:12:16,050 --> 02:12:20,970
And I hit decrypt. And you can see, well, first&nbsp;
of all, it's gonna prompt me to enter capture&nbsp;&nbsp;

02:12:20,970 --> 02:12:26,610
your storefront. This is this is getting really&nbsp;
annoying. Now, for some reason, it always does&nbsp;&nbsp;

02:12:26,610 --> 02:12:31,440
that, as you can see, it's gonna, it's gonna find&nbsp;
the action. Of course, this is this is dependent&nbsp;&nbsp;

02:12:31,440 --> 02:12:36,810
on the difficulty of the hash and whether or not&nbsp;
it can find it online. Okay, so you can see that&nbsp;&nbsp;

02:12:36,810 --> 02:12:42,390
it will display the hash and the password in plain&nbsp;
text, which in this case was passed 123. Now,&nbsp;&nbsp;

02:12:42,390 --> 02:12:46,530
of course, you can experiment with this.&nbsp;
And you can also experiment if, for example,&nbsp;&nbsp;

02:12:46,530 --> 02:12:53,580
the authentication token that you found was using&nbsp;
a different encryption, or a hashing algorithm for&nbsp;&nbsp;

02:12:53,580 --> 02:12:57,900
the password, the first thing you need to do is&nbsp;
identify what it's using, and then you go about&nbsp;&nbsp;

02:12:57,900 --> 02:13:02,820
decrypting it. Now, I'm not going to be talking&nbsp;
about the other parts here, because that's a bit&nbsp;&nbsp;

02:13:02,820 --> 02:13:09,420
that's a bit advanced. As you can see, by default,&nbsp;
the signature, the token signature failed,&nbsp;&nbsp;

02:13:09,420 --> 02:13:14,160
which means we can tamper with this token, and we&nbsp;
can make changes to it. And we can authenticate&nbsp;&nbsp;

02:13:14,160 --> 02:13:19,980
with it because it said, The OWASP juice shop is&nbsp;
is designed to be vulnerable. And this is where&nbsp;&nbsp;

02:13:19,980 --> 02:13:25,350
you perform all of these tests. Okay, so when&nbsp;
it comes down to the payload, the most important&nbsp;&nbsp;

02:13:25,350 --> 02:13:29,520
things are to look for the status, the ID and&nbsp;
obviously, if you can get any other information&nbsp;&nbsp;

02:13:29,520 --> 02:13:34,980
in the data section, or in terms of the email and&nbsp;
the password, that's also very important. Now,&nbsp;&nbsp;

02:13:34,980 --> 02:13:41,700
of course, it's not very easy to get a hold of&nbsp;
someone's of someone's token, but you can do&nbsp;&nbsp;

02:13:41,700 --> 02:13:47,550
it but and then you are performing the penetration&nbsp;
test on the token, because if someone was to write&nbsp;&nbsp;

02:13:47,550 --> 02:13:52,350
in the comment section of this video, what it was&nbsp;
to grab the the authentication token that belongs&nbsp;&nbsp;

02:13:52,350 --> 02:13:58,031
to Facebook lets you have access to someone's&nbsp;
computer for a few seconds. And as to get the&nbsp;&nbsp;

02:13:58,030 --> 02:14:03,430
authentication token, what would I be able to do?&nbsp;
Well, first of all, you have to test the security&nbsp;&nbsp;

02:14:03,430 --> 02:14:07,870
of the token. And I can guarantee you that their&nbsp;
tokens are going to be very well secured and&nbsp;&nbsp;

02:14:07,870 --> 02:14:12,940
performing the penetration or the penetration test&nbsp;
on them will be a different ballgame. So we'll be&nbsp;&nbsp;

02:14:12,940 --> 02:14:21,160
looking at changing them or or tempering them to&nbsp;
give us different types of access. We're going to&nbsp;&nbsp;

02:14:21,160 --> 02:14:28,270
be talking about HTTP attribute attributes and&nbsp;
cookie security. I am currently running OSU shop&nbsp;&nbsp;

02:14:28,270 --> 02:14:34,510
and what I did is I started a fresh new instance.&nbsp;
So I unzipped a new OSU shop. That's because I&nbsp;&nbsp;

02:14:34,510 --> 02:14:38,440
wanted to start afresh Now, of course, in the&nbsp;
previous video, we looked at cookie analysis&nbsp;&nbsp;

02:14:38,440 --> 02:14:44,020
and tokens. But now we're going to look at how&nbsp;
at the security aspect of how these cookies are&nbsp;&nbsp;

02:14:44,020 --> 02:14:51,430
secured and how you know how cookies are stolen&nbsp;
and how these can be exploited with with with&nbsp;&nbsp;

02:14:51,430 --> 02:14:57,250
other exploits or functionality like cross site&nbsp;
scripting. Now you will get to what I'm saying&nbsp;&nbsp;

02:14:57,250 --> 02:15:04,510
in a few seconds. So I have was used Stop running.&nbsp;
And I've created the same user and password as I&nbsp;&nbsp;

02:15:04,510 --> 02:15:11,020
did last time. So it's a test@test.com, that being&nbsp;
the email and the password is password 123. Just&nbsp;&nbsp;

02:15:11,020 --> 02:15:14,920
so you know. And I'll do that right now I'm just&nbsp;
going to log in, as you can see, test@test.com&nbsp;&nbsp;

02:15:15,700 --> 02:15:21,940
and the password is password 123. So let me just&nbsp;
log in. And there you are. So I've logged in and&nbsp;&nbsp;

02:15:21,940 --> 02:15:27,370
haven't solved any challenges. So when we talk&nbsp;
about cookie security, what do I mean? Well,&nbsp;&nbsp;

02:15:27,370 --> 02:15:32,260
this can be done or can be inspected really&nbsp;
easily. Now, of course, for this, you're not going&nbsp;&nbsp;

02:15:32,260 --> 02:15:37,510
to need any of the browser extensions or add ons,&nbsp;
because we'll just simply just be inspecting the&nbsp;&nbsp;

02:15:37,510 --> 02:15:43,330
element here. So if we open inspect element and go&nbsp;
into storage, and we go into cookies, and select&nbsp;&nbsp;

02:15:43,330 --> 02:15:49,750
the site, which is on localhost, you can see that&nbsp;
if I was to click on, for example, the token,&nbsp;&nbsp;

02:15:49,750 --> 02:15:58,030
and we just look at the data, you know, that we&nbsp;
can see within the token, if we go to the HTTP&nbsp;&nbsp;

02:15:58,030 --> 02:16:04,390
only section here, you can see that that is set to&nbsp;
false. Now, what does that mean? Well, that means&nbsp;&nbsp;

02:16:04,390 --> 02:16:12,400
that we can potentially exploit this cookie and it&nbsp;
storage location in the sense that it is it is, it&nbsp;&nbsp;

02:16:12,400 --> 02:16:17,770
is not secured. Now, I'll get to why and how this&nbsp;
is happening in the in a few seconds. Alright,&nbsp;&nbsp;

02:16:17,770 --> 02:16:24,910
so if the value is set to false, it means that the&nbsp;
cookie can be accessed and written to now how can&nbsp;&nbsp;

02:16:24,910 --> 02:16:30,190
one use this, you know, for potential attacks,&nbsp;
or Cookie, cookie stealing, as we know it. Now,&nbsp;&nbsp;

02:16:30,190 --> 02:16:36,399
if you are an advanced web application penetration&nbsp;
test, and you know about cross site scripting, you&nbsp;&nbsp;

02:16:36,399 --> 02:16:42,460
know, that usually attackers will use cross site&nbsp;
scripting, to steal cookies, by sending you links,&nbsp;&nbsp;

02:16:42,460 --> 02:16:49,270
that then, you know, by sending you links to pages&nbsp;
on the site, that you're already authenticated to,&nbsp;&nbsp;

02:16:49,270 --> 02:16:55,780
that have the the the malicious JavaScript&nbsp;
code that will then send your cookie,&nbsp;&nbsp;

02:16:55,779 --> 02:17:01,540
your authentication cookie with your token,&nbsp;
etc, etc, to their attack server. And from that,&nbsp;&nbsp;

02:17:01,540 --> 02:17:06,970
they can then use that to authenticate into your&nbsp;
account, it's not common, because mostly, the,&nbsp;&nbsp;

02:17:06,970 --> 02:17:12,280
the cookies are usually secured. Now, you will&nbsp;
run into sites that have this and this is a very,&nbsp;&nbsp;

02:17:12,279 --> 02:17:17,739
very big vulnerability in terms of severity. So if&nbsp;
you're a bug bounty hunter, this is in the medium&nbsp;&nbsp;

02:17:17,739 --> 02:17:24,519
to low category, so not really a big exploit, but&nbsp;
still a very, very big problem that many, many,&nbsp;&nbsp;

02:17:24,520 --> 02:17:29,380
you know, usually, I would like to say rookie&nbsp;
developers Miss, especially when dealing with&nbsp;&nbsp;

02:17:29,380 --> 02:17:34,810
huge frameworks like node etc. I'm not going to&nbsp;
get too deep into that. So you can see that the&nbsp;&nbsp;

02:17:34,810 --> 02:17:40,570
HTTP only is set to false. Now, what does this&nbsp;
mean? This means that we can use utilize a lot of&nbsp;&nbsp;

02:17:40,569 --> 02:17:48,160
functionality to exploit or to display the broken&nbsp;
or even more to send this my cookie or you know,&nbsp;&nbsp;

02:17:48,160 --> 02:17:53,470
my token, whatever you want to call it to a server&nbsp;
or to save it, alright, to grab it to steal it,&nbsp;&nbsp;

02:17:53,470 --> 02:17:59,140
you know, simply put, so how can we exploit&nbsp;
this? Well, we can use cross site scripting,&nbsp;&nbsp;

02:17:59,140 --> 02:18:05,350
and this is probably the most used method&nbsp;
for this. And to do this, we can simply,&nbsp;&nbsp;

02:18:05,350 --> 02:18:12,100
we can use any of the, we can use the search, or&nbsp;
we can use the contact. But I like using search&nbsp;&nbsp;

02:18:12,100 --> 02:18:17,290
because usually it is unfiltered. Now, when I&nbsp;
say this, I'm you know, many of you will say,&nbsp;&nbsp;

02:18:17,290 --> 02:18:21,580
Well, most of the big sites, well, I'm not talking&nbsp;
about the big sites, the big sites, obviously have&nbsp;&nbsp;

02:18:21,580 --> 02:18:25,960
to take this into consideration. I'm talking&nbsp;
about sites that are developed by small teams,&nbsp;&nbsp;

02:18:25,960 --> 02:18:32,890
they usually don't take this into consideration.&nbsp;
So if I was to just type in a simple cross site&nbsp;&nbsp;

02:18:32,890 --> 02:18:38,650
scripting script that will essentially display&nbsp;
my cookie right now as I'm authenticated. So to&nbsp;&nbsp;

02:18:38,649 --> 02:18:43,449
do that, I'll just type in script. And for&nbsp;
this, we're using an alert here to display&nbsp;&nbsp;

02:18:43,449 --> 02:18:49,630
to us so alert, and we're gonna say document,&nbsp;
whoops, stop, sorry, document, dot cookie. And,&nbsp;&nbsp;

02:18:49,630 --> 02:18:55,660
and then we're gonna just close the script like&nbsp;
so. So this will display our cookie to us. Not&nbsp;&nbsp;

02:18:55,660 --> 02:19:01,030
really helpful. But you can imagine if we were&nbsp;
to have this permanently posted, for example, as&nbsp;&nbsp;

02:19:01,030 --> 02:19:06,009
a post here, and then whenever we send that link&nbsp;
to someone, and they click on it, we can customize&nbsp;&nbsp;

02:19:06,010 --> 02:19:11,410
this JavaScript code to send their cookie to&nbsp;
our web server. And once we get their cookie,&nbsp;&nbsp;

02:19:11,410 --> 02:19:16,870
you basically know what's gonna happen there. So&nbsp;
if I hit Enter to search, you can see that it's&nbsp;&nbsp;

02:19:16,870 --> 02:19:22,059
going to display our cookie and our token, and&nbsp;
this is extremely dangerous. You might not get&nbsp;&nbsp;

02:19:22,060 --> 02:19:27,430
the context, but I'll explain it in a second. So&nbsp;
essentially, this information can be passed and&nbsp;&nbsp;

02:19:27,430 --> 02:19:33,640
sent anywhere across the world, provided that the&nbsp;
that your target clicks, clicks on a link in which&nbsp;&nbsp;

02:19:33,640 --> 02:19:39,640
this, this script is executed. Now, the question&nbsp;
that you might be asking yourself as well, where&nbsp;&nbsp;

02:19:39,640 --> 02:19:45,071
else can we post this in in sort of a malicious&nbsp;
way and I know that I sound malicious right now,&nbsp;&nbsp;

02:19:45,070 --> 02:19:51,130
but I'll also get into how to mitigate this. And&nbsp;
again, mitigating It is really simple. Just set&nbsp;&nbsp;

02:19:51,130 --> 02:19:59,470
your HTTP status or your HTTP attribute to true or&nbsp;
set it to on essentially securing your cookie now&nbsp;&nbsp;

02:19:59,470 --> 02:20:04,600
You can see that once we have this, you saw in&nbsp;
the previous video, what we could do with such&nbsp;&nbsp;

02:20:04,600 --> 02:20:11,111
information, and what info it contains in regards&nbsp;
to the user. And how we can, we can, you know,&nbsp;&nbsp;

02:20:11,110 --> 02:20:16,839
crack the password. But for now let's focus on how&nbsp;
this can be utilized to steal the cookie or how&nbsp;&nbsp;

02:20:16,840 --> 02:20:23,260
attackers do it. So you can also get insight if&nbsp;
you're a white hat. So usually I can post this in&nbsp;&nbsp;

02:20:23,260 --> 02:20:29,200
here, I can put, you know, I can type the script&nbsp;
in here. But this is not, it's probably not the&nbsp;&nbsp;

02:20:29,200 --> 02:20:34,300
best way of doing it. Because you essentially&nbsp;
have to convince the user to go into the search&nbsp;&nbsp;

02:20:34,300 --> 02:20:40,901
bar and type this in. Not really the best of ways&nbsp;
about going about going about this. So usually,&nbsp;&nbsp;

02:20:40,900 --> 02:20:47,500
we look for a page that allows us to, you know, to&nbsp;
post our own stuff, or to save this to a database&nbsp;&nbsp;

02:20:47,500 --> 02:20:54,460
or to save it to the website itself. So we let's&nbsp;
try contact us. Alright, so contact us. Yeah,&nbsp;&nbsp;

02:20:54,460 --> 02:20:59,740
that looks like a good place to start. So in the&nbsp;
comment you it already added our author for so in&nbsp;&nbsp;

02:20:59,740 --> 02:21:05,650
the comment, we can enter, we can end our script&nbsp;
in Yeah, and this will probably probably be saved.&nbsp;&nbsp;

02:21:05,650 --> 02:21:11,740
But we have to test it. Now. Of course, the cookie&nbsp;
stealing JavaScript code is not something that I'm&nbsp;&nbsp;

02:21:11,740 --> 02:21:15,250
going to be telling you how to do, you can&nbsp;
probably perform a lot of Google searches,&nbsp;&nbsp;

02:21:15,250 --> 02:21:21,700
it's part of the terms that I have to follow.&nbsp;
In regards to YouTube's YouTube's policies&nbsp;&nbsp;

02:21:21,700 --> 02:21:27,730
about malicious content, and when what not,&nbsp;
so I'm not going to show you the exact code,&nbsp;&nbsp;

02:21:27,730 --> 02:21:32,890
but I'll probably have it on my website, if you&nbsp;
want to take a look at it and experiment as to how&nbsp;&nbsp;

02:21:32,891 --> 02:21:41,111
to send cookies to a another server or server that&nbsp;
belongs to you, for example. So to do this, so now&nbsp;&nbsp;

02:21:41,110 --> 02:21:45,940
essentially, what I want to do is I want to save&nbsp;
this script, into the contacts section, because&nbsp;&nbsp;

02:21:45,940 --> 02:21:52,570
I believe this is saved. If I looked, I looked at&nbsp;
the structure. And indeed, this is saved. So the&nbsp;&nbsp;

02:21:52,570 --> 02:21:57,880
script is quite simple. So we can say, we can&nbsp;
give it a title because I know the feedback is&nbsp;&nbsp;

02:21:57,880 --> 02:22:07,840
left like that. So we can say script test. And we&nbsp;
can close the script here. So scripts, but then we&nbsp;&nbsp;

02:22:07,840 --> 02:22:13,391
have to include the the actual JavaScript code. So&nbsp;
yeah, so let's include this script within the main&nbsp;&nbsp;

02:22:13,391 --> 02:22:19,300
one. So script. And then once we close this one,&nbsp;
we can then use the other script. So your script,&nbsp;&nbsp;

02:22:19,300 --> 02:22:23,920
whoops script in, you can copy this code if&nbsp;
you want. By the way, let me just zoom in,&nbsp;&nbsp;

02:22:23,920 --> 02:22:27,400
because a lot of you had actually talked to me&nbsp;
about that, that you couldn't actually see the&nbsp;&nbsp;

02:22:27,400 --> 02:22:33,730
code. So script. And now we want to bring up&nbsp;
the alert. Now, of course, as I said, this is&nbsp;&nbsp;

02:22:33,730 --> 02:22:37,929
not really useful, because all you're doing is&nbsp;
displaying the cookie to the user themselves,&nbsp;&nbsp;

02:22:37,930 --> 02:22:48,521
once they visit this page, so you probably&nbsp;
get the idea. So script, alert, and we are&nbsp;&nbsp;

02:22:48,521 --> 02:22:52,811
just simply just going to write the document, of&nbsp;
course, it's all sending it to a malicious server,&nbsp;&nbsp;

02:22:52,811 --> 02:22:58,061
what I would have done is I would have used the&nbsp;
document dot cookie, and I would have appended it&nbsp;&nbsp;

02:22:58,061 --> 02:23:06,670
to be sent in in the form of probably a PHP file&nbsp;
or a PHP GET request to my server, and then my&nbsp;&nbsp;

02:23:06,670 --> 02:23:12,280
server would log all of the information being sent&nbsp;
back. So that's the concept there behind so we can&nbsp;&nbsp;

02:23:12,280 --> 02:23:19,869
then close the script here. And sorry, we have to&nbsp;
actually close the script. Oops, sorry, my bad.&nbsp;&nbsp;

02:23:19,869 --> 02:23:26,140
And then we close the script there. And finally,&nbsp;
we can close the final script ending here. So&nbsp;&nbsp;

02:23:26,140 --> 02:23:33,400
script and there we are. And we can leave a&nbsp;
rating if we want to. And there is a CAPTCHA here&nbsp;&nbsp;

02:23:33,399 --> 02:23:39,939
authentication 10 plus five. You You basically,&nbsp;
this is also an exploit here that you can enter.&nbsp;&nbsp;

02:23:39,939 --> 02:23:46,419
Because if you look at this very basically, from&nbsp;
a simple perspective, the capture here is again,&nbsp;&nbsp;

02:23:46,420 --> 02:23:53,230
is another false positive. And again, I know I'm&nbsp;
dragging this, I'm dragging it a lot. But But what&nbsp;&nbsp;

02:23:53,229 --> 02:23:58,809
I'm trying to explain here is, if you are going&nbsp;
to, you're going to be performing a penetration&nbsp;&nbsp;

02:23:58,810 --> 02:24:05,380
test on a web site, you need to understand that,&nbsp;
from the perspective of false positives, you&nbsp;&nbsp;

02:24:05,380 --> 02:24:11,770
should not go after the big exploitations or the&nbsp;
big exploits first. Alright, so if I submit this,&nbsp;&nbsp;

02:24:11,770 --> 02:24:17,650
as I know the structure of the OSU shop, this will&nbsp;
be submitted to one of the pages in which after&nbsp;&nbsp;

02:24:17,649 --> 02:24:24,099
I click, or any other user who is authenticated&nbsp;
clicks, will will run that script, or this script&nbsp;&nbsp;

02:24:24,100 --> 02:24:29,920
and will the cookie will be displayed on the&nbsp;
screen. And if you want to manipulate or use&nbsp;&nbsp;

02:24:29,920 --> 02:24:35,949
your own script to send the cookie to your server,&nbsp;
by all means go and do that. I'm not condoning it.&nbsp;&nbsp;

02:24:35,949 --> 02:24:45,159
So that is 75. And I hit submit. And what nots&nbsp;
wrong capture 10 plus five, actually, 25. Yes,&nbsp;&nbsp;

02:24:45,159 --> 02:24:50,380
brackets of division multiplication addition, you&nbsp;
guys must be thinking I suck at math. So that is&nbsp;&nbsp;

02:24:50,380 --> 02:24:58,390
25 plus five, plus 10. Sorry, that's 3535. And I&nbsp;
submit that whoops, we have to actually type our&nbsp;&nbsp;

02:24:58,390 --> 02:25:03,550
code back in Sorry about that, guys. So we can&nbsp;
just type in script, and we're simply testing&nbsp;&nbsp;

02:25:03,550 --> 02:25:11,380
test. And then after this, we can close the first&nbsp;
one. And script here. Whoops, sorry about that my&nbsp;&nbsp;

02:25:11,380 --> 02:25:20,739
keyboard is quite a distance from me. Alert. And&nbsp;
my spelling mistakes are really annoying script.&nbsp;&nbsp;

02:25:20,739 --> 02:25:30,519
And finally, we can use the document. My God, man&nbsp;
my typing document dot alert dot cookie, sorry,&nbsp;&nbsp;

02:25:30,520 --> 02:25:35,980
we are we have already sent the alert, we will&nbsp;
use the doc document, that alert would essentially&nbsp;&nbsp;

02:25:35,979 --> 02:25:43,569
display the entire webpage, document dot cookie.&nbsp;
And in here, we close the first script. And sorry,&nbsp;&nbsp;

02:25:43,569 --> 02:25:50,619
the the initial script. And then we close the&nbsp;
last one year. So script. And we close that right&nbsp;&nbsp;

02:25:50,619 --> 02:25:56,199
there. And finally, we can give this a rating and&nbsp;
resubmit. And that should submit it. I don't know&nbsp;&nbsp;

02:25:56,199 --> 02:26:00,939
what the issue is here. And then there we are.&nbsp;
Also some Alright, so there we are. Thank you for&nbsp;&nbsp;

02:26:00,939 --> 02:26:07,539
your feedback. So you did submitted there. Let me&nbsp;
zoom back out. Now, you can see that, where would&nbsp;&nbsp;

02:26:07,539 --> 02:26:13,419
you go to launch the script? That's, that that&nbsp;
will be the question that you might be asking.&nbsp;&nbsp;

02:26:13,419 --> 02:26:18,430
So on this in this structure, you can pretty much&nbsp;
experiment with all the other pages. And again,&nbsp;&nbsp;

02:26:18,430 --> 02:26:23,709
I do recommend that you use you know directory&nbsp;
discovery tools, like there Buster go buster,&nbsp;&nbsp;

02:26:23,709 --> 02:26:29,800
whatever is comfortable for you. So with this&nbsp;
in mind, if I was to just click on About Us,&nbsp;&nbsp;

02:26:29,800 --> 02:26:36,430
you can see that that is where the the the&nbsp;
feedback in regards to contact is stored.&nbsp;&nbsp;

02:26:36,430 --> 02:26:41,770
So there you are, there's the cookie. And if&nbsp;
I was to if I was to have implemented a script&nbsp;&nbsp;

02:26:41,770 --> 02:26:48,249
that would send the cookie to my server, once&nbsp;
I access to this page as an authenticated user,&nbsp;&nbsp;

02:26:48,249 --> 02:26:55,989
it would send my my session ID all of that good&nbsp;
stuff to my web server, I now be able to crack the&nbsp;&nbsp;

02:26:55,989 --> 02:27:01,479
password and authenticate with your account. As&nbsp;
simple as that without ever knowing your password&nbsp;&nbsp;

02:27:01,479 --> 02:27:05,918
without ever trying to have guessed it without&nbsp;
without ever trying to have exploited your system.&nbsp;&nbsp;

02:27:05,919 --> 02:27:12,399
I exploited the web application. And because&nbsp;
of the the ability of the developer of the web&nbsp;&nbsp;

02:27:12,399 --> 02:27:18,189
application to secure the cookies, I was able to&nbsp;
get into your account and god knows what else you&nbsp;&nbsp;

02:27:18,189 --> 02:27:24,009
can do in that person's account. And this is you&nbsp;
know, this is tribute to my all my Facebook hacker&nbsp;&nbsp;

02:27:24,010 --> 02:27:30,880
friends out there who think hacking Facebook is&nbsp;
about cracking and brute forcing. There you go,&nbsp;&nbsp;

02:27:30,880 --> 02:27:36,039
you know, web applications can can be cracked&nbsp;
in or can be exploited in different ways. Now,&nbsp;&nbsp;

02:27:36,039 --> 02:27:40,749
of course, as I said, it's going to get really&nbsp;
exciting as we move along with Duchamp. And&nbsp;&nbsp;

02:27:40,749 --> 02:27:47,030
that's the reason I'm using it because it explains&nbsp;
how this can be done on a real website. And yeah,&nbsp;&nbsp;

02:27:51,021 --> 02:27:56,691
we're going to be looking at OWASP juice shop. And&nbsp;
it seems to replicate what a real web application&nbsp;&nbsp;

02:27:56,690 --> 02:28:03,110
would be a fairly poorly designed one. But the&nbsp;
thing I like about it is, it has varying levels,&nbsp;&nbsp;

02:28:03,110 --> 02:28:08,690
levels of difficulty. And that's really,&nbsp;
really awesome. I have it set up on Heroku,&nbsp;&nbsp;

02:28:08,690 --> 02:28:13,759
as you can probably see right over here. And that&nbsp;
works perfectly fine for me because I you know,&nbsp;&nbsp;

02:28:13,760 --> 02:28:18,380
I wanted to set it up really quickly, I want to&nbsp;
run it on my local server, you know, using node&nbsp;&nbsp;

02:28:18,380 --> 02:28:24,320
or Docker. That's really is, I really didn't have&nbsp;
the time to do that. But if you want to you can,&nbsp;&nbsp;

02:28:24,320 --> 02:28:29,750
you can use Heroku. And it should be free for&nbsp;
you. So yeah, definitely go ahead and give it&nbsp;&nbsp;

02:28:29,750 --> 02:28:34,190
a try. And you should have a an instance set up&nbsp;
for yourself. So you can go ahead and do it. And&nbsp;&nbsp;

02:28:34,190 --> 02:28:39,290
it's giving us a prompt here telling us that&nbsp;
this website uses fruit cookies to ensure you&nbsp;&nbsp;

02:28:39,290 --> 02:28:45,530
get the juiciest tracking experience. Now, from my&nbsp;
experience, I would hit accept the cookies because&nbsp;&nbsp;

02:28:45,530 --> 02:28:52,220
essentially, that's what keeps track of your&nbsp;
progress. And yeah, that's pretty, that should&nbsp;&nbsp;

02:28:52,221 --> 02:28:58,580
be quite good. Now as for my browser, I'm using&nbsp;
the latest version of Firefox and I have you know,&nbsp;&nbsp;

02:28:58,580 --> 02:29:03,860
plugins or add ons like cookie editor. And that's&nbsp;
pretty much what we'll be needing In this video,&nbsp;&nbsp;

02:29:03,860 --> 02:29:10,460
I hope and we don't have the the proxies here like&nbsp;
sorry, Foxy proxy to allow us to use things like&nbsp;&nbsp;

02:29:10,460 --> 02:29:17,391
burp suite or zap whatever you want to use. OK,&nbsp;
so let's get started. Now the first challenge,&nbsp;&nbsp;

02:29:17,391 --> 02:29:23,960
as I believe is to get the the scoreboard and&nbsp;
we should start from there. And to do this,&nbsp;&nbsp;

02:29:23,960 --> 02:29:29,300
I think I have done this already. That's really&nbsp;
very simple. All we need to do is well first of&nbsp;&nbsp;

02:29:29,300 --> 02:29:34,700
all before we actually do that, the interface is&nbsp;
quite simple. It is a juice shop as you probably&nbsp;&nbsp;

02:29:34,700 --> 02:29:39,950
can see and could have understood and they&nbsp;
sold juice. Now the great thing that I like&nbsp;&nbsp;

02:29:39,950 --> 02:29:45,800
about OSU shop is that this replicates a real&nbsp;
life a web application with you know, security,&nbsp;&nbsp;

02:29:45,800 --> 02:29:51,111
misconfigurations, etc, etc. So if I log in,&nbsp;
you have your login page right over there, man,&nbsp;&nbsp;

02:29:51,110 --> 02:29:56,509
you can create a new account if you want to, you&nbsp;
can search where the Contact Us page allows us to,&nbsp;&nbsp;

02:29:56,510 --> 02:30:01,460
you know, essentially contact whoever is behind&nbsp;
the site. Then we have an About Us page. And&nbsp;&nbsp;

02:30:01,460 --> 02:30:07,311
the thing I like about this is, as I said,&nbsp;
it replicates what I would call a real web&nbsp;&nbsp;

02:30:07,311 --> 02:30:13,701
application. Now when you talk about, about the&nbsp;
scoreboard, I think that can be accessed really&nbsp;&nbsp;

02:30:13,700 --> 02:30:19,970
quickly by going into scoreboard like so. So, you&nbsp;
know, we can just hit scoreboard. And if I enter,&nbsp;&nbsp;

02:30:19,970 --> 02:30:24,651
that should give us the scoreboard. Alright,&nbsp;
so it gives us the notification once you've&nbsp;&nbsp;

02:30:24,650 --> 02:30:28,969
completed the challenge, and the reason it does&nbsp;
this is to notify you of your progress. Remember,&nbsp;&nbsp;

02:30:28,970 --> 02:30:34,250
this can be considered a capture the flag type&nbsp;
of challenge, but I wouldn't call it this I think&nbsp;&nbsp;

02:30:34,250 --> 02:30:38,690
this is fantastic for essentially explaining the&nbsp;
concept here. Alright, so let me explain how the&nbsp;&nbsp;

02:30:38,690 --> 02:30:44,360
scoreboard is essentially works. Alright, so&nbsp;
a scoreboard is as follows. Sorry about that,&nbsp;&nbsp;

02:30:44,360 --> 02:30:49,099
if you had my phone, it always seems to do&nbsp;
that. So we have, we have the challenges&nbsp;&nbsp;

02:30:49,100 --> 02:30:53,630
sorted in terms of difficulty. So we have a&nbsp;
one star, two star, three star, four star,&nbsp;&nbsp;

02:30:53,630 --> 02:30:58,970
five star and six star. And they all have&nbsp;
various challenges within them. So for example,&nbsp;&nbsp;

02:30:58,970 --> 02:31:04,491
the the difficulty sought in terms of star so you&nbsp;
get the idea, one star is quite easy, two stars,&nbsp;&nbsp;

02:31:05,300 --> 02:31:10,191
you know, not so easy, we have three stars,&nbsp;
things are getting a bit sweaty here, four stars,&nbsp;&nbsp;

02:31:10,190 --> 02:31:16,490
now we're talking five stars, I'm banging my head&nbsp;
on the wall, and six stars, that's going to take&nbsp;&nbsp;

02:31:16,490 --> 02:31:22,070
you probably a few, a few days, or, you know,&nbsp;
hours depending on your determination. Alright,&nbsp;&nbsp;

02:31:22,070 --> 02:31:26,840
so you can see it also gives you the gives you&nbsp;
the challenge names here. So if I click on the&nbsp;&nbsp;

02:31:26,840 --> 02:31:31,370
two star challenges, you can go ahead and look at&nbsp;
the challenges there. And we brought I think in&nbsp;&nbsp;

02:31:31,370 --> 02:31:35,990
the previous videos, we covered a lot of the two&nbsp;
star and three some of the four star challenges&nbsp;&nbsp;

02:31:35,990 --> 02:31:40,460
that we wanted to go through. So the three star&nbsp;
challenges are where things get really awesome,&nbsp;&nbsp;

02:31:40,460 --> 02:31:46,910
because it does start logging in with other&nbsp;
users. And there's a bit of cross site scripting,&nbsp;&nbsp;

02:31:46,910 --> 02:31:51,500
I'm not going to go through all of that,&nbsp;
let's start off with what we can do. Alright,&nbsp;&nbsp;

02:31:51,500 --> 02:31:59,540
so the first challenge in the first is access the&nbsp;
administration section of the store, or right,&nbsp;&nbsp;

02:31:59,540 --> 02:32:03,800
so I'm guessing we have to try and log in, I&nbsp;
think I've done this, this is the first challenge,&nbsp;&nbsp;

02:32:03,800 --> 02:32:12,680
we have to access a confidential document provoked&nbsp;
an error. That is not gracefully, very gracefully&nbsp;&nbsp;

02:32:12,680 --> 02:32:18,890
handled, not to show that is let us redirect you.&nbsp;
I'll try and cover as many as I can. In one video,&nbsp;&nbsp;

02:32:18,890 --> 02:32:23,661
we have cross site scripting attack. This was&nbsp;
simple. I think we covered this. So yeah, we can&nbsp;&nbsp;

02:32:23,660 --> 02:32:29,360
pretty much run that in one of these right over&nbsp;
here. So script, and alert, as it already gives&nbsp;&nbsp;

02:32:29,360 --> 02:32:35,089
you hints these are very, very easy. So I can&nbsp;
just say test. Have I given the OP Sorry, my bad.&nbsp;&nbsp;

02:32:35,090 --> 02:32:42,710
So yeah, there we are test. And we close that up.&nbsp;
And we also close the script right over here. And&nbsp;&nbsp;

02:32:42,710 --> 02:32:49,939
we hit Enter. And there we are. So that is one of&nbsp;
the challenges solved, hopefully did pop up there.&nbsp;&nbsp;

02:32:49,939 --> 02:32:55,849
So if we go back to the scoreboard, it still&nbsp;
tells us for some reason, the web application is&nbsp;&nbsp;

02:32:55,850 --> 02:33:00,920
too low, it's not told us that we have performed a&nbsp;
reflected cross site scripting, all those I don't&nbsp;&nbsp;

02:33:00,920 --> 02:33:06,200
know, right, so reflected. Anyway, we'll get to&nbsp;
that when we get to it. So if we inspect the login&nbsp;&nbsp;

02:33:06,200 --> 02:33:11,570
page, what we can do is we can create a user. So&nbsp;
I'm going to create a user here. And I'll just use&nbsp;&nbsp;

02:33:11,570 --> 02:33:18,259
a simple user here called test@test.com. And the&nbsp;
password or call that password. And I'm going to&nbsp;&nbsp;

02:33:18,260 --> 02:33:27,770
repeat the password here. And I'll just call the&nbsp;
password password. And I'm just going to use name&nbsp;&nbsp;

02:33:27,770 --> 02:33:32,720
of your favorite pet. And I'm just going to say&nbsp;
dog right over here. I'm going to hit register.&nbsp;&nbsp;

02:33:32,720 --> 02:33:38,510
And we're going to save that. Alright, so I can&nbsp;
log in now. Did I log in with the correct test?&nbsp;&nbsp;

02:33:38,510 --> 02:33:43,520
Yeah, there we are. And we're going to log in,&nbsp;
and we are logged in. Alright, so let me just&nbsp;&nbsp;

02:33:43,520 --> 02:33:49,340
zoom out. So the interface does not really crashed&nbsp;
on us. Let me just get rid of that. All right,&nbsp;&nbsp;

02:33:49,340 --> 02:33:54,260
so it's sorted out really well. We have the&nbsp;
language selector here your basket, which&nbsp;&nbsp;

02:33:54,260 --> 02:34:01,010
essentially allows you to select your to view the&nbsp;
items in your basket, you then have your coupon&nbsp;&nbsp;

02:34:01,010 --> 02:34:05,690
if you want, if you want to use a coupon and you&nbsp;
have your checkout, which essentially I believe&nbsp;&nbsp;

02:34:05,689 --> 02:34:11,899
takes you to the the OWASP juice shop, donate&nbsp;
page if I'm not wrong. Let's just see if that&nbsp;&nbsp;

02:34:11,899 --> 02:34:18,259
is correct. Yeah, yeah. So if you want to support&nbsp;
the project, I would, you know, you can donate to&nbsp;&nbsp;

02:34:18,260 --> 02:34:25,730
them. It's a really great project. I really do&nbsp;
recommend that if you can you do so. So you can&nbsp;&nbsp;

02:34:25,729 --> 02:34:29,870
change your password, which is awesome. I think&nbsp;
we also took a look at this and how to change&nbsp;&nbsp;

02:34:29,870 --> 02:34:38,650
it using using the GET requests. Contact us where&nbsp;
you can necessarily write in, you can contact the&nbsp;&nbsp;

02:34:39,910 --> 02:34:47,740
person via the site or the administrator as I&nbsp;
would believe. You can comment, recycle recycle&nbsp;&nbsp;

02:34:47,740 --> 02:34:57,011
what this requester recycling box so you can type&nbsp;
in liters here that has a selector. Alright, okay,&nbsp;&nbsp;

02:34:57,011 --> 02:35:02,200
that's not too bad. We have a complaints board.&nbsp;
And the scoreboard itself here, which for some&nbsp;&nbsp;

02:35:02,200 --> 02:35:07,211
reason, keeps doesn't really load. So let's try&nbsp;
and work on the first section. As I mentioned,&nbsp;&nbsp;

02:35:07,211 --> 02:35:12,671
I'll try and cover as much as I can here. And&nbsp;
you have the About Us here that has some sort of&nbsp;&nbsp;

02:35:12,671 --> 02:35:21,221
Let's see some sort of checkout or boring terms&nbsp;
of views. Let me just check the scoreboard what&nbsp;&nbsp;

02:35:21,221 --> 02:35:28,031
exactly are we supposed to do? Because access the&nbsp;
administration section? What's in the two star&nbsp;&nbsp;

02:35:28,030 --> 02:35:32,080
here? login with the administrator. All right, so&nbsp;
we're trying to access the administration section.&nbsp;&nbsp;

02:35:32,080 --> 02:35:39,221
So let's try and access that right over here.&nbsp;
So I'm just gonna type in admin administration,&nbsp;&nbsp;

02:35:39,221 --> 02:35:45,731
like so I'm gonna hit Enter. And yeah, that was&nbsp;
pretty easy. And we get the email right over here,&nbsp;&nbsp;

02:35:45,730 --> 02:35:54,130
admin and do shop. That's the admin email. And we&nbsp;
have all the emails right over here. So we have&nbsp;&nbsp;

02:35:54,131 --> 02:36:02,981
you met juice, juice shop, Bender, and some other&nbsp;
uses. And we have also, yeah, alright, so we got&nbsp;&nbsp;

02:36:02,980 --> 02:36:09,610
the registered users customer feedback, and the&nbsp;
recycling requests that have been posted so far.&nbsp;&nbsp;

02:36:09,610 --> 02:36:14,590
Which means you're starting from the basics.&nbsp;
So I think we can try and log in with admin,&nbsp;&nbsp;

02:36:14,591 --> 02:36:22,016
but we don't know the password. So yeah, so I'm&nbsp;
just going to log out. And let's see if we can log&nbsp;&nbsp;

02:36:22,016 --> 02:36:29,290
in with the password here. admin, I do shop, and&nbsp;
I probably I'm probably guessing we have to use&nbsp;&nbsp;

02:36:29,290 --> 02:36:33,580
SQL injection. And in this case, I think I know&nbsp;
what to do, because I have done this before. But&nbsp;&nbsp;

02:36:33,580 --> 02:36:38,801
it has been changed quite a bit since the last&nbsp;
time because I think in the previous versions,&nbsp;&nbsp;

02:36:38,801 --> 02:36:44,829
it was with admin only, there was no domain&nbsp;
oza username, I'm not too sure. Anyway,&nbsp;&nbsp;

02:36:44,829 --> 02:36:51,159
let's try and see if we can throw some&nbsp;
errors here. So if I log in, alright,&nbsp;&nbsp;

02:36:51,159 --> 02:36:55,239
so that means you have to provide a password. So&nbsp;
let me just try and use the single quotation. And&nbsp;&nbsp;

02:36:55,239 --> 02:36:59,559
let's see if that Yeah, it does throw an error.&nbsp;
And there Yeah, we completed the other challenge,&nbsp;&nbsp;

02:36:59,560 --> 02:37:04,450
which you successfully solved the challenge error&nbsp;
handling provacan errors here. So essentially,&nbsp;&nbsp;

02:37:04,449 --> 02:37:09,279
performing error enumeration, if that's something&nbsp;
you've never heard of, it's essentially where you&nbsp;&nbsp;

02:37:09,279 --> 02:37:14,529
just try and see all the CE o 's fuzzing really&nbsp;
just throwing, you know, information at the&nbsp;&nbsp;

02:37:14,529 --> 02:37:21,279
system, seeing how it responds. And we get here&nbsp;
the query. So we are performing SQL injection,&nbsp;&nbsp;

02:37:21,279 --> 02:37:26,769
because as you can see, tells us here we have&nbsp;
the the query right over here, which is telling&nbsp;&nbsp;

02:37:26,770 --> 02:37:34,030
us select and what this is saying is select&nbsp;
all entries from the user table where emails&nbsp;&nbsp;

02:37:34,029 --> 02:37:43,059
are equal to and we specify the single quotation.&nbsp;
And the password is what is this? This looks like&nbsp;&nbsp;

02:37:43,060 --> 02:37:52,480
a hash? What hash is this? Let me just check. I'm&nbsp;
think it might be MD. Five, I'm not too sure. Let&nbsp;&nbsp;

02:37:52,479 --> 02:37:59,139
me just check this hash identifier. And we just&nbsp;
paste that in there. Sorry about that. Let me&nbsp;&nbsp;

02:37:59,140 --> 02:38:05,320
just paste that in there. Yeah, this is an MD&nbsp;
five hash. So that probably let's just see if&nbsp;&nbsp;

02:38:05,319 --> 02:38:11,769
we can decrypt that or decode that. So I'm just&nbsp;
gonna say MD five decrypter, or something like&nbsp;&nbsp;

02:38:11,770 --> 02:38:17,650
that. Let's just see if we can do this online&nbsp;
really quickly. Come on, come on. I want to see&nbsp;&nbsp;

02:38:17,649 --> 02:38:24,549
what error because that's, that's a password.&nbsp;
Let's decrypt that. And we'll for some reason,&nbsp;&nbsp;

02:38:24,550 --> 02:38:29,890
it's taking too much time here. So yeah, yeah,&nbsp;
it's essentially hashing the password. Alright,&nbsp;&nbsp;

02:38:29,890 --> 02:38:36,669
interesting stuff there. We actually now know that&nbsp;
the password is being hashed, obviously, you know,&nbsp;&nbsp;

02:38:36,669 --> 02:38:43,239
with the Mt. Five, hashing algorithm or protocol,&nbsp;
whatever you wanna call it. So original. And yeah,&nbsp;&nbsp;

02:38:43,239 --> 02:38:50,800
that is the query statement there. So we can try&nbsp;
some basic SQL injection. And some of the basic&nbsp;&nbsp;

02:38:50,800 --> 02:38:57,240
ones to log into admin or to essentially log&nbsp;
into the administration, the admin panel is,&nbsp;&nbsp;

02:38:57,240 --> 02:39:02,820
now the thing that's weird is are we going to use&nbsp;
the password do we're trying to get authentication&nbsp;&nbsp;

02:39:02,820 --> 02:39:08,400
so that means let me disclose that. That means&nbsp;
if we just throw the error one more time,&nbsp;&nbsp;

02:39:08,400 --> 02:39:16,110
or get the when you were able to get the query&nbsp;
here. So we are saying select actually start from&nbsp;&nbsp;

02:39:16,110 --> 02:39:24,001
there. Select from users, so select all queries,&nbsp;
all entries from the user table, from where email&nbsp;&nbsp;

02:39:24,001 --> 02:39:32,581
use the table. So there's users Alright, so the&nbsp;
user, the user table as email and password, okay,&nbsp;&nbsp;

02:39:32,581 --> 02:39:41,070
I follow now. So that means we can try we can&nbsp;
try, we can try and use the or statement here.&nbsp;&nbsp;

02:39:41,070 --> 02:39:47,610
And probably we can use the not statement if we&nbsp;
are going to Yeah, that will make a lot of sense,&nbsp;&nbsp;

02:39:47,610 --> 02:39:52,590
but we only using email so we'll keep the&nbsp;
single quotation. So what that means is,&nbsp;&nbsp;

02:39:52,591 --> 02:40:00,901
is if you know about SQL injection, hopefully I&nbsp;
can explain what's going on here. So we know that&nbsp;&nbsp;

02:40:00,900 --> 02:40:07,171
the password is being hashed, we're saying select&nbsp;
from the table where email and password. So that's&nbsp;&nbsp;

02:40:07,171 --> 02:40:13,110
the statement. So select from the table for sort&nbsp;
of select from the users table where the email&nbsp;&nbsp;

02:40:13,110 --> 02:40:21,270
and password is going to be equal to is going to&nbsp;
be equal to what we have entered. But remember,&nbsp;&nbsp;

02:40:21,271 --> 02:40:28,231
the the password has to be has to stay as the&nbsp;
single quotation. So that means your we are&nbsp;&nbsp;

02:40:28,230 --> 02:40:32,820
going to be using the or so this is basic use,&nbsp;
you guys should be knowing this, but if you want&nbsp;&nbsp;

02:40:32,820 --> 02:40:39,001
me to cover it, let me know so or equals or so or&nbsp;
one equals one. And the other ways of doing this,&nbsp;&nbsp;

02:40:39,001 --> 02:40:44,700
I think I'll post a cheat sheet in the description&nbsp;
section, you can check it out for yourself just&nbsp;&nbsp;

02:40:44,700 --> 02:40:50,251
to get up to scratch with what's happening. So&nbsp;
what we're saying is we're using the or the or&nbsp;&nbsp;

02:40:50,251 --> 02:40:56,671
the syntax of or is very simple. It's where we&nbsp;
have the what's happening here is we're seeing,&nbsp;&nbsp;

02:40:56,671 --> 02:41:03,030
we're seeing Okay, so if you know the syntax&nbsp;
for how a query is made in SQL, it's really&nbsp;&nbsp;

02:41:03,030 --> 02:41:09,120
very simple. So we're saying select from, from&nbsp;
the table, remember, this is specifying a table,&nbsp;&nbsp;

02:41:09,120 --> 02:41:15,600
not a column. So it says select from the&nbsp;
users table from select from the users table,&nbsp;&nbsp;

02:41:15,601 --> 02:41:22,321
email password, so comparing and then we say&nbsp;
all the new specify the condition with a value,&nbsp;&nbsp;

02:41:22,320 --> 02:41:29,850
we can enter our into fields. So we can say the&nbsp;
value of the email can always be changed. And we&nbsp;&nbsp;

02:41:29,851 --> 02:41:33,720
obviously know that that is the first account&nbsp;
that was created. And the password is going to&nbsp;&nbsp;

02:41:33,720 --> 02:41:40,231
remain the same. So we hit login. And yeah, we&nbsp;
get still keep on getting an error here. Now,&nbsp;&nbsp;

02:41:40,230 --> 02:41:48,480
that is weird. No, because if I specify there is&nbsp;
no comment here, or one equals one, yes. So it is&nbsp;&nbsp;

02:41:48,480 --> 02:41:57,959
working. So you can see. So select from users,&nbsp;
where one equals one and password. Yeah, so we&nbsp;&nbsp;

02:41:57,960 --> 02:42:03,000
want to nullify and password we don't want and&nbsp;
there. So for that we use the user comment here.&nbsp;&nbsp;

02:42:03,000 --> 02:42:09,690
And there we are. Excellent. So we're able to log&nbsp;
in to the administrators use account. Alright,&nbsp;&nbsp;

02:42:09,690 --> 02:42:14,639
so let me explain what happened there. So as I&nbsp;
said, the the syntax of the query was as follows&nbsp;&nbsp;

02:42:14,640 --> 02:42:20,911
we're selecting from the users table, we're&nbsp;
selecting the email and password and comparing&nbsp;&nbsp;

02:42:20,910 --> 02:42:25,080
them to each other. So they have to match show&nbsp;
up, you're performing a query, a simple query,&nbsp;&nbsp;

02:42:25,080 --> 02:42:31,740
and what we said is, or that's a conditional&nbsp;
statement. So we're saying or that we specify&nbsp;&nbsp;

02:42:31,740 --> 02:42:37,320
the condition where the first value is going to&nbsp;
be equal to the the, the first one is going to&nbsp;&nbsp;

02:42:37,320 --> 02:42:43,980
be equal to one, and we nullify the, the password&nbsp;
where the password was we're essentially removing&nbsp;&nbsp;

02:42:43,980 --> 02:42:49,440
authentication. And we are what because we're&nbsp;
including the comment syntax for SQL. Alright,&nbsp;&nbsp;

02:42:49,440 --> 02:42:55,049
so that was pretty simple. But now, the thing&nbsp;
that's bothering me is we don't have the&nbsp;&nbsp;

02:42:55,050 --> 02:42:59,670
password. So let me just check the scoreboard.&nbsp;
And let's see what progress we've made so far.&nbsp;&nbsp;

02:42:59,670 --> 02:43:08,910
So have access administration section that's&nbsp;
not in here that is in here. So log in with the&nbsp;&nbsp;

02:43:08,910 --> 02:43:14,280
administrators use account. Marino the password.&nbsp;
So I think that's how we're going to be logging&nbsp;&nbsp;

02:43:14,280 --> 02:43:22,770
in. We know the email, because if I just go back&nbsp;
into administration here, administration, I hope&nbsp;&nbsp;

02:43:22,771 --> 02:43:32,611
the video is not getting too long. So we have the&nbsp;
admin. We have the admin email here. Um, oh, yes,&nbsp;&nbsp;

02:43:32,610 --> 02:43:39,390
yes, yes, yes, we have the token. So if we inspect&nbsp;
the element, and we go into the cookie editor,&nbsp;&nbsp;

02:43:39,391 --> 02:43:43,981
for example, we can use that or you can just use&nbsp;
storage. But I should have done it, you know,&nbsp;&nbsp;

02:43:43,980 --> 02:43:49,230
from the cookie editor from the beginning. So we&nbsp;
have the the token here. And I talked about this&nbsp;&nbsp;

02:43:49,230 --> 02:43:54,720
in my other video actually went through this&nbsp;
with the token. So. So we're gonna say token,&nbsp;&nbsp;

02:43:54,721 --> 02:44:01,921
I think the site was it's a JSON tokens, a token,&nbsp;
decode, and should be the first site here, the&nbsp;&nbsp;

02:44:01,921 --> 02:44:09,301
JSON web token. So jw t.io. That's an excellent&nbsp;
site. And we talked about this. So if you want to&nbsp;&nbsp;

02:44:09,301 --> 02:44:15,511
watch that video, I'll post it in the description.&nbsp;
So you can check it out. And the email is admin.&nbsp;&nbsp;

02:44:15,511 --> 02:44:20,071
So that's the authentication token, and that&nbsp;
gives us all the information we need. All right,&nbsp;&nbsp;

02:44:20,070 --> 02:44:26,700
so we have the password here. But again, what is&nbsp;
this hashed into? That looks like MD five again,&nbsp;&nbsp;

02:44:26,700 --> 02:44:30,331
but let me just confirm, and let's see what&nbsp;
that gives us. So the password is hashed,&nbsp;&nbsp;

02:44:30,331 --> 02:44:40,051
as we know with MB five, so let's just confirm&nbsp;
hash identifier, because there we are. Yeah,&nbsp;&nbsp;

02:44:40,051 --> 02:44:46,021
it is MD five. So let's just decrypt that one more&nbsp;
time. So I'm just gonna paste in that hash there.&nbsp;&nbsp;

02:44:46,021 --> 02:44:53,011
I'm just going to decrypt let's give that a few&nbsp;
seconds. Oh, my God, man, all the traffic lights.&nbsp;&nbsp;

02:44:53,011 --> 02:45:02,761
And let's hit verify. And yeah, there we are. The&nbsp;
password is I mean 123 Yeah, that's that's pretty&nbsp;&nbsp;

02:45:02,761 --> 02:45:07,891
basic, but again, replicating common practice&nbsp;
that you would find. So what was the email? Oh,&nbsp;&nbsp;

02:45:07,891 --> 02:45:15,331
boy, what was the email? Let me just log back&nbsp;
out. Correct. All right. So let me just use the&nbsp;&nbsp;

02:45:15,331 --> 02:45:22,230
statements. Oh, yeah. So we're logging in. So all&nbsp;
one equals one, because we're all the waters the&nbsp;&nbsp;

02:45:22,230 --> 02:45:27,210
I think we can access the the middle from the&nbsp;
administration. Sorry about that, guys. I know,&nbsp;&nbsp;

02:45:27,211 --> 02:45:32,959
I'm getting really mixed up. Well, we're&nbsp;
not logged in yet. So anyway, let me just&nbsp;&nbsp;

02:45:32,959 --> 02:45:41,480
log in. And we can do the administration here.&nbsp;
stration. And the admin I do shop at juice shop,&nbsp;&nbsp;

02:45:41,479 --> 02:45:48,229
a juice.up. Yeah, that's there to confuse&nbsp;
people. So you can guess it? And we're&nbsp;&nbsp;

02:45:48,229 --> 02:45:54,829
logging in with that. And the password is&nbsp;
admin 123. We're going to log in, and yeah,&nbsp;&nbsp;

02:45:54,829 --> 02:46:01,099
fantastic. So you solve the challenge password&nbsp;
strength. So that was the problem there. That's&nbsp;&nbsp;

02:46:01,099 --> 02:46:05,329
the vulnerability that they're trying to say&nbsp;
exists. So you know, again, password strength is&nbsp;&nbsp;

02:46:05,329 --> 02:46:10,609
something that people don't take into account,&nbsp;
login within message user credentials, without&nbsp;&nbsp;

02:46:10,609 --> 02:46:15,289
previously changing them or applying SQL. Could&nbsp;
you have done this with SQL injection? Probably,&nbsp;&nbsp;

02:46:15,289 --> 02:46:19,849
I'll have to cover SQL injection, because we know&nbsp;
SQL injection is one of those things that's really&nbsp;&nbsp;

02:46:19,849 --> 02:46:26,660
dependent on the query. So let me just go back to&nbsp;
the scoreboard here. I don't understand what else&nbsp;&nbsp;

02:46:26,659 --> 02:46:31,999
is left. There's still a lot of stuff that have&nbsp;
to cover. I talked about cross site scripting,&nbsp;&nbsp;

02:46:31,999 --> 02:46:39,109
but I think I'll cover that in the next video.&nbsp;
We'll explain it again. What is the what is the&nbsp;&nbsp;

02:46:39,109 --> 02:46:48,529
the confidential document error handling? Or we&nbsp;
don't have anything much they're actually someone&nbsp;&nbsp;

02:46:48,529 --> 02:46:56,058
else's basket? I did that. What else should I want&nbsp;
to cover here? Let's look at these ones right over&nbsp;&nbsp;

02:46:56,059 --> 02:47:02,660
here. So yeah, so the authentication area here&nbsp;
is where I want to look at. I think that's where&nbsp;&nbsp;

02:47:02,659 --> 02:47:06,409
I'm going to end this video. I know, I haven't&nbsp;
covered any advanced stuff. But hopefully that's&nbsp;&nbsp;

02:47:06,409 --> 02:47:11,359
like an introduction. So where we, where we have&nbsp;
been able to log into the administration in the&nbsp;&nbsp;

02:47:11,359 --> 02:47:17,178
administrators account, we are able to get the&nbsp;
scoreboard the administration panel, what else&nbsp;&nbsp;

02:47:17,179 --> 02:47:23,030
were we able to do? We were able to provoke&nbsp;
an error, not saying no nothing really complex&nbsp;&nbsp;

02:47:23,029 --> 02:47:30,979
there. And we were able to log in with the admin&nbsp;
tree at the administrators group user credentials.&nbsp;&nbsp;

02:47:30,979 --> 02:47:38,268
Now we looks like we can actually get access to&nbsp;
Max's search original users credential so again,&nbsp;&nbsp;

02:47:38,269 --> 02:47:42,709
another user that we can try and get access into.&nbsp;
Yeah, that's gonna be it for this video. Guys. If&nbsp;&nbsp;

02:47:42,709 --> 02:47:46,280
you found value in this video, please leave&nbsp;
a like down below. If you have any questions&nbsp;&nbsp;

02:47:46,280 --> 02:47:50,540
or suggestions, let me know in the comment&nbsp;
section on my social networks or on my website,&nbsp;&nbsp;

02:47:50,540 --> 02:47:55,700
and I'll be sure to leave your reply and I'll&nbsp;
be seeing you in the next video. Peace, guys.


