WEBVTT

00:00:00.000 --> 00:00:03.872 align:middle line:90%


00:00:03.872 --> 00:00:07.260 align:middle line:90%
[SOUND EFFECTS PLAYING]

00:00:07.260 --> 00:00:10.170 align:middle line:90%


00:00:10.170 --> 00:00:11.580 align:middle line:90%
Welcome to Intro to Web.

00:00:11.580 --> 00:00:17.820 align:middle line:84%
In this course, we're going to
get into what a website is, how

00:00:17.820 --> 00:00:20.340 align:middle line:84%
web protocols work,
and then we'll

00:00:20.340 --> 00:00:23.760 align:middle line:84%
dive into identifying
some web directories.

00:00:23.760 --> 00:00:27.640 align:middle line:90%
So what is a website?

00:00:27.640 --> 00:00:29.890 align:middle line:84%
Really, they're just
files on a server

00:00:29.890 --> 00:00:33.310 align:middle line:84%
that you're accessing,
generally through a browser.

00:00:33.310 --> 00:00:39.780 align:middle line:84%
So basic three files you're
likely to see, HTML, CSS,

00:00:39.780 --> 00:00:43.140 align:middle line:84%
and JavaScript, with
HTML being your HyperText

00:00:43.140 --> 00:00:46.260 align:middle line:84%
Markup Language, which
is just the basic format

00:00:46.260 --> 00:00:47.970 align:middle line:90%
of what's on that site.

00:00:47.970 --> 00:00:50.400 align:middle line:84%
Then for your
presentation, you've

00:00:50.400 --> 00:00:52.080 align:middle line:90%
got a Cascading Style Sheet.

00:00:52.080 --> 00:00:55.830 align:middle line:84%
And then for functionality
and anything additional,

00:00:55.830 --> 00:00:59.220 align:middle line:90%
you've got JavaScript.

00:00:59.220 --> 00:01:01.260 align:middle line:84%
And when you reach
out with your browser,

00:01:01.260 --> 00:01:07.680 align:middle line:84%
you're going to pull
these files using HTTP.

00:01:07.680 --> 00:01:14.970 align:middle line:84%
Likely, if someone is hosting
locally on their own servers,

00:01:14.970 --> 00:01:19.080 align:middle line:84%
they'll be using
Apache; NGINX; Tomcat;

00:01:19.080 --> 00:01:22.780 align:middle line:84%
or if it's a
Windows-based server, IIS.

00:01:22.780 --> 00:01:25.480 align:middle line:90%


00:01:25.480 --> 00:01:28.450 align:middle line:84%
If you have off-premise
hosting, which

00:01:28.450 --> 00:01:32.770 align:middle line:84%
is way more common nowadays
in your cloud providers,

00:01:32.770 --> 00:01:37.640 align:middle line:84%
be it AWS, Azure, or
Google Cloud platform,

00:01:37.640 --> 00:01:40.420 align:middle line:84%
there's also other
hosting services,

00:01:40.420 --> 00:01:44.080 align:middle line:84%
like WordPress, Firebase,
DigitalOcean, Cloudflare.

00:01:44.080 --> 00:01:50.530 align:middle line:84%
And they all provide
places to host these files,

00:01:50.530 --> 00:01:53.710 align:middle line:84%
so they're accessible
to all your users

00:01:53.710 --> 00:01:55.930 align:middle line:84%
without necessarily
having to carry

00:01:55.930 --> 00:01:59.290 align:middle line:84%
the burden of owning that
infrastructure yourself

00:01:59.290 --> 00:02:00.550 align:middle line:90%
or your organization.

00:02:00.550 --> 00:02:03.990 align:middle line:90%


00:02:03.990 --> 00:02:10.229 align:middle line:84%
With that, we use our browsers
to connect to these servers

00:02:10.229 --> 00:02:13.990 align:middle line:84%
and pull these files
utilizing HTTP.

00:02:13.990 --> 00:02:15.360 align:middle line:90%
That's the most common.

00:02:15.360 --> 00:02:19.990 align:middle line:84%
That's what we generally
all use nowadays,

00:02:19.990 --> 00:02:22.180 align:middle line:84%
and we'll get into
HTTPS in a little bit.

00:02:22.180 --> 00:02:26.710 align:middle line:84%
But the basics, HTTPS is
just additional to HTTP.

00:02:26.710 --> 00:02:29.700 align:middle line:90%


00:02:29.700 --> 00:02:35.520 align:middle line:84%
You've got headers that go
along with your requests

00:02:35.520 --> 00:02:37.080 align:middle line:90%
and your responses.

00:02:37.080 --> 00:02:40.080 align:middle line:84%
We'll talk about
browsers and sessions,

00:02:40.080 --> 00:02:43.920 align:middle line:84%
because HTTP on its own
does not maintain sessions

00:02:43.920 --> 00:02:47.550 align:middle line:90%
so we use something special.

00:02:47.550 --> 00:02:48.990 align:middle line:90%
So what is a header?

00:02:48.990 --> 00:02:53.280 align:middle line:84%
Headers hold
information about what

00:02:53.280 --> 00:02:58.110 align:middle line:84%
you're requesting when you
want the files from a server.

00:02:58.110 --> 00:03:00.000 align:middle line:84%
So there's certain
methods, and we'll

00:03:00.000 --> 00:03:03.660 align:middle line:90%
dive into all of the methods.

00:03:03.660 --> 00:03:06.310 align:middle line:84%
Because remember, these
are files being hosted,

00:03:06.310 --> 00:03:09.870 align:middle line:84%
so what directory are
we going to start with?

