Hey and welcome back.
So in this video, we're going to see how you can display the listing, TCP and UDP ports and the corresponding
programs, which I've been using the spots.
Now, this is a very, very helpful command and utility, which is going to help you in all the distributions,
which is either Mac OS Linux or Windows.
Now with this, you can identify that what are your ports, which services are running on them?
If the connection state is open, closed or established, and what are the ongoing currently open or
closed ports?
All right.
So let's quickly see, how can you identify this?
For this, the command that we are going to use is net start.
Now, I have already done a setup between this OS, which is the Mac OS and I have been running Debian
OS into my virtual machine.
As you can see over here, the IP address of this machine by the command I have config can be seen over
here is 192 168 to 41.3.
And on this machine I have started a NC connection which is a net cat connection as you can see over
here on port number four, four, four, six three.
All right, so let's come back to our Mac OS.
And on this system you can see I have config and I'm trying to see my IP address basically.
So on this system, basically I'm establishing a connection to the Linux Debian machine, which we have
seen currently using the command, which is and see the IP address of the machine that we have seen,
which is exactly the same IP address that we are connecting to and the port number on which the connection
has started.
As you can see over here, so this machine is listening on this port number and we are trying to connect
to that machine once we are successfully connected.
You can see we got a connect request from the IP address, which is this using the port number 51184.
And you can see we I was able to type a message which was we are connected now.
Anything that we type here on this terminal, we are able to see onto our next machine.
For example, let's see this works and let's go inside and see it works as we can see that both these
machines are connected and they are able to communicate with each other.
All right.
Let's come back to net stat now.
So we are going to see the connections that have been opened into this computer and to see if they are
communicating with any other host or service.
And what is the state?
Is it established, open or closed for that?
You can see over here I have typed the command which is net set and this is the output.
Let me just scroll up and here we go.
You can see net stat hyphen A to see all the connection requests including TCP, UDP.
And now if you notice over here, this is the connection that we have successfully established.
And you can see the IP address, which is 192 168 to 41.1, which is this machine which you can see
over here.
And the port of this machine, which is 51184, which is being used.
This is the foreign address, the remote machine to whom which we are connected on the port number four,
four, four, six three.
So this is the local address, as you can see over here.
This is the foreign address to whom we are connected on this specific port.
And we can confirm from here this is the same port and this is the local machine through which we have
got the connection from this port number and we can verify this using the net stat command.
Now you can see over here the state is established, which means both the machines are currently in
an established state and are communicating with each other.
So this is it for this video.
I hope you guys understood.
You can also see there are plenty of other services which have been running in the background.
Now, most of these services are being run by the system commands in which they try to frequently get
connected to the servers for security patches or updates, etc. or in case if you're running any system
level applications or antivirus and background, they also frequently connect to their servers for frequent
updates.
So this is it for this video.
I hope you guys understood.
In case you have any doubts or queries, you can you can always ask it into the Q&A.
Thank you.