We will filter only lines those contains “succeeded” which means port is open. Only open ports can be listed by using the grep command.
![nc netcat options nc netcat options](https://linoxide.com/wp-content/uploads/2013/12/portscanner_netcat1.png)
We can make output more readable by only printing the opne ports. Nc: connect to 192.168.253.134 port 87 (tcp) failed: Connection refusedīy default the netcat tool prints all port results wheter they are open or closed. Nc: connect to 192.168.253.134 port 86 (tcp) failed: Connection refused Nc: connect to 192.168.253.134 port 85 (tcp) failed: Connection refused Nc: connect to 192.168.253.134 port 84 (tcp) failed: Connection refused Nc: connect to 192.168.253.134 port 83 (tcp) failed: Connection refused Nc: connect to 192.168.253.134 port 82 (tcp) failed: Connection refused Nc: connect to 192.168.253.134 port 81 (tcp) failed: Connection refused Nc: connect to 192.168.253.134 port 78 (tcp) failed: Connection refused Nc: connect to 192.168.253.134 port 77 (tcp) failed: Connection refused Nc: connect to 192.168.253.134 port 76 (tcp) failed: Connection refused Nc: connect to 192.168.253.134 port 75 (tcp) failed: Connection refused Nc: connect to 192.168.253.134 port 74 (tcp) failed: Connection refused Nc: connect to 192.168.253.134 port 73 (tcp) failed: Connection refused
#Nc netcat options manual
The manual page provides more detailed information and description about the nc command. Port numbers can be individual or ranges: lo-hi Īlternatively the Linux and BSD systems provides the manual page of the netcat tool with the following command. X proto Proxy protocol: "4", "5" (SOCKS) or "connect"
![nc netcat options nc netcat options](https://assets.digitalocean.com/articles/netcat/page.png)
w timeout Timeout for connects and final net reads W recvlimit Terminate after receiving a number of packets V rtable Specify alternate routing table q secs quit after EOF on stdin and delay of secs p port Specify local port for remote connects P proxyuser Username for proxy authentication N Shutdown the network socket after EOF on stdin m minttl Minimum incoming TTL / Hop Limit k Keep inbound sockets open for multiple connects i interval Delay interval for lines sent, ports scanned OpenBSD netcat (Debian patchlevel 1.217-2ubuntu1) The help output contains options and their descriptions.