WEBVTT

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


00:00:03.840 --> 00:00:07.200 align:middle line:90%
[MUSIC LOGO]

00:00:07.200 --> 00:00:10.580 align:middle line:90%


00:00:10.580 --> 00:00:14.060 align:middle line:84%
We're going to continue
to look at SMB.

00:00:14.060 --> 00:00:16.820 align:middle line:84%
And in this lab, we're going to
utilize a tool called SMBMap.

00:00:16.820 --> 00:00:23.660 align:middle line:90%


00:00:23.660 --> 00:00:28.895 align:middle line:84%
We have our IP address that
was given to us, 10.4.26.58.

00:00:28.895 --> 00:00:29.645 align:middle line:90%
That's our target.

00:00:29.645 --> 00:00:32.150 align:middle line:90%


00:00:32.150 --> 00:00:33.440 align:middle line:90%
We will ping it.

00:00:33.440 --> 00:00:36.120 align:middle line:90%


00:00:36.120 --> 00:00:40.080 align:middle line:90%
And it looks like it is alive.

00:00:40.080 --> 00:00:43.850 align:middle line:90%
So let's run an Nmap scan.

00:00:43.850 --> 00:00:48.080 align:middle line:84%
And we get back what we would
hope to expect in an SMB lab.

00:00:48.080 --> 00:00:54.160 align:middle line:90%
It's 135, 139, and 445.

00:00:54.160 --> 00:00:57.040 align:middle line:84%
We'll jump to that
port 445, and we'll

00:00:57.040 --> 00:01:00.800 align:middle line:84%
run the script, tack-tack
script, for SMB protocols.

00:01:00.800 --> 00:01:06.060 align:middle line:90%


00:01:06.060 --> 00:01:08.290 align:middle line:84%
And this is going to
tell us the protocols

00:01:08.290 --> 00:01:10.495 align:middle line:90%
and the dialects running.

00:01:10.495 --> 00:01:17.530 align:middle line:84%
And we see there's SMB version
1 as well as 202, 210, 3.0,

00:01:17.530 --> 00:01:24.630 align:middle line:84%
and 302, with that SMB version
1 being quite dangerous.

00:01:24.630 --> 00:01:27.890 align:middle line:90%


00:01:27.890 --> 00:01:30.860 align:middle line:84%
Knowing that there
is SMB version 1,

00:01:30.860 --> 00:01:32.340 align:middle line:90%
we'll go with a null session.

00:01:32.340 --> 00:01:35.720 align:middle line:84%
So we're going to
utilize SMBMap, which

00:01:35.720 --> 00:01:38.270 align:middle line:90%
is a program made in Python.

00:01:38.270 --> 00:01:40.860 align:middle line:90%


00:01:40.860 --> 00:01:45.840 align:middle line:84%
And we'll go with the user
of guest and a null password.

00:01:45.840 --> 00:01:47.700 align:middle line:90%
So no password.

00:01:47.700 --> 00:01:52.110 align:middle line:84%
And then, we're looking
at the directory

00:01:52.110 --> 00:01:59.180 align:middle line:84%
from where we are, with the
host of 10.4.26.58, our target.

00:01:59.180 --> 00:02:02.450 align:middle line:90%
And we see it connects.

00:02:02.450 --> 00:02:09.500 align:middle line:84%
And it finds all these shares,
which guest is able to connect,

00:02:09.500 --> 00:02:14.600 align:middle line:84%
but only has read
access to IPC and print,

00:02:14.600 --> 00:02:17.660 align:middle line:84%
which with a null
session and IPC,

00:02:17.660 --> 00:02:20.210 align:middle line:90%
that's what you should expect.

00:02:20.210 --> 00:02:23.000 align:middle line:84%
It would be very dangerous
if it had more access

00:02:23.000 --> 00:02:24.845 align:middle line:90%
with a guest null session.

00:02:24.845 --> 00:02:28.370 align:middle line:90%


00:02:28.370 --> 00:02:31.130 align:middle line:84%
So we'll log in with
administrator and this password

00:02:31.130 --> 00:02:38.990 align:middle line:84%
that we were given for
the lab, smbserver_771.

00:02:38.990 --> 00:02:41.570 align:middle line:84%
And it connects, and now we
can see that we have read

00:02:41.570 --> 00:02:44.720 align:middle line:84%
and write access or read-only
access in certain places.

