Hi, and welcome to Section five Netcat Penetration Test.
In this video, we are going to talk about sniffing traffic using netcat.
Netcat is a versatile software and unfortunately it can be used in illegal
operation. And because of these malicious operations,
this can be flagged by other software that are checking for malicious activities
running on the computer. Netcat can be used as a traffic sniffer.
This test can be done running netcat as a normal user as long
as we use it to listen at port higher than 123
that are the well-known ports.
Sniffers can be used to capture the traffic in incoming traffic
and outgoing traffic. In net.
CAT is able to do this and additionally can perform additional tasks
to sniff traffic. To gather information.
Net CAT can relocate a service already on the system to a
different port or net CAT can transmit information to a,
an application running in background.
The idea of relocating a service is to alter the traffic flow
on our web server to get sensitive pieces of information.
If this operation is done on, well, no port like 80, we have to,
to have a root access. But if you use high ports,
that is no need to root access.
And in our redirect links we have to use pointing to a high
port like 80 80 for example. For example, we have this, uh,
U L U L I and the example and we have
a server.com, for example. And, uh, a port,
this will be a new port.
So this kind of attack is used often and un unaware people
are couching frequently, for example.
So we have the right name of the host of a site or, or a server.
We have a redirect porting.
So for this hack server, for example, is any,
any server. We have the Port 80,
but in this example here we have a redirect.
This serves to another port for a high port like 80 80, okay. For example,
if we are using some configuration in the Apache,
this is the path on Linux for change. Uh,
the, the port that servers listen. So here we are using, uh,
Catalytics environment to do this task. So the,
the task here is to use net CAT to head direct a service
and use net CAT two to log the,
all the information of this traffic. Okay,
so we we're gonna use Apache h h P server as our example,
and that's it. We will, we will redirect the, the service. First of all,
we have to verify if the service for Apache is running or not.
So we're gonna use pseudo service Apache two status.
So these views show to us if the, the service is active or not.
So in this case, this, the service is active. Okay?
So let's start this service using the word start.
And let's query again to verify if the service
is starting or not and the service running is active.
And we can use a web browser to access a local host address
to verify if the service is running or not.
So the Apache service is running,
this is the full page. Okay? And let's start our,
as a cushion of transferring the service and logging the
information. To start our task, we have to,
first we have to stop the service. So we are going to repeat the,
the same comment, but use the word stop like this.
So the ServiceNow is not active. So
we, we can see in the web browser that the service not access
anymore. And to change the head direct to service,
we have to access our specific file and change
the full port for this task, for this operation.
So here in our Color Links environment, the full command is
CD atc slash apache two.
The specific file is port com.
Okay, so let, let's show what we have in this port,
in this file. This file is, uh,
listen the file to verify and to map the four
port 80 like this for H TT P request,
and 4 4 3 for eight 80 TT p s requests.
So to head direct,
we have to make a configuration,
specific configuration in this folder. In this file.
So let me access this file and change the
configuration for port.
So here we have to change this, this lesson, we'll,
we'll update for 80 80 and we,
we'll change the configuration.
So now we have to restart our H H p a H
h H P Apache server.
So let repeat the common service,
pseudo service AP two start.
Now the Apache is running, let's access the full page.
But the difference here is we have to, the full page,
the full port is the 80, but we have changed it.
So we have to change the protocols.
HT p and l a specific port 88.
And the page is accessible. Okay? We have to, this is the,
for the, the format, we have the protocol, H T T P.
Here we have the, a host and we have a port.
Okay? So now the, the full page is accessible,
but we have to add a specific port. 80. 80, okay?
So now what we have to do is to use Netcat as
a sniffer. So to, as I could this operation,
we'll use a file to add this task. Okay?
And for this, let me open another tab here. This,
and we have to choose a folder to add our script
because this job will be more easily executed by net cat if you use this
script. So in our example here, we can use for example,
a temporary file.
This is a good option because it's out of
the holders of the operation system, for example.
And this is a good folder to, to our temporary fires for example.
'cause we have, we we're gonna use this operation to,
it's temporary. It's only to head direct and get a log.
So this is a good option to use this folder.
So create this script file.
So we're gonna use a pseudo nano,
a file name. Could be for example, Apache, er,
this is the nano predictor. And we create a simple script file,
batch file. So we'll be d for batch.
That's mean that we have specific path of the, the batch of the batch.
And we use this command here, net cat, first off,
first operation here is to log the all information that
the connection, uh, when the connection was operating.
So we'll use the option
dash o to create a file,
and we have to specify a full path for the file.
So we'll be patchy.
Put, we have now to specify a host and a port.
So now we have the server is running in my local host here.
Okay? Could be another IP address for another, uh, internet address.
But in this example here we are using a local server.
So this is a, a local IP address. And you have,
you have specify a port 80 80, okay?
Because this will be head direct for this port, for this host.
And for, and for this port, we have save and exit,
the Apache file Sniffer, it's here, it's present.
Some operations is a good idea to increase the power of this file.
So for example, you are gonna use this, the C mode,
C mode to elevate the power of this,
of this file to be no, no problem for execute. For example,
this one will be 3, 3, 3, 7, 7, 7.
That's mean that the file here is right
to read, write, and execute here.
And now we will start another instance of netcat here
in the operation lesson port 80.
And we use option A to as execute file.
So we'll be
our file that we have created right now. So,
okay, this, listen, what's the point here?
The point is the client will access the full webpage
for Apache, do the full page run in the port 80.
Okay? But I have transferred the service for another port,
and I create a net cat here.
That will be listen for port 80 here.
And I'll pointing and I'll execute a file as
a script. This script will create,
we'll run a netcat to log all the information that
the connection is tracking, tracking all, all our information, okay?
And this connection will be head direct for the page,
for the server with another port that we have transferred. Okay?
So this is the point. The client, he will access,
he's thinking that he's accessed the full webpage HT P webpage for
Apache.
But the client will be held direct to another port and uh,
to another host and, and port. Okay?
And this connection will be, so this is the, the point.
So in this operation here,
we'll use Netcat to sniffing the traffic. Okay?
So for example, I will open a new tab here and I will access,
then we'll be a redirect to report 80 80.
And Netcat will be able to log all the information about this
connection
in this video we saw about sniffing traffic using netcat.
In the next video, we'll take a look at rogue tunnel attacks.
I hope to see you there.