English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Linux nc command

Linux Command大全

The Linux nc command is used to set up the router.

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

Syntax

nc [-hlnruz]-g<gateway...>][-G<pointer number>][-i<delay seconds>][-o<output file>][-p<communication port>][-s<source address>][-v...][-w<timeout seconds>][host name][communication port...]

Parameter Description:

  • -g<gateway> Set the communication gateway of the router, up to8units.
  • -G<router count> Set the source route router, the value is4multiples.
  • -h Online help.
  • -i<delay seconds> Set the time interval to send information and scan communication ports.
  • -l Use listening mode to control incoming data.
  • -n Directly use IP address, without going through the domain name server.
  • -o<output file> Specify the file name, and save the data transmitted in and out as16Binary code dump to save the file.
  • -p<communication port> Set the communication port used by the local host.
  • -r Randomly specify the communication ports of the local and remote hosts.
  • -s<source address> Set the IP address of the local host sending the data packet.
  • -u Use UDP transmission protocol.
  • -v Display the execution process of the command.
  • -w<timeout seconds> Set the waiting time for connection.
  • -z Use 0 Input/Output Mode, Used Only When Scanning Communication Ports.

Online Examples

TCP Port Scan

# 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

Scan192.168.0.3 Port Range Is 1-100

Scan UDP Ports

# nc -u -z -w2 192.168.0.1 1-1000 //Scan192.168.0.3 Port Range Is 1-1000

Scan Specific Port

# nc -nvv 192.168.0.1 80 //Scan 80 Port
(UNKNOWN) [192.168.0.1] 80 (?) open
y  //User Input

Linux Command大全