WEBVTT

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


00:00:10.230 --> 00:00:13.428 align:middle line:84%
Frequently exploited
Linux services.

00:00:13.428 --> 00:00:14.970 align:middle line:84%
So now that we've
taken a look at how

00:00:14.970 --> 00:00:18.270 align:middle line:84%
to exploit multiple inherent
vulnerabilities on Windows,

00:00:18.270 --> 00:00:22.200 align:middle line:84%
ranging from gaining initial
access to a target system

00:00:22.200 --> 00:00:25.020 align:middle line:84%
to privilege escalation,
fault system vulnerabilities,

00:00:25.020 --> 00:00:27.450 align:middle line:84%
and of course, the
process of dumping NTLM

00:00:27.450 --> 00:00:30.360 align:middle line:84%
hashes from memory, we
can now turn our attention

00:00:30.360 --> 00:00:32.280 align:middle line:90%
to the Linux operating system.

00:00:32.280 --> 00:00:34.200 align:middle line:84%
And to get started,
let's get an idea

00:00:34.200 --> 00:00:36.330 align:middle line:84%
of the frequently,
or some of the most

00:00:36.330 --> 00:00:38.790 align:middle line:84%
frequently, exploited
Linux services.

00:00:38.790 --> 00:00:40.440 align:middle line:84%
But before we do
that, we actually

00:00:40.440 --> 00:00:43.110 align:middle line:84%
need to get an understanding
of what the Linux operating

00:00:43.110 --> 00:00:47.010 align:middle line:84%
system is, how it was
started, why it was developed,

00:00:47.010 --> 00:00:49.740 align:middle line:84%
and of course, where it
is typically deployed.

00:00:49.740 --> 00:00:52.620 align:middle line:84%
And this will all
really set up the stage,

00:00:52.620 --> 00:00:55.860 align:middle line:84%
or will actually
contextualize, or give you

00:00:55.860 --> 00:00:57.630 align:middle line:84%
an idea of what
types of services

00:00:57.630 --> 00:01:00.120 align:middle line:84%
are frequently exploited
and the types of services

00:01:00.120 --> 00:01:03.330 align:middle line:84%
that you're likely to encounter
when dealing with a system

00:01:03.330 --> 00:01:05.010 align:middle line:90%
or host running Linux.

00:01:05.010 --> 00:01:07.050 align:middle line:90%
All right, so what is Linux?

00:01:07.050 --> 00:01:09.630 align:middle line:84%
Well, Linux is a free
and open source operating

00:01:09.630 --> 00:01:12.900 align:middle line:84%
system that is comprised
of the Linux kernel, which

00:01:12.900 --> 00:01:15.990 align:middle line:84%
was developed by Linus
Torvalds, and the new toolkit,

00:01:15.990 --> 00:01:18.810 align:middle line:84%
which is a collection of
software and utilities

00:01:18.810 --> 00:01:21.690 align:middle line:84%
that was started and
developed by Richard Stallman.

00:01:21.690 --> 00:01:24.060 align:middle line:84%
This combination of
open source software

00:01:24.060 --> 00:01:27.180 align:middle line:84%
is what makes up the Linux
operating system as a whole,

00:01:27.180 --> 00:01:30.715 align:middle line:84%
and it is commonly
referred to as GNU/Linux.

00:01:30.715 --> 00:01:32.340 align:middle line:84%
All right, so whenever
you hear someone

00:01:32.340 --> 00:01:34.410 align:middle line:84%
saying I installed
Linux on my laptop,

00:01:34.410 --> 00:01:38.790 align:middle line:84%
or installed Linux on my
server, what they really mean

00:01:38.790 --> 00:01:42.690 align:middle line:84%
is that they installed GNU
plus Linux or GNU/Linux, right?

00:01:42.690 --> 00:01:44.850 align:middle line:84%
And the reason for that
is because the Linux

00:01:44.850 --> 00:01:48.540 align:middle line:84%
kernel or Linux originally
is just a kernel.

00:01:48.540 --> 00:01:51.840 align:middle line:84%
And a kernel as we know, is the
core of an operating system,

