WEBVTT

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


00:00:10.150 --> 00:00:13.840 align:middle line:84%
Enumerating processes
and cron jobs on Linux.

00:00:13.840 --> 00:00:15.400 align:middle line:84%
In this video, we
will be exploring

00:00:15.400 --> 00:00:19.330 align:middle line:84%
the process of how to enumerate
running processes and cron

00:00:19.330 --> 00:00:22.870 align:middle line:84%
jobs on Linux or rather
enumerating cron jobs that

00:00:22.870 --> 00:00:26.510 align:middle line:84%
have been configured to run
on a Linux target system.

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

00:00:29.500 --> 00:00:32.680 align:middle line:84%
enumerating this information
is important in the context

00:00:32.680 --> 00:00:36.430 align:middle line:84%
of the post-exploitation
phase of a penetration test.

00:00:36.430 --> 00:00:40.450 align:middle line:84%
And in the context of
performing or enumerating

00:00:40.450 --> 00:00:44.690 align:middle line:84%
this information on Linux, what
exactly are we looking for?

00:00:44.690 --> 00:00:48.355 align:middle line:84%
Well, firstly, we're looking
for, or we have essentially--

00:00:48.355 --> 00:00:52.570 align:middle line:84%
we're going to be
enumerating or identifying

00:00:52.570 --> 00:00:54.790 align:middle line:84%
the running services
on the Linux system.

00:00:54.790 --> 00:00:57.310 align:middle line:84%
And the objective
there is to identify

00:00:57.310 --> 00:01:00.610 align:middle line:84%
the services that are
running as well as

00:01:00.610 --> 00:01:03.130 align:middle line:90%
their respective process IDs.

00:01:03.130 --> 00:01:05.379 align:middle line:84%
And of course, we'll
also be taking a look

00:01:05.379 --> 00:01:08.530 align:middle line:84%
at how to enumerate the cron
jobs that have been configured

00:01:08.530 --> 00:01:10.520 align:middle line:90%
to run on the Linux system.

00:01:10.520 --> 00:01:17.230 align:middle line:84%
So a cron job is essentially the
Linux alternative or the Linux

00:01:17.230 --> 00:01:20.860 align:middle line:84%
implementation of
scheduled tasks on Windows,

00:01:20.860 --> 00:01:24.940 align:middle line:84%
or cron job is
essentially a task

00:01:24.940 --> 00:01:29.590 align:middle line:84%
that has been configured to
run on a specified schedule.

00:01:29.590 --> 00:01:32.950 align:middle line:84%
Cron jobs are not just
limited to specific commands

00:01:32.950 --> 00:01:34.180 align:middle line:90%
or scripts.

00:01:34.180 --> 00:01:36.850 align:middle line:84%
You can really also
set up a cron job

00:01:36.850 --> 00:01:40.450 align:middle line:84%
to execute a specific
command, a specific binary.

00:01:40.450 --> 00:01:42.310 align:middle line:84%
And of course, in
most cases, cron jobs

00:01:42.310 --> 00:01:47.260 align:middle line:84%
are set up to execute a specific
batch script or a Python script

00:01:47.260 --> 00:01:49.120 align:middle line:90%
at a specified schedule.

00:01:49.120 --> 00:01:53.110 align:middle line:84%
So you can configure a cron
job to run every minute.

00:01:53.110 --> 00:01:56.410 align:middle line:84%
You can configure it to
run every day, every month,

00:01:56.410 --> 00:01:56.950 align:middle line:90%
et cetera.

00:01:56.950 --> 00:02:00.520 align:middle line:84%
So in regards to the
schedule that a cron job can

00:02:00.520 --> 00:02:06.700 align:middle line:84%
be configured to run on or with
the options are endless, right?

00:02:06.700 --> 00:02:10.840 align:middle line:84%
And the reason we're trying
to enumerate the actual cron

00:02:10.840 --> 00:02:12.460 align:middle line:84%
jobs that have been
configured to run

00:02:12.460 --> 00:02:16.780 align:middle line:84%
is primarily down to
privilege escalation whereby--

