WEBVTT

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


00:00:05.808 --> 00:00:08.712 align:middle line:90%
[MUSIC PLAYING]

00:00:08.712 --> 00:00:10.170 align:middle line:90%


00:00:10.170 --> 00:00:14.460 align:middle line:84%
DNS zone transfers-- welcome
to the active information

00:00:14.460 --> 00:00:17.590 align:middle line:84%
gathering phase or
section of this course.

00:00:17.590 --> 00:00:20.880 align:middle line:84%
We're going to be starting off
by taking a look at the DNS

00:00:20.880 --> 00:00:22.530 align:middle line:90%
zone transfers.

00:00:22.530 --> 00:00:25.110 align:middle line:84%
Now, before we do that, we
need to get an understanding as

00:00:25.110 --> 00:00:29.670 align:middle line:84%
to what DNS is, and how DNS
servers or name servers work,

00:00:29.670 --> 00:00:31.830 align:middle line:84%
and more specifically,
how they can

00:00:31.830 --> 00:00:34.800 align:middle line:84%
be abused by attackers
or penetration testers

00:00:34.800 --> 00:00:40.170 align:middle line:84%
to obtain more records
from said DNS server

00:00:40.170 --> 00:00:44.640 align:middle line:84%
for a specific domain or
target, if you will, but more

00:00:44.640 --> 00:00:46.380 align:middle line:90%
specifically, a domain.

00:00:46.380 --> 00:00:48.840 align:middle line:90%
All right, so what is DNS?

00:00:48.840 --> 00:00:50.490 align:middle line:84%
And there's a good
reason why I'm

00:00:50.490 --> 00:00:52.770 align:middle line:84%
covered I'm covering
this now, as opposed

00:00:52.770 --> 00:00:55.830 align:middle line:84%
to when we were performing
passive DNS reconnaissance.

00:00:55.830 --> 00:00:59.220 align:middle line:84%
Well, DNS stands for
Domain Name System.

00:00:59.220 --> 00:01:02.730 align:middle line:84%
It is a protocol that is used
to resolve domain names or host

00:01:02.730 --> 00:01:04.569 align:middle line:90%
names to IP addresses.

00:01:04.569 --> 00:01:06.040 align:middle line:90%
Now, why is that important?

00:01:06.040 --> 00:01:08.550 align:middle line:84%
Well, during the early
days of the internet,

00:01:08.550 --> 00:01:11.730 align:middle line:84%
users would have to remember
the IP addresses of the sites

00:01:11.730 --> 00:01:13.680 align:middle line:90%
that they wanted to visit.

00:01:13.680 --> 00:01:16.650 align:middle line:84%
Because when you type in
google.com into your browser--

00:01:16.650 --> 00:01:19.080 align:middle line:90%
into a modern web browser--

00:01:19.080 --> 00:01:22.320 align:middle line:84%
your web browser really doesn't
know what google.com is,

00:01:22.320 --> 00:01:28.380 align:middle line:84%
because the actual server
that's hosting the website

00:01:28.380 --> 00:01:32.895 align:middle line:84%
doesn't have a domain name or
cannot be natively accessed via

00:01:32.895 --> 00:01:33.990 align:middle line:90%
a domain name.

00:01:33.990 --> 00:01:35.790 align:middle line:90%
It has an IP address.

00:01:35.790 --> 00:01:37.770 align:middle line:84%
And that's how you
typically interact with it

00:01:37.770 --> 00:01:39.130 align:middle line:90%
on a network level.

00:01:39.130 --> 00:01:41.640 align:middle line:84%
Well, this is where
DNS comes into play.

00:01:41.640 --> 00:01:44.610 align:middle line:84%
So DNS was essentially
created to solve this issue,

00:01:44.610 --> 00:01:46.530 align:middle line:90%
among many other issues.

00:01:46.530 --> 00:01:48.990 align:middle line:84%
But it essentially
allows your browser

00:01:48.990 --> 00:01:54.270 align:middle line:84%
to resolve an IP address or a
domain name to an IP address.

00:01:54.270 --> 00:01:57.000 align:middle line:84%
So when you type in
google.com in your browser,

00:01:57.000 --> 00:01:59.610 align:middle line:84%
your browser says,
OK, google.com.

00:01:59.610 --> 00:02:02.280 align:middle line:84%
It then makes a request
to the DNS server

00:02:02.280 --> 00:02:04.780 align:middle line:84%
that your system has
been configured to use.

00:02:04.780 --> 00:02:09.660 align:middle line:84%
And it says, hey, this user here
is trying to access google.com.

00:02:09.660 --> 00:02:12.390 align:middle line:84%
Could you please tell me
the IP address of google.com

00:02:12.390 --> 00:02:16.240 align:middle line:84%
so that I can make a
request to that IP address?

00:02:16.240 --> 00:02:19.080 align:middle line:84%
And then, the DNS service
says, OK, google.com--

00:02:19.080 --> 00:02:19.890 align:middle line:90%
I have that here.

00:02:19.890 --> 00:02:21.990 align:middle line:90%
Here's the IP address.

00:02:21.990 --> 00:02:23.860 align:middle line:84%
And the browser then
makes the request.

00:02:23.860 --> 00:02:27.090 align:middle line:84%
The web server then
responds with the web page,

00:02:27.090 --> 00:02:30.060 align:middle line:84%
and it's then rendered
in your browser.

00:02:30.060 --> 00:02:34.500 align:middle line:84%
So as I said, during
the early days,

00:02:34.500 --> 00:02:37.370 align:middle line:84%
when you had to type
in IP addresses--

00:02:37.370 --> 00:02:39.450 align:middle line:84%
IP addresses are very
difficult to remember,

00:02:39.450 --> 00:02:40.830 align:middle line:90%
because they're numbers.

00:02:40.830 --> 00:02:44.350 align:middle line:84%
And human beings remember
names instead of numbers,

00:02:44.350 --> 00:02:46.420 align:middle line:84%
so that's why we
have domain names.

00:02:46.420 --> 00:02:48.780 align:middle line:90%
So google.com is a domain name.

00:02:48.780 --> 00:02:49.830 align:middle line:90%
Easy to remember.

00:02:49.830 --> 00:02:54.330 align:middle line:84%
You'll pretty much never forget
it for the rest of your life.

00:02:54.330 --> 00:02:57.810 align:middle line:84%
It's much easier to remember
an address like google.com

00:02:57.810 --> 00:03:03.790 align:middle line:84%
instead of 172.56.91.2,
or whatever the case.

00:03:03.790 --> 00:03:07.110 align:middle line:84%
So what is a DNS server,
also known as a name server?

00:03:07.110 --> 00:03:08.760 align:middle line:84%
Well, a DNS server
is essentially

00:03:08.760 --> 00:03:11.490 align:middle line:84%
like a telephone
directory that contains

00:03:11.490 --> 00:03:14.100 align:middle line:84%
domain names and their
corresponding IP addresses

00:03:14.100 --> 00:03:19.320 align:middle line:84%
amongst or among
many other records.

00:03:19.320 --> 00:03:25.980 align:middle line:84%
So believe it or not, you
currently use a DNS server.

00:03:25.980 --> 00:03:29.290 align:middle line:84%
Right now, where
or what DNS server

00:03:29.290 --> 00:03:31.290 align:middle line:90%
you use is primarily based--

00:03:31.290 --> 00:03:36.640 align:middle line:84%
or is primarily dependent on
your internet service provider.

00:03:36.640 --> 00:03:39.420 align:middle line:84%
So if you ever log
in to your router,

