WEBVTT

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


00:00:05.844 --> 00:00:08.279 align:middle line:90%
[MUSIC PLAYING]

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


00:00:10.230 --> 00:00:12.840 align:middle line:84%
Welcome to the Linux
Local Enumeration

00:00:12.840 --> 00:00:14.232 align:middle line:90%
section of this course.

00:00:14.232 --> 00:00:16.440 align:middle line:84%
In this video, we're going
to be taking a look at how

00:00:16.440 --> 00:00:19.920 align:middle line:84%
to enumerate system
information on a Linux target

00:00:19.920 --> 00:00:21.310 align:middle line:90%
that you have compromised.

00:00:21.310 --> 00:00:24.720 align:middle line:84%
So again, this section is going
to mirror the same process

00:00:24.720 --> 00:00:28.770 align:middle line:84%
or methodology that we used in
the Windows Local Enumeration

00:00:28.770 --> 00:00:29.290 align:middle line:90%
section.

00:00:29.290 --> 00:00:32.430 align:middle line:84%
So we're going to be enumerating
system information, users,

00:00:32.430 --> 00:00:33.090 align:middle line:90%
and groups--

00:00:33.090 --> 00:00:38.010 align:middle line:84%
network information
services, as well as taking a

00:00:38.010 --> 00:00:41.490 align:middle line:84%
look at how to automate
Linux Local Enumeration.

00:00:41.490 --> 00:00:44.190 align:middle line:84%
So we are now
turning our attention

00:00:44.190 --> 00:00:47.590 align:middle line:84%
to enumerating system
information on a Linux system.

00:00:47.590 --> 00:00:50.370 align:middle line:84%
So you should have a
good idea as to why

00:00:50.370 --> 00:00:53.730 align:middle line:84%
we're performing system
information enumeration

00:00:53.730 --> 00:00:56.760 align:middle line:84%
and how that information
is important,

00:00:56.760 --> 00:00:58.920 align:middle line:84%
or why that information
is important.

00:00:58.920 --> 00:01:01.110 align:middle line:84%
Now, in the context
of Linux, we are

00:01:01.110 --> 00:01:04.319 align:middle line:84%
going to be looking for very
different pieces of system

00:01:04.319 --> 00:01:08.470 align:middle line:84%
information, but really the
same at a very abstracted layer,

00:01:08.470 --> 00:01:08.970 align:middle line:90%
right?

00:01:08.970 --> 00:01:11.880 align:middle line:84%
So on Windows, we were
trying to identify

00:01:11.880 --> 00:01:16.320 align:middle line:84%
the actual version of Windows,
as well as the operating system

00:01:16.320 --> 00:01:18.270 align:middle line:84%
architecture and
so on and so forth.

00:01:18.270 --> 00:01:20.010 align:middle line:84%
In the case of
Linux, we are going

00:01:20.010 --> 00:01:22.320 align:middle line:84%
to be looking for the
host name of the system.

00:01:22.320 --> 00:01:24.660 align:middle line:84%
We also want to identify
the distribution

00:01:24.660 --> 00:01:26.770 align:middle line:84%
and the distribution
release version.

00:01:26.770 --> 00:01:28.510 align:middle line:90%
So why is this important?

00:01:28.510 --> 00:01:31.020 align:middle line:84%
Well, let me give
you a brief history

00:01:31.020 --> 00:01:33.240 align:middle line:84%
as to what a Linux
distribution is

00:01:33.240 --> 00:01:36.210 align:middle line:84%
and how that will affect
the post-exploitation phase

00:01:36.210 --> 00:01:39.310 align:middle line:84%
of your penetration test
when it comes down to Linux.

00:01:39.310 --> 00:01:42.510 align:middle line:84%
So if you have never
used Linux before,

00:01:42.510 --> 00:01:45.690 align:middle line:84%
Linux is essentially an
operating system kernel,

00:01:45.690 --> 00:01:48.480 align:middle line:84%
and a Linux distribution
is the pairing

00:01:48.480 --> 00:01:52.140 align:middle line:84%
of software and utilities
with the Linux kernel.

00:01:52.140 --> 00:01:54.540 align:middle line:84%
An example of a
Linux distribution

00:01:54.540 --> 00:01:59.800 align:middle line:84%
is Ubuntu, Debian, Arch Linux,
Manjaro, so on and so forth.

00:01:59.800 --> 00:02:02.460 align:middle line:84%
There are plenty of Linux
distributions out there.

00:02:02.460 --> 00:02:04.740 align:middle line:84%
Now, the key thing
to note here is

00:02:04.740 --> 00:02:07.860 align:middle line:84%
that distributions are designed
differently and utilize

00:02:07.860 --> 00:02:10.800 align:middle line:84%
different utilities--
for example,

00:02:10.800 --> 00:02:13.330 align:middle line:90%
for package management.

00:02:13.330 --> 00:02:16.710 align:middle line:84%
So for example, if I exploit
a Debian-based distribution

00:02:16.710 --> 00:02:20.730 align:middle line:84%
like Ubuntu, the
default package manager

00:02:20.730 --> 00:02:23.010 align:middle line:84%
that's used on
Debian-based distributions

00:02:23.010 --> 00:02:24.900 align:middle line:84%
is the aptitude
package manager, which

00:02:24.900 --> 00:02:29.850 align:middle line:90%
is actually abbreviated to APD.

00:02:29.850 --> 00:02:33.090 align:middle line:84%
So if you've ever typed
in sudo apt-get install,

00:02:33.090 --> 00:02:35.440 align:middle line:84%
that is the aptitude
package manager.

00:02:35.440 --> 00:02:38.790 align:middle line:84%
Now, if I exploit a Linux
system or a Linux target

00:02:38.790 --> 00:02:42.510 align:middle line:84%
running Arch Linux, or an
Arch Linux-based distribution,

00:02:42.510 --> 00:02:46.890 align:middle line:84%
the default package manager
is the Pacman package manager.

00:02:46.890 --> 00:02:49.260 align:middle line:84%
And this information
is very important,

00:02:49.260 --> 00:02:51.510 align:middle line:84%
not just in the context
of package managers,