00:01:51.840 --> 00:01:55.050 align:middle line:84%
and alone it really can't
do much for end users.

00:01:55.050 --> 00:01:59.550 align:middle line:84%
And when it was developed,
or during that time,

00:01:59.550 --> 00:02:03.690 align:middle line:84%
about the same time in
parallel, Richard Stallman

00:02:03.690 --> 00:02:05.940 align:middle line:84%
was actually working
on a toolkit--

00:02:05.940 --> 00:02:08.970 align:middle line:84%
a GNU toolkit, a collection
of open source tools

00:02:08.970 --> 00:02:11.520 align:middle line:84%
and programs--
and actually found

00:02:11.520 --> 00:02:14.520 align:middle line:84%
that he could pair this
toolkit with the Linux kernel

00:02:14.520 --> 00:02:17.640 align:middle line:84%
to form a complete operating
system, which we now

00:02:17.640 --> 00:02:19.830 align:middle line:90%
know as GNU/Linux.

00:02:19.830 --> 00:02:23.250 align:middle line:84%
And to give you an example
of some of the GNU tools

00:02:23.250 --> 00:02:25.500 align:middle line:84%
and programs-- and they
really are important

00:02:25.500 --> 00:02:27.780 align:middle line:84%
and you must have
used them by now.

00:02:27.780 --> 00:02:30.870 align:middle line:84%
An example of these utilities
are the cat command,

00:02:30.870 --> 00:02:34.990 align:middle line:84%
the LS command, the CD command,
the make directory command.

00:02:34.990 --> 00:02:37.860 align:middle line:84%
All of these tools are
part of the GNU toolkit.

00:02:37.860 --> 00:02:40.560 align:middle line:84%
And what that means is that
without the GNU toolkit,

00:02:40.560 --> 00:02:44.230 align:middle line:84%
Linux would really not be what
it is today, and vice versa,

00:02:44.230 --> 00:02:44.730 align:middle line:90%
right?

00:02:44.730 --> 00:02:47.010 align:middle line:84%
The GNU toolkit would
not be what it is today

00:02:47.010 --> 00:02:48.850 align:middle line:90%
without the Linux kernel.

00:02:48.850 --> 00:02:50.820 align:middle line:84%
So it's very important
that we appreciate

00:02:50.820 --> 00:02:53.760 align:middle line:84%
both aspects of what make
up the Linux operating

00:02:53.760 --> 00:02:55.740 align:middle line:90%
system as a whole today.

00:02:55.740 --> 00:02:59.580 align:middle line:84%
All right, now, in terms of
where Linux is typically used,

00:02:59.580 --> 00:03:01.500 align:middle line:84%
we need to get an
idea of distributions.

00:03:01.500 --> 00:03:03.990 align:middle line:84%
And if you've ever worked
in the IT industry before,

00:03:03.990 --> 00:03:06.570 align:middle line:84%
or if you've ever worked
with a computer before,

00:03:06.570 --> 00:03:08.910 align:middle line:84%
you must have heard
of the term Linux

00:03:08.910 --> 00:03:11.430 align:middle line:90%
distribution or Linux distros.

00:03:11.430 --> 00:03:14.430 align:middle line:84%
Linux distributions are
essentially just variants

00:03:14.430 --> 00:03:15.930 align:middle line:90%
of the same operating system.

00:03:15.930 --> 00:03:18.150 align:middle line:84%
The only thing
different between them

00:03:18.150 --> 00:03:21.113 align:middle line:84%
is the fact that they may use
different desktop environments.

00:03:21.113 --> 00:03:22.530 align:middle line:84%
And that's one of
the great things

00:03:22.530 --> 00:03:25.080 align:middle line:84%
about using Linux is
you have the ability

00:03:25.080 --> 00:03:28.080 align:middle line:84%
to customize your operating
system based on what you need,

00:03:28.080 --> 00:03:28.620 align:middle line:90%
right?

00:03:28.620 --> 00:03:32.820 align:middle line:84%
And many of these distributions
have different development