00:02:16.780 --> 00:02:18.980 align:middle line:84%
and we'll get to that
section when we get there.

00:02:18.980 --> 00:02:21.700 align:middle line:84%
But we're going to
be trying to identify

00:02:21.700 --> 00:02:23.650 align:middle line:84%
cron jobs that have
been misconfigured

00:02:23.650 --> 00:02:26.620 align:middle line:90%
or are configured insecurely.

00:02:26.620 --> 00:02:29.620 align:middle line:84%
And we'll be exploring how
we can utilize those cron

00:02:29.620 --> 00:02:31.575 align:middle line:90%
jobs to elevate our privileges.

00:02:31.575 --> 00:02:32.950 align:middle line:84%
With that being
said, we're going

00:02:32.950 --> 00:02:34.870 align:middle line:84%
to be utilizing the
same lab environment

00:02:34.870 --> 00:02:38.240 align:middle line:84%
that we used in the previous
video within this section.

00:02:38.240 --> 00:02:40.690 align:middle line:84%
And again, we're going
to need to gain access

00:02:40.690 --> 00:02:42.280 align:middle line:90%
to the target system first.

00:02:42.280 --> 00:02:45.820 align:middle line:84%
So we've already identified
the vulnerable service that's

00:02:45.820 --> 00:02:47.360 align:middle line:90%
running on the target system.

00:02:47.360 --> 00:02:49.630 align:middle line:84%
So once we gain
access, we can then

00:02:49.630 --> 00:02:53.590 align:middle line:84%
start enumerating the processes
and the cron jobs that are

00:02:53.590 --> 00:02:55.250 align:middle line:90%
running on the target system.

00:02:55.250 --> 00:02:57.730 align:middle line:84%
So I'll see you within
the lab environment.

00:02:57.730 --> 00:03:00.350 align:middle line:90%


00:03:00.350 --> 00:03:02.510 align:middle line:84%
All right, so I'm back
within the lab environment.

00:03:02.510 --> 00:03:04.093 align:middle line:84%
And of course, the
first step is going

00:03:04.093 --> 00:03:06.740 align:middle line:84%
to involve identifying
the target IP that

00:03:06.740 --> 00:03:09.320 align:middle line:84%
can be done by typing
in the ifconfig command

00:03:09.320 --> 00:03:12.275 align:middle line:84%
and taking a look at the
interface ethernet 1.

00:03:12.275 --> 00:03:16.760 align:middle line:84%
All you need to do is just
copy this inet value here.

00:03:16.760 --> 00:03:18.350 align:middle line:84%
In your case,
it'll be different.

00:03:18.350 --> 00:03:20.090 align:middle line:84%
But all you need to
do is just copy it

00:03:20.090 --> 00:03:23.690 align:middle line:84%
and make sure to change the
2 at the end here to a 3.

00:03:23.690 --> 00:03:26.990 align:middle line:90%
And that's the target IP.

00:03:26.990 --> 00:03:28.370 align:middle line:84%
Given the fact
that we've already

00:03:28.370 --> 00:03:31.040 align:middle line:84%
identified the
vulnerable service that's

00:03:31.040 --> 00:03:35.870 align:middle line:84%
running on the target system,
which we know is VSFTPD 2.3.4,

00:03:35.870 --> 00:03:38.330 align:middle line:84%
we also know that it is
vulnerable to a backdoor

00:03:38.330 --> 00:03:40.430 align:middle line:84%
command execution
vulnerability that can

00:03:40.430 --> 00:03:42.140 align:middle line:90%
be exploited with Metasploit.

00:03:42.140 --> 00:03:44.760 align:middle line:84%
So I'm going to open
up msfconsole here.

00:03:44.760 --> 00:03:50.000 align:middle line:84%
So msfconsole, and we'll give
this a couple of seconds.

00:03:50.000 --> 00:03:53.120 align:middle line:84%
We then are going to set the
global variable for the RHOSTS

00:03:53.120 --> 00:03:54.830 align:middle line:90%
option to the--

00:03:54.830 --> 00:03:57.720 align:middle line:84%
we'll essentially set the
value to the target IP address.

