Instructor: Welcome back.
In the last video,
we talked about using Tor Browser
to anonymize our traffic on the internet.
Right now, let's take a look at
how we can use something called proxy
to redirect our Nmap scans through a third-party
in order to mask our
original physical address and IP address
to the target that we are scanning.
So in order to do that,
what you want to do
is you want to start your terminal first,
and the first thing that we want to redo,
in case you haven't done it in the previous lecture,
is to run sudo apt-get install tor.
It will ask you for your password,
and once you type the password in,
it will install the Tor service for you.
In case you have already done this in the previous lecture,
the next command that we want to do
is we want to actually start the Tor service.
And we can do it
with the help of this command right here,
service tor start.
Press enter.
And you won't get any output back for this command.
It will only ask for password,
which you have to type in,
and the Tor service will be started.
We can check it by typing service tor status
and it will say that the status is active.
Next thing we want to do
is we want to install ProxyChains,
which is a tool that will allow us
to filter our traffic through a proxy.
And in this specific video,
we're going to filter it using the Tor service,
so our IP address will change
with the help of Tor service.
To install ProxyChains, you run this command:
sudo apt-get install proxychains.
For me, I have already installed ProxyChains,
for you, it might take a minute or two to finish.
And as soon as it's done,
we want to navigate to its configuration file
to set an option or two.
To do that, we want to type
sudo nano /etc/proxychains.conf,
which is short for configuration.
It will open this file,
and the settings that you want to have are these ones.
You want to hash the strict_chain or comment it out.
And you want to enable the dynamic_chain.
Down here, we also want to add socks5 support,
which will be filtered through the local host
on port 9050.
Even here, it says defaults set to tor.
We have socks4 on local host 9050,
and socks5 on local host 9050.
Once you have all of these options set,
you want to save the configuration file,
exit the configuration file,
and just small quick tip,
make sure you use sudo once changing the configuration file,
because otherwise it will not work.
You won't have the permission
to change this configuration file
if you don't use sudo.
Now to make sure all of it works,
let's try to run ProxyChains
and then let's for example, open Firefox.
If this works,
then we should have a stable internet connection
which will be a little bit slower in Firefox.
And also our IP address should change.
Pretty much the same thing that we did with Tor,
but right now, it should also do it in Firefox.
Let's first of all try to access google.com
just to see whether we can load it.
And you notice it does take some time to finish.
And next thing we want to do is type
what is my IP?
We just want to make sure
that we successfully masked our IP address.
So currently, we have this IP address.
You can already see that my results
are given in different language,
which is always a good sign.
And if I go on whatismyip.com,
we should see where exactly
is this IP address located?
Here it is.
This is the location of the IP.
And let's take a look at one more result.
And you notice it does take quite some time
for pages to load,
but this is quite normal
since our traffic is going through a proxy.
And for some reason this timed out, nevermind.
We already checked on one site,
and we successfully changed our IP address
so it will appear like this
to any website that we visit.
Now that we confirmed that this works,
we can close Firefox,
which will automatically close this command
and give us our terminal back.
And now to run the Nmap scan,
all you have to do is simply type
proxychains, and then nmap.
And for example, let's go with nmap.org.
We want to scan it.
Let's use -F command, we already know what it does.
And the scan will run.
Now one thing about this is
that the scans will run much slower
than without proxy chains,
which is also normal.
Same way our traffic is slower
when we go on Firefox,
and when we go on Tor Browser.
The same reason is behind the slow Nmap scan.
As you can see, it already scanned couple of ports.
It found the port 80 to be open.
For port 139, we got socket error or timeout.
And it will do this for each and every port.
And nmap.org won't really know
where our traffic is coming from.
Nonetheless, we got all of this to work well.
We also found port 22 to be open,
which is I believe, correct result.
And that is pretty much it,
it's as simple as that.
Now you can combine different options with the Nmap scan.
All of those options that we already covered,
feel free to use them.
Now, nmap.org is allowed to be scanned,
but don't scan it multiple times.
They say it on their website
that you shouldn't spam scans on their website.
You can scan it once or twice.
That would be about it for this video.
This is how we can combine
proxy Tor service and our Nmap scan,
the same way we would combine this ProxyChains
with other tools as well that support it.
Nonetheless, thank you for watching this video.
And in the next video we are going to take a look
at how we can run VPN inside of Kali Linux.
See you in the next lecture.