00:02:44.720 --> 00:02:52.190 align:middle line:90%


00:02:52.190 --> 00:02:56.480 align:middle line:84%
Utilizing that same
authentication administrator

00:02:56.480 --> 00:02:59.180 align:middle line:84%
and smbserver_771,
now we're going

00:02:59.180 --> 00:03:05.705 align:middle line:84%
to try to run a command,
this tack-x with IP config.

00:03:05.705 --> 00:03:09.590 align:middle line:90%


00:03:09.590 --> 00:03:16.625 align:middle line:84%
And we see it returns the
product of that command

00:03:16.625 --> 00:03:17.750 align:middle line:90%
in the Windows environment.

00:03:17.750 --> 00:03:18.920 align:middle line:90%
It runs IP config.

00:03:18.920 --> 00:03:21.470 align:middle line:90%
And it tells us what it was.

00:03:21.470 --> 00:03:23.750 align:middle line:84%
That's potentially
very dangerous,

00:03:23.750 --> 00:03:26.630 align:middle line:84%
if we can now have
remote code execution

00:03:26.630 --> 00:03:30.230 align:middle line:90%
simply through connecting VSMB.

00:03:30.230 --> 00:03:33.980 align:middle line:90%


00:03:33.980 --> 00:03:36.290 align:middle line:84%
Currently, we're
only enumerating,

00:03:36.290 --> 00:03:38.600 align:middle line:84%
but we can use this
information later.

00:03:38.600 --> 00:03:42.260 align:middle line:90%


00:03:42.260 --> 00:03:46.470 align:middle line:84%
Let's see a list of what
we've got when we connect.

00:03:46.470 --> 00:03:49.290 align:middle line:90%
This is different.

00:03:49.290 --> 00:03:50.370 align:middle line:90%
We connected.

00:03:50.370 --> 00:03:52.860 align:middle line:90%
We saw what shares we have.

00:03:52.860 --> 00:03:56.850 align:middle line:84%
And now with this tack-L,
we'll list out the contents.

00:03:56.850 --> 00:04:07.620 align:middle line:90%


00:04:07.620 --> 00:04:11.455 align:middle line:84%
There's no mapped
network drives.

00:04:11.455 --> 00:04:12.580 align:middle line:90%
But there are local drives.

00:04:12.580 --> 00:04:14.050 align:middle line:84%
There's a C drive
and an L drive,

00:04:14.050 --> 00:04:18.269 align:middle line:84%
which is what we got from
that tack-L, the list.

00:04:18.269 --> 00:04:19.440 align:middle line:90%
Kind of matched.

00:04:19.440 --> 00:04:23.722 align:middle line:84%
We saw that there was C
drive and D drive there.

00:04:23.722 --> 00:04:25.460 align:middle line:84%
So this just gave
us a list of them.

00:04:25.460 --> 00:04:28.450 align:middle line:90%


00:04:28.450 --> 00:04:31.200 align:middle line:84%
Now, let's connect
to that C drive.

00:04:31.200 --> 00:04:37.190 align:middle line:90%


00:04:37.190 --> 00:04:39.200 align:middle line:84%
This is like running
a dir or an ls.

00:04:39.200 --> 00:04:43.880 align:middle line:84%
We see what the contents
of the C drive are.

00:04:43.880 --> 00:04:46.940 align:middle line:84%
In here, we see that
there's a flag.txt.

00:04:46.940 --> 00:04:49.110 align:middle line:90%
We'll come back to that.

00:04:49.110 --> 00:04:50.730 align:middle line:90%
But what else can we do here?

00:04:50.730 --> 00:04:54.200 align:middle line:84%
Well, with SMBMap, map we can
utilize a few different things.

00:04:54.200 --> 00:04:57.840 align:middle line:90%
Let's create a file.

00:04:57.840 --> 00:04:59.870 align:middle line:84%
So we don't have really
anything here right now.

00:04:59.870 --> 00:05:02.540 align:middle line:90%


00:05:02.540 --> 00:05:03.980 align:middle line:90%
Let's touch backdoor.

00:05:03.980 --> 00:05:07.180 align:middle line:90%


00:05:07.180 --> 00:05:13.230 align:middle line:84%
And now, we have a file called
backdoor, which is empty.