00:03:09.870 --> 00:03:17.710 align:middle line:84%
Your host, what is the actual
location of the server?

00:03:17.710 --> 00:03:21.630 align:middle line:84%
Now, we've, in
information gathering,

00:03:21.630 --> 00:03:25.440 align:middle line:84%
gotten into domains
and subdomains.

00:03:25.440 --> 00:03:28.770 align:middle line:84%
This is specific
for each request.

00:03:28.770 --> 00:03:31.260 align:middle line:84%
And then another big
thing that you're

00:03:31.260 --> 00:03:34.590 align:middle line:84%
going to get used to
seeing in headers for HTTP

00:03:34.590 --> 00:03:39.780 align:middle line:84%
are user agent,
which identifies what

00:03:39.780 --> 00:03:44.040 align:middle line:84%
"browser" you are using
to make that request

00:03:44.040 --> 00:03:48.480 align:middle line:84%
because certain browsers
require specific functionality.

00:03:48.480 --> 00:03:51.360 align:middle line:84%
And web designers,
web developers

00:03:51.360 --> 00:03:54.420 align:middle line:84%
develop based on the
platform that their users are

00:03:54.420 --> 00:03:58.440 align:middle line:84%
likely to use and create
cross-functional things.

00:03:58.440 --> 00:04:02.730 align:middle line:84%
So based on your user
agent string, whatever

00:04:02.730 --> 00:04:05.130 align:middle line:84%
you identify as
your browser, they

00:04:05.130 --> 00:04:09.310 align:middle line:84%
provide what your browser is
used to projecting to you.

00:04:09.310 --> 00:04:12.800 align:middle line:90%
Well, we get a lot out of that.

00:04:12.800 --> 00:04:16.120 align:middle line:84%
We can utilize that,
and we can spoof it.

00:04:16.120 --> 00:04:18.250 align:middle line:84%
What you get back
from the server

00:04:18.250 --> 00:04:20.680 align:middle line:90%
is going to be a response.

00:04:20.680 --> 00:04:21.810 align:middle line:90%
You send a request.

00:04:21.810 --> 00:04:23.470 align:middle line:90%
You get back a response.

00:04:23.470 --> 00:04:25.970 align:middle line:84%
No matter how you're
interacting with those files,

00:04:25.970 --> 00:04:27.730 align:middle line:90%
it's not always reading.

00:04:27.730 --> 00:04:29.290 align:middle line:90%
We get into that with methods.

00:04:29.290 --> 00:04:33.490 align:middle line:84%
But either way, the client
sends a request and the server

00:04:33.490 --> 00:04:34.285 align:middle line:90%
sends a response.

00:04:34.285 --> 00:04:37.150 align:middle line:90%


00:04:37.150 --> 00:04:40.270 align:middle line:84%
Big things in the headers
for your responses

00:04:40.270 --> 00:04:42.568 align:middle line:90%
are your status codes.

00:04:42.568 --> 00:04:44.110 align:middle line:84%
We're going to get
a lot out of that.

00:04:44.110 --> 00:04:48.230 align:middle line:84%
And then content type, there's
a lot of information there.

00:04:48.230 --> 00:04:50.780 align:middle line:84%
And this is not a
computer science course.

00:04:50.780 --> 00:04:53.710 align:middle line:84%
This is web app
penetration testing.

00:04:53.710 --> 00:04:55.510 align:middle line:84%
I'm only teaching
you what you need

00:04:55.510 --> 00:05:00.040 align:middle line:84%
to know here so that you
can get started with web app

00:05:00.040 --> 00:05:02.810 align:middle line:90%
penetration testing as a whole.

00:05:02.810 --> 00:05:06.010 align:middle line:84%
So we request the client
interaction with the server

00:05:06.010 --> 00:05:10.660 align:middle line:84%
by requesting things, and
we do that through methods.

00:05:10.660 --> 00:05:13.370 align:middle line:84%
These are the methods
that are available.

00:05:13.370 --> 00:05:17.290 align:middle line:84%
I'll tell you TRACK is the
one that may or may not

00:05:17.290 --> 00:05:25.950 align:middle line:84%
be used by every browser out
there, but GET is very common.

00:05:25.950 --> 00:05:27.900 align:middle line:90%
That's retrieving a file.

00:05:27.900 --> 00:05:30.480 align:middle line:84%
HEAD is just going
to pull the headers.

00:05:30.480 --> 00:05:35.112 align:middle line:84%
POST posts like a
form or a log-in.

00:05:35.112 --> 00:05:36.570 align:middle line:84%
That's going to be
a post where you

00:05:36.570 --> 00:05:39.390 align:middle line:84%
send specific data
to the server,

00:05:39.390 --> 00:05:43.650 align:middle line:84%
but it's going to still
return you something specific.

00:05:43.650 --> 00:05:48.450 align:middle line:84%
There's PUT for putting
files onto the server.

00:05:48.450 --> 00:05:50.580 align:middle line:90%
Yes, that is possible.

00:05:50.580 --> 00:05:53.700 align:middle line:84%
Or DELETE if you want
to delete things off,

00:05:53.700 --> 00:05:55.710 align:middle line:84%
and we'll get into
that in the lab.

00:05:55.710 --> 00:06:02.150 align:middle line:84%
There's also CONNECT, which
may or may not be used.

00:06:02.150 --> 00:06:03.650 align:middle line:90%
Not super common.

00:06:03.650 --> 00:06:07.910 align:middle line:84%
OPTIONS allows you to know
which of these methods

00:06:07.910 --> 00:06:10.530 align:middle line:90%
are available as options.

