AIM: TCP / UDP connectivity using Netcat
netcat = net+cat.
It is cat command over the network. Mostly used for file transfer over the network. Learn basic unix/linux commands to understand working of this tool.
Step 1: Install the ncat. Sometimes it comes with nmap package so check it before installing a fresh package.
Step 2: Start ncat by going to ncat folder in cmd.
To show the TCP connection we need to maintain a client-server session.
Step 3: Open two 'cmd' windows in administrator mode.
Step 4: Goto the folder where ncat.exe is installed (in both the windows).
Step 5: Run the command: ncat.exe -l 4444
Here -l sets ncat to listen at port number 4444.
Step 6: On the second cmd (client window) run the command: ncat.exe 127.0.0.1 4444
127.0.0.1 is the local ip address. The address of same PC, and 4444 is the port number where ncat is listening. To practice the practical in the lab enter your neighbour's IP address, and choose any port number greater than 1024.
Step 7: Now type the message which is to be sent on the server. As soon as you press the enter key, the message is sent to the server and it is displayed on the server cmd window.
Step 8: Now the connection has made. To disconnect the connection press ctrl+c.
Step 9: To transfer any file type on the server side:
ncat.exe -l 4444 > input.txt
on the client window:
ncat.exe 127.0.0.1 4444 < output.txt
Assignment: Do the file transfer between two PC in lab.
Dostları ilə paylaş: |