This page was already viewed 367times
Netcat command is a networking command-line tool in Linux. It works like a port scanning tool, a security tool, or a network monitoring tool. It is an important utility for system administrators to be aware of and is often referred to as the Swiss army knife of networking tools.
Moer specifically, it is an unix utility which reads and writes data across network connections using TCP or UDP protocol. It is designed to be a reliable “back-end” tool that can be used directly or easily driven by other programs and scripts. At the same time it is a feature-rich network debugging and exploration tool, since it can create almost any kind of connection you would need and has several interesting built-in capabilities.
*InstallationWith the following command, you will be able to install the netcat utility:
computer@linux:#sudo apt install netcat netcat
Alternatively, you may try the following command (kali linux):
computer@linux:#sudo apt install netcat netcat-traditional
*Telnet serverserver@linux:#nc -l -p 1234client@linux:#nc 192.168.X.Y 1234
server@linux:#nc -l -p 1234 -e /bin/shclient@linux:#nc 192.168.X.Y 1234
[Troubleshoot] if not working, try:
*Remote command executionserver@linux:#/bin/nc.traditional -l -p 1234 -e /bin/sh
*Video stream serverserver@linux:#nc -l -p 1234client@linux:#ls | nc 192.168.X.Y 1234
As a prerequisite: mplayer should be installed on client.
client@linux:#apt-get install mplayer
Launch stream server on video.mp4
*File transferserver@linux:#cat video.mp4 | nc -l -p 1234client@linux:#nc 192.168.X.Y 1234 | mplayer -vo x11 -cache 3000 -
*File transfer with progress barsender@linux:#cat superfile.txt | nc -l -p 1234receiver@linux:#nc 192.168.X.Y 1234 > received.txt
As a prerequisite: pv should be installed on sender.
sender@linux:#apt-get install pv
Perform file tansfer
sender@linux:#cat superfile.txt | pv -b | nc -l -p 1234"receiver@linux:#nc 192.168.X.Y 1234 > received.txt"