00:05:13.230 --> 00:05:15.870 align:middle line:84%
We're going to take
backdoor, and we're

00:05:15.870 --> 00:05:19.510 align:middle line:90%
going to put it in the C drive.

00:05:19.510 --> 00:05:22.770 align:middle line:84%
So it's very much the
same as our command

00:05:22.770 --> 00:05:24.870 align:middle line:84%
previously, except
instead of looking

00:05:24.870 --> 00:05:27.630 align:middle line:84%
at the contents of
the C drive, we're

00:05:27.630 --> 00:05:31.680 align:middle line:84%
going to use tack-tack
upload with SMBMap.

00:05:31.680 --> 00:05:43.620 align:middle line:84%
We'll upload the file from our
attack machine to the victim.

00:05:43.620 --> 00:05:48.180 align:middle line:84%
We'll call the file
backdoor in both situations.

00:05:48.180 --> 00:05:51.580 align:middle line:84%
And now we know it's there,
but let's double-check.

00:05:51.580 --> 00:05:57.290 align:middle line:84%
Let's run the same
command again.

00:05:57.290 --> 00:05:59.000 align:middle line:84%
And now, we see that
backdoor is there.

00:05:59.000 --> 00:06:01.540 align:middle line:90%
It wasn't there before.

00:06:01.540 --> 00:06:04.520 align:middle line:84%
But our upload seems
to have worked.

00:06:04.520 --> 00:06:06.970 align:middle line:90%
It's also an empty file.

00:06:06.970 --> 00:06:10.630 align:middle line:84%
But we were able
to upload a file.

00:06:10.630 --> 00:06:14.820 align:middle line:90%


00:06:14.820 --> 00:06:17.690 align:middle line:90%
And same results.

00:06:17.690 --> 00:06:20.660 align:middle line:90%
Now we see backdoor is there.

00:06:20.660 --> 00:06:23.930 align:middle line:90%
Well, could we download a file?

00:06:23.930 --> 00:06:29.360 align:middle line:84%
We know that there's this
flag.txt so we'll do tack-tack

00:06:29.360 --> 00:06:32.120 align:middle line:90%
download from c$ flag.txt.

00:06:32.120 --> 00:06:35.960 align:middle line:90%


00:06:35.960 --> 00:06:39.800 align:middle line:84%
And it said it
downloaded it to root.

00:06:39.800 --> 00:06:40.970 align:middle line:90%
And now we see it here.

00:06:40.970 --> 00:06:45.170 align:middle line:90%


00:06:45.170 --> 00:06:50.105 align:middle line:84%
We cat it out, and
we have the contents.

00:06:50.105 --> 00:06:55.520 align:middle line:90%


00:06:55.520 --> 00:07:04.200 align:middle line:84%
So with SMBMap, we were
able to connect, enumerate,

00:07:04.200 --> 00:07:08.997 align:middle line:84%
upload, and download files
with some authentication.

00:07:08.997 --> 00:07:10.830 align:middle line:84%
All we needed was the
username and password.

00:07:10.830 --> 00:07:13.500 align:middle line:84%
But we were still able to
find some information out,

00:07:13.500 --> 00:07:15.240 align:middle line:90%
even with just the guest count.

00:07:15.240 --> 00:07:18.990 align:middle line:84%
We saw what drives were there,
and we saw that there was IPC

00:07:18.990 --> 00:07:21.900 align:middle line:90%
that we could read from.

00:07:21.900 --> 00:07:27.243 align:middle line:84%
All this, we want to take in,
ingest, record, and continue

00:07:27.243 --> 00:07:28.410 align:middle line:90%
the rest of our enumeration.

00:07:28.410 --> 00:07:30.300 align:middle line:84%
There were other
ports out there.

00:07:30.300 --> 00:07:32.860 align:middle line:84%
Depending on the machine, there
could be a lot more to find.

00:07:32.860 --> 00:07:35.400 align:middle line:84%
So we're going to continue
to dig into that before we

00:07:35.400 --> 00:07:37.470 align:middle line:90%
start really exploiting.

00:07:37.470 --> 00:07:41.280 align:middle line:84%
But this file upload and file
download, it's quite useful.

00:07:41.280 --> 00:07:44.330 align:middle line:90%
And we'll come back to it later.

00:07:44.330 --> 00:07:45.000 align:middle line:90%