The nc (or netcat) utility is used for just about anything under the sun involving TCP, UDP, or UNIX-domain sockets. It can open TCP connections, send UDP packets, listen on arbitrary TCP and UDP ports, do port scanning, and deal with both IPv4 and IPv6.
Forces nc to use IPv4 addresses only.
Forces nc to use IPv6 addresses only.
Enable debugging on the socket.
Do not attempt to read from stdin.
Specifies the size of the TCP receive buffer.
Specifies a delay time interval between lines of text sent and received. Also causes a delay time between connections to mul‐tiple ports.
ttl Set the TTL / hop limit of outgoing packets.
Ask the kernel to drop incoming packets whose TTL / hop limit is under minttl.
shutdown(2) the network socket after EOF on the input. Some servers require this to finish their work.
Do not do any DNS or service lookups on any specified addresses, hostnames or ports.
Specifies the size of the TCP send buffer.
Specifies a username to present to a proxy server that requires authentication. If no username is specified then authentica‐tion will not be attempted. Proxy authentication is only supported for HTTP CONNECT proxies at present.
Specifies the source port nc should use, subject to privilege restrictions and availability.
after EOF on stdin, wait the specified number of seconds and then quit. If seconds is negative, wait forever (default). Speci‐fying a non-negative seconds implies -N.
Enables the RFC 2385 TCP MD5 signature option.
Specifies the IP of the interface which is used to send the packets. For UNIX-domain datagram sockets, specifies the localtemporary socket file to create and use so that datagrams can be received.
Change IPv4 TOS value. keyword may be one of critical, inetcontrol, lowcost, lowdelay, netcontrol, throughput, reliability, orone of the DiffServ Code Points: ef, af11 ... af43, cs0 ... cs7; or a number in either hex or decimal.
Specifies to use UNIX-domain sockets.
Set the routing table to be used.
Have nc give more verbose output.
Terminate after receiving recvlimit packets from the network.
Connections which cannot be established or are idle timeout after timeout seconds. The -w flag has no effect on the -l option,i.e. nc will listen forever for a connection, with or without the -w flag. The default is no timeout.
Requests that nc should use the specified protocol when talking to the proxy server. Supported protocols are “4” (SOCKS v.4),“5” (SOCKS v.5) and “connect” (HTTPS proxy). If the protocol is not specified, SOCKS version 5 is used.
Requests that nc should connect to destination using a proxy at proxy_address and port. If port is not specified, the well-known port for the proxy protocol is used (1080 for SOCKS, 3128 for HTTPS). An IPv6 address can be specified unambiguously byenclosing proxy_address in square brackets.