00:03:57.720 --> 00:04:01.340 align:middle line:84%
So I'll say setg RHOSTS,
and I'll paste in the IP

00:04:01.340 --> 00:04:02.000 align:middle line:90%
that I copied.

00:04:02.000 --> 00:04:03.770 align:middle line:90%
And I'll change the 2 to a 3.

00:04:03.770 --> 00:04:06.980 align:middle line:84%
This will essentially ensure
that the target IP is specified

00:04:06.980 --> 00:04:10.010 align:middle line:84%
globally for the RHOSTS
option so that whenever

00:04:10.010 --> 00:04:15.710 align:middle line:84%
we load a module, the target IP
value is going to be specified.

00:04:15.710 --> 00:04:19.550 align:middle line:84%
Now that is done, we can
search for the vsftpd module.

00:04:19.550 --> 00:04:20.579 align:middle line:90%
There it is.

00:04:20.579 --> 00:04:22.050 align:middle line:90%
So I'll just copy it.

00:04:22.050 --> 00:04:24.520 align:middle line:90%
And I'll say use.

00:04:24.520 --> 00:04:28.170 align:middle line:84%
And if I now show the
options for this module,

00:04:28.170 --> 00:04:30.350 align:middle line:84%
you can see the target
IP is already specified.

00:04:30.350 --> 00:04:32.090 align:middle line:90%
So I type in exploit.

00:04:32.090 --> 00:04:34.190 align:middle line:84%
And that should provide
me with a command shell

00:04:34.190 --> 00:04:36.890 align:middle line:84%
session, which I'm then going
to upgrade to a Meterpreter

00:04:36.890 --> 00:04:38.388 align:middle line:90%
session.

00:04:38.388 --> 00:04:38.930 align:middle line:90%
There we are.

00:04:38.930 --> 00:04:42.770 align:middle line:84%
I'll put this in the background
using the key combination

00:04:42.770 --> 00:04:44.240 align:middle line:90%
Control and Z.

00:04:44.240 --> 00:04:45.680 align:middle line:90%
And I'll hit yes.

00:04:45.680 --> 00:04:46.850 align:middle line:90%
I'll list out my sessions.

00:04:46.850 --> 00:04:49.880 align:middle line:84%
You can see the command
shell session is currently

00:04:49.880 --> 00:04:50.840 align:middle line:90%
has an idea of 1.

00:04:50.840 --> 00:04:57.790 align:middle line:84%
So I'll say sessions upgrade 1
to get a Meterpreter session.

00:04:57.790 --> 00:05:01.210 align:middle line:84%
And we'll give this
a couple of seconds.

00:05:01.210 --> 00:05:03.370 align:middle line:84%
And you can see we get
a Meterpreter session.

00:05:03.370 --> 00:05:05.080 align:middle line:84%
So I'll now list
out my sessions,

00:05:05.080 --> 00:05:07.060 align:middle line:90%
and it's running on session 2.

00:05:07.060 --> 00:05:10.900 align:middle line:84%
So I'll say sessions 2, and we
have our Meterpreter session.

00:05:10.900 --> 00:05:14.290 align:middle line:84%
So we can enumerate the
list of running processes

00:05:14.290 --> 00:05:17.320 align:middle line:84%
with Meterpreter by
typing in ps, right?

00:05:17.320 --> 00:05:19.270 align:middle line:84%
And before I do
that, I actually want

00:05:19.270 --> 00:05:23.380 align:middle line:84%
to open up the actual
documentation for Meterpreter.

00:05:23.380 --> 00:05:25.750 align:middle line:84%
And if I take a look at
the system commands here,

00:05:25.750 --> 00:05:27.940 align:middle line:84%
you can see that in
regards to processes,

00:05:27.940 --> 00:05:30.940 align:middle line:84%
it's fairly similar to what
we did on Windows, where

00:05:30.940 --> 00:05:34.270 align:middle line:84%
we type in ps that will
list the running processes.

00:05:34.270 --> 00:05:37.390 align:middle line:84%
We can also suspend or
resume a list of processes,

00:05:37.390 --> 00:05:39.940 align:middle line:84%
we can also filter
processes by their name.

