Introduction to NC commands
NC process is netcat is a common network tool (the Swiss knife of the network); NC communication reads and writes data through TCP/IP protocol,
Can be TCP, UDP after network link communication.
The most reusable function of the NC scan Port NC is to scan the port for opening, a bit like telnet:
Nc-v-W 2 ' hostname-i ' 3901-3905
nc:connect to 10.246.46.15 Port 3901 (TCP) Failed:connection refused Nc:conn
ECT to 10.246.46.15 Port 3902 (TCP) Failed:connection refused
Connection to 10.246.46.15 3903 Port [Tcp/charsetmgr] s ucceeded! #端口开通
nc:connect to 10.246.46.15 Port 3904 (TCP) Failed:connection refused Connection to
10.246.46.15 3905 Port [Tcp/mupdate] succeeded! #端口开通
You can use the NC return value to determine whether the port is open
Nc-v-W 2 ' hostname-i ' 3901
nc:connect to 10.246.46.15 Port 3901 (TCP) Failed:connection refused
echo $?
1
nc-v-W 2 ' hostname-i ' 3903
Connection to 10.246.46.15 3903 Port [tcp/charsetmgr] succeeded!
echo $?
0
NC Chat Tools
NC is a TCP/IP network protocol tool that is sure to be followed by TCP connections, and can simulate one of the simplest chat tools with NC: Server-side "any side"
Nc-l 55555
shi ni
shiwo^h^h
ni hao shuming
ni shmming
Client side "either side"
NC 10.246.46.15 55555
shi ni
shiwo
ni hao shuming
ni shmming
NC Transfer Files
Since NC is a network connection to the TCP/IP protocol, you can use NC to establish a connection to transfer file transfer files to write the contents of the file to the NC-enabled port listen
Cat rpyc.py |nc-l 33333
Receives the file side, the NC connects transmits the file machine the listen port, and receives the file to write in the specified file
NC 10.246.46.15 33333 > rpyc.py
NC Usage: http://www.huanxiangwu.com/477/linux-nc-netcat