WEBVTT

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


00:00:03.346 --> 00:00:06.692 align:middle line:90%
[MUSIC LOGO]

00:00:06.692 --> 00:00:10.520 align:middle line:90%


00:00:10.520 --> 00:00:13.910 align:middle line:84%
We're going to dive a little
deeper into SMB and Samba.

00:00:13.910 --> 00:00:16.920 align:middle line:84%
There is so much that you
can do with these services

00:00:16.920 --> 00:00:18.140 align:middle line:90%
and this protocol.

00:00:18.140 --> 00:00:24.470 align:middle line:84%
And even after all this, we've
only scratched the surface.

00:00:24.470 --> 00:00:28.520 align:middle line:84%
But got to start
you with something.

00:00:28.520 --> 00:00:29.540 align:middle line:90%
Look at our IP address.

00:00:29.540 --> 00:00:33.310 align:middle line:90%


00:00:33.310 --> 00:00:36.860 align:middle line:90%
Part of this 192.4.17.

00:00:36.860 --> 00:00:37.885 align:middle line:90%
It's our 24 network.

00:00:37.885 --> 00:00:40.480 align:middle line:90%


00:00:40.480 --> 00:00:52.010 align:middle line:84%
So to run an Nmap scan on the
.3, and we see 139 and 445.

00:00:52.010 --> 00:00:54.570 align:middle line:84%
Can you hit the I
Believe button with me

00:00:54.570 --> 00:01:00.240 align:middle line:90%
that they are indeed SMB Samba?

00:01:00.240 --> 00:01:05.880 align:middle line:84%
We're going to do
smb-enum-shares this time.

00:01:05.880 --> 00:01:07.170 align:middle line:90%
We've looked at shares before.

00:01:07.170 --> 00:01:24.500 align:middle line:90%


00:01:24.500 --> 00:01:27.937 align:middle line:84%
Helps if you have
a script in there.

00:01:27.937 --> 00:01:32.140 align:middle line:90%


00:01:32.140 --> 00:01:33.000 align:middle line:90%
There we are.

00:01:33.000 --> 00:01:35.640 align:middle line:90%
We see the shares.

00:01:35.640 --> 00:01:39.480 align:middle line:90%
We've got Aisha, Emma, IPC.

00:01:39.480 --> 00:01:46.580 align:middle line:90%


00:01:46.580 --> 00:01:49.160 align:middle line:90%
See its samba recon lab.

00:01:49.160 --> 00:01:52.050 align:middle line:90%


00:01:52.050 --> 00:01:55.890 align:middle line:84%
And you can even see
who has access to what.

00:01:55.890 --> 00:01:59.140 align:middle line:90%


00:01:59.140 --> 00:02:00.640 align:middle line:90%
A little bit.

00:02:00.640 --> 00:02:03.040 align:middle line:90%
Let's build on that.

00:02:03.040 --> 00:02:06.280 align:middle line:84%
Because all this stuff,
the sharers, the users,

00:02:06.280 --> 00:02:09.520 align:middle line:84%
who has access to read and
write, we can utilize that.

00:02:09.520 --> 00:02:10.630 align:middle line:90%
We can use that.

00:02:10.630 --> 00:02:15.940 align:middle line:90%
That's why we are enumerating.

00:02:15.940 --> 00:02:22.660 align:middle line:84%
Like, when someone in a heist
movie is casing a joint,

00:02:22.660 --> 00:02:27.160 align:middle line:84%
trying to figure out how to get
in, we're doing the same thing.

00:02:27.160 --> 00:02:32.185 align:middle line:84%
We need to find out all
of the possible ways in.

00:02:32.185 --> 00:02:35.210 align:middle line:90%


00:02:35.210 --> 00:02:41.810 align:middle line:84%
Then, there's another
enum-shares auxiliary scanner

00:02:41.810 --> 00:02:50.733 align:middle line:90%
set rhosts to our IP address.

00:02:50.733 --> 00:02:51.900 align:middle line:90%
Always good to show options.

00:02:51.900 --> 00:02:55.590 align:middle line:90%


00:02:55.590 --> 00:02:59.070 align:middle line:84%
Everything with a
Yes is filled in.

00:02:59.070 --> 00:03:04.150 align:middle line:84%
Most of it comes default,
the way the tool is set up.