00:05:39.940 --> 00:05:42.500 align:middle line:84%
And we can terminate
a specific process.

00:05:42.500 --> 00:05:46.090 align:middle line:84%
So again, if I
type in ps, you can

00:05:46.090 --> 00:05:47.770 align:middle line:84%
see that will display
the process list.

00:05:47.770 --> 00:05:51.610 align:middle line:84%
And it's sorted based
on process ID, the PPID,

00:05:51.610 --> 00:05:55.370 align:middle line:84%
the name of the process,
the architecture, the user,

00:05:55.370 --> 00:05:56.710 align:middle line:90%
and of course, the path, right?

00:05:56.710 --> 00:05:59.450 align:middle line:84%
And of course, I've already
explained these columns.

00:05:59.450 --> 00:06:02.710 align:middle line:84%
And you can see that we have
quite a few processes here.

00:06:02.710 --> 00:06:05.680 align:middle line:84%
And more specifically,
we can see that we

00:06:05.680 --> 00:06:07.570 align:middle line:90%
have the vsftpd process.

00:06:07.570 --> 00:06:10.300 align:middle line:84%
And it doesn't specify
the actual binary here

00:06:10.300 --> 00:06:13.670 align:middle line:84%
or the path to the binary,
which is very interesting.

00:06:13.670 --> 00:06:16.840 align:middle line:84%
And then of course, we can
utilize the various system

00:06:16.840 --> 00:06:21.100 align:middle line:84%
commands for Meterpreter
to essentially kill

00:06:21.100 --> 00:06:24.020 align:middle line:84%
a specific process if
we want to do that.

00:06:24.020 --> 00:06:26.810 align:middle line:84%
We can also filter
the processes by name.

00:06:26.810 --> 00:06:27.880 align:middle line:90%
So I can say pgrep.

00:06:27.880 --> 00:06:30.580 align:middle line:84%
And I can say vsftpd,
for us looking

00:06:30.580 --> 00:06:32.600 align:middle line:90%
for a particular process.

00:06:32.600 --> 00:06:36.350 align:middle line:84%
And we also-- you can see we
can-- if I filter that there,

00:06:36.350 --> 00:06:40.750 align:middle line:84%
it looks like we have two
processes attached to vsftpd.

00:06:40.750 --> 00:06:44.320 align:middle line:84%
One of which has
a process ID of 7.

00:06:44.320 --> 00:06:46.630 align:middle line:84%
The other one has
a process ID of 9.

00:06:46.630 --> 00:06:48.230 align:middle line:90%
And you get the idea.

00:06:48.230 --> 00:06:51.370 align:middle line:84%
So that's a fairly
simple to understand.

00:06:51.370 --> 00:06:56.650 align:middle line:84%
And I'm just going to open
up a commercial session here.

00:06:56.650 --> 00:06:59.230 align:middle line:84%
And I'm going to open
up a bash session.

00:06:59.230 --> 00:07:02.760 align:middle line:90%
So /bin/bash -i.

00:07:02.760 --> 00:07:04.680 align:middle line:84%
And again, to do
this manually, we

00:07:04.680 --> 00:07:08.010 align:middle line:84%
can also utilize the
Linux utility called ps.

00:07:08.010 --> 00:07:10.170 align:middle line:84%
So if I type in ps,
that'll essentially

00:07:10.170 --> 00:07:12.930 align:middle line:90%
list out the list of processes.

00:07:12.930 --> 00:07:14.640 align:middle line:90%
In this case, it is not found.

00:07:14.640 --> 00:07:18.720 align:middle line:84%
But if I type in ps aux, you can
see that it's still not found.

00:07:18.720 --> 00:07:21.090 align:middle line:84%
So the ps utility
is not installed

00:07:21.090 --> 00:07:23.040 align:middle line:90%
on this target system.

00:07:23.040 --> 00:07:26.490 align:middle line:84%
As a result, what I can
do to highlight the rest

00:07:26.490 --> 00:07:29.940 align:middle line:84%
or how to run this
command, I will just exit,

00:07:29.940 --> 00:07:32.760 align:middle line:84%
or what I can do is
let me just terminate