00:03:39.420 --> 00:03:42.510 align:middle line:84%
you should see that a
DNS server IP address

00:03:42.510 --> 00:03:43.630 align:middle line:90%
has been provided there.

00:03:43.630 --> 00:03:48.120 align:middle line:84%
So that means that all requests
going through that router

00:03:48.120 --> 00:03:51.720 align:middle line:84%
will essentially go through--
or all requests will

00:03:51.720 --> 00:03:53.770 align:middle line:90%
be made to that DNS server.

00:03:53.770 --> 00:03:56.760 align:middle line:84%
Now, there are a plethora
of public DNS servers

00:03:56.760 --> 00:03:59.370 align:middle line:84%
that have been set up by
companies like Cloudflare.

00:03:59.370 --> 00:04:02.940 align:middle line:84%
Their DNS server
address is 1.1.1.1.

00:04:02.940 --> 00:04:08.400 align:middle line:84%
And Google, for example,
their DNS server is 8.8.8.8.

00:04:08.400 --> 00:04:10.260 align:middle line:84%
These DNS servers
are very popular,

00:04:10.260 --> 00:04:13.470 align:middle line:84%
primarily because they contain
records of almost all domains

00:04:13.470 --> 00:04:14.560 align:middle line:90%
on the internet.

00:04:14.560 --> 00:04:16.860 align:middle line:90%
So again, the domain--

00:04:16.860 --> 00:04:19.200 align:middle line:84%
the actual DNS service
provided to you

00:04:19.200 --> 00:04:26.160 align:middle line:84%
by your ISP pretty much
contained most or all of the--

00:04:26.160 --> 00:04:28.470 align:middle line:84%
they contain records
of almost all

00:04:28.470 --> 00:04:30.120 align:middle line:90%
of the domains on the internet.

00:04:30.120 --> 00:04:32.400 align:middle line:84%
But individuals
typically utilize

00:04:32.400 --> 00:04:33.630 align:middle line:90%
Cloudflare, like myself.

00:04:33.630 --> 00:04:36.180 align:middle line:84%
So within your
operating system, you

00:04:36.180 --> 00:04:38.160 align:middle line:84%
can actually configure
what DNS server

00:04:38.160 --> 00:04:39.420 align:middle line:90%
you want to use for requests.

00:04:39.420 --> 00:04:43.290 align:middle line:84%
So on Windows, you can click
on the Networking options

00:04:43.290 --> 00:04:47.040 align:middle line:84%
and modify your adaptor
options to essentially make

00:04:47.040 --> 00:04:51.060 align:middle line:84%
requests to any of
these public DNS

00:04:51.060 --> 00:04:55.180 align:middle line:84%
servers provided to you by
Cloudflare or by Google,

00:04:55.180 --> 00:04:56.160 align:middle line:90%
for example.

00:04:56.160 --> 00:04:59.550 align:middle line:84%
Or you can use the default
ones set or configured

00:04:59.550 --> 00:05:02.500 align:middle line:84%
within your default
gateway or your router,

00:05:02.500 --> 00:05:07.140 align:middle line:84%
which I'm going assume is going
to be the case for most of you.

00:05:07.140 --> 00:05:11.670 align:middle line:84%
All right, so what is
typically contained

00:05:11.670 --> 00:05:14.520 align:middle line:84%
on a DNS server
or a name server,

00:05:14.520 --> 00:05:16.680 align:middle line:90%
for lack of a better word?

00:05:16.680 --> 00:05:18.960 align:middle line:90%
Well, we have records.

00:05:18.960 --> 00:05:22.450 align:middle line:84%
So I've mentioned these
records previously

00:05:22.450 --> 00:05:24.340 align:middle line:84%
during the passive
information gathering

00:05:24.340 --> 00:05:25.690 align:middle line:90%
section of this course.

00:05:25.690 --> 00:05:30.220 align:middle line:84%
So we typically-- these
are a list of DNS records.

00:05:30.220 --> 00:05:32.720 align:middle line:84%
It's not by any
means exhaustive,

00:05:32.720 --> 00:05:35.680 align:middle line:84%
but we typically have A
records, which resolve

00:05:35.680 --> 00:05:37.990 align:middle line:90%
a hostname to a domain name--

00:05:37.990 --> 00:05:42.650 align:middle line:84%
or sorry-- resolve a hostname or
domain name to an IPv4 address.

00:05:42.650 --> 00:05:47.410 align:middle line:84%
So when we were utilizing
DNS recon or a tool like host

00:05:47.410 --> 00:05:51.520 align:middle line:84%
can be typed in, for example,
hosthackersploit.org.

00:05:51.520 --> 00:05:54.970 align:middle line:84%
It would essentially
provide us with the A record

00:05:54.970 --> 00:05:57.760 align:middle line:84%
for that domain name,
which is the IPv4 address.

00:05:57.760 --> 00:06:02.560 align:middle line:84%
When you see the AAAA record,
that resolves the hostname

00:06:02.560 --> 00:06:04.300 align:middle line:90%
to an IPv6 address.

00:06:04.300 --> 00:06:07.900 align:middle line:84%
When you see NS,
that's essentially

00:06:07.900 --> 00:06:09.730 align:middle line:90%
reference to the domain--

00:06:09.730 --> 00:06:12.440 align:middle line:90%
the actual domain name server.

00:06:12.440 --> 00:06:14.980 align:middle line:84%
You then have the MX record,
which resolves the domain

00:06:14.980 --> 00:06:16.210 align:middle line:90%
to a mail server.

00:06:16.210 --> 00:06:20.140 align:middle line:84%
We then have CNAME, which
is used for domain aliases.

00:06:20.140 --> 00:06:22.330 align:middle line:90%
TXT is a text record.

00:06:22.330 --> 00:06:26.350 align:middle line:84%
The HINFO-- that's used
for host information.

00:06:26.350 --> 00:06:27.460 align:middle line:90%
And then you have SOA--

00:06:27.460 --> 00:06:29.510 align:middle line:84%
the SOA record, which
is very important.

00:06:29.510 --> 00:06:31.330 align:middle line:90%
That is the domain authority.

00:06:31.330 --> 00:06:35.680 align:middle line:84%
You also have the SRV record,
which is the service records.

00:06:35.680 --> 00:06:38.440 align:middle line:84%
And then, of course, you have
PTR, which resolves an IP

00:06:38.440 --> 00:06:41.410 align:middle line:90%
address to a host name.

00:06:41.410 --> 00:06:47.560 align:middle line:84%
So these are records that are
typically-- that you typically

00:06:47.560 --> 00:06:50.530 align:middle line:84%
find whenever you're
dealing with DNS

00:06:50.530 --> 00:06:52.690 align:middle line:84%
or whenever you're performing
DNS reconnaissance,

00:06:52.690 --> 00:06:55.300 align:middle line:84%
regardless of whether
it's passive or active.

00:06:55.300 --> 00:06:59.530 align:middle line:90%
So what is DNS interrogation?

00:06:59.530 --> 00:07:01.450 align:middle line:84%
Because what we are
primarily doing here

00:07:01.450 --> 00:07:03.190 align:middle line:90%
is performing DNS interrogation.

00:07:03.190 --> 00:07:06.610 align:middle line:84%
Now, remember, this is an
active reconnaissance technique.

00:07:06.610 --> 00:07:09.970 align:middle line:84%
DNS interrogation is the process
of enumerating DNS records

00:07:09.970 --> 00:07:11.380 align:middle line:90%
for a specific domain.

00:07:11.380 --> 00:07:15.490 align:middle line:84%
Now, we had done this
previously with tools or sites