00:03:32.820 --> 00:03:34.710 align:middle line:90%
ideologies and philosophies.

00:03:34.710 --> 00:03:38.220 align:middle line:84%
And they're really developed
either for a general use case

00:03:38.220 --> 00:03:40.390 align:middle line:90%
or for a specific use case.

00:03:40.390 --> 00:03:43.320 align:middle line:84%
So, for example, Kali Linux
is a Linux distribution

00:03:43.320 --> 00:03:45.570 align:middle line:84%
that was developed for
penetration testers

00:03:45.570 --> 00:03:47.580 align:middle line:90%
and security researchers.

00:03:47.580 --> 00:03:50.520 align:middle line:84%
So that means it will typically
have the tools installed,

00:03:50.520 --> 00:03:52.350 align:middle line:84%
or package that you
typically require

00:03:52.350 --> 00:03:54.060 align:middle line:90%
to perform a penetration test.

00:03:54.060 --> 00:03:56.160 align:middle line:84%
Then you have general
purpose distributions,

00:03:56.160 --> 00:03:59.370 align:middle line:84%
like Ubuntu, which again was
developed for anyone to install

00:03:59.370 --> 00:04:02.490 align:middle line:84%
on their computer or laptop,
or even on their server,

00:04:02.490 --> 00:04:04.770 align:middle line:84%
and they can then install
the additional tools

00:04:04.770 --> 00:04:06.210 align:middle line:90%
that they require on top of it.

00:04:06.210 --> 00:04:08.280 align:middle line:84%
And of course, we have
many other distributions

00:04:08.280 --> 00:04:13.200 align:middle line:84%
like Debian, Arch Linux,
Manjaro, Linux Mint, MX Linux,

00:04:13.200 --> 00:04:14.790 align:middle line:90%
et cetera, et cetera, right?

00:04:14.790 --> 00:04:17.610 align:middle line:84%
Now, Linux has
various use cases.

00:04:17.610 --> 00:04:19.680 align:middle line:84%
I think that's a fairly
simple to understand.

00:04:19.680 --> 00:04:22.360 align:middle line:84%
At this point you can install
it on a laptop or computer.

00:04:22.360 --> 00:04:26.250 align:middle line:84%
But really, the area where
it has succeeded the most

00:04:26.250 --> 00:04:28.140 align:middle line:90%
is in the server space.

00:04:28.140 --> 00:04:31.750 align:middle line:84%
So it is typically deployed
as a server operating system.

00:04:31.750 --> 00:04:34.680 align:middle line:84%
For this reason, there are
specific services and protocols

00:04:34.680 --> 00:04:37.650 align:middle line:84%
that will typically be found
running on a Linux server.

00:04:37.650 --> 00:04:39.900 align:middle line:84%
Now, these services
will provide an attacker

00:04:39.900 --> 00:04:42.810 align:middle line:84%
with an access vector that
they can utilize to gain access

00:04:42.810 --> 00:04:44.070 align:middle line:90%
to a target host.

00:04:44.070 --> 00:04:47.200 align:middle line:84%
Having a good understanding
of what these services are,

00:04:47.200 --> 00:04:49.620 align:middle line:84%
how they work, and their
potential vulnerabilities,

00:04:49.620 --> 00:04:53.400 align:middle line:84%
is a vitally important skill to
have as a penetration tester.

00:04:53.400 --> 00:04:56.640 align:middle line:84%
So whenever you run across
a Linux server or a server

00:04:56.640 --> 00:04:58.710 align:middle line:84%
running Linux,
you'll typically find

00:04:58.710 --> 00:05:02.700 align:middle line:84%
a few services across your
entire experience with them.

00:05:02.700 --> 00:05:05.770 align:middle line:84%
And let's actually explore
some of these services.

00:05:05.770 --> 00:05:08.940 align:middle line:84%
So, depending on what the Linux
server has been configured

00:05:08.940 --> 00:05:12.300 align:middle line:84%
to run or host, you'll typically
find that it has a web server,

00:05:12.300 --> 00:05:14.760 align:middle line:90%
and typically it will be Apache.

