Instructor: Welcome back,
and in this bonus video we're going to be covering
the tool that I created in Python 3,
that is used to gather emails.
Now, even though later in the course we'll be coding some
of our own Python tools.
This is one that we will not code,
so we'll just see how it works.
I will explain how it works, of course
and we are going to see how many emails it can gather.
So, this is the tool right here called Email Scraper
and you will have this to download in the resources
of this lecture.
But let me show you how you can transfer it
on the Kali Linux desktop.
If you go up here on the devices
and you go on drag and drop
and click on B directional,
then anything that you have
on your desktop since I had the program right here,
if you go and drag it to your Kali Linux machine
it'll get moved onto your Kali Linux desktop.
As you can see right here, this folder already
contains this file since I already have it on my desktop
so I'll just skip this.
But you, after setting this to be directional
can transfer any file from your host desktop
to your Kali Linux desktop.
Okay, good.
Now that we know how we can transfer it
let us see what this tool is and how we can run it.
So just to check out the code of this tool real quick.
Let us double click on it and let me enlarge all this.
And what this tool essentially does is it asks us
for the URL and we provide it
with the URL of a certain domain name.
Then what this tool does is it tries to extract all
of the emails
that are in the HTML page of the URL that's specified,
but what it also does is it tries to crawl
within other URLs that are found inside of that page.
For example, this count variable right here
that is equal to 100,
means that we will be searching for emails
in 100 different links.
So you specified domain URL,
then it goes through that URL
it extracts all of the emails,
but it also extracts all of the other URLs
that are leading to different pages.
Then it goes to those different pages
and performs the same thing.
It tries to find the emails and it also finds more URLs
and it does that until it reaches 100 URLs.
This is a number that you can change if you want to.
So you can set this to be lower or higher depending on
how much results you want to find.
Down here, we can see that it is finding
those emails using regex.
So this is the pattern that we are searching for,
and don't worry if you don't understand any of this.
regex is just a way for us to find certain patterns in
a lot of texts.
So for example, this is a pattern
that will allow us to find emails
in the HTML code of the page.
And then we at the end of this print all of
the emails that we found.
So that is the basic principle behind this tool.
Let us see how it runs and
whether we managed to find more emails
than we did with Hunter.io and theHarvester.
So let's close this.
Go to our terminal, find where you have this file downloaded
and I have it on my desktop.
And to just run it
we can type Python 3 and then the name of the file,
it'll tell us enter Target URL to scan.
And here I'm going to specify the full URL
to the same domain name that we used
for theHarvester and Hunter.io,
just so we can compare how many results we get
with this tool and how many results we got
with Hunter.io and theHarvester.
So if I type
(keyboard typing)
the domain name and press your enter
This will go and process 100 links.
And depending on whether you change that number
it might be higher or lower.
And at the end of processing these links
it will print out all of the emails that it managed to find.
So if you remember, with Hunter.io
the fact that we used with the free account
we managed to gather 10 different emails.
With theHarvester,
first time we didn't manage to get any email,
but after running it a couple
of times we might be able to get around 10 to
15 different emails with theHarvester.
But let's see how many this tool will find.
So let's just wait for this to finish
and I will get back to you as soon as it's done.
Okay, so the tool has finished scanning
and here are all of the emails that we manage to find.
You can see there is at least a hundred
or 150 of them and they all belong to the same domain.
Now, we might occasionally find some email
that doesn't belong to this domain,
and we saw one down here, I believe.
Let me just find it.
This one, it doesn't have the domain name inside
of the email, but all of the others do.
And we got at least 5 to 10 times more results
than we managed to get with theHarvester
which is Kali Linux tool
or with the free account of Hunter.io.
And here are all the links that it processed.
So it clicked on all of these links
and it tried to extract as much emails as it could
from these links.
Cool, right?
So now you have a tool that will be able to capture
a lot of emails based on the specified domain.
Just make sure that once you run the tool
you specify HTTP or HTTPs before the domain name.
Okay, so this tool is now yours.
Feel free to use it as much as you want.
And later on, in the course we will also
be coding our own Python tools.
There will not be some too advanced tools
but we will be covering basics
of creating our own hacking tools
which is something that every hacker should
at some point of their journey learn.
Great.
So, now that we've finished
with the information gathering section.
We're ready to start off with scanning section.
And you might be wondering how are you going to
be able to follow the scanning section
and all the other sections,
since you don't really have permission to scan any website?
Don't worry.
There are a lot of free vulnerable machines
and websites that we can download and practice on them.
And we are going to be seeing how we can find them
and install them inside of our virtual box,
so we will have our own vulnerable lab where
we can practice our hacking.
So thank you for watching this section
and I will see you in the next one.