00:03:04.150 --> 00:03:06.450 align:middle line:84%
Unless someone tells
you otherwise, trust it.

00:03:06.450 --> 00:03:09.360 align:middle line:90%


00:03:09.360 --> 00:03:11.220 align:middle line:84%
Unless you know
otherwise, trust it.

00:03:11.220 --> 00:03:16.810 align:middle line:90%


00:03:16.810 --> 00:03:20.440 align:middle line:84%
And it brings back
all those same shares.

00:03:20.440 --> 00:03:22.742 align:middle line:84%
Another way of
cracking that nut.

00:03:22.742 --> 00:03:24.325 align:middle line:84%
Presents it to you
in a different way.

00:03:24.325 --> 00:03:30.170 align:middle line:90%


00:03:30.170 --> 00:03:33.160 align:middle line:84%
We'll take a look at enum for
Linux, doing the same thing.

00:03:33.160 --> 00:03:34.840 align:middle line:90%
Tag capital S. We'll do shares.

00:03:34.840 --> 00:03:42.210 align:middle line:90%


00:03:42.210 --> 00:03:43.335 align:middle line:90%
There's our list.

00:03:43.335 --> 00:03:50.070 align:middle line:90%


00:03:50.070 --> 00:03:53.610 align:middle line:84%
Now, I'm presenting this to you
because it's not a tools class.

00:03:53.610 --> 00:03:55.560 align:middle line:90%
Pick the tool that you like.

00:03:55.560 --> 00:03:57.810 align:middle line:84%
Pick the tool that
you think is useful.

00:03:57.810 --> 00:04:00.345 align:middle line:84%
Maybe you try several
different tools.

00:04:00.345 --> 00:04:08.820 align:middle line:90%


00:04:08.820 --> 00:04:15.360 align:middle line:84%
And you'll figure out which
ones you like the most.

00:04:15.360 --> 00:04:19.079 align:middle line:84%
And we're going to list out
the shares with smbclient,

00:04:19.079 --> 00:04:21.390 align:middle line:90%
the tag L with a null session.

00:04:21.390 --> 00:04:22.997 align:middle line:90%
No password.

00:04:22.997 --> 00:04:23.955 align:middle line:90%
We've done that before.

00:04:23.955 --> 00:04:26.910 align:middle line:90%


00:04:26.910 --> 00:04:27.855 align:middle line:90%
Works fairly well.

00:04:27.855 --> 00:04:33.180 align:middle line:90%


00:04:33.180 --> 00:04:36.760 align:middle line:84%
Now, what we want to
find out is what groups.

00:04:36.760 --> 00:04:39.430 align:middle line:84%
Groups are a lot
like users or shares.

00:04:39.430 --> 00:04:47.290 align:middle line:84%
And in that, they can tell us
useful stuff about our target.

00:04:47.290 --> 00:04:49.990 align:middle line:90%


00:04:49.990 --> 00:04:52.930 align:middle line:84%
Who has different rights,
can do different things.

00:04:52.930 --> 00:04:55.840 align:middle line:84%
A user might not have access,
but being part of a group,

00:04:55.840 --> 00:04:57.100 align:middle line:90%
then they do have access.

00:04:57.100 --> 00:05:02.160 align:middle line:90%


00:05:02.160 --> 00:05:04.410 align:middle line:84%
And we see, there's two
groups-- there's maintainers,

00:05:04.410 --> 00:05:05.977 align:middle line:90%
and there's reserved.

00:05:05.977 --> 00:05:07.560 align:middle line:84%
We don't know exactly
what that means,

00:05:07.560 --> 00:05:10.140 align:middle line:84%
but we can write it
down, keep it for later.

00:05:10.140 --> 00:05:21.410 align:middle line:90%


00:05:21.410 --> 00:05:24.260 align:middle line:84%
Connect with our rpcclient
with a null session.

00:05:24.260 --> 00:05:30.880 align:middle line:90%


00:05:30.880 --> 00:05:35.330 align:middle line:84%
Because we saw that it
would connect before.

00:05:35.330 --> 00:05:36.710 align:middle line:90%
[INAUDIBLE] groups.

00:05:36.710 --> 00:05:41.640 align:middle line:90%