00:07:15.490 --> 00:07:17.110 align:middle line:90%
like DNSdumpster.

00:07:17.110 --> 00:07:19.430 align:middle line:90%
However, the process with that--

00:07:19.430 --> 00:07:23.590 align:middle line:84%
the problem with that is that
will only give you so much

00:07:23.590 --> 00:07:26.740 align:middle line:84%
with regards to A
records or MX records.

00:07:26.740 --> 00:07:28.510 align:middle line:84%
The objective of
DNS interrogation

00:07:28.510 --> 00:07:30.460 align:middle line:84%
is to probe a DNS
server to provide us

00:07:30.460 --> 00:07:32.920 align:middle line:84%
with DNS records for
a specific domain,

00:07:32.920 --> 00:07:35.920 align:middle line:84%
more specifically, additional
records that we might not

00:07:35.920 --> 00:07:38.570 align:middle line:90%
have had access to previously.

00:07:38.570 --> 00:07:41.290 align:middle line:84%
Now, this process can provide
us with important information

00:07:41.290 --> 00:07:43.990 align:middle line:84%
like the IP address of
a domain, subdomains,

00:07:43.990 --> 00:07:47.300 align:middle line:84%
or mail server addresses,
et cetera, et cetera.

00:07:47.300 --> 00:07:48.460 align:middle line:90%
Now, how can this--

00:07:48.460 --> 00:07:53.020 align:middle line:84%
how can we obtain more
records from a DNS server

00:07:53.020 --> 00:07:55.150 align:middle line:84%
with regards to a
particular domain?

00:07:55.150 --> 00:07:58.310 align:middle line:84%
This is where DNS zone
transfers come into play.

00:07:58.310 --> 00:08:01.330 align:middle line:84%
So in certain cases,
DNS server admins

00:08:01.330 --> 00:08:06.280 align:middle line:84%
may want to copy or transfer
zone files from one DNS server

00:08:06.280 --> 00:08:06.850 align:middle line:90%
to another.

00:08:06.850 --> 00:08:09.580 align:middle line:84%
A zone file is
essentially a file

00:08:09.580 --> 00:08:14.050 align:middle line:84%
that contains records pertinent
to a particular domain.

00:08:14.050 --> 00:08:16.090 align:middle line:84%
And when they want
to do this, they

00:08:16.090 --> 00:08:20.770 align:middle line:84%
utilize a functionality
called a zone transfer.

00:08:20.770 --> 00:08:24.670 align:middle line:84%
Now, if this is left
misconfigured and unsecured,

00:08:24.670 --> 00:08:27.670 align:middle line:84%
this functionality can
be abused by attackers

00:08:27.670 --> 00:08:30.760 align:middle line:84%
to copy the zone file from
the primary DNS server

00:08:30.760 --> 00:08:35.210 align:middle line:84%
to another DNS server,
typically our own.

00:08:35.210 --> 00:08:39.039 align:middle line:84%
And a DNS zone transfer can
provide penetration testers

00:08:39.039 --> 00:08:42.970 align:middle line:84%
or provide us with a holistic
view of an organization's

00:08:42.970 --> 00:08:44.920 align:middle line:90%
network layout.

00:08:44.920 --> 00:08:47.740 align:middle line:84%
Furthermore, in certain cases,
internal network addresses

00:08:47.740 --> 00:08:50.920 align:middle line:84%
may be found on an
organization's DNS servers.

00:08:50.920 --> 00:08:53.860 align:middle line:84%
So we may be able to find
additional subdomains

00:08:53.860 --> 00:08:57.170 align:middle line:84%
for the company's internal
network, et cetera, et cetera.

00:08:57.170 --> 00:08:58.870 align:middle line:84%
This is something
that you'll see.

00:08:58.870 --> 00:09:01.970 align:middle line:84%
We will be targeting the
zonetransfer.me website.

00:09:01.970 --> 00:09:04.600 align:middle line:84%
So again, you can do this
on your own Kali Linux

00:09:04.600 --> 00:09:07.100 align:middle line:84%
VM or your own penetration
testing distribution.

00:09:07.100 --> 00:09:09.850 align:middle line:84%
I'm just going to switch
over to my Kali Linux VM,

00:09:09.850 --> 00:09:11.710 align:middle line:90%
and we can get started.

00:09:11.710 --> 00:09:13.258 align:middle line:84%
This will make
sense as we actually

00:09:13.258 --> 00:09:14.800 align:middle line:84%
go through the
process, and I'll just

00:09:14.800 --> 00:09:18.670 align:middle line:84%
show you the difference between
performing passive DNS recon

00:09:18.670 --> 00:09:20.073 align:middle line:90%
and active DNS recon.

00:09:20.073 --> 00:09:21.490 align:middle line:84%
And then, we'll
take a look at how

00:09:21.490 --> 00:09:25.000 align:middle line:84%
to perform a DNS zone
transfer to obtain

00:09:25.000 --> 00:09:30.310 align:middle line:84%
more information or more records
from a DNS server regarding

00:09:30.310 --> 00:09:31.700 align:middle line:90%
a particular domain.

00:09:31.700 --> 00:09:34.500 align:middle line:90%
So I'll just switch over.

00:09:34.500 --> 00:09:37.320 align:middle line:84%
All right, so I'm back
on my Kali Linux VM.

00:09:37.320 --> 00:09:41.320 align:middle line:84%
And I'm currently on the
zonetransfer.me website.

00:09:41.320 --> 00:09:43.530 align:middle line:84%
So as you can see,
this website was set up

00:09:43.530 --> 00:09:47.400 align:middle line:84%
to teach students
about DNS security

00:09:47.400 --> 00:09:51.870 align:middle line:84%
and, more specifically, problems
related to DNS zone transfers.

00:09:51.870 --> 00:09:56.160 align:middle line:84%
So again, this is a really,
really cool resource

00:09:56.160 --> 00:09:57.100 align:middle line:90%
that you can use.

00:09:57.100 --> 00:09:59.730 align:middle line:84%
It's publicly available,
and they've provided you

00:09:59.730 --> 00:10:02.070 align:middle line:90%
with permission to use it.

00:10:02.070 --> 00:10:04.290 align:middle line:84%
So you should be
good on that front.

00:10:04.290 --> 00:10:06.660 align:middle line:84%
So again, this will
give you a rundown

00:10:06.660 --> 00:10:09.990 align:middle line:84%
as how to perform a DNS zone
transfer with a utility called

00:10:09.990 --> 00:10:12.360 align:middle line:84%
a Dig, which we
will be exploring.

00:10:12.360 --> 00:10:18.390 align:middle line:84%
Now, if we go to dnsdumpster.com
and we type in zonetransfer.me,

00:10:18.390 --> 00:10:20.070 align:middle line:90%
which is the target website--

00:10:20.070 --> 00:10:22.110 align:middle line:90%
so zonetransfer.me.

00:10:22.110 --> 00:10:24.630 align:middle line:84%
And I'll just click
on Search there.

00:10:24.630 --> 00:10:27.480 align:middle line:84%
You'll see that it's
going to provide us

00:10:27.480 --> 00:10:30.820 align:middle line:84%
with the DNS servers, or the
name servers, if you will.

00:10:30.820 --> 00:10:34.230 align:middle line:84%
So this is the primary one, and
then there is a secondary one.

00:10:34.230 --> 00:10:38.790 align:middle line:84%
And it provides us with both of
the name server or DNS server

00:10:38.790 --> 00:10:40.500 align:middle line:90%
IP addresses.

00:10:40.500 --> 00:10:43.920 align:middle line:84%
And then it provides us with
records like the MX records,

