WEBVTT

00:00:00.900 --> 00:00:04.000
Last on our list of things to talk about are Google

00:00:04.000 --> 00:00:06.540
engine hacks and some automation.

00:00:06.550 --> 00:00:09.440
We'll begin with a couple of basic Google dorks and a quick

00:00:09.440 --> 00:00:11.930
visit to the Google exploit database.

00:00:11.940 --> 00:00:15.880
Then, we'll take a look at MetaGooFil, theHarvester,

00:00:15.890 --> 00:00:18.800
and wrap things up with OWASP Amass.

00:00:20.810 --> 00:00:22.490
Let's begin with Google dorks.

00:00:22.500 --> 00:00:25.560
Google dorks are really nothing more than advanced searches

00:00:25.560 --> 00:00:28.870
that you can create to find all sorts of documents and

00:00:28.870 --> 00:00:30.590
information about your target.

00:00:30.600 --> 00:00:41.230
The URL for the Exploit DB is https://exploit‑db.com/google‑hacking‑database.

00:00:41.820 --> 00:00:45.920
This database is frequently updated and often includes searches that

00:00:45.920 --> 00:00:48.970
help identify default installations of products,

00:00:48.980 --> 00:00:51.190
which may use known credentials.

00:00:51.190 --> 00:00:54.300
For example, here's an entry for WampServer,

00:00:54.920 --> 00:00:58.115
which is a LAMP‑stack environment that it's meant

00:00:58.115 --> 00:01:00.695
to run on desktops and laptops.

00:01:00.975 --> 00:01:05.495
Finding this in the wild on an actual server means we may have found

00:01:05.495 --> 00:01:08.350
an easy entry point into someone's environment,

00:01:08.505 --> 00:01:13.695
as the credentials and security used by WampServer is documented and well known.

00:01:14.980 --> 00:01:18.950
You can use the Exploit DB as a starting point, but then improve on the dork.

00:01:18.960 --> 00:01:19.600
For example,

00:01:19.600 --> 00:01:22.470
we previously identified that Pluralsight might have a

00:01:22.470 --> 00:01:26.130
publicly‑facing remote desktop server that we may be able to

00:01:26.130 --> 00:01:28.160
attack later on in the engagement.

00:01:28.180 --> 00:01:29.620
Let's look for others.

00:01:30.070 --> 00:01:30.830
First,

00:01:30.830 --> 00:01:35.620
we can search Google dorks that somehow relate to the remote desktop protocol.

00:01:35.630 --> 00:01:40.860
Once we find what we're looking for, we can look at the actual dork itself.

00:01:40.870 --> 00:01:42.770
And if we run this dork as is,

00:01:42.780 --> 00:01:46.310
it will return all of the instances of publicly available,

00:01:46.320 --> 00:01:50.020
or I should say exploitable remote desktop instances.

00:01:50.030 --> 00:01:53.010
We can tweak this query as well to tell Google to only

00:01:53.010 --> 00:01:56.250
search within the Pluralsight domain, like this.

00:02:03.250 --> 00:02:06.150
(Working) Okay, we're not getting any results other than ads,

00:02:06.160 --> 00:02:07.460
so that's a good sign.

00:02:07.550 --> 00:02:11.540
This means Pluralsight doesn't have any exposed RDP servers other

00:02:11.540 --> 00:02:14.160
than what we previously identified using Shodan.

00:02:16.200 --> 00:02:17.490
Using advanced search,

00:02:17.490 --> 00:02:21.510
we can search for all types of files within the Pluralsight domain as well.

00:02:21.520 --> 00:02:25.710
Here we're searching for Excel files, and when we hit the search,

00:02:25.720 --> 00:02:27.730
there is one, an Author Invoice.

00:02:27.760 --> 00:02:31.080
We would, of course, repeat this for all of the different types,

00:02:31.130 --> 00:02:35.910
including PDF, Word, Excel, and other everyday formats.

00:02:37.160 --> 00:02:39.600
Here's an alternate way to search for files.

00:02:39.610 --> 00:02:41.800
The program is called Metagoofill,

00:02:41.810 --> 00:02:45.010
and it's a great way to search for different types of documents.

00:02:45.050 --> 00:02:49.540
We just spent a few minutes looking for Excel files using Google,

00:02:49.550 --> 00:02:51.000
can automate that.

00:02:51.010 --> 00:02:56.150
Simply specify the domain name, the limit on the number of documents to return,

00:02:56.170 --> 00:03:00.160
the document types, and where we want to store them,

00:03:00.170 --> 00:03:02.830
and Metagoofill will do the rest of the work.

00:03:02.840 --> 00:03:07.880
The last parameter here creates a 10‑second pause between calls,

00:03:07.890 --> 00:03:08.410
otherwise,