00:02:51.510 --> 00:02:54.360 align:middle line:84%
but the way these operating
systems are, or rather

00:02:54.360 --> 00:02:57.180 align:middle line:84%
these distributions are
designed and developed--

00:02:57.180 --> 00:02:59.340 align:middle line:84%
and the different
utilities they utilize.

00:02:59.340 --> 00:03:03.510 align:middle line:84%
So getting an idea of what
exact distribution is running

00:03:03.510 --> 00:03:06.630 align:middle line:84%
on the Linux target system
is very important, as well as

00:03:06.630 --> 00:03:08.530 align:middle line:84%
the distribution
release version.

00:03:08.530 --> 00:03:10.840 align:middle line:84%
So again, let me just
use another example.

00:03:10.840 --> 00:03:13.410 align:middle line:84%
If I exploit a Linux
target running Ubuntu,

00:03:13.410 --> 00:03:17.370 align:middle line:84%
I also want to identify what
specific version of Ubuntu

00:03:17.370 --> 00:03:19.380 align:middle line:84%
is running on the
target, because Ubuntu

00:03:19.380 --> 00:03:21.420 align:middle line:90%
has multiple release versions.

00:03:21.420 --> 00:03:29.490 align:middle line:84%
So it has Ubuntu 12, 13, 14,
16, 18, 19, 20, 21, et cetera.

00:03:29.490 --> 00:03:33.750 align:middle line:84%
And all of this information is
really pertinent to privilege

00:03:33.750 --> 00:03:34.560 align:middle line:90%
escalation.

00:03:34.560 --> 00:03:38.250 align:middle line:84%
So for example, again,
if I exploit in Ubuntu

00:03:38.250 --> 00:03:41.370 align:middle line:84%
a Linux target
running Ubuntu, I also

00:03:41.370 --> 00:03:44.700 align:middle line:84%
need to identify the specific
version of Ubuntu running,

00:03:44.700 --> 00:03:49.950 align:middle line:84%
so that I can identify privilege
escalation exploits that

00:03:49.950 --> 00:03:54.330 align:middle line:84%
are specific to that specific
version of Ubuntu that is

00:03:54.330 --> 00:03:57.510 align:middle line:90%
installed on the target system.

00:03:57.510 --> 00:04:00.390 align:middle line:84%
In addition to the distribution
and distribution release

00:04:00.390 --> 00:04:03.990 align:middle line:84%
version information, I
also want to identify,

00:04:03.990 --> 00:04:05.970 align:middle line:84%
or we also need to
identify the kernel

00:04:05.970 --> 00:04:07.570 align:middle line:90%
version and architecture.

00:04:07.570 --> 00:04:10.170 align:middle line:84%
Remember, I said that
a Linux distribution

00:04:10.170 --> 00:04:12.030 align:middle line:84%
is the pairing of
the Linux kernel

00:04:12.030 --> 00:04:15.150 align:middle line:84%
and additional
utilities that make up

00:04:15.150 --> 00:04:17.290 align:middle line:90%
an operating system as a whole.

00:04:17.290 --> 00:04:20.670 align:middle line:84%
Well, the Linux kernel has a
different versioning system

00:04:20.670 --> 00:04:23.880 align:middle line:84%
that is not tied to a
specific distribution.

00:04:23.880 --> 00:04:26.730 align:middle line:84%
And if you have
used Linux before,

00:04:26.730 --> 00:04:28.750 align:middle line:84%
you should have actually
seen this before.

00:04:28.750 --> 00:04:31.830 align:middle line:84%
You have the ability to
install other Linux kernels,

00:04:31.830 --> 00:04:36.090 align:middle line:84%
or modified Linux kernels
on your Linux distribution.

00:04:36.090 --> 00:04:38.820 align:middle line:84%
So you need to identify
the specific kernel

00:04:38.820 --> 00:04:40.560 align:middle line:90%
version and the architecture.

00:04:40.560 --> 00:04:43.260 align:middle line:84%
And the reason this
information is important

00:04:43.260 --> 00:04:44.970 align:middle line:84%
is if you are trying
to, for example,

00:04:44.970 --> 00:04:48.480 align:middle line:84%
perform privilege escalation
via kernel exploit,

00:04:48.480 --> 00:04:50.550 align:middle line:84%
you need the specific
kernel version

00:04:50.550 --> 00:04:53.130 align:middle line:84%
that's running on the
target to essentially locate

00:04:53.130 --> 00:04:56.220 align:middle line:84%
kernel exploits for that
specific kernel that is

00:04:56.220 --> 00:04:58.770 align:middle line:90%
installed on the target system.

00:04:58.770 --> 00:05:01.660 align:middle line:84%
We also want to identify the
architecture of the kernel.

00:05:01.660 --> 00:05:04.050 align:middle line:84%
So this will give us an idea
of what type of binaries

00:05:04.050 --> 00:05:05.890 align:middle line:84%
we can execute on
the target system.

00:05:05.890 --> 00:05:08.310 align:middle line:84%
So is the kernel
a 32-bit kernel?

00:05:08.310 --> 00:05:12.130 align:middle line:84%
Is it a 64-bit kernel,
et cetera, et cetera?

00:05:12.130 --> 00:05:14.380 align:middle line:84%
We can also enumerate
the CPU information,

00:05:14.380 --> 00:05:17.430 align:middle line:84%
so we can get an idea of what
CPU is installed on the target

00:05:17.430 --> 00:05:19.050 align:middle line:90%
system, or what is running--

00:05:19.050 --> 00:05:20.880 align:middle line:90%
how many calls it has.

00:05:20.880 --> 00:05:24.510 align:middle line:84%
And this will give us an idea of
the actual resource allocation

00:05:24.510 --> 00:05:26.010 align:middle line:90%
of the target system.

00:05:26.010 --> 00:05:29.640 align:middle line:84%
We can also identify or
enumerate disk information

00:05:29.640 --> 00:05:31.260 align:middle line:84%
and mounted drives,
so we can get

00:05:31.260 --> 00:05:36.060 align:middle line:84%
an idea of the current drives
connected to the Linux target