00:06:10.530 --> 00:06:13.220 align:middle line:84%
And then PATCH,
again, may or may not

00:06:13.220 --> 00:06:18.770 align:middle line:84%
be available but to patch
the software on the server.

00:06:18.770 --> 00:06:22.400 align:middle line:84%
Again, based off
of our user agent,

00:06:22.400 --> 00:06:26.070 align:middle line:84%
we might get different
sorts of information.

00:06:26.070 --> 00:06:27.890 align:middle line:84%
So just think about
how we might be

00:06:27.890 --> 00:06:31.730 align:middle line:84%
able to use that as
penetration testers.

00:06:31.730 --> 00:06:34.740 align:middle line:90%
What you get back is a response.

00:06:34.740 --> 00:06:37.370 align:middle line:90%
So the server sends resources.

00:06:37.370 --> 00:06:42.560 align:middle line:84%
And to let your browser
know what it's receiving,

00:06:42.560 --> 00:06:46.370 align:middle line:84%
there's status codes,
with 200 being OK,

00:06:46.370 --> 00:06:48.740 align:middle line:90%
like that was a good request.

00:06:48.740 --> 00:06:50.490 align:middle line:90%
Here's what you asked for.

00:06:50.490 --> 00:06:53.120 align:middle line:90%
So a 200 is an OK.

00:06:53.120 --> 00:06:55.430 align:middle line:90%
A 302 is a redirect.

00:06:55.430 --> 00:06:57.770 align:middle line:84%
The website that you're
requesting actually

00:06:57.770 --> 00:07:03.060 align:middle line:84%
goes to another website,
and the browsers and HTTP

00:07:03.060 --> 00:07:06.860 align:middle line:84%
work that out and already
send a GET request usually

00:07:06.860 --> 00:07:09.950 align:middle line:90%
to that new page.

00:07:09.950 --> 00:07:13.200 align:middle line:84%
A 404, you might be
familiar with that.

00:07:13.200 --> 00:07:19.460 align:middle line:84%
Resource not available
or not found.

00:07:19.460 --> 00:07:20.900 align:middle line:90%
So what is a browser?

00:07:20.900 --> 00:07:24.950 align:middle line:84%
A browser just interprets
and processes these files.

00:07:24.950 --> 00:07:27.860 align:middle line:84%
They take the HTML,
which then connects

00:07:27.860 --> 00:07:31.280 align:middle line:84%
to your CSS and your
JavaScript, and serves it up

00:07:31.280 --> 00:07:37.010 align:middle line:84%
for you in a fashion
that you can work with.

00:07:37.010 --> 00:07:38.330 align:middle line:90%
There's other files.

00:07:38.330 --> 00:07:45.320 align:middle line:84%
There's PHP, which is just
a software file that's

00:07:45.320 --> 00:07:46.490 align:middle line:90%
based on the backend.

00:07:46.490 --> 00:07:50.610 align:middle line:84%
It's just another way for
it to send those files,

00:07:50.610 --> 00:07:56.260 align:middle line:84%
but we'll get into that with
some examples in the future.

00:07:56.260 --> 00:07:57.600 align:middle line:90%
So then sessions.

00:07:57.600 --> 00:07:59.940 align:middle line:84%
I mentioned this a
little bit before.

00:07:59.940 --> 00:08:05.790 align:middle line:84%
HTTP does not maintain sessions
as a protocol in and of itself.

00:08:05.790 --> 00:08:08.970 align:middle line:90%
Instead, it utilizes cookies.

00:08:08.970 --> 00:08:14.760 align:middle line:84%
Cookies are codes that go
alongside your requests.

00:08:14.760 --> 00:08:22.470 align:middle line:84%
And as long as that cookie
stays there for as many times

00:08:22.470 --> 00:08:24.390 align:middle line:84%
as you're connected
to the website,

00:08:24.390 --> 00:08:25.950 align:middle line:90%
then your session remains.

00:08:25.950 --> 00:08:28.530 align:middle line:84%
If you log in, then you're
going to get a cookie.

00:08:28.530 --> 00:08:32.010 align:middle line:84%
If you add things to your cart,
you're going to get a cookie.

00:08:32.010 --> 00:08:34.080 align:middle line:90%
There's also tracking cookies.

00:08:34.080 --> 00:08:35.835 align:middle line:90%
There's authentication cookies.

00:08:35.835 --> 00:08:37.440 align:middle line:90%
I talked about logging in.

00:08:37.440 --> 00:08:39.690 align:middle line:84%
There's different
versions of logging in.

00:08:39.690 --> 00:08:42.059 align:middle line:84%
Maybe if you have
an admin account,

00:08:42.059 --> 00:08:45.630 align:middle line:84%
then you get a different
sort of authorization cookie.

00:08:45.630 --> 00:08:48.190 align:middle line:90%
Cookies can be very helpful.

00:08:48.190 --> 00:08:51.780 align:middle line:84%
But again, tracking
cookies might be invasive.

00:08:51.780 --> 00:08:55.870 align:middle line:84%
And there are some
governments that have said,

00:08:55.870 --> 00:09:00.510 align:middle line:84%
hey, yeah, tracking cookies
of a certain type are invasive

00:09:00.510 --> 00:09:01.900 align:middle line:90%
and they're not allowed.

00:09:01.900 --> 00:09:05.680 align:middle line:84%
But in and of themselves,
they're not a problem.

00:09:05.680 --> 00:09:07.990 align:middle line:90%
They're helpful.

00:09:07.990 --> 00:09:11.290 align:middle line:84%
Think about, as a pen
tester, what could you

00:09:11.290 --> 00:09:14.120 align:middle line:90%
take advantage of with cookies?