00:07:32.760 --> 00:07:34.000 align:middle line:90%
this particular channel.

00:07:34.000 --> 00:07:36.330 align:middle line:84%
So Control C terminate
that channel.

00:07:36.330 --> 00:07:38.160 align:middle line:84%
And I'll put this
in the background.

00:07:38.160 --> 00:07:40.260 align:middle line:84%
It looks like our
Meterpreter session has died.

00:07:40.260 --> 00:07:42.430 align:middle line:90%
That's perfectly fine.

00:07:42.430 --> 00:07:45.060 align:middle line:84%
So I'm currently running
within msfconsole.

00:07:45.060 --> 00:07:48.720 align:middle line:84%
And I can run the ps command
on my Kali Linux system,

00:07:48.720 --> 00:07:50.260 align:middle line:90%
just to explain how this works.

00:07:50.260 --> 00:07:51.900 align:middle line:90%
So I can say ps.

00:07:51.900 --> 00:07:54.060 align:middle line:84%
And if I hit Enter,
you can see that we'll

00:07:54.060 --> 00:07:56.110 align:middle line:90%
list out a list of processes.

00:07:56.110 --> 00:08:00.550 align:middle line:84%
And it'll sort it based on the
process ID, the TTY session,

00:08:00.550 --> 00:08:04.830 align:middle line:84%
the time, and then the command
that is being executed, right?

00:08:04.830 --> 00:08:07.860 align:middle line:84%
Now, I can also utilize
the ps aux command

00:08:07.860 --> 00:08:12.360 align:middle line:84%
to display all processes and
to also display information

00:08:12.360 --> 00:08:14.260 align:middle line:90%
that is important to us.

00:08:14.260 --> 00:08:17.710 align:middle line:84%
So in this case, you can see
this has additional columns.

00:08:17.710 --> 00:08:21.510 align:middle line:84%
So for example, you have the
user, the process ID, the CPU,

00:08:21.510 --> 00:08:23.370 align:middle line:90%
and memory consumption.

00:08:23.370 --> 00:08:26.130 align:middle line:84%
You also have the
actual start time.

00:08:26.130 --> 00:08:29.820 align:middle line:84%
And then of course, you have the
command that is being executed.

00:08:29.820 --> 00:08:31.680 align:middle line:84%
And in this case,
we can actually

00:08:31.680 --> 00:08:34.750 align:middle line:84%
see the msfconsole
process right over here.

00:08:34.750 --> 00:08:36.450 align:middle line:84%
And it provides us
with information

00:08:36.450 --> 00:08:40.620 align:middle line:84%
regarding the process ID,
et cetera, et cetera, right?

00:08:40.620 --> 00:08:44.580 align:middle line:84%
We can also limit or
filter the processes

00:08:44.580 --> 00:08:48.130 align:middle line:84%
that we want to see based
on specific parameters.

00:08:48.130 --> 00:08:52.500 align:middle line:84%
So for example, if I say ps
aux, I can type out the output

00:08:52.500 --> 00:08:55.770 align:middle line:84%
and utilize grep to filter
through and only display

00:08:55.770 --> 00:08:57.040 align:middle line:90%
information that we want.

00:08:57.040 --> 00:09:02.490 align:middle line:84%
So for example, I can also say
if I wanted to essentially list

00:09:02.490 --> 00:09:05.580 align:middle line:84%
out a specific process
like msfconsole,

00:09:05.580 --> 00:09:09.330 align:middle line:84%
you can see that it's going
to display the processes based

00:09:09.330 --> 00:09:11.880 align:middle line:84%
on the keyword that
I specified here.

00:09:11.880 --> 00:09:16.440 align:middle line:84%
And if I wanted to limit the
output to a specific user

00:09:16.440 --> 00:09:19.170 align:middle line:84%
or to only display
processes associated

00:09:19.170 --> 00:09:21.960 align:middle line:84%
with a specific user, I
can say, for example, root.

00:09:21.960 --> 00:09:23.280 align:middle line:90%
So grep root.

00:09:23.280 --> 00:09:24.060 align:middle line:90%
Hit Enter.