00:05:36.060 --> 00:05:37.110 align:middle line:90%
system of compromise.

00:05:37.110 --> 00:05:39.090 align:middle line:84%
How much our storage
has been consumed?

00:05:39.090 --> 00:05:40.240 align:middle line:90%
How much is left?

00:05:40.240 --> 00:05:41.730 align:middle line:84%
Are there any other
drives that are

00:05:41.730 --> 00:05:45.910 align:middle line:84%
connected to the Linux target
system, et cetera, et cetera?

00:05:45.910 --> 00:05:47.610 align:middle line:84%
And finally, we
can also enumerate

00:05:47.610 --> 00:05:49.650 align:middle line:84%
the installed
packages and software.

00:05:49.650 --> 00:05:52.770 align:middle line:84%
So this will give us an
idea of what packages are

00:05:52.770 --> 00:05:54.730 align:middle line:90%
installed on the Linux system.

00:05:54.730 --> 00:05:57.540 align:middle line:84%
And again, this is also
pertinent to privilege

00:05:57.540 --> 00:06:01.860 align:middle line:84%
escalation whereby we
are going to be utilizing

00:06:01.860 --> 00:06:04.860 align:middle line:84%
this information to identify
specific packages that

00:06:04.860 --> 00:06:07.620 align:middle line:84%
might be vulnerable to
a privilege escalation

00:06:07.620 --> 00:06:08.380 align:middle line:90%
vulnerability.

00:06:08.380 --> 00:06:10.980 align:middle line:84%
So in the case of Linux,
this can pretty much

00:06:10.980 --> 00:06:14.790 align:middle line:84%
be done manually without
a Meterpreter session.

00:06:14.790 --> 00:06:16.410 align:middle line:84%
But of course, we'll
also be exploring

00:06:16.410 --> 00:06:19.710 align:middle line:84%
how this can be automated
at the end of this section.

00:06:19.710 --> 00:06:23.220 align:middle line:84%
With that being said, this
video has a lab environment

00:06:23.220 --> 00:06:25.620 align:middle line:84%
attached to it, so all you
need to do is fire it up.

00:06:25.620 --> 00:06:29.440 align:middle line:84%
This lab environment requires
us to exploit the target system

00:06:29.440 --> 00:06:29.940 align:middle line:90%
first.

00:06:29.940 --> 00:06:31.620 align:middle line:84%
So that's what we're
going to be doing.

00:06:31.620 --> 00:06:34.110 align:middle line:84%
After we've gained access
to the Linux target system,

00:06:34.110 --> 00:06:37.080 align:middle line:84%
we're then going to
perform system information

00:06:37.080 --> 00:06:37.900 align:middle line:90%
and enumeration.

00:06:37.900 --> 00:06:40.560 align:middle line:84%
So with that being
said, I'll be seeing you

00:06:40.560 --> 00:06:41.970 align:middle line:90%
in the lab environment.

00:06:41.970 --> 00:06:45.770 align:middle line:90%


00:06:45.770 --> 00:06:48.560 align:middle line:84%
All right, so I am back
within the lab environment.

00:06:48.560 --> 00:06:51.230 align:middle line:84%
And within this lab
environment, you'll

00:06:51.230 --> 00:06:54.050 align:middle line:84%
not be provided with a
graphical user interface.

00:06:54.050 --> 00:06:57.110 align:middle line:84%
Instead, you'll be provided
with a terminal interface.

00:06:57.110 --> 00:07:00.170 align:middle line:84%
And this is your Kali Linux
system, or your penetration

00:07:00.170 --> 00:07:01.640 align:middle line:90%
testing distribution.

00:07:01.640 --> 00:07:06.080 align:middle line:84%
And the next step would be to
identify the target IP address.

00:07:06.080 --> 00:07:10.040 align:middle line:84%
And this can be done by typing
in ifconfig and taking a look

00:07:10.040 --> 00:07:11.570 align:middle line:90%
at the interface ethernet1.

00:07:11.570 --> 00:07:15.352 align:middle line:84%
So this is the IP address
of the Kali Linux system

00:07:15.352 --> 00:07:16.310 align:middle line:90%
that you're working on.

00:07:16.310 --> 00:07:18.150 align:middle line:84%
In your case, it's
going to be different.

00:07:18.150 --> 00:07:20.840 align:middle line:84%
So do take that
into consideration.

00:07:20.840 --> 00:07:24.410 align:middle line:84%
However, we can copy this and
change the 2 right over here

00:07:24.410 --> 00:07:25.250 align:middle line:90%
to a 3.

00:07:25.250 --> 00:07:27.390 align:middle line:84%
And that is going to be
the target IP address.

00:07:27.390 --> 00:07:30.060 align:middle line:84%
So in your case, the
subnet will be different,

00:07:30.060 --> 00:07:32.810 align:middle line:84%
but the Kali Linux IP,
or the Kali Linux system

00:07:32.810 --> 00:07:35.760 align:middle line:84%
will always be on the second
IP within this subnet,

00:07:35.760 --> 00:07:38.090 align:middle line:84%
and the target system
will be on the third IP.

00:07:38.090 --> 00:07:41.120 align:middle line:84%
So whatever the case,
just copy this value here,

00:07:41.120 --> 00:07:43.460 align:middle line:84%
and remember to
change the 2 to a 3,

00:07:43.460 --> 00:07:45.810 align:middle line:84%
and that's the
target IP address.

00:07:45.810 --> 00:07:49.130 align:middle line:84%
Now that we've done
that, the next step would

00:07:49.130 --> 00:07:51.380 align:middle line:84%
be to identify the
vulnerable service that's

00:07:51.380 --> 00:07:53.750 align:middle line:84%
running on the target
system, that we

00:07:53.750 --> 00:07:56.300 align:middle line:84%
can exploit or
utilize or essentially

00:07:56.300 --> 00:07:57.720 align:middle line:90%
exploit to gain access.

00:07:57.720 --> 00:08:01.400 align:middle line:84%
So we are going to perform a
simple Nmap service version

00:08:01.400 --> 00:08:03.660 align:middle line:90%
detection scan on the target IP.