00:09:14.120 --> 00:09:19.205 align:middle line:84%
Maybe not your session but
maybe someone else's session.

00:09:19.205 --> 00:09:20.830 align:middle line:84%
That's a little more
advanced than what

00:09:20.830 --> 00:09:24.770 align:middle line:84%
we're going to get into, but
it's worth thinking about

00:09:24.770 --> 00:09:28.030 align:middle line:90%
and it's very important.

00:09:28.030 --> 00:09:32.410 align:middle line:90%
So HTTPS, this is very common.

00:09:32.410 --> 00:09:34.620 align:middle line:90%
It's no longer 2017.

00:09:34.620 --> 00:09:38.940 align:middle line:90%
HTTPS is what everyone is using.

00:09:38.940 --> 00:09:40.440 align:middle line:90%
It is now the standard.

00:09:40.440 --> 00:09:45.690 align:middle line:84%
It is HTTP secure,
and it just wraps

00:09:45.690 --> 00:09:53.120 align:middle line:84%
your application-level data in
an application-level encryption

00:09:53.120 --> 00:09:56.270 align:middle line:90%
of TLS or SSL.

00:09:56.270 --> 00:09:58.950 align:middle line:84%
And what it does is it
takes your information.

00:09:58.950 --> 00:10:00.300 align:middle line:90%
Here's a couple examples.

00:10:00.300 --> 00:10:04.130 align:middle line:84%
This is a POST request and
what it looks like over HTTP

00:10:04.130 --> 00:10:06.740 align:middle line:90%
and a POST request over HTTPS.

00:10:06.740 --> 00:10:10.700 align:middle line:84%
It's encrypted so that it
looks like gobbledygook

00:10:10.700 --> 00:10:15.780 align:middle line:84%
to anyone listening, even
if it's on the same machine.

00:10:15.780 --> 00:10:19.090 align:middle line:84%
If you have the keys,
you can decrypt it.

00:10:19.090 --> 00:10:22.920 align:middle line:84%
But likely, anyone
sniffing can't make out

00:10:22.920 --> 00:10:29.640 align:middle line:84%
what is going on there,
so that is HTTPS.

00:10:29.640 --> 00:10:31.620 align:middle line:84%
We're going to jump
into an environment now,

00:10:31.620 --> 00:10:34.260 align:middle line:84%
and I'll show you
a little bit more

00:10:34.260 --> 00:10:37.185 align:middle line:84%
about these things that I
mentioned in the slides.

00:10:37.185 --> 00:10:42.130 align:middle line:90%


00:10:42.130 --> 00:10:43.420 align:middle line:90%
Get my face out of the way.

00:10:43.420 --> 00:10:46.300 align:middle line:90%


00:10:46.300 --> 00:10:48.940 align:middle line:90%
We have demo.ine.local.

00:10:48.940 --> 00:10:51.520 align:middle line:90%


00:10:51.520 --> 00:10:53.920 align:middle line:84%
We're just going to
ping it and it is up.

00:10:53.920 --> 00:10:57.140 align:middle line:84%
And it gives us an IP
address of 192.35.202.3.

00:10:57.140 --> 00:11:00.100 align:middle line:90%


00:11:00.100 --> 00:11:04.180 align:middle line:84%
We're just going
to navigate there.

00:11:04.180 --> 00:11:12.030 align:middle line:84%
demo.ine.local, it
says bWAPP from OWASP.

00:11:12.030 --> 00:11:16.980 align:middle line:84%
Great little web app to
identify some of these things.

00:11:16.980 --> 00:11:20.490 align:middle line:84%
Let's run an Nmap scan on
that domain, demo.ine.local.

00:11:20.490 --> 00:11:23.520 align:middle line:90%


00:11:23.520 --> 00:11:31.290 align:middle line:84%
And we can see it's got port 80
open hosting on HTTP and MySQL,

00:11:31.290 --> 00:11:33.165 align:middle line:90%
and we could run that again.

00:11:33.165 --> 00:11:45.630 align:middle line:90%


00:11:45.630 --> 00:11:48.005 align:middle line:84%
And we'll just do some service
enumeration on those, too.

00:11:48.005 --> 00:11:52.390 align:middle line:90%


00:11:52.390 --> 00:11:53.850 align:middle line:90%
We'll have that run.

00:11:53.850 --> 00:11:55.800 align:middle line:84%
But we can see, we've
got the website here.

00:11:55.800 --> 00:12:01.440 align:middle line:84%
If you look at the website,
it says /login.php.

00:12:01.440 --> 00:12:06.870 align:middle line:84%
I mentioned this a little bit
before but .php is a file type

00:12:06.870 --> 00:12:09.630 align:middle line:90%
often used by Apache.

00:12:09.630 --> 00:12:12.840 align:middle line:84%
And it's a language
in and of itself

00:12:12.840 --> 00:12:18.870 align:middle line:84%
utilized by the Apache
service to then serve up

00:12:18.870 --> 00:12:21.690 align:middle line:90%
the proper files.

00:12:21.690 --> 00:12:26.950 align:middle line:84%
So when I say "files," let's
take a look at the page source.

00:12:26.950 --> 00:12:31.510 align:middle line:90%
And here, we have the HTML code.

00:12:31.510 --> 00:12:34.740 align:middle line:84%
There's the head information
with some metadata and links

00:12:34.740 --> 00:12:40.680 align:middle line:84%
to the style sheet, which
is that CSS, stylesheet.css.

00:12:40.680 --> 00:12:47.064 align:middle line:84%
And we've got some scripts
that are over here in html5.js.