00:03:08.410 --> 00:03:13.270
Google can block you if it sees too many requests coming from your IP address.

00:03:13.270 --> 00:03:27.770
(Working) Some of the documents returned an HTTP 403 status code,

00:03:27.780 --> 00:03:30.280
which means we're forbidden from accessing them,

00:03:30.290 --> 00:03:36.070
but what Metagoofill was able to download is now in the plfiles folder.

00:03:36.080 --> 00:03:39.860
Here we have an education‑grant PDF file and the

00:03:39.870 --> 00:03:43.010
Author‑Invoice we previously found with Google.

00:03:45.280 --> 00:03:48.360
TheHarvester is another interesting automation tool

00:03:48.360 --> 00:03:50.840
that used to be more feature rich.

00:03:50.850 --> 00:03:54.600
Recently, however, Google blocked some of its features,

00:03:54.610 --> 00:03:56.990
and it's no longer able to search Google,

00:03:57.000 --> 00:04:02.020
LinkedIn, and several other resources that utilized the Google API.

00:04:02.030 --> 00:04:05.590
It's still useful, however, and it's easy to work with.

00:04:05.990 --> 00:04:08.330
It is accessible from the terminal window,

00:04:08.340 --> 00:04:12.430
and here we have a command that's telling theHarvester to use the

00:04:12.430 --> 00:04:17.649
DuckDuckGo search engine and return a maximum of 100 results.

00:04:17.660 --> 00:04:22.340
The context in which it performs the search is Pluralsight.com.

00:04:25.640 --> 00:04:28.970
We can now collect these results and store them as part of our notes.

00:04:30.650 --> 00:04:35.140
Let's perform another search, this time targeting DNSdumpster.

00:04:35.150 --> 00:04:39.140
DNSdumpster is great at returning DNS information,

00:04:39.150 --> 00:04:41.460
which provides us with a large landscape of

00:04:41.460 --> 00:04:44.110
potential endpoints that we can target.

00:04:44.120 --> 00:04:47.900
Another popular search to use is crt.sh,

00:04:47.900 --> 00:04:52.220
which returns certificate information for the given domain name.

00:04:52.230 --> 00:04:54.750
All useful information that we can potentially

00:04:54.750 --> 00:04:57.470
leverage in future steps of the test.

00:04:58.710 --> 00:05:02.310
A list of currently supported passive recon search engines is

00:05:02.310 --> 00:05:05.900
available here on theHarvester GitHub page.

00:05:05.910 --> 00:05:10.260
Note that theHarvester can also be used in active mode as well,

00:05:10.270 --> 00:05:15.140
in which case it can be used to find DNS and subdomain information.

00:05:16.470 --> 00:05:18.030
Similarly to theHarvester,

00:05:18.030 --> 00:05:23.300
we can use the OWASP Amass to perform and gather additional intelligence.

00:05:23.440 --> 00:05:26.080
The tool actually has a number of great features

00:05:26.080 --> 00:05:27.760
that I encourage you to explore.

00:05:27.760 --> 00:05:30.290
Today, I'll demonstrate just one of them.

00:05:30.300 --> 00:05:34.350
Here we're telling Amass to passively enumerate DNS entries

00:05:34.350 --> 00:05:38.050
for Pluralsight.com and cite the source,

00:05:38.060 --> 00:05:41.190
which is where it found that particular DNS entry.

00:05:41.540 --> 00:05:42.420
Amass, of course,

00:05:42.420 --> 00:05:45.290
is quite powerful and can be used to further continue

00:05:45.290 --> 00:05:49.630
enumeration in a more active approach, but I'll stop here.

00:05:53.950 --> 00:05:54.740
As you can see,

00:05:54.740 --> 00:05:58.020
it found a great deal of domains and subdomains

00:05:58.020 --> 00:06:00.660
that use the word Pluralsight.com.

00:06:00.670 --> 00:06:01.470
We would, of course,

00:06:01.470 --> 00:06:05.960
capture all this information and store it within our notes for later review

00:06:05.960 --> 00:06:10.260
to see what we can actually use here as an attack vector.

00:06:10.270 --> 00:06:10.870
Overall,

00:06:10.870 --> 00:06:14.140
this is just a handful of tools that provide value in

00:06:14.155 --> 00:06:15.995
the passive reconnaissance space.

00:06:16.005 --> 00:06:20.135
There are many tools and many ways of achieving the goal of identifying

00:06:20.135 --> 00:06:23.030
and learning as much as possible about your target.

00:06:23.285 --> 00:06:24.900
As a foundational step,

00:06:24.900 --> 00:06:29.210
using this knowledge provides the attack surface for active reconnaissance,

00:06:29.215 --> 00:06:31.240
which is your next phase, and, of course,

00:06:31.245 --> 00:06:34.340
for exploitation, which is the phase after that.