00:10:43.920 --> 00:10:47.910 align:middle line:84%
which is used to resolve mail
servers, and then TXT records

00:10:47.910 --> 00:10:51.520 align:middle line:84%
and the hostrecords,
which are A records here.

00:10:51.520 --> 00:10:54.390 align:middle line:84%
So you can see passively,
this really doesn't give us

00:10:54.390 --> 00:10:55.440 align:middle line:90%
much information.

00:10:55.440 --> 00:10:59.180 align:middle line:84%
And the same can be obtained
with a tool like DNSrecon.

00:10:59.180 --> 00:11:05.910 align:middle line:84%
So we say, dnsrecon,
d, zonetransfer.me.

00:11:05.910 --> 00:11:10.720 align:middle line:90%


00:11:10.720 --> 00:11:12.220 align:middle line:84%
We'll give this a
couple of seconds.

00:11:12.220 --> 00:11:13.910 align:middle line:90%
And I'll just zoom in here.

00:11:13.910 --> 00:11:16.450 align:middle line:84%
So you can see, this will
give us more records.

00:11:16.450 --> 00:11:18.730 align:middle line:84%
But you'll actually
see what I'm talking

00:11:18.730 --> 00:11:20.150 align:middle line:90%
about in a couple of seconds.

00:11:20.150 --> 00:11:23.920 align:middle line:84%
So this will try and enumerate
all of the DNS records

00:11:23.920 --> 00:11:24.700 align:middle line:90%
that I mentioned.

00:11:24.700 --> 00:11:26.117 align:middle line:84%
And in this case,
it looks like we

00:11:26.117 --> 00:11:29.860 align:middle line:84%
have an error when it's
enumerating SRV records, which

00:11:29.860 --> 00:11:30.970 align:middle line:90%
is perfectly fine.

00:11:30.970 --> 00:11:33.020 align:middle line:90%
That's a problem with the tool.

00:11:33.020 --> 00:11:36.680 align:middle line:84%
But you can see, we get
the SOA record here.

00:11:36.680 --> 00:11:40.750 align:middle line:84%
So as you can see here,
that's the SOA record.

00:11:40.750 --> 00:11:43.180 align:middle line:84%
The SOA record is
the domain authority.

00:11:43.180 --> 00:11:47.050 align:middle line:84%
And then, of course, we have
the primary name server here

00:11:47.050 --> 00:11:50.260 align:middle line:84%
and then, of course, the
secondary name server.

00:11:50.260 --> 00:11:55.120 align:middle line:84%
So we have
nsztm1.digi.ninja and then

00:11:55.120 --> 00:11:58.810 align:middle line:84%
the corresponding IP address
for that particular name server.

00:11:58.810 --> 00:12:01.030 align:middle line:90%
And then, we have the MX--

00:12:01.030 --> 00:12:02.260 align:middle line:90%
the MX records here.

00:12:02.260 --> 00:12:06.390 align:middle line:84%
This is the mail server
for this particular domain.

00:12:06.390 --> 00:12:08.140 align:middle line:84%
And then, of course,
we have the A record,

00:12:08.140 --> 00:12:10.660 align:middle line:84%
which points to the IP
address of the web server

00:12:10.660 --> 00:12:16.630 align:middle line:84%
if it's not being protected
by a proxy or web application

00:12:16.630 --> 00:12:18.820 align:middle line:84%
firewall, which we covered
in the previous section

00:12:18.820 --> 00:12:20.630 align:middle line:90%
of this course.

00:12:20.630 --> 00:12:25.510 align:middle line:84%
Now, again, you can also utilize
other tools like, for example,

00:12:25.510 --> 00:12:28.040 align:middle line:84%
Dnsenum, which we'll
get to in a second.

00:12:28.040 --> 00:12:31.120 align:middle line:84%
So we type in dnsenum
and then help--

00:12:31.120 --> 00:12:33.190 align:middle line:84%
the reason why it
did not cover Dnsenum

00:12:33.190 --> 00:12:35.500 align:middle line:84%
is primarily because
this also performs

00:12:35.500 --> 00:12:39.310 align:middle line:84%
active DNS reconnaissance
which, again, is valid now

00:12:39.310 --> 00:12:41.950 align:middle line:84%
but was not valid when we
were performing passive DNS

00:12:41.950 --> 00:12:43.120 align:middle line:90%
reconnaissance.

00:12:43.120 --> 00:12:48.910 align:middle line:84%
So Dnsenum can essentially
enumerate the records

00:12:48.910 --> 00:12:50.900 align:middle line:90%
that are publicly available.

00:12:50.900 --> 00:12:54.250 align:middle line:84%
And in addition
to doing that, it

00:12:54.250 --> 00:12:57.670 align:middle line:84%
can also be used to
perform a DNS zone

00:12:57.670 --> 00:13:00.205 align:middle line:84%
transfer automatically,
which is really great.

00:13:00.205 --> 00:13:02.703 align:middle line:90%


00:13:02.703 --> 00:13:04.120 align:middle line:84%
And it can also
be used to perform

00:13:04.120 --> 00:13:09.070 align:middle line:84%
a DNS brute force, which can
be used to identify records--

00:13:09.070 --> 00:13:13.450 align:middle line:84%
more specifically, subdomains,
at least from my experience--

00:13:13.450 --> 00:13:16.120 align:middle line:84%
by performing a brute
force and trying

00:13:16.120 --> 00:13:18.862 align:middle line:90%
to identify records that way.

00:13:18.862 --> 00:13:20.320 align:middle line:84%
But that's not
something that we'll

00:13:20.320 --> 00:13:21.970 align:middle line:84%
be exploring in this
video because it's

00:13:21.970 --> 00:13:23.830 align:middle line:84%
beyond the scope of
what we are covering.

00:13:23.830 --> 00:13:26.830 align:middle line:84%
Now, one thing that I wanted to
point out that's very important

00:13:26.830 --> 00:13:31.360 align:middle line:84%
is before DNS, your
computer would typically

00:13:31.360 --> 00:13:32.740 align:middle line:90%
utilize the hosts file.

00:13:32.740 --> 00:13:35.980 align:middle line:84%
Now, the hosts file is present
on all operating systems.

00:13:35.980 --> 00:13:39.480 align:middle line:84%
On Linux, it's
stored under the--

00:13:39.480 --> 00:13:40.830 align:middle line:90%
let me just open it up with Vim.

00:13:40.830 --> 00:13:44.260 align:middle line:84%
It's stored under the etc,
and it's the hosts file here.

00:13:44.260 --> 00:13:47.760 align:middle line:84%
So if I open this up-- and
I'll just provide my password

00:13:47.760 --> 00:13:53.220 align:middle line:84%
with Kali-- this contains a
list of host names, firstly,

00:13:53.220 --> 00:13:56.700 align:middle line:84%
and their corresponding
IP addresses,

00:13:56.700 --> 00:14:00.830 align:middle line:84%
as well as domain names
and their corresponding IP

00:14:00.830 --> 00:14:01.330 align:middle line:90%
addresses.

00:14:01.330 --> 00:14:03.420 align:middle line:84%
Now, because we don't
really need the host file

00:14:03.420 --> 00:14:07.560 align:middle line:84%
in this case, you can see that
we don't have any mapped domain

00:14:07.560 --> 00:14:08.940 align:middle line:90%
names to IP addresses.

00:14:08.940 --> 00:14:13.350 align:middle line:84%
But that's one way that users
or individuals who are typically

00:14:13.350 --> 00:14:17.220 align:middle line:84%
navigating around the
issue of not having

