Allow complex port list specificition for nc(1) [PSARC/2008/680 Self Review]

Darren Reed dr146992 at sac.sfbay.sun.com
Tue Nov 4 03:45:26 PST 2008


This case is being submitted on behalf of an external contributor,
Erik Trauschke <erik.trauschke at freenet.de> and is considered to be
a small, self contained change, that qualifies for automatic approval.
This seeks patch binding, although there are no current plans to
port this change back.

Template Version: @(#)sac_nextcase %I% %G% SMI
This information is Copyright 2008 Sun Microsystems
1. Introduction
    1.1. Project/Component Working Name:
	 Allow complex port list specificition for nc(1)
    1.2. Name of Document Author/Supplier:
	 Author:  Erik Trauschke
    1.3  Date of This Document:
	04 November, 2008
4. Technical Description

The current implementation of nc(1) only supports a single port or one
port range what makes working with multiple ports not belonging to a 
certain range inconvenient. Therefore nc(1) should accept a list of single
ports and port ranges as a parameter to avoid multiple calls to nc(1) for
each port or port range.

old interface:

  +-------------------------------------------+-----------------+
  |Interfaces:                                | Comments:       |
  +-------------------------------------------+-----------------+
   port_low-port_high | single_port             port_range spec


new interfaces:

  +-------------------------------------------+-----------------+
  |Interfaces:                                | Comments:       |
  +-------------------------------------------+-----------------+
   port_range1[,port_range2,port_range2,...]    port_list spec
   port_low-port_high | single_port             port_range spec
  

Stability level of all interfaces above is changed to Committed.

This case is a follow up to PSARC 2007/389 (Netcat in Solaris)

--- old/./nc.txt	2008-10-01 18:13:54.809743196 +0200
+++ new/./nc.txt	2008-10-01 18:13:54.801974565 +0200
@@ -314,11 +314,11 @@
 
      port	  Specify port.
      port_list
-		  port_list can	be specified as	 single	 integers
-		  or ranges. Specify ranges in the form	of nn-mm.
-		  The port_list	must have at  least  one  member,
-		  but  can  have  multiple  members  separated by
-		  spaces or ranges.
+		  port_list can	be specified as	single	integers,
+		  ranges or combinations of both.  Specify ranges
+		  in the form of nn-mm. The port_list	must have 
+		  at least one member, but can have multiple 
+		  ports/ranges separated by commas.
 
 		  In  general,	a  destination	 port	must   be
 
@@ -651,6 +651,13 @@
 
 
 
+     Using a list of ports and port ranges for a port scan on various ports
+
+
+       $ nc -z host.example.com 21-25,53,80,110-120,443
+
+
+
 
 
 SunOS 5.11	     Last change: 6 Dec	2007		       10


6. Resources and Schedule
    6.4. Steering Committee requested information
   	6.4.1. Consolidation C-team Name:
		ON
    6.5. ARC review type: Automatic
    6.6. ARC Exposure: open




More information about the opensolaris-arc mailing list