00:08:03.660 --> 00:08:06.230 align:middle line:84%
So I'll paste in the IP that
I copied, and I'll change

00:08:06.230 --> 00:08:09.050 align:middle line:90%
the 2 to 3, and I'll hit Enter.

00:08:09.050 --> 00:08:11.330 align:middle line:84%
And as you can
see, the Nmap scan

00:08:11.330 --> 00:08:13.350 align:middle line:84%
is complete in a
couple of seconds.

00:08:13.350 --> 00:08:16.700 align:middle line:84%
And we have the FTP port
open on port 21, which

00:08:16.700 --> 00:08:18.500 align:middle line:90%
is the default FTP port.

00:08:18.500 --> 00:08:20.420 align:middle line:84%
And the actual
service that's running

00:08:20.420 --> 00:08:24.140 align:middle line:90%
is vsftpd version 2.3.4.

00:08:24.140 --> 00:08:27.740 align:middle line:84%
Now this version
of vsftpd 2.3.4 is

00:08:27.740 --> 00:08:32.030 align:middle line:84%
vulnerable to a backdoor
command execution vulnerability,

00:08:32.030 --> 00:08:32.870 align:middle line:90%
or exploit.

00:08:32.870 --> 00:08:35.179 align:middle line:84%
And we can confirm
this through the use

00:08:35.179 --> 00:08:37.049 align:middle line:90%
of the searchsploit utility.

00:08:37.049 --> 00:08:41.960 align:middle line:84%
So we can say, searchsploit
vsftpd and hit Enter.

00:08:41.960 --> 00:08:44.660 align:middle line:84%
And at the bottom, you can
see that there is a Metasploit

00:08:44.660 --> 00:08:50.330 align:middle line:84%
exploit module for this specific
version of vsftpd, 2.3.4,

00:08:50.330 --> 00:08:52.170 align:middle line:90%
installed on the target.

00:08:52.170 --> 00:08:55.280 align:middle line:84%
So now that we have identified
what exploit module we can use,

00:08:55.280 --> 00:08:58.190 align:middle line:90%
we can fire up msfconsole.

00:08:58.190 --> 00:09:00.170 align:middle line:84%
And this will just take
a couple of seconds.

00:09:00.170 --> 00:09:02.690 align:middle line:84%
We can then search
for the module.

00:09:02.690 --> 00:09:05.090 align:middle line:84%
And what I'll do is I'll
just copy the target IP

00:09:05.090 --> 00:09:07.760 align:middle line:84%
address here, as we'll
need it within Metasploit.

00:09:07.760 --> 00:09:11.870 align:middle line:84%
And we can then say
search and vsftpd.

00:09:11.870 --> 00:09:13.080 align:middle line:90%
There we are.

00:09:13.080 --> 00:09:16.460 align:middle line:84%
And we can set the target
IP address globally,

00:09:16.460 --> 00:09:18.920 align:middle line:84%
or we can configure the
R Host option globally,

00:09:18.920 --> 00:09:21.770 align:middle line:84%
or set the R Host
global variable,

00:09:21.770 --> 00:09:26.030 align:middle line:84%
by saying, setg R Hosts
based in the target IP.

00:09:26.030 --> 00:09:30.050 align:middle line:84%
And what this will do
is it will essentially

00:09:30.050 --> 00:09:34.530 align:middle line:84%
set the R Host value globally
for all modules that you use.

00:09:34.530 --> 00:09:37.010 align:middle line:84%
So when we use this
specific module,

00:09:37.010 --> 00:09:40.860 align:middle line:84%
the R Hosts option of the target
IP will already be specified.

00:09:40.860 --> 00:09:43.760 align:middle line:84%
So I can say, use, paste
in the module name there.

00:09:43.760 --> 00:09:47.100 align:middle line:84%
And if I show the options
for this particular module,

00:09:47.100 --> 00:09:49.490 align:middle line:84%
you can see that the target
IP has been configured.

00:09:49.490 --> 00:09:52.170 align:middle line:84%
And in the case of
this exploit module,

00:09:52.170 --> 00:09:56.720 align:middle line:84%
we have the R port option,
which is essentially

00:09:56.720 --> 00:10:02.190 align:middle line:84%
the port that has vsftpd 2.3.4
running on the target system--

00:10:02.190 --> 00:10:04.950 align:middle line:84%
which, again, is configured
correctly to port 21.

00:10:04.950 --> 00:10:08.660 align:middle line:84%
So we can just type in
exploit and give that

00:10:08.660 --> 00:10:09.530 align:middle line:90%
a couple of seconds.

00:10:09.530 --> 00:10:13.070 align:middle line:84%
And this should provide us
with a command shell session,

00:10:13.070 --> 00:10:15.890 align:middle line:84%
that we can then upgrade
to a Meterpreter session.

00:10:15.890 --> 00:10:19.340 align:middle line:84%
So you can see that the
backdoor service has spawned,

00:10:19.340 --> 00:10:22.010 align:middle line:84%
and we will gain access
to the target system.

00:10:22.010 --> 00:10:24.680 align:middle line:84%
It looks like we've gained
access to the target system

00:10:24.680 --> 00:10:26.060 align:middle line:90%
as the root user.

00:10:26.060 --> 00:10:29.900 align:middle line:84%
The root user on Linux is the
user account with the highest

00:10:29.900 --> 00:10:31.040 align:middle line:90%
privileges available.

00:10:31.040 --> 00:10:33.020 align:middle line:84%
It is the equivalent
of the administrator

00:10:33.020 --> 00:10:34.640 align:middle line:90%
account on Windows.

00:10:34.640 --> 00:10:37.010 align:middle line:84%
So you can see whenever
you get a command shell

00:10:37.010 --> 00:10:39.680 align:middle line:84%
session with Metasploit,
it'll not give you a prompt

00:10:39.680 --> 00:10:40.670 align:middle line:90%
immediately, right?

00:10:40.670 --> 00:10:44.570 align:middle line:84%
However, this is an actual Linux
terminal, or an actual Linux

00:10:44.570 --> 00:10:45.560 align:middle line:90%
shell session.

00:10:45.560 --> 00:10:48.260 align:middle line:84%
We can confirm
that by saying LS.