00:05:41.640 --> 00:05:45.180 align:middle line:84%
We see them again there,
maintain there, and reserved.

00:05:45.180 --> 00:05:47.108 align:middle line:90%
Some of these scripts are just--

00:05:47.108 --> 00:05:48.900 align:middle line:84%
or some of these programs
are just scripts,

00:05:48.900 --> 00:05:51.375 align:middle line:84%
doing the same thing and
pulling out the details.

00:05:51.375 --> 00:05:54.640 align:middle line:90%


00:05:54.640 --> 00:06:00.330 align:middle line:84%
Like, this looks the exact
same as what we just did,

00:06:00.330 --> 00:06:02.940 align:middle line:84%
without having to work
through rpcclient.

00:06:02.940 --> 00:06:08.380 align:middle line:90%


00:06:08.380 --> 00:06:12.110 align:middle line:84%
We can see if the server
is configured for printing.

00:06:12.110 --> 00:06:14.065 align:middle line:90%
Do enum for Linux.

00:06:14.065 --> 00:06:22.130 align:middle line:90%


00:06:22.130 --> 00:06:23.525 align:middle line:90%
With a tag i.

00:06:23.525 --> 00:06:32.940 align:middle line:90%


00:06:32.940 --> 00:06:35.680 align:middle line:84%
And we get back that no
printers were returned.

00:06:35.680 --> 00:06:37.335 align:middle line:90%
So there are no printers.

00:06:37.335 --> 00:06:42.180 align:middle line:90%


00:06:42.180 --> 00:06:46.360 align:middle line:84%
We saw before that
public was accessible.

00:06:46.360 --> 00:06:49.140 align:middle line:90%
Let's go back to smbclient.

00:06:49.140 --> 00:06:50.775 align:middle line:84%
This one actually
lets us connect.

00:06:50.775 --> 00:06:57.920 align:middle line:90%


00:06:57.920 --> 00:07:02.575 align:middle line:84%
And we'll connect to that
public with no password.

00:07:02.575 --> 00:07:06.750 align:middle line:90%


00:07:06.750 --> 00:07:08.730 align:middle line:90%
And we are in.

00:07:08.730 --> 00:07:11.280 align:middle line:90%
We can run help.

00:07:11.280 --> 00:07:14.325 align:middle line:84%
And a lot of our commands
are standard Linux commands.

00:07:14.325 --> 00:07:17.030 align:middle line:90%


00:07:17.030 --> 00:07:18.570 align:middle line:90%
We see that there's directories.

00:07:18.570 --> 00:07:19.445 align:middle line:90%
It's going to secret.

00:07:19.445 --> 00:07:23.680 align:middle line:90%


00:07:23.680 --> 00:07:26.560 align:middle line:84%
Run another listening
in cat flag.

00:07:26.560 --> 00:07:36.430 align:middle line:90%


00:07:36.430 --> 00:07:38.000 align:middle line:90%
How about we get the flag.

00:07:38.000 --> 00:07:44.266 align:middle line:90%


00:07:44.266 --> 00:07:52.460 align:middle line:84%
We'll leave that and now cat
flag because it's a share.

00:07:52.460 --> 00:07:55.520 align:middle line:84%
So all we did is we
downloaded with--

00:07:55.520 --> 00:08:01.040 align:middle line:84%
basically, we used get, which
is the API way of asking for it.

00:08:01.040 --> 00:08:04.220 align:middle line:90%


00:08:04.220 --> 00:08:08.096 align:middle line:84%
We downloaded it, and
then we took a look at it.

00:08:08.096 --> 00:08:08.940 align:middle line:90%
Pretty neat.

00:08:08.940 --> 00:08:12.620 align:middle line:84%
So we were able to
figure all that out

00:08:12.620 --> 00:08:19.430 align:middle line:84%
by knowing that we had
access with a null session.

00:08:19.430 --> 00:08:22.730 align:middle line:84%
Now, what if a null session
doesn't particularly

00:08:22.730 --> 00:08:25.430 align:middle line:90%
work in that same way?

00:08:25.430 --> 00:08:30.520 align:middle line:84%
We'll look at that one in the
next video, in the next lab.

00:08:30.520 --> 00:08:31.420 align:middle line:90%