Understanding Netcat

netcat basic commands

Netcat is a computer networking service tool for reading from and writing to network connections using TCP and UDP. Netcat also known as "Swiss-army knife for TCP/IP". It has lots of features which includes port scanning, transferring files, and port listening, and it can also be used as a backdoor.

Netcat works in two mode :- client and server.Take some time to review Netcat's command options.





















Listening on a port with Netcat
Listening on a  port using Netcat is useful for network debugging client applications. Let's implement a simple chat application using Netcat. First take note of your local IP address (my ip is 192.168.91.129)
1. To listen on port 4444 and accept incoming connections, type on 1st machine
    nc -lvp 4444
(This machine behaves as a server since it is listening an incoming connection on 
 port 4444)
2. From a 2nd machine (I am using a windows machine), connect to port 4444 on your machine:
    nc -vv 192.168.91.129 4444
(This machine behaves as a client since it is establishing connection with server with an ip address 192.168.91.129 and port 4444)
After 
 connection establishment  you can send  messages from one machine to another.
Note:- For using netcat in windows download netcat for windows and run commands from command prompt.In this way our chat application works.














 








In this way our chat application works.

No comments:

Post a Comment