00:10:48.260 --> 00:10:51.170 align:middle line:84%
And you can see that
it will essentially

00:10:51.170 --> 00:10:52.310 align:middle line:90%
execute the command.

00:10:52.310 --> 00:10:55.070 align:middle line:84%
Now, whenever we're
working on a Linux system,

00:10:55.070 --> 00:10:58.640 align:middle line:84%
we want to obtain a somewhat
interactive session.

00:10:58.640 --> 00:11:01.760 align:middle line:84%
So we can, for example,
spawn a bash session.

00:11:01.760 --> 00:11:04.460 align:middle line:84%
So I can say bin bash
I. And you can now

00:11:04.460 --> 00:11:06.530 align:middle line:84%
see this will provide
us with a proper bash

00:11:06.530 --> 00:11:09.560 align:middle line:90%
terminal on the target system.

00:11:09.560 --> 00:11:12.940 align:middle line:84%
So one of the great
features of bash

00:11:12.940 --> 00:11:15.460 align:middle line:84%
is that it'll show
you your current user

00:11:15.460 --> 00:11:17.480 align:middle line:90%
at the host name of the system.

00:11:17.480 --> 00:11:20.710 align:middle line:84%
So in this case, we have
access to the target system.

00:11:20.710 --> 00:11:22.810 align:middle line:84%
The target system
is called victim 1.

00:11:22.810 --> 00:11:25.090 align:middle line:84%
And we currently have
access to the target system

00:11:25.090 --> 00:11:27.880 align:middle line:84%
as the root user, which means
we do not need to perform

00:11:27.880 --> 00:11:29.960 align:middle line:90%
any privilege escalation.

00:11:29.960 --> 00:11:30.460 align:middle line:90%
All right.

00:11:30.460 --> 00:11:33.760 align:middle line:84%
So with that being said,
we can also upgrade this

00:11:33.760 --> 00:11:35.050 align:middle line:90%
to an Meterpreter session.

00:11:35.050 --> 00:11:38.710 align:middle line:84%
So for example, I
can hit Control-Z

00:11:38.710 --> 00:11:40.880 align:middle line:90%
to put this in the background.

00:11:40.880 --> 00:11:42.820 align:middle line:84%
And then if I type
in, sessions, you

00:11:42.820 --> 00:11:46.840 align:middle line:84%
can see that we have our
command shell session here.

00:11:46.840 --> 00:11:51.580 align:middle line:84%
And I can say, sessions
hyphen u for upgrade.

00:11:51.580 --> 00:11:53.900 align:middle line:84%
And then I can specify
the session ID.

00:11:53.900 --> 00:11:55.420 align:middle line:90%
So I'll set that to 1.

00:11:55.420 --> 00:11:58.870 align:middle line:84%
And once we hit Enter, we should
receive a Meterpreter session.

00:11:58.870 --> 00:12:00.760 align:middle line:84%
So I'll just give this
a couple of seconds.

00:12:00.760 --> 00:12:03.250 align:middle line:84%
There we are-- Meterpreter
session 2 opened.

00:12:03.250 --> 00:12:07.000 align:middle line:84%
Don't worry if you get an error
regarding the actual execution

00:12:07.000 --> 00:12:08.200 align:middle line:90%
of the following command.

00:12:08.200 --> 00:12:11.440 align:middle line:84%
If we type in, sessions, you
can see that we have indeed

00:12:11.440 --> 00:12:13.270 align:middle line:90%
obtained a Meterpreter session.

00:12:13.270 --> 00:12:16.690 align:middle line:84%
So we can say, sessions 2,
to utilize the Meterpreter

00:12:16.690 --> 00:12:17.200 align:middle line:90%
session.

00:12:17.200 --> 00:12:21.250 align:middle line:84%
And we can now get started
with the process of performing

00:12:21.250 --> 00:12:23.710 align:middle line:90%
system information enumeration.

00:12:23.710 --> 00:12:26.380 align:middle line:84%
So with Meterpreter,
as you already know,

00:12:26.380 --> 00:12:29.350 align:middle line:84%
you can type in,
sysinfo, and that'll

00:12:29.350 --> 00:12:31.600 align:middle line:84%
give you a basic idea of
what's running on the target

00:12:31.600 --> 00:12:34.870 align:middle line:84%
system in regards to the
actual computer IP address,

00:12:34.870 --> 00:12:36.490 align:middle line:90%
or the host name.

00:12:36.490 --> 00:12:39.380 align:middle line:84%
As for the operating system,
this is the actual distribution

00:12:39.380 --> 00:12:39.880 align:middle line:90%
name.

00:12:39.880 --> 00:12:41.200 align:middle line:90%
So it's running Debian.

00:12:41.200 --> 00:12:44.350 align:middle line:84%
And the distribution
release version is 9.5.

00:12:44.350 --> 00:12:47.260 align:middle line:84%
And it'll also tell you the
exact version of the Linux

00:12:47.260 --> 00:12:48.840 align:middle line:90%
kernel running on the target.

00:12:48.840 --> 00:12:50.260 align:middle line:84%
So in this case,
the target system

00:12:50.260 --> 00:12:55.300 align:middle line:84%
is running Linux
version 5.4.094 generic.

00:12:55.300 --> 00:12:59.890 align:middle line:84%
The architecture is x64,
and the Meterpreter session

00:12:59.890 --> 00:13:02.890 align:middle line:90%
is a 32-bit Meterpreter session.

00:13:02.890 --> 00:13:10.030 align:middle line:84%
Now, we can also explore how
to perform system information

00:13:10.030 --> 00:13:14.260 align:middle line:84%
enumeration manually, through
the use of a standard bash

00:13:14.260 --> 00:13:15.830 align:middle line:90%
session on the Linux target.

00:13:15.830 --> 00:13:16.930 align:middle line:90%
So I'll type in, shell.

00:13:16.930 --> 00:13:22.210 align:middle line:84%
And then I'll say, bin bash
I, to obtain a bash session.

00:13:22.210 --> 00:13:22.840 align:middle line:90%
There we are.