00:14:17.220 --> 00:14:22.770 align:middle line:84%
a system to automatically
resolve domain names to IP

00:14:22.770 --> 00:14:23.290 align:middle line:90%
addresses.

00:14:23.290 --> 00:14:26.910 align:middle line:84%
So this is sort of like your
local DNS server, if you will.

00:14:26.910 --> 00:14:30.430 align:middle line:84%
But it's good not to think
about it in that way.

00:14:30.430 --> 00:14:32.100 align:middle line:90%
So I'll give you an example.

00:14:32.100 --> 00:14:35.100 align:middle line:84%
So let's say on
my local network,

00:14:35.100 --> 00:14:40.470 align:middle line:84%
the IP address of my router
is 192.168.1.1, which it is.

00:14:40.470 --> 00:14:45.600 align:middle line:84%
You can see it redirects me to
the admin panel of my router.

00:14:45.600 --> 00:14:48.140 align:middle line:84%
I need to remember this IP
address to access the admin

00:14:48.140 --> 00:14:48.640 align:middle line:90%
panel.

00:14:48.640 --> 00:14:51.180 align:middle line:84%
But I can also,
within my hosts file,

00:14:51.180 --> 00:14:53.970 align:middle line:84%
map this IP address
to a local domain.

00:14:53.970 --> 00:14:56.610 align:middle line:84%
Remember, this is local, which
means it cannot be accessed

00:14:56.610 --> 00:15:01.590 align:middle line:84%
on the internet because this
record is not present on public

00:15:01.590 --> 00:15:02.470 align:middle line:90%
DNS servers.

00:15:02.470 --> 00:15:06.600 align:middle line:84%
So in order to do this,
I would say 192.168.1.1,

00:15:06.600 --> 00:15:08.430 align:middle line:84%
and you can try this
on your own network.

00:15:08.430 --> 00:15:09.450 align:middle line:90%
And I can say--

00:15:09.450 --> 00:15:11.460 align:middle line:84%
I can map it to the
following local domain.

00:15:11.460 --> 00:15:14.430 align:middle line:90%
So I can say router.admin.

00:15:14.430 --> 00:15:16.090 align:middle line:84%
All right, so I'll
right and quit.

00:15:16.090 --> 00:15:21.180 align:middle line:84%
And now, if I open up a new tab
here and I say router.admin,

00:15:21.180 --> 00:15:24.160 align:middle line:84%
you can see it resolves
to that local IP address.

00:15:24.160 --> 00:15:26.280 align:middle line:84%
So you can now
see how DNS works.

00:15:26.280 --> 00:15:29.460 align:middle line:84%
And this is something that
I just wanted to point out.

00:15:29.460 --> 00:15:33.150 align:middle line:84%
So fairly simple to
understand, and we can actually

00:15:33.150 --> 00:15:35.640 align:middle line:84%
perform a few tests on it
before we take a look at how

00:15:35.640 --> 00:15:38.720 align:middle line:90%
to perform a DNS zone transfer.

00:15:38.720 --> 00:15:42.860 align:middle line:84%
So again, you can utilize
the hosts file whenever

00:15:42.860 --> 00:15:45.410 align:middle line:90%
you want to add custom--

00:15:45.410 --> 00:15:49.820 align:middle line:84%
or whenever you want to map
a specific domain to an IP

00:15:49.820 --> 00:15:50.370 align:middle line:90%
address.

00:15:50.370 --> 00:15:53.540 align:middle line:84%
So I'll just get
rid of that there,

00:15:53.540 --> 00:15:57.725 align:middle line:84%
because I don't really require
it, and I'll right and quit.

00:15:57.725 --> 00:15:59.600 align:middle line:84%
All right, so let's talk
about zone transfer.

00:15:59.600 --> 00:16:03.590 align:middle line:84%
So I'm just going to go
back to zonetransfer.me.

00:16:03.590 --> 00:16:08.450 align:middle line:84%
And you can see that the
domain is zonetransfer.me,

00:16:08.450 --> 00:16:14.150 align:middle line:84%
and the two name servers
are nsztm1.digi.ninja and

00:16:14.150 --> 00:16:16.310 align:middle line:90%
nsztn2.digi.ninja.

00:16:16.310 --> 00:16:18.480 align:middle line:84%
Feel free to use this
domain in your training,

00:16:18.480 --> 00:16:19.560 align:middle line:90%
et cetera, et cetera.

00:16:19.560 --> 00:16:22.490 align:middle line:84%
So we can easily perform
a DNS zone transfer.

00:16:22.490 --> 00:16:25.220 align:middle line:84%
Now, in order for this to work
as I mentioned in the slides,

00:16:25.220 --> 00:16:27.980 align:middle line:84%
the DNS zone transfer
functionality

00:16:27.980 --> 00:16:33.110 align:middle line:84%
must be enabled on any one of
those name servers, primarily,

00:16:33.110 --> 00:16:36.420 align:middle line:84%
the primary DNS server, or
name server, if you will.

00:16:36.420 --> 00:16:38.990 align:middle line:84%
Now, as I said, we can do
this automatically using

00:16:38.990 --> 00:16:40.820 align:middle line:90%
a tool called Dnsenum.

00:16:40.820 --> 00:16:47.640 align:middle line:84%
And we can say dnsenum
zonetransfer.me and hit Enter.

00:16:47.640 --> 00:16:50.320 align:middle line:84%
All right, so we'll give
this a couple of seconds

00:16:50.320 --> 00:16:52.283 align:middle line:84%
and the reason for
that is very important.

00:16:52.283 --> 00:16:54.700 align:middle line:84%
All right, so it's performing
a brute force automatically,

00:16:54.700 --> 00:16:56.560 align:middle line:84%
which is not something
that I wanted to do.

00:16:56.560 --> 00:16:58.540 align:middle line:84%
But I'll explain a
couple of things.

00:16:58.540 --> 00:17:00.930 align:middle line:84%
So you can see
that, firstly, it'll

00:17:00.930 --> 00:17:04.410 align:middle line:84%
give you what we could
publicly access previously

00:17:04.410 --> 00:17:05.760 align:middle line:90%
or passively access.

00:17:05.760 --> 00:17:06.869 align:middle line:90%
We have the host address.

00:17:06.869 --> 00:17:09.450 align:middle line:84%
This is the A record,
which points to the IP

00:17:09.450 --> 00:17:10.839 align:middle line:90%
address of the web server.

00:17:10.839 --> 00:17:14.099 align:middle line:84%
You then have the name servers
here and their respective IP

00:17:14.099 --> 00:17:14.940 align:middle line:90%
addresses.

00:17:14.940 --> 00:17:16.810 align:middle line:84%
And then you have
the mail servers.

00:17:16.810 --> 00:17:20.010 align:middle line:84%
Now, it's going to try and
perform a zone transfer

00:17:20.010 --> 00:17:22.050 align:middle line:90%
and will get the bind versions.

00:17:22.050 --> 00:17:25.050 align:middle line:84%
Now, you can see the zone
transfer is successful,

00:17:25.050 --> 00:17:28.890 align:middle line:84%
and it performs it on this
particular name server.

00:17:28.890 --> 00:17:30.690 align:middle line:84%
And it provides us
with all the records

00:17:30.690 --> 00:17:32.710 align:middle line:84%
that were stored on
that name server.

00:17:32.710 --> 00:17:36.510 align:middle line:84%
So now, in addition to
getting just this information

00:17:36.510 --> 00:17:39.540 align:middle line:84%
like these A records
and MX records,