00:12:47.064 --> 00:12:50.070 align:middle line:84%
These are the other files
utilized and connected

00:12:50.070 --> 00:12:58.400 align:middle line:84%
to the HTML that is served up
by this file login.php located

00:12:58.400 --> 00:12:59.150 align:middle line:90%
on the web server.

00:12:59.150 --> 00:13:02.760 align:middle line:90%


00:13:02.760 --> 00:13:06.350 align:middle line:84%
And again, not a
computer science or a web

00:13:06.350 --> 00:13:10.200 align:middle line:90%
app or a web design course.

00:13:10.200 --> 00:13:12.020 align:middle line:84%
There's ways of
going and learning

00:13:12.020 --> 00:13:18.330 align:middle line:84%
what "head" means and "body,"
headers and these lists

00:13:18.330 --> 00:13:20.390 align:middle line:90%
and tables.

00:13:20.390 --> 00:13:23.750 align:middle line:84%
Highly recommend taking
a course specific to this

00:13:23.750 --> 00:13:28.250 align:middle line:84%
that we should have in
our fundamentals area,

00:13:28.250 --> 00:13:31.593 align:middle line:84%
just so you can understand
what all this means.

00:13:31.593 --> 00:13:34.010 align:middle line:84%
Because if you're going to do
web app penetration testing,

00:13:34.010 --> 00:13:37.500 align:middle line:84%
you need to understand what
it is you're looking at.

00:13:37.500 --> 00:13:40.250 align:middle line:90%
We can also Inspect Element.

00:13:40.250 --> 00:13:44.320 align:middle line:90%


00:13:44.320 --> 00:13:47.860 align:middle line:84%
And in here, we can
look at storage.

00:13:47.860 --> 00:13:52.210 align:middle line:84%
And see, we've got a
cookie for a PHP session ID

00:13:52.210 --> 00:13:55.300 align:middle line:84%
and it tells us where the
path is and the domain.

00:13:55.300 --> 00:13:57.770 align:middle line:84%
And this is just
setting things up.

00:13:57.770 --> 00:14:01.240 align:middle line:84%
So as we move
around this website,

00:14:01.240 --> 00:14:05.320 align:middle line:84%
we've got some
persistence, really.

00:14:05.320 --> 00:14:11.080 align:middle line:84%
So that as we continue to do
stuff, it kind of makes sense.

00:14:11.080 --> 00:14:14.860 align:middle line:84%
And if we went into
the Style Editor,

00:14:14.860 --> 00:14:16.570 align:middle line:84%
we could see what
the CSS looks like.

00:14:16.570 --> 00:14:23.920 align:middle line:90%


00:14:23.920 --> 00:14:27.120 align:middle line:84%
And there's a console to
interact with the JavaScript,

00:14:27.120 --> 00:14:29.670 align:middle line:90%
but here is your HTML.

00:14:29.670 --> 00:14:32.460 align:middle line:84%
And you can see what
each element is related

00:14:32.460 --> 00:14:36.510 align:middle line:84%
to in the stylesheet,
and you can often

00:14:36.510 --> 00:14:40.410 align:middle line:84%
see if there's any
JavaScript connected to it.

00:14:40.410 --> 00:14:45.410 align:middle line:84%
But I'm not going to get
in too much more of that.

00:14:45.410 --> 00:14:50.830 align:middle line:84%
I'd show you how it's a file
that's served up on that server

00:14:50.830 --> 00:14:53.110 align:middle line:90%
and that we're looking at it.

00:14:53.110 --> 00:14:54.940 align:middle line:90%
Cookie Editor is awesome.

00:14:54.940 --> 00:14:57.780 align:middle line:90%


00:14:57.780 --> 00:15:00.790 align:middle line:84%
If you get Kali,
you'll play with that.

00:15:00.790 --> 00:15:05.130 align:middle line:84%
So this right here
is an HTTP page

00:15:05.130 --> 00:15:10.860 align:middle line:84%
because it's hosted on
port 80 on HTTP service,

00:15:10.860 --> 00:15:13.380 align:middle line:90%
so it is not secure.

00:15:13.380 --> 00:15:29.680 align:middle line:84%
Meaning that, if we
spin up Wireshark

00:15:29.680 --> 00:15:45.140 align:middle line:84%
and we listen in on eth1,
connect here, let's to do this.

00:15:45.140 --> 00:15:46.160 align:middle line:90%
Bee, bug.

00:15:46.160 --> 00:15:47.990 align:middle line:90%
You can see, it's right there.

00:15:47.990 --> 00:15:52.360 align:middle line:90%


00:15:52.360 --> 00:15:56.800 align:middle line:84%
If we pop back over
and search for HTTP,

00:15:56.800 --> 00:16:01.045 align:middle line:84%
actually let's do
frame contains bee.

00:16:01.045 --> 00:16:04.190 align:middle line:90%


00:16:04.190 --> 00:16:05.660 align:middle line:90%
We have our login.php.

00:16:05.660 --> 00:16:08.480 align:middle line:90%
Let's follow this HTTP stream.

00:16:08.480 --> 00:16:12.590 align:middle line:84%
And right there, we
have our login.php.

00:16:12.590 --> 00:16:16.970 align:middle line:84%
We did a POST request with
these variables for the login

00:16:16.970 --> 00:16:19.850 align:middle line:90%
as bee and the password as bug.

00:16:19.850 --> 00:16:24.920 align:middle line:84%
And it included a little cookie
that we didn't think about,

00:16:24.920 --> 00:16:27.310 align:middle line:90%
security level of 0.

00:16:27.310 --> 00:16:28.750 align:middle line:90%
And the form was submitted.