00:13:22.840 --> 00:13:28.390 align:middle line:84%
And what we can do is we
can navigate to the home

00:13:28.390 --> 00:13:30.230 align:middle line:90%
directory of the root user.

00:13:30.230 --> 00:13:32.710 align:middle line:90%
So we can say CD root.

00:13:32.710 --> 00:13:33.610 align:middle line:90%
There we are.

00:13:33.610 --> 00:13:36.080 align:middle line:84%
And if we print our working
directory, you can see,

00:13:36.080 --> 00:13:37.930 align:middle line:84%
we're currently within
the root directory.

00:13:37.930 --> 00:13:38.430 align:middle line:90%
All right.

00:13:38.430 --> 00:13:41.390 align:middle line:84%
So let's start off firstly
by identifying the hostname.

00:13:41.390 --> 00:13:43.630 align:middle line:84%
So we can do that
by saying hostname.

00:13:43.630 --> 00:13:46.030 align:middle line:84%
You can see that the
hostname of this system

00:13:46.030 --> 00:13:49.360 align:middle line:84%
is victim 1, which, as I said,
is highlighted here in bash.

00:13:49.360 --> 00:13:50.890 align:middle line:90%
So we already know that.

00:13:50.890 --> 00:13:55.560 align:middle line:84%
If we want to identify the
actual distribution itself--

00:13:55.560 --> 00:13:58.060 align:middle line:84%
so if we want to check and see
what distribution is running,

00:13:58.060 --> 00:14:02.750 align:middle line:84%
we can do that by cat-ing the
content of etc issue file.

00:14:02.750 --> 00:14:05.000 align:middle line:90%
So I can say, cat etc issue.

00:14:05.000 --> 00:14:08.230 align:middle line:84%
And you can see that it's
running Debian Linux version 9.

00:14:08.230 --> 00:14:10.960 align:middle line:84%
If we want to identify
more information regarding

00:14:10.960 --> 00:14:13.330 align:middle line:84%
the specific version of
Debian that's running,

00:14:13.330 --> 00:14:17.290 align:middle line:84%
we can say cat etc, and we
can use the asterisk option,

00:14:17.290 --> 00:14:19.870 align:middle line:84%
or the wildcard option
here-- and say, release,

00:14:19.870 --> 00:14:21.910 align:middle line:90%
to display all information.

00:14:21.910 --> 00:14:23.950 align:middle line:84%
And you can now see
that it'll display

00:14:23.950 --> 00:14:26.710 align:middle line:84%
the actual name of the
distribution, as well

00:14:26.710 --> 00:14:28.040 align:middle line:90%
as the release version--

00:14:28.040 --> 00:14:29.200 align:middle line:90%
so version 9.

00:14:29.200 --> 00:14:32.860 align:middle line:84%
And it then provides you
with the home URL support URL

00:14:32.860 --> 00:14:35.570 align:middle line:84%
and bug report URL
for this distribution.

00:14:35.570 --> 00:14:38.860 align:middle line:84%
So we can see that it's
running Debian 9, which

00:14:38.860 --> 00:14:40.960 align:middle line:90%
is coded named Stretch.

00:14:40.960 --> 00:14:43.990 align:middle line:84%
The actual version of Debian
is 9, and there we are.

00:14:43.990 --> 00:14:45.760 align:middle line:84%
So we now know that
the target system

00:14:45.760 --> 00:14:48.220 align:middle line:90%
is running Debian 9 Stretch.

00:14:48.220 --> 00:14:50.680 align:middle line:84%
We can also enumerate
the kernel version

00:14:50.680 --> 00:14:53.990 align:middle line:84%
that's running by typing
in the uname a command.

00:14:53.990 --> 00:14:56.470 align:middle line:84%
So if I type in
uname a, you can see

00:14:56.470 --> 00:14:59.960 align:middle line:84%
that this will display
a lot of information.

00:14:59.960 --> 00:15:02.470 align:middle line:84%
This is essentially going
to display the actual host

00:15:02.470 --> 00:15:03.490 align:middle line:90%
name of the system--

00:15:03.490 --> 00:15:08.590 align:middle line:84%
the kernel version--
so 5.4.0.94 generic.

00:15:08.590 --> 00:15:11.770 align:middle line:84%
And it'll also display, right
over here, the date and time--

00:15:11.770 --> 00:15:14.740 align:middle line:84%
and then, of course, the
actual kernel architecture.

00:15:14.740 --> 00:15:17.210 align:middle line:84%
Now, if you want to
clean up this output,

00:15:17.210 --> 00:15:20.930 align:middle line:84%
you can say uname r, to limit
it to the kernel version.

00:15:20.930 --> 00:15:22.390 align:middle line:84%
And you can see
right at the bottom

00:15:22.390 --> 00:15:23.860 align:middle line:90%
here, that's the kernel version.

00:15:23.860 --> 00:15:27.340 align:middle line:90%
So 5.4.094 generic.

00:15:27.340 --> 00:15:29.050 align:middle line:84%
All right, so that
is how to enumerate

00:15:29.050 --> 00:15:31.420 align:middle line:84%
the distribution-- the
distribution release version,

00:15:31.420 --> 00:15:34.090 align:middle line:90%
as well as the kernel version.

00:15:34.090 --> 00:15:37.960 align:middle line:84%
Now, you can also enumerate
the environment variables

00:15:37.960 --> 00:15:41.870 align:middle line:84%
for a specific user, which
I will be going over,

00:15:41.870 --> 00:15:44.290 align:middle line:84%
especially when we get to
the privilege escalation

00:15:44.290 --> 00:15:45.860 align:middle line:90%
section of this course.

00:15:45.860 --> 00:15:48.310 align:middle line:84%
But that can be done
by typing in env.

00:15:48.310 --> 00:15:51.340 align:middle line:84%
And that'll essentially display
the environment variables

00:15:51.340 --> 00:15:52.280 align:middle line:90%
for the root user.

00:15:52.280 --> 00:15:57.400 align:middle line:84%
So this will provide you with
the environment variables

00:15:57.400 --> 00:15:59.200 align:middle line:90%
for the root user, specifically.

