Hi and welcome back to section six net Cat Penetration Test.
In this video we are going to talk about testing network latency.
In the last video,
we saw how to start a troubleshooting and we saw how to scan hosts
a network with net cap.
The result of this scanning was to check if some ports are open and
if the expected service are well run.
The second step in troubleshooting in this case is to check if,
if the network is the cause of the problems.
Sometimes the latency with the network is too large and cause problems in
application connect. There are some tools to test the network latency,
but net CAT can be used. In this case,
the latency is very important because even the S is working in a high
latency. The connection could not be possible for this task.
We could use Net CAT again because Net Cat was designed to establish data
channels. You can use Net CAT to help off an application that give us some time
informality. So in this case,
in Linux-based environment we can use software called Time.
The software Time could give us some timing functionality,
this software calculus, the total run in time of any common.
Another tool that we need to use in this case is the software to produce data
during our test.
And for this we could use the software called Yes,
the software produce an output as a string repeatedly
until something kill it. So we have the common like this on screen.
We have
a server not getting and server that we receive a data
and from another point we use the software time give us
time personality and the software, yes,
to give us data functionality and we use a pipe.
That's mean that what we have in the left will be the input, what we,
we have in the right and in the right common line.
We have clients in instance from of netcat that we
connect with the server one time.
We have the time span on the operation and the number of bytes we can provide
with the latency calculation,
the speed of transmission will be equals to the size of the data sent
divided by the transmission time.
So now let's take a look on how we can use and calculate our
our operation. So here I have two screen here.
The left one is uh,
Microsoft Windows here present my network and the second one is my
Linux environment.
So let's do some calculation and verify the latency of this network.
So in the left side here,
I run instance of Netcat in a server mode.
So that's mean that I will use the option V to get verbose and
to get more details about all the, the stuff that Net Cat is doing.
L to listen and p to specify a port.
So the host will be the IP on this machine and the port will
be 4 4, 4 4. Okay.
And the data that I will receive during, uh,
connection I will send for a local file.
So receive it by data that, okay,
so on the left side will be my server and the right side will be
a net cat instance client.
And I use the same command that we saw before.
So I use the common time is in the Linux based environment
is a problem to calculate and give us the time of the
some operation we are gonna use.
The yes is a common to produce as output of this commodities.
We will produce a string format,
a string data and we'll repeat forever until something kill this
operation. And in the pipe,
that's mean that what what we have in left would be the input for the command
that we have in right. So here is my common, uh,
is my net cat common client instance.
So I use the VV to get more information about this connection. Local host,
this is the, the IP of the this machine here running windows,
uh, of windows and the the port. Okay?
So the result here will be time that I took for run
this command, the quantity of bite.
Because with this we will be able to
verify and to check the latency of this,
this command of this network. Okay, so let me start a server.
Okay? The service is okay and now I will start my client.
So for this operation here,
I have to put control C to break this common 'cause. It's how the,
the software, the application, the program works. So let's start.
Okay, so now we have a connections done.
A connection is okay and the yes common is produces data.
And because the net cat client here,
this data is passing to my server here.
So let me broke this comment like this, like this,
okay, so the connection was broken.
I have this comment took 18 seconds and this is the quantity
of bytes transmit. Okay?
So now we have all the elements that make us
possible to calculate a latency. Okay,
so now I'm gonna use a calculator to make some calculation.
So this is the result of bytes.
So we have a scale, uh, this byte, kilobytes megabytes,
and we have to choose one quantity of bytes of kilobytes or
megabytes. So let's use here megabytes.
So to jump to bytes two kilobytes a megabytes,
we have to divide this input by 124.
So if we have a hundred, a thousand,
24 bytes, actually we have one kilobyte.
If we have 1,024 kilobyte,
actually we have uh, one megabyte. So this is how it works in open science.
So let me put the, the result of byte
4 4 6 4 6 4 0
divided to thousand 24.
So this is the quantity of kilobytes and divided for
thousand 24.
So this is four two megabytes now
divided by the the time 18 two.
So this is the result of megabytes by second.
So let's take not here.
So the first one was 1 23 megabytes
by seconds. Let's do again the same operation to get some results.
And when this we have some average, okay, so,
uh, let show that the file, it's here. Okay, this is the file.
Lemme this, this one clear again.
And let's repeat the same operation.
So I will run server with another file.
Name one in. I will start again by server, my,
my client to make a connection.
So let's wait some seconds for example,
4, 3, 2, 1. It's okay.
So this command took 20 seconds and we have this concept
of bite. And let's repeat the operation here.
So we'll be
5, 1, 2 and more. Four zeros,
1, 2, 3, 4 divided by 2020
4,004.
So 4.8 megabytes and now divided by the time
2073. Okay,
so the result was a little better than the previous one,
megabytes by seconds.
Let's repeat the same operation again to get more data.
The server, the client,
let's take some longer now to get more time,
to give more time and to produce more data.
So 5, 4, 3, 2, 1. It's okay.
So now
4, 4, 6, 4 6, 4 0 divided by
24. 24.
So 4.2 megabytes divided by the time.
So it's able to check that we are a little variation here
in this network. So first one, the second result,
the third one, let's took another example,
another evaluation just to get more data.
So lemme clear again, clear again,
run the server. Running again. Client,
this time will be more short.
So 5, 4, 3, 2, 1. It's okay,
it's okay.
So now we have here
5, 3, 1, 6, 6 0 8 divided by
four. So now we have,
we have more megabytes
and we have to divide by the time eight
divided by 8.04. Okay?
The result is better. So we have a little
variation here. So if we, we have more data here,
average will be better.
But I mean this procedure here about the transfer of
data with netcat, a calculator in a noted,
we are able to check and to calculate our valuation
and get the Latins at this moment in this network.
So this is very useful to have this information
and proceed with our troubleshoot operation.
This video we saw how to use Netcat to help to test network
latency. The next video you'll take a look at application connectivity.
I hope to see you there.