00:09:24.060 --> 00:09:26.310 align:middle line:84%
And this will show
me all processes

00:09:26.310 --> 00:09:29.200 align:middle line:84%
that belong to the root
user right over here.

00:09:29.200 --> 00:09:33.270 align:middle line:84%
So the ps command or
utility is quite useful.

00:09:33.270 --> 00:09:35.430 align:middle line:84%
However, in this case,
as we were able to see,

00:09:35.430 --> 00:09:37.380 align:middle line:84%
it is not installed
on the target system.

00:09:37.380 --> 00:09:39.660 align:middle line:90%
That is very rarely the case.

00:09:39.660 --> 00:09:42.960 align:middle line:84%
On most Linux systems that
you will be gaining access to,

00:09:42.960 --> 00:09:46.440 align:middle line:84%
the ps utility will
pretty much be installed

00:09:46.440 --> 00:09:49.150 align:middle line:90%
because it is extremely useful.

00:09:49.150 --> 00:09:52.720 align:middle line:84%
Another utility that you can
utilize is the top command.

00:09:52.720 --> 00:09:56.670 align:middle line:84%
So let me just open up one
of the actual command shell

00:09:56.670 --> 00:09:57.430 align:middle line:90%
session here.

00:09:57.430 --> 00:10:00.120 align:middle line:84%
So I'll say sessions
1, as we don't really

00:10:00.120 --> 00:10:02.010 align:middle line:84%
need them Meterpreter
session at this point.

00:10:02.010 --> 00:10:04.140 align:middle line:90%
So I'll say /bin/bash -i.

00:10:04.140 --> 00:10:06.570 align:middle line:84%
That is the top command,
which will essentially

00:10:06.570 --> 00:10:09.070 align:middle line:90%
display a list of processes.

00:10:09.070 --> 00:10:11.650 align:middle line:84%
And in this case, it's not
installed on the target system,

00:10:11.650 --> 00:10:13.317 align:middle line:84%
so I'll just put that
in the background.

00:10:13.317 --> 00:10:16.090 align:middle line:84%
And we can run the command
on the Kali Linux system.

00:10:16.090 --> 00:10:17.890 align:middle line:90%
So I'll say top.

00:10:17.890 --> 00:10:20.400 align:middle line:84%
And you can see that the
top utility will give you

00:10:20.400 --> 00:10:22.270 align:middle line:90%
a list of all running processes.

00:10:22.270 --> 00:10:25.140 align:middle line:84%
And this is a dynamic
utility and that it

00:10:25.140 --> 00:10:28.020 align:middle line:84%
is showing you a
list of processes

00:10:28.020 --> 00:10:30.510 align:middle line:84%
as they're actually
being executed.

00:10:30.510 --> 00:10:33.340 align:middle line:84%
And it's also highlighting
their resource consumption.

00:10:33.340 --> 00:10:35.940 align:middle line:84%
So you can see you have your
CPU counter and your memory

00:10:35.940 --> 00:10:36.840 align:middle line:90%
counter.

00:10:36.840 --> 00:10:39.240 align:middle line:84%
And again, the top
utility is quite useful

00:10:39.240 --> 00:10:42.960 align:middle line:84%
because it tells you how
long the system has been up,

00:10:42.960 --> 00:10:45.750 align:middle line:90%
the users, the load average.

00:10:45.750 --> 00:10:48.720 align:middle line:84%
It also displays the amount
of memory that's free.

00:10:48.720 --> 00:10:51.150 align:middle line:84%
So in this case,
about 10 gigabytes.

00:10:51.150 --> 00:10:52.680 align:middle line:90%
I think that's in bytes.

00:10:52.680 --> 00:10:54.330 align:middle line:90%
I'm not really sure.

00:10:54.330 --> 00:10:57.840 align:middle line:84%
Yeah, that is in MiB, so
that's the amount of memory

00:10:57.840 --> 00:11:00.540 align:middle line:84%
that is available, the
amount that is free,

00:11:00.540 --> 00:11:02.140 align:middle line:90%
and the amount that is used.