00:15:59.200 --> 00:16:01.990 align:middle line:84%
So you can see it'll provide
you with the path information.

00:16:01.990 --> 00:16:06.520 align:middle line:84%
The path environment variable
specifies the directory

00:16:06.520 --> 00:16:10.000 align:middle line:84%
that is used by default
whenever you type in a command,

00:16:10.000 --> 00:16:11.620 align:middle line:90%
or rather for binaries.

00:16:11.620 --> 00:16:14.170 align:middle line:84%
So you can see whenever you
type in a command like cat,

00:16:14.170 --> 00:16:17.710 align:middle line:84%
it'll essentially check
the local sbin directory

00:16:17.710 --> 00:16:20.230 align:middle line:84%
and see whether the
cat binary is in there.

00:16:20.230 --> 00:16:23.050 align:middle line:84%
If it is in there,
it'll execute it.

00:16:23.050 --> 00:16:26.020 align:middle line:84%
You can see that the working
directory of the root user

00:16:26.020 --> 00:16:28.180 align:middle line:84%
is on the root,
which was correct.

00:16:28.180 --> 00:16:30.910 align:middle line:84%
And we know just
additional information

00:16:30.910 --> 00:16:36.530 align:middle line:84%
regarding this user accounts'
environment variables.

00:16:36.530 --> 00:16:40.390 align:middle line:84%
Now let's talk a little bit
about hardware resources,

00:16:40.390 --> 00:16:42.560 align:middle line:90%
or rather resource consumption.

00:16:42.560 --> 00:16:47.080 align:middle line:84%
So we can display the CPU
information by saying, LS CPU--

00:16:47.080 --> 00:16:48.400 align:middle line:90%
very simple.

00:16:48.400 --> 00:16:50.650 align:middle line:84%
And you can see
right over here, this

00:16:50.650 --> 00:16:53.320 align:middle line:90%
will tell you the architecture.

00:16:53.320 --> 00:16:54.940 align:middle line:90%
We then have the CPUs.

00:16:54.940 --> 00:16:58.540 align:middle line:84%
Because this is running on
a server, there's 48 CPUs.

00:16:58.540 --> 00:17:00.730 align:middle line:84%
And it'll provide
you with the threads

00:17:00.730 --> 00:17:03.730 align:middle line:90%
per core, the cores per socket.

00:17:03.730 --> 00:17:08.380 align:middle line:84%
The vendor ID, it'll tell
you the actual manufacturer

00:17:08.380 --> 00:17:09.310 align:middle line:90%
of the CPU.

00:17:09.310 --> 00:17:10.839 align:middle line:90%
In this case, it's AMD.

00:17:10.839 --> 00:17:12.700 align:middle line:90%
The CPU family is 23.

00:17:12.700 --> 00:17:18.160 align:middle line:84%
The model name is AMD EPYC 7601
32-core processor, because this

00:17:18.160 --> 00:17:20.920 align:middle line:90%
is running in a data center.

00:17:20.920 --> 00:17:22.960 align:middle line:84%
It'll then give you
the actual clock--

00:17:22.960 --> 00:17:28.630 align:middle line:84%
the clock speed of the
processor, or rather one core

00:17:28.630 --> 00:17:30.880 align:middle line:90%
of this CPU.

00:17:30.880 --> 00:17:33.550 align:middle line:84%
And yeah, you can also get
additional information,

00:17:33.550 --> 00:17:37.660 align:middle line:84%
like the hypervisor vendor,
the virtualization type--

00:17:37.660 --> 00:17:42.230 align:middle line:84%
the L1, L2, and L3 cache,
et cetera, et cetera.

00:17:42.230 --> 00:17:46.420 align:middle line:84%
We can also get an idea of
how much RAM is being consumed

00:17:46.420 --> 00:17:49.060 align:middle line:84%
by typing in the free
hyphen-H command,

00:17:49.060 --> 00:17:52.300 align:middle line:84%
to display how much
RAM is being consumed.

00:17:52.300 --> 00:17:56.200 align:middle line:84%
In this case, you can see
that the free command is not--

00:17:56.200 --> 00:17:57.860 align:middle line:84%
it's telling us,
command not found.

00:17:57.860 --> 00:18:00.380 align:middle line:84%
That's because the
utility is not installed.

00:18:00.380 --> 00:18:02.110 align:middle line:84%
But if it was
installed, you'd be

00:18:02.110 --> 00:18:04.450 align:middle line:84%
able to identify
that information.

00:18:04.450 --> 00:18:08.680 align:middle line:84%
Now, if I wanted to
display a list of drives

00:18:08.680 --> 00:18:11.290 align:middle line:84%
or disks connected
to the system,

00:18:11.290 --> 00:18:13.310 align:middle line:90%
I can utilize the df utility.

00:18:13.310 --> 00:18:19.210 align:middle line:84%
So df, and I can specify the
output to be human readable.

00:18:19.210 --> 00:18:23.190 align:middle line:84%
And that can be done
by saying df hyphen-H.

00:18:23.190 --> 00:18:26.310 align:middle line:84%
This will display a
list of file systems,

00:18:26.310 --> 00:18:29.320 align:middle line:84%
as well as the size of
these file systems--

00:18:29.320 --> 00:18:31.830 align:middle line:84%
the used storage--
available storage--

00:18:31.830 --> 00:18:33.820 align:middle line:84%
and where this has
been mounted on.

00:18:33.820 --> 00:18:36.840 align:middle line:84%
So you can see that this
right over here-- dev sda--

00:18:36.840 --> 00:18:38.880 align:middle line:90%
that's storage device A.

00:18:38.880 --> 00:18:44.650 align:middle line:84%
That is where this Linux
system has been installed.

00:18:44.650 --> 00:18:47.220 align:middle line:84%
And it is actually
mounted on etc hosts.

00:18:47.220 --> 00:18:50.730 align:middle line:84%
Now this might not be the
same for all the Linux

00:18:50.730 --> 00:18:53.170 align:middle line:90%
systems that you will work on.

00:18:53.170 --> 00:18:54.690 align:middle line:84%
But this, again,
is a special case,

00:18:54.690 --> 00:18:58.210 align:middle line:84%
because this is running
in a data center.