00:17:39.540 --> 00:17:42.340 align:middle line:84%
you can see we get
other records here.

00:17:42.340 --> 00:17:45.540 align:middle line:84%
So for example, we have a few
TXT records that we could not

00:17:45.540 --> 00:17:47.350 align:middle line:90%
access previously.

00:17:47.350 --> 00:17:49.500 align:middle line:90%
We also get a PTR record.

00:17:49.500 --> 00:17:52.030 align:middle line:90%
We get a subdomain here.

00:17:52.030 --> 00:17:55.890 align:middle line:84%
And in this case, we'll
actually get into that.

00:17:55.890 --> 00:17:58.440 align:middle line:84%
But for example, this one
looks potentially interesting.

00:17:58.440 --> 00:18:01.630 align:middle line:84%
So it looks like they had
a subdomain called canberra

00:18:01.630 --> 00:18:02.910 align:middle line:90%
office.zonetransfer.me.

00:18:02.910 --> 00:18:05.400 align:middle line:84%
The A record points
to this particular IP.

00:18:05.400 --> 00:18:09.060 align:middle line:84%
So that's something that we
couldn't identify previously,

00:18:09.060 --> 00:18:11.670 align:middle line:84%
and that's something
that we also could not

00:18:11.670 --> 00:18:16.170 align:middle line:84%
identify by performing
subdomain enumeration

00:18:16.170 --> 00:18:19.030 align:middle line:84%
with a tool like Sublist3r,
which was doing it passively.

00:18:19.030 --> 00:18:21.917 align:middle line:84%
So you can see that we
aren't able to access this

00:18:21.917 --> 00:18:24.000 align:middle line:84%
on the internet, which
pretty much means that this

00:18:24.000 --> 00:18:26.610 align:middle line:90%
is an internal DNS record.

00:18:26.610 --> 00:18:28.650 align:middle line:84%
So this could possibly
be referring to--

00:18:28.650 --> 00:18:31.500 align:middle line:84%
or this could possibly be
pointing to an IP address

00:18:31.500 --> 00:18:33.610 align:middle line:84%
within the company's
internal network,

00:18:33.610 --> 00:18:37.000 align:middle line:90%
which is a huge security issue.

00:18:37.000 --> 00:18:40.170 align:middle line:84%
We also have the
following record,

00:18:40.170 --> 00:18:43.980 align:middle line:84%
which is a TXT record, which
essentially just provides us

00:18:43.980 --> 00:18:45.370 align:middle line:90%
with the following information.

00:18:45.370 --> 00:18:49.890 align:middle line:84%
In this case, it's
cmdexec.zonetransfer.me.

00:18:49.890 --> 00:18:52.020 align:middle line:90%
We can try and access that.

00:18:52.020 --> 00:18:55.260 align:middle line:84%
And of course, this is-- you
can see, server not found, which

00:18:55.260 --> 00:18:57.780 align:middle line:84%
makes sense, because
that's a TXT record.

00:18:57.780 --> 00:19:01.470 align:middle line:84%
And you can see there are a
couple of interesting pieces

00:19:01.470 --> 00:19:06.190 align:middle line:84%
of information that have been
added in the TXT records here.

00:19:06.190 --> 00:19:07.520 align:middle line:90%
So for example, Hi.

00:19:07.520 --> 00:19:09.270 align:middle line:84%
As I said, this was
set up to show you how

00:19:09.270 --> 00:19:12.030 align:middle line:90%
to perform a DNS zone transfer.

00:19:12.030 --> 00:19:17.970 align:middle line:84%
So you can see that
we have a few--

00:19:17.970 --> 00:19:20.520 align:middle line:84%
these are the actual
name servers here.

00:19:20.520 --> 00:19:22.670 align:middle line:84%
And these are their
corresponding domains--

00:19:22.670 --> 00:19:26.430 align:middle line:84%
so internal.zonetransfer.me, me
which pretty much confirms what

00:19:26.430 --> 00:19:33.570 align:middle line:84%
we were already saying that some
of these subdomains may be--

00:19:33.570 --> 00:19:38.100 align:middle line:84%
some of these records may
be pointing or resolving

00:19:38.100 --> 00:19:41.500 align:middle line:84%
subdomains to internal network
addresses and vise versa.

00:19:41.500 --> 00:19:42.990 align:middle line:84%
And then, of course,
you can see we

00:19:42.990 --> 00:19:45.630 align:middle line:84%
have a couple of other
subdomains that point to A--

00:19:45.630 --> 00:19:53.880 align:middle line:84%
that our A records here, or
IPv6 addresses, or AAA records,

00:19:53.880 --> 00:19:56.140 align:middle line:90%
and so on and so forth.

00:19:56.140 --> 00:19:58.260 align:middle line:84%
We can also see
that, for example,

00:19:58.260 --> 00:20:02.880 align:middle line:84%
staging.zonetransfer.me has an
alias of sydneyoperahouse.com,

00:20:02.880 --> 00:20:06.250 align:middle line:84%
which means if we try and
access staging.zonetransfer.me--

00:20:06.250 --> 00:20:07.920 align:middle line:90%
and I think that this will work.

00:20:07.920 --> 00:20:11.520 align:middle line:84%
Because it's a CNAME
record, it'll redirect to--

00:20:11.520 --> 00:20:12.600 align:middle line:90%
let's see.

00:20:12.600 --> 00:20:15.720 align:middle line:84%
It will redirect to
sydneyoperahouse.com,

00:20:15.720 --> 00:20:18.030 align:middle line:84%
which in this case, it
looks like it failed.

00:20:18.030 --> 00:20:24.780 align:middle line:84%
But that could primarily
be because this

00:20:24.780 --> 00:20:27.240 align:middle line:90%
is an internal record.

00:20:27.240 --> 00:20:29.430 align:middle line:90%
Most of them appear to be--

00:20:29.430 --> 00:20:33.250 align:middle line:84%
that appears to be the
case for most of them.

00:20:33.250 --> 00:20:36.000 align:middle line:84%
And then, of course, you can see
there's a couple of other ones.

00:20:36.000 --> 00:20:38.280 align:middle line:84%
It also then performs
zone transfer

00:20:38.280 --> 00:20:40.900 align:middle line:84%
on this particular
name server here.

00:20:40.900 --> 00:20:42.750 align:middle line:84%
And in this case,
it looks like we

00:20:42.750 --> 00:20:45.090 align:middle line:84%
get a couple of
other records that we

00:20:45.090 --> 00:20:47.880 align:middle line:84%
weren't able to get
previously from this one.

00:20:47.880 --> 00:20:50.470 align:middle line:84%
Or it actually looks like it's
pretty much the same thing.

00:20:50.470 --> 00:20:51.840 align:middle line:90%
So nothing new there.

00:20:51.840 --> 00:20:56.050 align:middle line:84%
Or we can try and maybe
access office.zonetransfer.me.

00:20:56.050 --> 00:20:57.700 align:middle line:90%
But you get the idea.

00:20:57.700 --> 00:21:00.450 align:middle line:84%
This is very important
information, because,

00:21:00.450 --> 00:21:04.260 align:middle line:84%
as I said, if we are able to
get internal IP addresses,

00:21:04.260 --> 00:21:08.610 align:middle line:84%
then we pretty much are
getting a very good idea

00:21:08.610 --> 00:21:12.240 align:middle line:84%
as to what the internal network
infrastructure looks like.

00:21:12.240 --> 00:21:14.580 align:middle line:84%
And we're identifying
subdomains that

00:21:14.580 --> 00:21:17.770 align:middle line:84%
might be useful once we gain
access to the target network.

