Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

Linux nc command

Linux nc command

Linux Command Reference Linux Command Reference

The Linux nc command is used to configure routers.

Executing this command can set the relevant parameters of the router.

Syntax

nc [-hlnruz][-g<网关...>][-G<指向器数目>][-i<延迟秒数>][-o<输出文件>][-p<通信端口>][-s<来源位址>][-v...][-w<超时秒数>][主机名称][通信端口...]

Parameter Description:

Example

TCP port scanning



# nc -v -z -w2 192.168.0.3 1-100 

192.168.0.3: inverse host lookup failed: Unknown host

(UNKNOWN) [192.168.0.3] 80 (http) open

(UNKNOWN) [192.168.0.3] 23 (telnet) open

(UNKNOWN) [192.168.0.3] 22 (ssh) open

Scan ports 1-100 on 192.168.0.3

Scan UDP ports



# nc -u -z -w2 192.168.0.1 1-1000 //Scanning ports of 192.168.0.3, range is 1-1000

Scan specific ports



# nc -nvv 192.168.0.1 80 //scan port 80

(UNKNOWN) [192.168.0.1] 80 (?) open

y  //用户输入

Linux Command Reference Linux Command Reference