00:18:58.210 --> 00:19:01.140 align:middle line:84%
You can also limit this to
specific file extensions.

00:19:01.140 --> 00:19:04.290 align:middle line:84%
So if I was only interested in
the x-t4 file extension, which

00:19:04.290 --> 00:19:07.290 align:middle line:84%
is the default file format
for the Linux operating

00:19:07.290 --> 00:19:11.580 align:middle line:84%
system, that will display dev
sda, which is storage device A.

00:19:11.580 --> 00:19:14.400 align:middle line:84%
This is the equivalent
of the C drive for Linux.

00:19:14.400 --> 00:19:16.980 align:middle line:84%
And you can see that
it's a 1.9 terabytes,

00:19:16.980 --> 00:19:19.740 align:middle line:84%
because there are other
Linux systems running

00:19:19.740 --> 00:19:22.710 align:middle line:90%
on this main server.

00:19:22.710 --> 00:19:26.250 align:middle line:84%
You can see that the actual
amount of storage that is used

00:19:26.250 --> 00:19:29.350 align:middle line:84%
is about 90%, so
on and so forth.

00:19:29.350 --> 00:19:33.900 align:middle line:84%
You can also, again,
display disk information

00:19:33.900 --> 00:19:37.380 align:middle line:84%
by typing in the command
lsblk, and then grepping

00:19:37.380 --> 00:19:42.510 align:middle line:84%
the output-only display
devices with the storage device

00:19:42.510 --> 00:19:43.230 align:middle line:90%
annotation.

00:19:43.230 --> 00:19:45.690 align:middle line:90%
So we can say, grab sd.

00:19:45.690 --> 00:19:47.820 align:middle line:84%
And right over here,
you can see that this

00:19:47.820 --> 00:19:50.490 align:middle line:90%
will display sda and sdb.

00:19:50.490 --> 00:19:53.850 align:middle line:84%
So storage device B
is a swap partition,

00:19:53.850 --> 00:19:55.750 align:middle line:90%
that is used for swap memory.

00:19:55.750 --> 00:20:00.900 align:middle line:84%
So again, this will give you an
idea of what storage devices,

00:20:00.900 --> 00:20:04.020 align:middle line:84%
or rather the actual
configuration and partitions

00:20:04.020 --> 00:20:08.760 align:middle line:84%
that are essentially configured
on the Linux target system.

00:20:08.760 --> 00:20:11.610 align:middle line:84%
The final piece of information
that we can enumerate

00:20:11.610 --> 00:20:15.340 align:middle line:84%
is, of course, the installed
packages, or the installed

00:20:15.340 --> 00:20:15.840 align:middle line:90%
software.

00:20:15.840 --> 00:20:18.630 align:middle line:84%
Now given the fact that the
target system is running

00:20:18.630 --> 00:20:22.560 align:middle line:84%
Debian, we can utilize the
Debian package management

00:20:22.560 --> 00:20:24.990 align:middle line:90%
utility-- also known as dpkg.

00:20:24.990 --> 00:20:27.930 align:middle line:84%
And we can say, L, to list
the installed packages

00:20:27.930 --> 00:20:28.780 align:middle line:90%
on this system.

00:20:28.780 --> 00:20:30.330 align:middle line:90%
So dpkgl.

00:20:30.330 --> 00:20:32.010 align:middle line:84%
And right over
here, it'll display

00:20:32.010 --> 00:20:33.600 align:middle line:90%
all the installed packages

00:20:33.600 --> 00:20:36.120 align:middle line:84%
And on Linux, they're
going to be quite a lot,

00:20:36.120 --> 00:20:40.230 align:middle line:84%
because every tool
or utility or command

00:20:40.230 --> 00:20:41.700 align:middle line:90%
is considered a package.

00:20:41.700 --> 00:20:43.830 align:middle line:84%
So for example, bash,
right over here,

00:20:43.830 --> 00:20:45.900 align:middle line:84%
it'll give you the
exact version of bash.

00:20:45.900 --> 00:20:48.600 align:middle line:84%
And as I said within the
slides, this information

00:20:48.600 --> 00:20:52.950 align:middle line:84%
is really important-- as, for
example, in the case of bash,

00:20:52.950 --> 00:20:55.110 align:middle line:84%
specific versions of
bash have actually

00:20:55.110 --> 00:20:59.820 align:middle line:84%
been found, or known to suffer
from privilege escalation

00:20:59.820 --> 00:21:00.640 align:middle line:90%
vulnerabilities.

00:21:00.640 --> 00:21:04.260 align:middle line:84%
So all of this information
is extremely important

00:21:04.260 --> 00:21:08.010 align:middle line:84%
and will be exploring
how this information can

00:21:08.010 --> 00:21:12.540 align:middle line:84%
be contextualized in the case
of identifying vulnerabilities

00:21:12.540 --> 00:21:16.470 align:middle line:84%
that affect the specific version
of a particular utility that is

00:21:16.470 --> 00:21:18.990 align:middle line:90%
installed on a target system.

00:21:18.990 --> 00:21:21.750 align:middle line:84%
So we've been able to
enumerate a lot of information

00:21:21.750 --> 00:21:23.880 align:middle line:84%
from the Linux
target, and that is

00:21:23.880 --> 00:21:26.010 align:middle line:84%
going to conclude the
practical demonstration

00:21:26.010 --> 00:21:30.030 align:middle line:90%
side of this video.

00:21:30.030 --> 00:21:33.240 align:middle line:84%
So we've been able to enumerate
quite a lot of information

00:21:33.240 --> 00:21:35.460 align:middle line:90%
from the Linux target system.

00:21:35.460 --> 00:21:37.380 align:middle line:84%
In the next video, we're
going to be exploring

00:21:37.380 --> 00:21:39.510 align:middle line:84%
the process of how
to enumerate users

00:21:39.510 --> 00:21:42.720 align:middle line:84%
and groups on this same
Linux target system.

00:21:42.720 --> 00:21:47.090 align:middle line:84%
With that being said, I'll be
seeing you in the next video.

00:21:47.090 --> 00:21:48.000 align:middle line:90%