00:21:17.770 --> 00:21:23.520 align:middle line:84%
So that is how to perform a
DNS zone transfer with Dnsenum.

00:21:23.520 --> 00:21:26.580 align:middle line:84%
Now, you can also perform
a zone transfer with Dig.

00:21:26.580 --> 00:21:29.380 align:middle line:84%
If you're not familiar with
what Dig is, I can just type in,

00:21:29.380 --> 00:21:31.800 align:middle line:90%
for example, what is Dig?

00:21:31.800 --> 00:21:35.470 align:middle line:84%
And you can see, Dig is
a DNS lookup utility.

00:21:35.470 --> 00:21:38.340 align:middle line:84%
So you can take a look at
the usage instructions here.

00:21:38.340 --> 00:21:41.430 align:middle line:84%
We need to specify the
name server and then

00:21:41.430 --> 00:21:43.810 align:middle line:84%
the actual domain,
which is our target.

00:21:43.810 --> 00:21:48.230 align:middle line:84%
So we can essentially type
in dig and then axfr--

00:21:48.230 --> 00:21:50.660 align:middle line:84%
that is the zone
transfer switch.

00:21:50.660 --> 00:21:53.430 align:middle line:84%
And then, we specify the
actual name server here,

00:21:53.430 --> 00:21:57.660 align:middle line:84%
which in this case, let's see
if we can identify that there.

00:21:57.660 --> 00:22:01.440 align:middle line:90%
So let's try this one first.

00:22:01.440 --> 00:22:04.440 align:middle line:84%
And then, we have
zonetransfer.me.

00:22:04.440 --> 00:22:08.450 align:middle line:90%


00:22:08.450 --> 00:22:10.490 align:middle line:84%
All right, and as
you can see, we

00:22:10.490 --> 00:22:13.910 align:middle line:84%
have performed the DNS
zone transfer with Dig.

00:22:13.910 --> 00:22:17.900 align:middle line:84%
And I really like using Dig,
because the problem with a tool

00:22:17.900 --> 00:22:22.880 align:middle line:84%
like Dnsenum is it performs a
lot of checks and most of which

00:22:22.880 --> 00:22:24.860 align:middle line:84%
you can really control
and then goes ahead

00:22:24.860 --> 00:22:27.990 align:middle line:90%
and performs a DNS brute force.

00:22:27.990 --> 00:22:32.090 align:middle line:84%
But in this case, you can see we
get different types of records

00:22:32.090 --> 00:22:34.790 align:middle line:84%
that, firstly, we were able
to get publicly and then,

00:22:34.790 --> 00:22:37.440 align:middle line:90%
of course, internal ones here.

00:22:37.440 --> 00:22:40.580 align:middle line:84%
So yeah, that's how to
perform a DNS zone transfer.

00:22:40.580 --> 00:22:44.120 align:middle line:90%
And some of these may be public.

00:22:44.120 --> 00:22:47.420 align:middle line:90%
These domains may be--

00:22:47.420 --> 00:22:50.370 align:middle line:84%
some of these domains may be
accessible on the internet,

00:22:50.370 --> 00:22:52.460 align:middle line:84%
which means you can also
target them or add them

00:22:52.460 --> 00:22:55.200 align:middle line:84%
to the scope of the systems
that you're testing.

00:22:55.200 --> 00:22:57.270 align:middle line:84%
So you can test them
out for yourself.

00:22:57.270 --> 00:23:00.730 align:middle line:84%
So for example,
vpn.zonetransfer.me.

00:23:00.730 --> 00:23:01.730 align:middle line:90%
Let's see if that works.

00:23:01.730 --> 00:23:04.580 align:middle line:84%
Some of these servers may
not be hosting anything,

00:23:04.580 --> 00:23:07.220 align:middle line:84%
primarily because
that's not really

00:23:07.220 --> 00:23:10.130 align:middle line:90%
the objective of this project.

00:23:10.130 --> 00:23:13.310 align:middle line:84%
But yeah, that's how to
perform a DNS zone transfer.

00:23:13.310 --> 00:23:15.980 align:middle line:84%
Now, one thing I
want to point out

00:23:15.980 --> 00:23:20.930 align:middle line:84%
is, let's say we say a
dnsrecon d hackersploit.org.

00:23:20.930 --> 00:23:26.240 align:middle line:84%
Now, in my case, I'm
using Cloudflare as my--

00:23:26.240 --> 00:23:27.170 align:middle line:90%
I'm using Cloudflare.

00:23:27.170 --> 00:23:29.960 align:middle line:84%
So the name server
will point to--

00:23:29.960 --> 00:23:33.200 align:middle line:84%
the name servers
will essentially

00:23:33.200 --> 00:23:34.950 align:middle line:90%
be the Cloudflare name server.

00:23:34.950 --> 00:23:39.650 align:middle line:84%
So for example, if I wanted
to perform a DNS zone transfer

00:23:39.650 --> 00:23:42.770 align:middle line:84%
on hackersploit.org, maybe
with a tool like Dnsenum,

00:23:42.770 --> 00:23:44.150 align:middle line:90%
I could just specify that here.

00:23:44.150 --> 00:23:46.940 align:middle line:84%
And of course, this will fail,
because zone transfers have

00:23:46.940 --> 00:23:52.250 align:middle line:84%
been disabled or the Cloudflare,
name servers, or DNS servers

00:23:52.250 --> 00:23:55.040 align:middle line:84%
do not have that
option configured,

00:23:55.040 --> 00:23:57.260 align:middle line:84%
because they know how to
secure things correctly.

00:23:57.260 --> 00:23:59.240 align:middle line:84%
But if I type that
here, you can see

00:23:59.240 --> 00:24:01.280 align:middle line:90%
that the zone transfers fail.

00:24:01.280 --> 00:24:05.480 align:middle line:84%
And then, it'll start
performing a DNS brute force.

00:24:05.480 --> 00:24:09.320 align:middle line:84%
And you can actually view
the actual file or the word

00:24:09.320 --> 00:24:11.130 align:middle line:90%
list that is it is using.

00:24:11.130 --> 00:24:13.320 align:middle line:84%
And let me explain what's
happening on that front.

00:24:13.320 --> 00:24:16.220 align:middle line:84%
So if I cut out the
content of this file,

00:24:16.220 --> 00:24:17.900 align:middle line:90%
you can see that it's going to--

00:24:17.900 --> 00:24:20.450 align:middle line:84%
in this case, there's
quite a few words here.

00:24:20.450 --> 00:24:22.790 align:middle line:90%
And in my case--

00:24:22.790 --> 00:24:25.430 align:middle line:84%
in most cases, the
DNS brute force

00:24:25.430 --> 00:24:27.920 align:middle line:84%
can be used to identify
different types of records,

00:24:27.920 --> 00:24:31.760 align:middle line:84%
primarily subdomains, as
that makes the most sense.

00:24:31.760 --> 00:24:34.640 align:middle line:84%
And of course, you can
utilize a tool like Dnsenum,

00:24:34.640 --> 00:24:37.280 align:middle line:84%
or you can utilize
a tool like Fierce,

00:24:37.280 --> 00:24:38.670 align:middle line:90%
which I'll cover right now.

00:24:38.670 --> 00:24:40.250 align:middle line:84%
So let me just
clear my terminal.

00:24:40.250 --> 00:24:42.680 align:middle line:84%
And if I type in
fierce, you can see

00:24:42.680 --> 00:24:46.160 align:middle line:84%
that it doesn't give us any
information regarding the tool.

00:24:46.160 --> 00:24:47.350 align:middle line:90%
Does it have a main page?