00:05:14.760 --> 00:05:16.080 align:middle line:90%
So what is Apache?

00:05:16.080 --> 00:05:19.140 align:middle line:84%
Apache is a free and open
source cross-platform web

00:05:19.140 --> 00:05:22.590 align:middle line:84%
server, released under
the Apache license 2.0.

00:05:22.590 --> 00:05:26.380 align:middle line:84%
Apache accounts for over
80% of web servers globally.

00:05:26.380 --> 00:05:28.800 align:middle line:84%
So really, most web
servers out there

00:05:28.800 --> 00:05:31.470 align:middle line:84%
are running Apache or
a variant of Apache.

00:05:31.470 --> 00:05:33.990 align:middle line:84%
And like with any other
web server technology,

00:05:33.990 --> 00:05:37.770 align:middle line:84%
like Microsoft IX and NGINX,
it will run on Port 80,

00:05:37.770 --> 00:05:40.260 align:middle line:84%
and in the case of
an SSL certificate,

00:05:40.260 --> 00:05:42.420 align:middle line:90%
it will run on Port 443.

00:05:42.420 --> 00:05:46.290 align:middle line:84%
You then have the most important
service, which is Secure Shell.

00:05:46.290 --> 00:05:49.590 align:middle line:84%
This is something that you will
typically, or rather always,

00:05:49.590 --> 00:05:53.520 align:middle line:84%
find on a Linux server, because
it is really the only way

00:05:53.520 --> 00:05:55.890 align:middle line:84%
to remotely gain access
to the Linux server, which

00:05:55.890 --> 00:05:58.320 align:middle line:84%
makes sense, especially
if the server is

00:05:58.320 --> 00:06:02.340 align:middle line:84%
being hosted on a server farm
and not physically on premises.

00:06:02.340 --> 00:06:04.860 align:middle line:90%
So, SSH stands for Secure Shell.

00:06:04.860 --> 00:06:07.770 align:middle line:84%
SSH is a cryptographic
remote Access Protocol

00:06:07.770 --> 00:06:10.920 align:middle line:84%
that is used to remotely
access and control systems

00:06:10.920 --> 00:06:14.010 align:middle line:84%
over an unsecured network,
like the internet.

00:06:14.010 --> 00:06:17.280 align:middle line:84%
SSH was developed as a
secure successor to Telnet.

00:06:17.280 --> 00:06:19.020 align:middle line:84%
So if you guys
remember Telnet, Telnet

00:06:19.020 --> 00:06:22.050 align:middle line:84%
was essentially a remote
access or remote control

00:06:22.050 --> 00:06:24.690 align:middle line:90%
protocol that run on Port 23.

00:06:24.690 --> 00:06:26.700 align:middle line:90%
SSH runs on Port 22.

00:06:26.700 --> 00:06:30.000 align:middle line:84%
And the upside to
SSH over Telnet

00:06:30.000 --> 00:06:33.120 align:middle line:84%
is that it supports
authentication-- both username

00:06:33.120 --> 00:06:34.890 align:middle line:84%
and password
authentication as well

00:06:34.890 --> 00:06:36.970 align:middle line:90%
as key-based authentication.

00:06:36.970 --> 00:06:41.490 align:middle line:84%
And SSH as we know runs
on Port 22 right now.

00:06:41.490 --> 00:06:43.740 align:middle line:84%
The other protocol
that you might find,

00:06:43.740 --> 00:06:45.750 align:middle line:84%
and you really will
find quite a lot,

00:06:45.750 --> 00:06:48.240 align:middle line:84%
is FTP which is the
File Transfer Protocol.

00:06:48.240 --> 00:06:50.280 align:middle line:90%
This runs on Port 21.

00:06:50.280 --> 00:06:51.510 align:middle line:90%
That's TCP.

00:06:51.510 --> 00:06:54.420 align:middle line:84%
So, FTP stands for the
File Transfer Protocol.

00:06:54.420 --> 00:06:57.510 align:middle line:84%
It is a protocol that
utilizes TCP port 21