00:16:28.750 --> 00:16:32.410 align:middle line:90%
This is what we sent in.

00:16:32.410 --> 00:16:38.560 align:middle line:84%
And we had a cookie, our
PHP session ID, to maintain.

00:16:38.560 --> 00:16:44.860 align:middle line:84%
And it came up with a redirect,
a 302, which then automatically

00:16:44.860 --> 00:16:46.570 align:middle line:90%
sent to portal.php.

00:16:46.570 --> 00:16:48.135 align:middle line:90%
So you had login.php.

00:16:48.135 --> 00:16:51.130 align:middle line:90%
It went to portal.php.

00:16:51.130 --> 00:16:52.750 align:middle line:90%
I didn't request that.

00:16:52.750 --> 00:16:55.600 align:middle line:90%
It happened when we logged in.

00:16:55.600 --> 00:16:59.380 align:middle line:90%
And then that's served up a 200.

00:16:59.380 --> 00:17:01.990 align:middle line:84%
And we ended up with
this HTML, which

00:17:01.990 --> 00:17:03.640 align:middle line:90%
is what we're looking at now.

00:17:03.640 --> 00:17:06.700 align:middle line:90%


00:17:06.700 --> 00:17:12.099 align:middle line:84%
So that's the basics of
how these files go across

00:17:12.099 --> 00:17:14.619 align:middle line:84%
and how we interact
with the browser.

00:17:14.619 --> 00:17:19.570 align:middle line:84%
We could also use
a tool like curl.

00:17:19.570 --> 00:17:24.579 align:middle line:90%


00:17:24.579 --> 00:17:35.470 align:middle line:84%
And curl is just going
to pull over that page,

00:17:35.470 --> 00:17:37.880 align:middle line:84%
and there wasn't
anything for it to show.

00:17:37.880 --> 00:17:42.750 align:middle line:90%


00:17:42.750 --> 00:17:43.250 align:middle line:90%
Oh.

00:17:43.250 --> 00:17:48.640 align:middle line:90%


00:17:48.640 --> 00:17:50.140 align:middle line:84%
There wasn't anything
for it to show

00:17:50.140 --> 00:17:53.810 align:middle line:84%
because curl doesn't
automatically

00:17:53.810 --> 00:17:56.165 align:middle line:90%
follow the redirect.

00:17:56.165 --> 00:17:58.730 align:middle line:84%
I added verbosity
to my curl request.

00:17:58.730 --> 00:18:04.770 align:middle line:84%
Curl does the same thing
that a browser does,

00:18:04.770 --> 00:18:07.590 align:middle line:84%
which is very specific
in your command line.

00:18:07.590 --> 00:18:12.450 align:middle line:84%
So I said "curl" and
then this domain,

00:18:12.450 --> 00:18:16.310 align:middle line:84%
and so it sent a GET
request to that host

00:18:16.310 --> 00:18:20.420 align:middle line:90%
and its user agent was curl.

00:18:20.420 --> 00:18:26.240 align:middle line:84%
And what we got back was a
302, which is a redirect.

00:18:26.240 --> 00:18:28.820 align:middle line:84%
That's all it learned, was
that there was a redirect.

00:18:28.820 --> 00:18:32.280 align:middle line:90%


00:18:32.280 --> 00:18:35.640 align:middle line:84%
And it says that the location
of the redirect is portal.php,

00:18:35.640 --> 00:18:37.470 align:middle line:90%
so that's kind of useful.

00:18:37.470 --> 00:18:42.550 align:middle line:90%


00:18:42.550 --> 00:18:52.900 align:middle line:84%
Now, let's take a look
at demossl.ine.local,

00:18:52.900 --> 00:18:54.160 align:middle line:90%
and that one's up.

00:18:54.160 --> 00:18:57.190 align:middle line:84%
And let's run an Nmap
on demossl.ine.local.

00:18:57.190 --> 00:19:04.530 align:middle line:90%


00:19:04.530 --> 00:19:07.170 align:middle line:90%
Typos happen.

00:19:07.170 --> 00:19:11.250 align:middle line:84%
And it's got both port
80 open and port 443,

00:19:11.250 --> 00:19:14.380 align:middle line:90%
and that same MySQL server.

00:19:14.380 --> 00:19:23.600 align:middle line:84%
So let's look at the ports on
that one along with services.

00:19:23.600 --> 00:19:26.960 align:middle line:90%


00:19:26.960 --> 00:19:29.390 align:middle line:84%
That's really what we want,
is service enumeration.

00:19:29.390 --> 00:19:32.590 align:middle line:90%


00:19:32.590 --> 00:19:39.000 align:middle line:84%
While that's coming up,
let's go take a look.

00:19:39.000 --> 00:19:41.520 align:middle line:90%
I'm going to restart this one.

00:19:41.520 --> 00:19:44.310 align:middle line:90%


00:19:44.310 --> 00:19:45.465 align:middle line:90%
Continue without saving.

00:19:45.465 --> 00:19:51.266 align:middle line:90%


00:19:51.266 --> 00:19:53.806 align:middle line:90%
And we go to demossl.ine.local.

00:19:53.806 --> 00:19:59.180 align:middle line:90%


00:19:59.180 --> 00:20:01.250 align:middle line:90%
And from there, let's log in.

00:20:01.250 --> 00:20:06.360 align:middle line:90%


00:20:06.360 --> 00:20:07.800 align:middle line:90%
And we were able to log in.

00:20:07.800 --> 00:20:12.300 align:middle line:90%
In this case, we see HTTPS.

00:20:12.300 --> 00:20:14.880 align:middle line:90%
That's my login.

