Hi and welcome back to section 1 netcat introduction
in this video. We're going to look at some comments
options to understand the possibilities of
commands and operations that are possible in netcats
because that cat is available for different operations
systems in different versions. We will focus
on the main options available for all operating systems.
We in some assumptions the main
options present in the most versions are -
H to display the version of the two
common line and the options available in these
version of Snapchat Dash V. It's about
very positive these result in the
level in the verbosity.
Add the results of netgate we showed that
is going on for each step that the two is taken
when executing our inner common or
when it receives an external command.
HL
Or listen listen serum mode when you
use the L option you set netcat
to the server mode.
That is mean that netcat is able to listen to
any connection from some specific port.
-
e
allows netcut to execute a specific program when a
client connects to it.
If the problem is a terminal or shell, it's
a powerful option because it's allow our incoming
clients to connect to netcat and a
direct shell access because there is no user identification
or authentication process associate with
this access.
- Z or zero, IO
And data will be passed to the receiver essentially for
DCP. This is a three handshake.
Dash k
This option reops netcat with the same cone line
after the original connection.
Dash o
It's create a file that represents a log of
the connections traffic when xodex mode formation
and text.
- R this option randomized ports
in serving mode - R will also
randomize local Source ports
-w
followed by seconds to set the network inactivity timeout
That's you is UDP mode.
Since UDP is a characterless protocol. It's
recommended that is use timeouts with
midi this option.
So let's start first of all how you use
the netcat in the
Microsoft Windows environment.
And then I will use the netcat the Gino
version available in Linux environment.
So let me start in Windows environment.
First we are you use the option -
H to verify the version of
the netcat and the list
of options available for this these two
so that's a and I will
add the pipe more just to get
the freeze screen in blocks of
information to be more easy to read the information
first.
We can we we are able to see the
version of netcat here.
And this is a version for any
map project. Netcat.
We're not talking about netcat. We are
talking about two that can be
using in the server mode and
client mode
the server mode is available when you
when we use the dash.
L for listen
when you start that cat using Dash L. The netcat
is able to listen in this is
specific Port from any client.
First we are used the dash V for VivoCity.
That's mean that.
When you are using the HV all the steps
that not get are doing.
For send information or receiving information some information
about this step will be print in this
in the in the screen. So it's more easy
to understand what's going on at that
moment. When used netcat.
so
For this producers employ here. We are start netget
in the list listed mode. That means
the server mode.
And we we can specify a port.
to say
Hey, I'm starting netcat. I mean this specific Port so
we're gonna use for example part 1
2 3 4 5.
So we add this moment. Netcat is telling
us that and listen.
here
I'm using the localhost.
And I'm connect I mean
this sport here.
So netcat is listen any connection
from the sport here.
when these another prompt
I will use netcat and I
will connect.
From this available Port so I use Dash V
to get the very boracity and
get more details about my my connection.
I have to specify the host. So
the host is lockout host.
And I will specify a port so a port
is one two, three, four five.
So at this moment.
I'm connected.
And I'm able to exchange some
information between these two
connections. So I say hi.
Hello.
in the server here is the server here was able
to First he's able to
identify a connection
they will print the port that this.
This netcat here this prompt use it to connect
when this part because in this
prompt here I say hey, I'm ready to
listen from this port.
And this client here?
Use it.
local port
For example this part here to connect.
To this part here. So we are talking about two components
and
connection destination port and initial initial port
So the connection is done and the first information is
right is ready here.
And the server will we respond for?
Hi, and we can verify that the connection
is working and the text the
data.
Is going to One Direction
from from an authorization to another Direction.
In this same example, I will stop the
tool here.
And I will start a server without.
The V option verbose the option.
Just show how can I use the
netcat?
But look we have we don't have
no information like before.
So let's mean that.
All the connection that that we have here.
Is more we don't have more information available. So
this is not you can use
it but is a good practice to use
the V option?
To get more information about all the connection that
we are going.
to do
another option here is using the the option
k
Okay, that's mean that is the server is ready
to receive another connections
from other clients. For example.
For example you we use we start
the server like this.
the localhost in the part 1 2 3 4 5
and we use we connect in
a client.
Or localhost one, two, three, four,
five two. So we have a connections then.
here, but if a client
present disconnect
like this
the server
disconnect and the server is not it's not able
to to receive another connection or for
a different client or for same
client.
So an option that we can use for the server is the dash
k?
Another reminder. Another reminder is that we can
use
like this in separate mode or we
can add.
all together
and use
the options like this.
So I'm using the option K. That's mean
that the net getting a server mode is able to
reopen another another connections.
And we used you use option.
To connect in the server the
the client here is connected with server the client
can out the connection, but
the server is still on.
so this is a good option to
to use a netcat in the server mode hours
open for new connections. So
the server is already open here.
We can connect with this client.
And from this another terminal comment
shell.
We we will connect again. So
Dash V2 to get the information step
by step localhost and the
part one, two, three, four five. Let's mean
that this client here.
We connect netcat and we can verify here.
First we have this client in this in this ball
in this board.
And then we have another client in this port. Let's mean
that the server is available at this
point here.
and
for connection the first client we connect
from a another port
and another client we connect from another Port so
service say to us that we have a new connection from
this port. Yeah another connection from
this port. So the client one is
able to exchange messenger, for example
being client one
in receive the message from the
front client one.
And the client should do the same thing client.
you
so
what we have here is a server is in
is able to receive any connections
from any client.
another powerful option that we can use here
in that cat is - e
That means that net gets allowed to execute a specific
problem when a client connects to it.
So we start netcat in a server mode.
Netcad - V.
l
listen
and P
and we study specify a port one, two,
three, four five and we're gonna use the old dish
e
and press executed program
specific program. So we gonna
use CMD or
for verify this option to execute
remote terminal
when the client connect the server
so the server will start.
with this option
and the client will connect this server.
When there's V?
Local Host
And the port one two, three, four five.
So look the connection is done.
So here the client say that.
The decline is connected.
the server
shows that connection is done. The
connection is already ready to
use.
And when the connection is, okay.
The server will execute these specific program.
So CMD.
And now in the connection from
the the client here, we can
verify a header when
we start a command in Windows.
We have a new new window when they
had saying the Microsoft Corporation. All
right. All right reserve it
and we have a prompt.
That means that the connection is
done.
and the
the run the program is already
executing and this moment the
command was
The Prompt let's mean that our reverse shell
is is ready to be used so I
have this connection
Ready to be used.
And this is very this is very very powerful because I
don't have to use any user
identification or authentication to
start a remote session with the server.
So
As you can see I have the connection the connection
from from one remote.
And I can do any operation and get
in result with a client.
For example, let me start here again.
And the servant I will create a new
folder.
So we'll be 10.
and get
the
U1
I will enter in this.
folder and get
P1
and you create a file. So
here that text for
example my file it's here.
and I start a new server
here and get
the L
b 1 2 3 4 5
passing and and using the
dash e
and specify a prompt.
So the service are in several is ready. They might
my client.
will connect This Server the
Local Host one two three, four five
and look the connection is done.
The problem same the is executed now.
And the prompt is running. This is like my
welcome messenger from the command and
I start the server in
this folder paint.
And I have a direct connection from this folder
here so I can use the to
get the the list of
file.
And two things here. I have already a connection.
To the server running a remote.
Show our remote prompt and a
link direct for the folder. That server is
running.
So this is a powerful operation. We're gonna
see in the future more details about these reverse
shell.
But is a very very powerful option
that we have here in netcat.
Another option that we can use is -
oh
with this option
create a file that represent a log for all
the information.
During the connection so all
the data that was exchanged from
the client and the server.
We can kept this information and put
in a file.
So for this option we use start.
A new netcat server mode.
So we LP in the
server in the port one, two, three, four five.
and now the option Dash o
and we will specify a file
like dump dot X.
Okay, the server is listen.
here
I will create a connection a client
connection. So
be localhost.
In the port one, two, three, four five.
So, okay this connection is done. So
I use.
Hello server.
The server you response in Renault client.
I'm looking for another message here. It's being serve instrument
pong.
and okay the connection
is okay.
We're gonna see that we have a file here dump dot
X.
So we you get the information from this.
So we will type.
number X
and we see the text.
Information here login all the
operation that we have done during the exchange
data between the server and the
client.
Now we're going to use a Linux environment and
you you use at the full
version started in a Linux environment. Let's mean
the netcat for window project. So we used
this the a few.
options that that we have used in Windows
environment
Some options is specific.
for Linux environment for this
version Gino version
brunette
And now let's see some some option here.
First of all, we will check the version of netcat.
So yeah, as I
said before in the last video is the
is the same problem netcat but the
different version and is another only yes.
So NC for netcat so first, let's
see - H to check
the the version and some
options that we have looked at.
We have less version less
options than other version but it's
a powerful tool and we're gonna
see a lot of information a lot of powerful options and
operations that we can use using this
tool.
So let me clear here. And first
of all, let's talk about
the dash are that's mean
that the option to randomize Sports. So
in a safe mode, we'll start a netcad.
in the option
vlr that's me. There is
a very Bose a mode and for
listen in R to
randomize and check that now the
server is open is listen.
In the port three four three seven.
Let cancer here I will do again and verify
and you can check that.
Every time that I use these common I
get a different port here so I
can specify it's possible to specify a
port one two, three, four five. Okay, but
I can
use the option to randomize this.
Okay.
Another interesting option here.
Is the the dash Wu that's mean
that I can specify the second to set
a networking activity timeout. So for
example, I use
w
W3
so
looked at the server is open only
for three seconds so I can specify a
second this very interesting to avoid
any inactivity time not give the
time out. For example.
so let's
verify a connector for example here and I
start a client and see the localhost in
the port.
Let me start here without the the option w.
b 1 2
3 4 5
a in the connection
or the client like a host Port 1 2
3 4 5 so the connection is already done.
Another option here is Dash o
we have a seen these options
from Microsoft environment.
But in Linux environment is a little
bit different we can have this
file in The Exodus my information and text.
So for example
Let me let me start a server with
the option Dash.
home
and I have to specify on file name.
So don't X.
So, okay. The server is already is ready.
All right, it's ready.
in the client, I will
use client actually localhost 1 2
3 4 5
great. So the connection is okay. Let me
say.
Hello server.
It's hello server. Hello client.
So this the client will send a new
information.
being the server instrument panel
And okay, I was top the connection.
so
the the file is is okay.
He's already created. Let's take a
look around on this file.
and see that information is
here the is a difference between
the Linux version and the windows
version then again get
Brian map version in any cat Gino version because
we have the text file.
here and we have Exodus more
information to
so this is an interesting information or dump
or X version and you
can use for a lot of things.
So let's start interesting operation here.
Now we have two environments different environments here. We have
Microsoft environment.
and Linux environment
so
let's verify we have a connection between
these two environments. So let me verify my
My IP so might be
this one here my IP number.
I have my IP address.
Okay, and how you start a
server in the Microsoft environment from any
cat? So any cat we listen?
At P 1 2
3 4 5 and are you use the
dash e?
to start a remote
start to start a terminal here. So
okay the server is okay from this
is listening and local here localhost here
using this port.
If any client connecting the server.
The server the server will start this program
here could be any problem. Okay, it
could be not bad program. For example.
or Explorer software
But we this example here. We you start
a command here.
So in the mement the the
Linux environment here, we start
this connection. So the
server is already already. Okay.
and
Let's start here. So I will create.
Uh, netcat here, okay.
using a v
for Vivo variables. I will specify the
IP address that I want
to connect. So the server is in this IP here.
or
using this port 1 2 3 4
5
so
the connection is okay.
The server can guarantees years the connection from
this.
for
this IP is my localhost here. And
you see this port so is the the
part use it by the client to connect with the
server and look.
I specify the common here
to be executed. And now I
have a connection reverse
prox prompt share common
here available in Windows.
So that's mean that I have.
the link
from Linux terminal
to Microsoft command. So with this
option here I can have access to any
information from this machine. We're gonna
see this example more detail
in the next chapters name in the
next videos in this course.
But this is a simple example showing that the connection
was done.
and this connection was done without
the user provide any using the
identification or authentication. So this
is this is very powerful.
And now we explore another option
is - Z.
That's easy is use it.
for for scanning
some ports
and to get the status of the sport if
the sport is open or not.
So this connection we will see more details information
about this option the the future this
course.
But the Z option the netcat
you start to verify some ports
using a three-way handshake
TCP. We're gonna see the the TCP
protocol more in details in the
next in the next videos.
and India next sections
But at this moment I can say that the the
Z option the scanning using here. We
will use TCP through
handshake on its verify if the port is
open or not.
So in the windows environment, we use
the windows environment. So
when they use it you Windows environment will start.
server, so B listen
in the door in the port 880. Okay,
so the server is
okay listening.
and in the Linux environment
you start
as a client and see or
V
for variable City
We will use the Wu to
get to use the timeout
to because we will use a range
ports. So it's important to choose
specify a limit time
to to.
you verify each port
And the Z option I know that my server
is in this.
Part here in this IP address here.
And I I will use a range
of ports to to verify
if any port is open.
So I have this there is a port in
this IP address. There is a port.
80 18, so let me start doing
the
with a range
for example 8075
to
80 85
so they can't get up Sports and go down.
Okay, so, let's see. What happened here.
okay the connection
Connection is done.
straight connect
I forget I'm not information here for the option
in.
the option in
say do not get you use the IP addresses.
Okay, so, okay the server
is okay.
Let's verify.
so
Okay.
we see that there's a open door for
the door 80 here 8080 so
With this option here was we are we was able to
see that netcat.
Start I scan.
And he catch the open
door here or the eight eight.
And He suggests for
http.
Alt here.
Okay.
Netcat will tell you the service associate
within a specific Port so.
In the Linux environment and also in
the wind Microsoft Windows environment. We have a file with
some specifics ports.
and the name of this port
Some Alias Alliance for this part
for example, for example in the wind in Linux
environment.
We have this file.
in the
here, so, let me let let verify the
report so it ITC services
here so you can verify that the long
list of parts.
And the information for for port for
example, if any part if the
sport here is running.
Uh could be my C
code server. For example, or this one
here is for the the Venus
S A from a for example, so let
me let the bird let let
improve.
Let me prove this.
So I will.
I use the option.
here
and I will get a TC, but
I will use pipe.
grip
880
So look.
This was the option that netcat showed to
us because for this port here.
We have Services map for
this.
Is protocol here HTTP?
So this mean that we have a
file in the services file a to
specify to bind and to map
for each server to each part.
In this video we saw different options
available in Microsoft Windows.
And Linux environments and finally we saw
some samples and practices and
with some combinations.
We will take a look at some base cooperations available
in netcat. I hope to see you there.