00:24:47.350 --> 00:24:48.020 align:middle line:90%
No, it doesn't.

00:24:48.020 --> 00:24:54.620 align:middle line:84%
If I say fierce and I open
up the Help menu here,

00:24:54.620 --> 00:24:59.540 align:middle line:84%
you can see that Fierce is a
semi-lightweight scanner that

00:24:59.540 --> 00:25:02.720 align:middle line:84%
helps locate non-contagious
IP space in hostnames

00:25:02.720 --> 00:25:04.070 align:middle line:90%
against specific domains.

00:25:04.070 --> 00:25:05.870 align:middle line:84%
It is really meant
as a precursor

00:25:05.870 --> 00:25:09.890 align:middle line:84%
to Nmap, Unicorn scan,
Nessus, Nikto, et cetera.

00:25:09.890 --> 00:25:12.350 align:middle line:84%
Since all of those
require that you already

00:25:12.350 --> 00:25:15.950 align:middle line:84%
know what IP space
you're looking for,

00:25:15.950 --> 00:25:17.570 align:middle line:84%
this does not
perform exploitation

00:25:17.570 --> 00:25:20.480 align:middle line:84%
and does not scan the whole
internet indiscriminately.

00:25:20.480 --> 00:25:23.330 align:middle line:84%
It is meant specifically
to locate likely targets

00:25:23.330 --> 00:25:26.120 align:middle line:84%
both inside and outside
a corporate network.

00:25:26.120 --> 00:25:29.090 align:middle line:84%
Because it utilizes
DNS primarily,

00:25:29.090 --> 00:25:31.490 align:middle line:84%
you'll often find a
misconfigured networks

00:25:31.490 --> 00:25:33.290 align:middle line:84%
that leak internal
address space,

00:25:33.290 --> 00:25:37.310 align:middle line:84%
as we were able to
do with the zone

00:25:37.310 --> 00:25:40.040 align:middle line:90%
transfer-- for zonetransfer.me.

00:25:40.040 --> 00:25:43.740 align:middle line:84%
And that's specifically
useful in targeted malware.

00:25:43.740 --> 00:25:47.720 align:middle line:84%
So to perform the brute
force with Fierce,

00:25:47.720 --> 00:25:50.220 align:middle line:90%
it really is very, very simple.

00:25:50.220 --> 00:25:55.070 align:middle line:84%
You simply specify-- you simply
type in fierce and then dns,

00:25:55.070 --> 00:25:58.310 align:middle line:84%
and you can then say,
for example, example--

00:25:58.310 --> 00:26:03.470 align:middle line:84%
or in this case, we can
type in zonetransfer.me.

00:26:03.470 --> 00:26:06.260 align:middle line:84%
And this will not perform
a DNS zone transfer

00:26:06.260 --> 00:26:07.860 align:middle line:90%
and then specify the word list.

00:26:07.860 --> 00:26:11.570 align:middle line:84%
So if I hit Enter, it
performs the zone transfer,

00:26:11.570 --> 00:26:15.600 align:middle line:84%
but you can also disable
that if you wanted to.

00:26:15.600 --> 00:26:20.540 align:middle line:84%
So I believe there
is a switch for that.

00:26:20.540 --> 00:26:24.760 align:middle line:84%
So for example, if I wanted
to perform a DNS brute force

00:26:24.760 --> 00:26:29.380 align:middle line:84%
on hackersploit.org in order to
identify other records that we

00:26:29.380 --> 00:26:32.410 align:middle line:84%
might have missed and, more
specifically, subdomains,

00:26:32.410 --> 00:26:35.380 align:middle line:84%
you can see that the
DNS zone transfer fails.

00:26:35.380 --> 00:26:38.320 align:middle line:84%
And it's going to
check for wildcard DNS.

00:26:38.320 --> 00:26:41.140 align:middle line:84%
That, of course,
fails, and then it's

00:26:41.140 --> 00:26:44.680 align:middle line:84%
going to perform the
following amount of tests

00:26:44.680 --> 00:26:48.370 align:middle line:84%
based on the entries contained
within the default word list.

00:26:48.370 --> 00:26:50.050 align:middle line:84%
Now, this is going
to take a while.

00:26:50.050 --> 00:26:53.020 align:middle line:84%
And this is definitely
active information gathering,

00:26:53.020 --> 00:26:57.290 align:middle line:84%
because you're now actively
engaging with the target.

00:26:57.290 --> 00:26:59.410 align:middle line:84%
And you can see in
this case, it's already

00:26:59.410 --> 00:27:01.755 align:middle line:90%
been able to obtain subdomains.

00:27:01.755 --> 00:27:03.130 align:middle line:84%
And this is
something that we had

00:27:03.130 --> 00:27:05.740 align:middle line:84%
trouble with when we were
performing passive DNS

00:27:05.740 --> 00:27:06.670 align:middle line:90%
reconnaissance.

00:27:06.670 --> 00:27:08.776 align:middle line:90%
So it provides us with the--

00:27:08.776 --> 00:27:11.170 align:middle line:84%
in this case, it looks
like we have two A records

00:27:11.170 --> 00:27:14.650 align:middle line:84%
for community.hackersploit.org,
which probably means

00:27:14.650 --> 00:27:16.990 align:middle line:84%
that it is behind
a Cloudflare again

00:27:16.990 --> 00:27:21.370 align:middle line:84%
and that this isn't being
protected by a proxy.

00:27:21.370 --> 00:27:24.580 align:middle line:84%
So that is going to conclude
the practical demonstration

00:27:24.580 --> 00:27:26.830 align:middle line:90%
site of this video.

00:27:26.830 --> 00:27:33.360 align:middle line:84%
All right, so that concludes
the active DNS recon section

00:27:33.360 --> 00:27:34.270 align:middle line:90%
of this course.

00:27:34.270 --> 00:27:38.200 align:middle line:84%
We have covered DNS
reconnaissance quite a bit.

00:27:38.200 --> 00:27:39.840 align:middle line:84%
We're now going to
turn our attention

00:27:39.840 --> 00:27:42.480 align:middle line:90%
to performing scanning.

00:27:42.480 --> 00:27:44.400 align:middle line:84%
And more specifically,
we're going

00:27:44.400 --> 00:27:47.010 align:middle line:84%
to be starting off by
taking a look at how

00:27:47.010 --> 00:27:49.410 align:middle line:84%
to perform host
discovery on a network

00:27:49.410 --> 00:27:50.940 align:middle line:90%
that you've gained access to.

00:27:50.940 --> 00:27:54.030 align:middle line:84%
So we're now going to assume
that you have gained access

00:27:54.030 --> 00:27:56.190 align:middle line:90%
to a target network.

00:27:56.190 --> 00:27:59.580 align:middle line:84%
And this is pretty
much the case for when

00:27:59.580 --> 00:28:02.400 align:middle line:84%
you're performing a penetration
test on an internal network

00:28:02.400 --> 00:28:05.980 align:middle line:84%
and you're provided with
access to the internal network.

00:28:05.980 --> 00:28:08.700 align:middle line:84%
So your first objective
is to identify all systems

00:28:08.700 --> 00:28:09.580 align:middle line:90%
on the network.

00:28:09.580 --> 00:28:11.038 align:middle line:84%
And we're going to
be taking a look

00:28:11.038 --> 00:28:12.210 align:middle line:90%
at how to do this with Nmap.

00:28:12.210 --> 00:28:15.834 align:middle line:84%
So I'll be seeing you
in the next video.

00:28:15.834 --> 00:28:16.334 align:middle line:90%