00:11:02.140 --> 00:11:05.020 align:middle line:84%
So again, the top
utility is quite useful.

00:11:05.020 --> 00:11:09.690 align:middle line:84%
And as I said, it's pretty
much going to be installed.

00:11:09.690 --> 00:11:12.630 align:middle line:84%
For example, if I
exploit an Ubuntu system,

00:11:12.630 --> 00:11:16.350 align:middle line:84%
the top utility comes
pre-packaged with Ubuntu.

00:11:16.350 --> 00:11:18.390 align:middle line:90%
So that's the top utility.

00:11:18.390 --> 00:11:23.130 align:middle line:84%
Now, the other checks or the
other piece of information

00:11:23.130 --> 00:11:26.340 align:middle line:84%
that we wanted to enumerate
are cron jobs, right?

00:11:26.340 --> 00:11:30.480 align:middle line:84%
And I'll just navigate
back into session 1.

00:11:30.480 --> 00:11:33.280 align:middle line:84%
And I'll open up a
bash session here.

00:11:33.280 --> 00:11:34.830 align:middle line:90%
So /bin/bash -i.

00:11:34.830 --> 00:11:37.260 align:middle line:84%
And we can essentially
display the cron jobs

00:11:37.260 --> 00:11:39.540 align:middle line:84%
for a specific user
or the user that you

00:11:39.540 --> 00:11:42.480 align:middle line:84%
have access to or with
on the target system

00:11:42.480 --> 00:11:45.060 align:middle line:90%
by typing in crontab -l.

00:11:45.060 --> 00:11:47.100 align:middle line:84%
So if I hit Enter,
you can see that.

00:11:47.100 --> 00:11:51.040 align:middle line:84%
Again, in this case, the crontab
utility is not installed.

00:11:51.040 --> 00:11:52.050 align:middle line:90%
So what?

00:11:52.050 --> 00:11:53.070 align:middle line:90%
We can do again.

00:11:53.070 --> 00:11:55.200 align:middle line:84%
And again, this is
quite unfortunate.

00:11:55.200 --> 00:11:58.350 align:middle line:84%
But again, you can also do
it on the Kali Linux system.

00:11:58.350 --> 00:12:00.840 align:middle line:90%
We can say crontab -l.

00:12:00.840 --> 00:12:04.560 align:middle line:84%
And this will display the list
of cron jobs for the root user.

00:12:04.560 --> 00:12:06.240 align:middle line:84%
In this case, you
can see that it says

00:12:06.240 --> 00:12:08.410 align:middle line:90%
no crontab for the root user.

00:12:08.410 --> 00:12:11.490 align:middle line:84%
So no cron jobs have been
configured by the root user

00:12:11.490 --> 00:12:13.660 align:middle line:84%
or for the root user
for that matter.

00:12:13.660 --> 00:12:19.290 align:middle line:84%
We can also display the
contents of the etc directory,

00:12:19.290 --> 00:12:24.120 align:middle line:84%
but we're looking for all files
with cron in the file name.

00:12:24.120 --> 00:12:27.750 align:middle line:84%
So we can use the asterisk
command as a wildcard.

00:12:27.750 --> 00:12:30.000 align:middle line:84%
This will display
all cron files.

00:12:30.000 --> 00:12:32.250 align:middle line:84%
And right here, you can
see that cron sort it

00:12:32.250 --> 00:12:35.250 align:middle line:90%
based on daily cron jobs.

00:12:35.250 --> 00:12:37.380 align:middle line:84%
You also have your
hourly cron jobs,

00:12:37.380 --> 00:12:39.480 align:middle line:90%
monthly, weekly, et cetera.

00:12:39.480 --> 00:12:42.300 align:middle line:84%
And we can also cat
out the content.

00:12:42.300 --> 00:12:46.320 align:middle line:84%
And we can say cat /etc/cron
and use the wild card again.

00:12:46.320 --> 00:12:48.810 align:middle line:84%
And right over here,
this will tell us

00:12:48.810 --> 00:12:51.930 align:middle line:84%
that we really don't have
any cron jobs configured.

00:12:51.930 --> 00:12:55.290 align:middle line:84%
If they were configured,
this is typically how

