Hi and welcome back to Section five Blackhead Tricks
my Net Cat.
In this video we are going to talk about Net Cat common Cheat Sheet.
This cheat sheet provides various tips for using Net Cat on both
Linux and Microsoft Windows.
So let's do a recap about the basic comments of Net Cat. First of all,
we have the operation modes that Netcat works,
it's client and server.
You can run a instance of netcat in a client mode in a server mode.
So this is the the template for running atca.
We have Netcat and C for the version available in the Linux environment.
So we have the common netcat, we have the first options,
the first options that we have.
Then we have to specify a host name and then port in the
options that we can use in netcat we have dash H or
help and get the version dash V to get the control verbosity of
the AMLO information.
So in this dash v we are able to get more details
when we are running the software,
the the Red Cat and we have the dash V W V to get more details in the
implementation. That takes for example, uh,
the main document about the sockets so is uh, internal implementation.
We have a dash L for listen this specify that we are running that
cat in several modes.
We have the option dash E for alumni cat with acute specific common
when a client connected to it. So we can open, for example,
a specific program or running a dash. We gonna see this.
So this is very powerful options.
Dash k to reopen Netcat with the same common line after the original connect is
closed. For example, if we connect NaCl,
if we run Netcat to seven mode and someone connect,
make a quick connect to listen to verify if the port is open.
For example,
the dash key is very interesting because this keep the door open for this
connection dash o to get X dump on Netcat traffic to
a fire for example. So this is like a,
a log mode on netcat when we are using connection with Net cat,
we have two protocols for transport layer for the
full protocol that netcat use is to c p. But we have used,
we have available uh, dash U U D P mode. For example,
U D P is a connection like protocol and dash w v to
set network activity time out.
So this is very interesting to set a time out in our connection.
For the examples with Netcat, we have a,
a very basic version option is a simple shut interface
that's mean that we have two instance of Netcat one running in the server
mode and another one run in the client mode.
In a server mode we have this template here that's mean is a netcat
options and Port.
So the option for host name is Hide because we are running
a server mode and the host name the IP is the actual I IP of the machine that
we are running these server mode of netcat.
And the template for the client mode is options, host,
name and port.
That's mean that the host name is the IP of the host of the machine
that we order server that we want to connect.
So we have this example here in a server mode we have the option
V L P,
that's mean that we have V to get my formation L or
specify a lesson.
That's mean that net get running several mode and P to specify
a port.
So that's mean that in this local machine we are
running netcat in a certain mode in this port
1, 2, 3, 4, 5.
And for the client mode we have netcat dash V.
That's mean that we have more details.
And for this connection the host name is local host.
That's mean that we are running the,
these both instance of Net Cat are running the same machine.
But if we are running the seven mode in a different machine,
this op local host gets me,
the host name will be IP of this machine running net
cat in seven mode and the port 1, 2, 3, 4, 5,
that's mean that this is the port that we are connecting for the option for PO
scanning.
We have some options that is very interesting to use.
In a port scan for example,
we have the dash V that's mean network in an activity
timeout we have the dash Z, that's mean the two,
there's no latency zero IO dash I to set a delay
interval between port scanning.
So that's mean we have two or three seconds for port scan each port dash
n to prevent d n s lookup.
That's mean that no need to resolve D N Ss for a specific host
name.
And we have dash R to scan portion randomly.
The template for this option for port scanning is
the n c, the common, not yet a portion for options.
A portion to specify a host name and a portion to specify a range of ports.
So in the example that we have here, we have the net,
all the set of commons, we have a host name.
In this case this is external ip.
It is in the same network but it's not the local host. For example,
we have the option dash Z to get no latency
and the range of port to port one two, port 2000 for example.
We saw also that Netcat is using for transferring files.
So Netcat has the ability to both pull and push files and we have this
template here. First one for example, the first template,
we have the options port, the port two,
and we have this design to specify the direction that we are
passing the file, the file name.
So in this case we are running in the server and when someone's connecting the
server, we'll receive a file name. Okay,
so the next template that we have is for the client mode
is when the net cat connect the server.
So we have the portion for options,
we have the portion for host name to specify a host name portion for port.
And we have the opposite sign that we have in the server
mode. That's mean that when we receive a file,
this input in the left will be our output in the right.
So this will be the file that we are receiving. So we have option for example,
to change the name of the file. So we have some options here. For example,
the, the instance of this is the net cat dash vlp.
That's mean that we are running net cat in server mode in the port
1, 2, 3, 4, 5.
We have the sign to specify the file,
the file that will be passed or who connect the server in the client
mode. We have uh,
dash V to get get one formation w V two.
That's mean that we have a timeout for two seconds. We have a specified uh,
host name. There's a ip,
we have the port and we have the opus of the sign.
That's mean that what we receive in the left will be a result of the
right file. We saw also that we have the option,
we have a tool in Linux to get the MD five
sum. That's mean that we,
we we calculate the integrity of the file and we saw too that
these are interesting option to get a collection of files.
When we use the tar, it's mean that we are uh,
compact the files and pass to the net cat and the
client will will connect with the server and Will is compact this
file. So this is a very interesting,
very efficient way to get a collection of fires in one time
for example.
So this is very efficient way to do this for the possibility of bone and
grabbing.
We saw that net CAT can be used to verify more details
about a server in a specific port. So we saw that for example,
we can run start the Apache two version in our machine
and get the status and we have a port scanning port meaning a
specific port is one single port.
So this is a very interesting option to verify for example if the server
in this port is open or not. So this is very interesting option.
We saw that there's a possibility to get more information about the
servers that are running in this specific port.
So we saw too in the HTTP server for example,
we have a combination of comments to get more information about
this server.
So in this example here we have a combination of commands.
We have the common print F to print something in the terminal
and we have a little header when that is use it in
the HTP server. We have the, for example,
in this example we have the head that's mean that uh,
is a common H T P command to get only the head of the H T
P request. So we have the common head,
we have the the dash to specify the host the root,
okay the version of the H T P.
And we have to specify a host and we have the option pipe.
That's mean that what we have in left will be the input what we have in the
right.
So in this case we have a net cat connecting in a specific host
and port. So below we have an instance of this template.
We have the command print f printing, the option for head.
That's mean that we have,
we get only the option of the head of H G P command request. Okay?
And this example, the host will be the site,
the website of Microsoft in the print in the left common in the right,
the pipe common.
We have a net cat connecting in the port 18 in the HT
P server for Microsoft.
That's mean that the net cat will connect in the port 80 or the Microsoft
website. And then we as execute a command for print F.
So this is interesting because this command will print the only had
part of the H G P request and we get more information about
the service that is running in this web server. So for example,
the version of the this, the web server that they're running,
if it's a patch or not for example.
So this is very interesting to get more details about the sales that is
running. Another very useful option that we saw about remote Bash.
It's mean that we have a template like this. Like we have the option part,
the port part two dash a and the dash path.
So in the,
in Microsoft's environment is a CMD aza and for Linux
environment we have the slash being slash bash.
This is very powerful because when you connect Net Cat in a several instance
we are say hey when connected in Net Cat we can execute a bash.
So these are are a remote bash in another machine in another,
a host name for example.
So this give a powerful option for the client.
When the client connect with this,
the client will receive a remote pash.
So he has all the power of the pash of the terminal of
the console.
So the client is able to execute commons a remote commons in
this machine and this is very powerful.
In another option is using that cat for port forwarding.
So that's mean that we have a forward of port.
So we have the source computing and the computer and we have
a think plate for these options.
So we have host name of relay in a part number,
number one for example and for the relay computer we have the same
part number for the source computer part. Uh, pipe.
That means we are running another instance of netcat.
We specify another host name of the target and a second part name
number. So for example,
in the instance below we have Netcat command running the host name
in the part 1, 2, 3, 4, 5.
Then we have a Netcat listen in this port
1, 2, 4, 5 and in a pipe another command
of Netcat for the host name of the another machine and
connecting to order another port five, port 3, 2, 1.
That's mean that we have three machines in this history.
We have a machine with our initial connection,
we have an intermediate machine connecting the first machine.
Then we have a forward passing for the third machine.
So this is very interesting for example,
to break some tracking 'cause we have machine item,
energy machine connecting with a computer. Number one for example.
But the connection will be passed to a third machine.
So this is very interesting scenario or port forwarding.
In this video we saw about net Cat common cheat sheet.
In next video you'll take a look at Net Cat's role in log four J
exploitation. I hope to see you there.