00:06:57.510 --> 00:07:00.330 align:middle line:84%
and is used to facilitate
file sharing between a server

00:07:00.330 --> 00:07:02.800 align:middle line:90%
and client and vise versa.

00:07:02.800 --> 00:07:06.180 align:middle line:84%
So you'll typically see that
an FTP, the FTP protocol

00:07:06.180 --> 00:07:07.960 align:middle line:90%
is paired with a web server.

00:07:07.960 --> 00:07:11.250 align:middle line:84%
And if you have ever bought a
domain and hosted a website,

00:07:11.250 --> 00:07:13.710 align:middle line:84%
you know that you can
transfer your website files

00:07:13.710 --> 00:07:15.420 align:middle line:90%
to the web server with FTP.

00:07:15.420 --> 00:07:20.040 align:middle line:84%
So FTP essentially allows
you to essentially facilitate

00:07:20.040 --> 00:07:23.020 align:middle line:84%
file sharing between the server
and a client and vise versa.

00:07:23.020 --> 00:07:24.750 align:middle line:84%
So you can upload
files to a server

00:07:24.750 --> 00:07:27.180 align:middle line:84%
and you can download
files from the server.

00:07:27.180 --> 00:07:30.480 align:middle line:84%
And FTP also supports
authentication, username

00:07:30.480 --> 00:07:31.770 align:middle line:90%
and password authentication.

00:07:31.770 --> 00:07:34.410 align:middle line:84%
And of course, you might be
understanding or guessing

00:07:34.410 --> 00:07:38.220 align:middle line:84%
what the attack vector is
going to look like right now.

00:07:38.220 --> 00:07:39.930 align:middle line:90%
All right, you then have Samba.

00:07:39.930 --> 00:07:41.190 align:middle line:90%
Now, what is samba?

00:07:41.190 --> 00:07:43.740 align:middle line:84%
Because you can see that
it runs on Port 445,

00:07:43.740 --> 00:07:47.160 align:middle line:84%
and if you remember,
SMB runs on Port 445.

00:07:47.160 --> 00:07:50.940 align:middle line:84%
Samba is essentially the
Linux implementation of SMB.

00:07:50.940 --> 00:07:54.210 align:middle line:84%
It is the open source Linux
implementation of SMB,

00:07:54.210 --> 00:07:58.260 align:middle line:84%
and is essentially used to
allow Windows systems to access

00:07:58.260 --> 00:08:02.050 align:middle line:84%
Linux shares and the devices
connected to the Linux system.

00:08:02.050 --> 00:08:05.160 align:middle line:84%
So you'll typically
find Samba configured

00:08:05.160 --> 00:08:09.030 align:middle line:84%
to run on maybe a
desktop running Linux.

00:08:09.030 --> 00:08:12.150 align:middle line:84%
And that can be very rare,
but it's very important

00:08:12.150 --> 00:08:14.370 align:middle line:84%
that you understand
how to exploit

00:08:14.370 --> 00:08:16.650 align:middle line:84%
Samba or the various
types of exploits

00:08:16.650 --> 00:08:18.990 align:middle line:90%
you can run against Samba.

00:08:18.990 --> 00:08:21.630 align:middle line:84%
All right, so now that
we've explored or got

00:08:21.630 --> 00:08:24.330 align:middle line:84%
an understanding of some of
the frequently exploited Linux

00:08:24.330 --> 00:08:27.815 align:middle line:84%
services, let's get started
with our first vulnerability

00:08:27.815 --> 00:08:29.190 align:middle line:84%
that we're going
to be exploring.

00:08:29.190 --> 00:08:31.680 align:middle line:84%
And that ties into
the Apache web server.

00:08:31.680 --> 00:08:35.130 align:middle line:84%
We are going to be exploring
how to exploit the shell shock

00:08:35.130 --> 00:08:37.600 align:middle line:90%
vulnerability in the next video.

00:08:37.600 --> 00:08:39.720 align:middle line:90%
So I'll see you there.

00:08:39.720 --> 00:08:40.220 align:middle line:90%