00:12:55.290 --> 00:12:57.620 align:middle line:84%
or what a cron job
would look like.

00:12:57.620 --> 00:13:00.720 align:middle line:84%
So you would
essentially have your--

00:13:00.720 --> 00:13:03.300 align:middle line:84%
if you take a look at
the job definition,

00:13:03.300 --> 00:13:06.850 align:middle line:84%
this is where the actual
schedule is specified.

00:13:06.850 --> 00:13:08.700 align:middle line:84%
So again, you can
specify whether you

00:13:08.700 --> 00:13:12.900 align:middle line:84%
want to run it every minute or
what specific minute of an hour

00:13:12.900 --> 00:13:16.680 align:middle line:84%
you want to run it on, what hour
of the day you want to run it

00:13:16.680 --> 00:13:20.910 align:middle line:84%
on, day of the month, month, day
of the week, et cetera, right?

00:13:20.910 --> 00:13:23.220 align:middle line:84%
And of course, in
this case, this video

00:13:23.220 --> 00:13:25.470 align:middle line:84%
is primarily focused
on techniques.

00:13:25.470 --> 00:13:28.590 align:middle line:84%
When we actually get to
privilege escalation,

00:13:28.590 --> 00:13:31.560 align:middle line:84%
we'll actually see or we'll
be able to explore what

00:13:31.560 --> 00:13:33.520 align:middle line:90%
a real cron job looks like.

00:13:33.520 --> 00:13:36.150 align:middle line:84%
So yeah, that is
going to conclude

00:13:36.150 --> 00:13:40.270 align:middle line:84%
the practical demonstration
side of this video.

00:13:40.270 --> 00:13:40.770 align:middle line:90%
All right.

00:13:40.770 --> 00:13:45.120 align:middle line:84%
So we've been able to take a
look at how to enumerate system

00:13:45.120 --> 00:13:49.110 align:middle line:84%
information on Linux, users,
and groups, network information,

00:13:49.110 --> 00:13:52.650 align:middle line:84%
and now, services, and cron
jobs, or rather, processes,

00:13:52.650 --> 00:13:53.715 align:middle line:90%
and cron jobs.

00:13:53.715 --> 00:13:55.590 align:middle line:84%
In the next video, we're
going to take a look

00:13:55.590 --> 00:13:57.720 align:middle line:90%
at how to automate all of this.

00:13:57.720 --> 00:14:02.400 align:middle line:84%
And the way we're going to do
that is through an automation

00:14:02.400 --> 00:14:07.260 align:middle line:84%
or rather, for lack of a better
word, an automated enumeration

00:14:07.260 --> 00:14:11.650 align:middle line:84%
script for Linux, as we explored
during the Windows section.

00:14:11.650 --> 00:14:14.730 align:middle line:84%
So we're essentially going
to be utilizing a script

00:14:14.730 --> 00:14:20.520 align:middle line:84%
to automate all of these steps
of local enumeration on Linux.

00:14:20.520 --> 00:14:23.100 align:middle line:84%
And again, the reason, as I
said, that we're covering this

00:14:23.100 --> 00:14:24.810 align:middle line:84%
at the end of the
video, is primarily

00:14:24.810 --> 00:14:27.000 align:middle line:84%
because or at the
end of this section

00:14:27.000 --> 00:14:30.600 align:middle line:84%
is primarily because it's
very important that you

00:14:30.600 --> 00:14:33.330 align:middle line:84%
learn how to perform local
enumeration manually.

00:14:33.330 --> 00:14:36.420 align:middle line:84%
After you know how to perform
local enumeration manually,

00:14:36.420 --> 00:14:39.060 align:middle line:84%
you can then automate
the checks when

00:14:39.060 --> 00:14:42.480 align:middle line:84%
you're working or performing
a real penetration test,

00:14:42.480 --> 00:14:45.540 align:middle line:84%
given the time constraints
that you are under

00:14:45.540 --> 00:14:47.640 align:middle line:90%
or that you need to abide by.

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

00:14:51.797 --> 00:14:52.297 align:middle line:90%