00:20:14.880 --> 00:20:22.710 align:middle line:84%
But connection's secured,
and we have this certificate.

00:20:22.710 --> 00:20:28.140 align:middle line:90%


00:20:28.140 --> 00:20:29.550 align:middle line:90%
Here.

00:20:29.550 --> 00:20:39.120 align:middle line:84%
We'd see who it was issued
by and the public key

00:20:39.120 --> 00:20:40.455 align:middle line:90%
and the fingerprints.

00:20:40.455 --> 00:20:48.000 align:middle line:84%
And this is how it
sets up our encryption.

00:20:48.000 --> 00:20:54.010 align:middle line:84%
Knowing what these keys
are, if we had set it up

00:20:54.010 --> 00:20:58.000 align:middle line:84%
and grabbed the private keys,
then we could decrypt this.

00:20:58.000 --> 00:21:01.360 align:middle line:90%


00:21:01.360 --> 00:21:02.810 align:middle line:90%
But we have this redirect.

00:21:02.810 --> 00:21:06.520 align:middle line:90%


00:21:06.520 --> 00:21:19.340 align:middle line:84%
Because initially, it went
to a null HTTP, got the 302,

00:21:19.340 --> 00:21:21.966 align:middle line:84%
and sent back
servers at demossl--

00:21:21.966 --> 00:21:26.460 align:middle line:90%


00:21:26.460 --> 00:21:31.560 align:middle line:84%
ah, document is moved to
HTTPS demossl.ine.local.

00:21:31.560 --> 00:21:33.720 align:middle line:90%


00:21:33.720 --> 00:21:35.430 align:middle line:90%
It automatically followed that.

00:21:35.430 --> 00:21:40.120 align:middle line:90%


00:21:40.120 --> 00:21:40.660 align:middle line:90%
You can see.

00:21:40.660 --> 00:21:43.810 align:middle line:90%


00:21:43.810 --> 00:21:45.070 align:middle line:90%
Pause TCP stream.

00:21:45.070 --> 00:21:51.020 align:middle line:90%


00:21:51.020 --> 00:21:57.940 align:middle line:84%
And then that
launched into this.

00:21:57.940 --> 00:22:02.970 align:middle line:84%
Because right before that,
it started encryption.

00:22:02.970 --> 00:22:05.740 align:middle line:90%


00:22:05.740 --> 00:22:07.960 align:middle line:84%
Looks like the only
things not encrypted

00:22:07.960 --> 00:22:09.460 align:middle line:90%
in there, some strings.

00:22:09.460 --> 00:22:14.420 align:middle line:90%


00:22:14.420 --> 00:22:17.690 align:middle line:84%
But this is the
best it tried to do

00:22:17.690 --> 00:22:21.320 align:middle line:84%
of taking that encrypted
data and trying to pull

00:22:21.320 --> 00:22:22.940 align:middle line:90%
any sort of strings out of it.

00:22:22.940 --> 00:22:27.220 align:middle line:90%


00:22:27.220 --> 00:22:31.630 align:middle line:84%
And this is the difference
between HTTP and HTTPS.

00:22:31.630 --> 00:22:35.680 align:middle line:84%
And we can see, it's
still just running Apache.

00:22:35.680 --> 00:22:37.750 align:middle line:90%
It's the same exact version.

00:22:37.750 --> 00:22:44.860 align:middle line:84%
It's just configured and running
on 443, configured with SSL.

00:22:44.860 --> 00:22:46.210 align:middle line:90%
And that's the difference there.

00:22:46.210 --> 00:22:51.000 align:middle line:90%


00:22:51.000 --> 00:22:55.760 align:middle line:84%
Now, let's talk a little
bit about directories

00:22:55.760 --> 00:22:58.670 align:middle line:90%
showed in here.

00:22:58.670 --> 00:22:59.540 align:middle line:90%
Let's pull back up.

00:22:59.540 --> 00:23:06.730 align:middle line:90%


00:23:06.730 --> 00:23:10.520 align:middle line:90%
There we have portal.php.

00:23:10.520 --> 00:23:14.330 align:middle line:84%
Well, what other
directories exist in here?

00:23:14.330 --> 00:23:20.060 align:middle line:84%
We're going to use
dirb, because it is fast

00:23:20.060 --> 00:23:21.770 align:middle line:84%
and we'll just do
demo.ine.local.

00:23:21.770 --> 00:23:23.750 align:middle line:90%


00:23:23.750 --> 00:23:28.130 align:middle line:84%
And what dirb is going to
do is it's baked into Kali,

00:23:28.130 --> 00:23:33.150 align:middle line:84%
and it's going to do some
directory busting for us.

00:23:33.150 --> 00:23:34.510 align:middle line:90%
Has generated words.

00:23:34.510 --> 00:23:36.510 align:middle line:90%
It used this word list.

00:23:36.510 --> 00:23:39.810 align:middle line:84%
User shared dirb
with this common.

00:23:39.810 --> 00:23:46.200 align:middle line:84%
And that's the default for
dirb, which, for most examples

00:23:46.200 --> 00:23:49.000 align:middle line:90%
here, are going to work fine.

00:23:49.000 --> 00:23:52.320 align:middle line:84%
And it found a lot
of directories.

00:23:52.320 --> 00:23:53.550 align:middle line:90%
There's an admin directory.

00:23:53.550 --> 00:23:54.137 align:middle line:90%
There's apps.

00:23:54.137 --> 00:23:54.720 align:middle line:90%
There's fonts.

00:23:54.720 --> 00:23:55.680 align:middle line:90%
There's images.

00:23:55.680 --> 00:24:00.550 align:middle line:84%
And you might be thinking,
well, what does that mean?

00:24:00.550 --> 00:24:03.100 align:middle line:84%
And that would be
a great question.

00:24:03.100 --> 00:24:10.710 align:middle line:84%
So let's go to
demo.ine.local and fonts.

00:24:10.710 --> 00:24:13.110 align:middle line:90%
That's a directory.

00:24:13.110 --> 00:24:15.240 align:middle line:84%
These are different fonts
that are being used.

00:24:15.240 --> 00:24:18.930 align:middle line:90%
They'll be utilized by the CSS.

00:24:18.930 --> 00:24:21.480 align:middle line:90%
There's also images.

00:24:21.480 --> 00:24:25.800 align:middle line:84%
These are the images that are
hosted on different pages,

00:24:25.800 --> 00:24:32.770 align:middle line:84%
but they're stored in the same
server in an images directory.

00:24:32.770 --> 00:24:36.090 align:middle line:90%


00:24:36.090 --> 00:24:40.650 align:middle line:84%
We saw that there is an
admin, and that takes us

00:24:40.650 --> 00:24:42.600 align:middle line:90%
to an admin portal.

00:24:42.600 --> 00:24:46.710 align:middle line:84%
This is a finding depending
on what you can do with it.

00:24:46.710 --> 00:24:51.280 align:middle line:90%


00:24:51.280 --> 00:24:51.780 align:middle line:90%
All right.

00:24:51.780 --> 00:24:53.265 align:middle line:90%
There are credentials, bee, bug.

00:24:53.265 --> 00:24:57.880 align:middle line:90%


00:24:57.880 --> 00:25:01.480 align:middle line:90%
Those are still logged in.

00:25:01.480 --> 00:25:04.150 align:middle line:84%
There's the JavaScript,
so you could see the files

00:25:04.150 --> 00:25:07.450 align:middle line:90%
of what is in this JavaScript.

00:25:07.450 --> 00:25:13.870 align:middle line:90%


00:25:13.870 --> 00:25:16.210 align:middle line:90%
Another great one is robots.txt.

00:25:16.210 --> 00:25:19.120 align:middle line:90%


00:25:19.120 --> 00:25:31.830 align:middle line:84%
Your different search
engines out there

00:25:31.830 --> 00:25:34.438 align:middle line:84%
need to know what
they should scan

00:25:34.438 --> 00:25:36.105 align:middle line:84%
and what they shouldn't
scan to include.

00:25:36.105 --> 00:25:41.040 align:middle line:90%


00:25:41.040 --> 00:25:45.150 align:middle line:84%
Did I really just do
that for this one?

00:25:45.150 --> 00:25:47.790 align:middle line:84%
In their results and
what they should spider,

00:25:47.790 --> 00:25:50.580 align:middle line:90%
so robots.txt tells you.

00:25:50.580 --> 00:25:56.250 align:middle line:84%
The user agent GoodBot
is nothing is disallowed.

00:25:56.250 --> 00:26:01.140 align:middle line:84%
BadBot, everything from
root down is disallowed.

00:26:01.140 --> 00:26:06.210 align:middle line:84%
And then everything else,
don't go through admin.

00:26:06.210 --> 00:26:11.100 align:middle line:84%
Don't spider admin or documents
or images or passwords.

00:26:11.100 --> 00:26:16.590 align:middle line:84%
Passwords has me wanting
to look at things,

00:26:16.590 --> 00:26:21.373 align:middle line:90%
and we've got passwords.

00:26:21.373 --> 00:26:22.290 align:middle line:90%
Well, that's not good.

00:26:22.290 --> 00:26:27.090 align:middle line:90%


00:26:27.090 --> 00:26:29.730 align:middle line:84%
Different login IDs
and their passwords.

00:26:29.730 --> 00:26:32.760 align:middle line:90%


00:26:32.760 --> 00:26:39.710 align:middle line:84%
And looks like some
of their information

00:26:39.710 --> 00:26:41.300 align:middle line:90%
to recover their passwords.

00:26:41.300 --> 00:26:44.600 align:middle line:90%


00:26:44.600 --> 00:26:49.530 align:middle line:84%
So that's why it's important to
check robots.txt and see what's

00:26:49.530 --> 00:26:53.340 align:middle line:84%
not allowed, because
what's not allowed

00:26:53.340 --> 00:26:57.450 align:middle line:84%
might be things that we want
to look at as pen tester.

00:26:57.450 --> 00:26:59.760 align:middle line:84%
Should they not be
available at all?

00:26:59.760 --> 00:27:00.450 align:middle line:90%
All right.

00:27:00.450 --> 00:27:06.900 align:middle line:84%
So those are web directories
and websites and how they work.

00:27:06.900 --> 00:27:11.072 align:middle line:90%


00:27:11.072 --> 00:27:14.210 align:middle line:84%
I hope that that was
informative and that you

00:27:14.210 --> 00:27:15.980 align:middle line:90%
learned a little bit.

00:27:15.980 --> 00:27:23.930 align:middle line:84%
If this is your first foray
into web app pen testing,

00:27:23.930 --> 00:27:27.080 align:middle line:84%
then I hope this gets
you a little taste.

00:27:27.080 --> 00:27:29.090 align:middle line:84%
We're going to now
dive into some labs

00:27:29.090 --> 00:27:31.010 align:middle line:84%
and get into some
more specifics, more

00:27:31.010 --> 00:27:37.360 align:middle line:84%
tools for directory
busting, and some exploits.

00:27:37.360 --> 00:27:40.730 align:middle line:90%
So hang on for those.