8
2012
Nmap for IOS? No, IOSMap
The Tcl shell can be used to run Cisco IOS CLI EXEC commands within a Tcl script. Using the Tcl shell to run CLI commands allows customers to build menus to guide novice users through tasks, to automate repetitive tasks, and to create custom output for show commands.
Not everyone knows that it is possible to implement a port scanning tool like a light Nmap. Surfing the web I have found a tool named IOSMap, a Cisco port scanning tool.
It is not mandatory know Tcl to use this script; the only thing you need to know is how execute a Tcl script.
To use IOSMap script you need:
Step #1: Download the script http://sourceforge.net/…/IOSmap%201.1/iosmap1.1.zip/download
Step #2: Copy it into your tftp/ftp/http… server folder as you prefer
Step #3: Launch the script. All IOSmap parameters are defined at the command line. The help text for IOSmap shows all the scan options available:
Ciscozine#tclsh tftp://192.168.1.11/IOSmap.tcl help
Loading IOSmap.tcl from 192.168.1.11 (via FastEthernet0/0.2): !
[OK - 15912 bytes]
Loading services.list from 192.168.1.11 (via FastEthernet0/0.2): !
[OK - 42121 bytes]
Starting IOSmap 0.9 ( http://www.defaultroute.ca ) at 2012-02-07 14:02 Rome
Invalid IP address specified ==> help
================================================================
IOScan 0.1
Usage: IOScan
HOST DISCOVERY:
-P0/PN Treat all hosts as online - skip Ping test
-SL List hosts and ports to scan
SCAN TYPE:
-sP Ping scan only
-sT TCP Connect Scan
-sU UDP Scan
--reason: display the reason a port state is reported as such
PORT SPECIFICATION:
-p Specify ports to scan.
-p22 Scan port 22
-p22,23,135-139,445 Scan ports 22, 23, 135, 136, 137, 138, 139, 445
TARGET SPECIFICATION:
CIDR, IP range and single IPs are all a supported - comma delimited
For example:
192.168.10.0/24,192.168.17.21-34,192.168.40.1
Ciscozine#
Some examples..
Example #1: Check the tcp ports (135-139, 443, 445) on the 192.168.1.10 host
Ciscozine#tclsh tftp://192.168.1.11/IOSmap.tcl -sT -p135-139,443,445 192.168.1.10 Loading IOSmap.tcl from 192.168.1.11 (via FastEthernet0/0.2): ! [OK - 15912 bytes] Loading services.list from 192.168.1.11 (via FastEthernet0/0.2): ! [OK - 42121 bytes] Starting IOSmap 0.9 ( http://www.defaultroute.ca ) at 2012-02-07 13:24 Rome Free Memory on Platform = 80289968 / Memory required for this scan = 2579282 Interesting ports on host 192.168.1.10 PORT STATE SERVICE 135/tcp open msrpc 136/tcp closed profile 137/tcp closed netbios-ns 138/tcp closed netbios-dgm 139/tcp open netbios-ssn 443/tcp closed https 445/tcp open microsoft-ds Ciscozine#
Example #2: Check if the hosts (192.168.1.0/29, 192.168.255.0/30) are up
Ciscozine#tclsh tftp://192.168.1.11/IOSmap.tcl -sP 192.168.1.0/29,192.168.255.0/30 Loading IOSmap.tcl from 192.168.1.11 (via FastEthernet0/0.2): ! [OK - 15912 bytes] Starting IOSmap 0.9 ( http://www.defaultroute.ca ) at 2012-02-07 13:25 Rome Free Memory on Platform = 81737004 / Memory required for this scan = 3362393 Host 192.168.1.1 is up Host 192.168.1.2 is down Host 192.168.1.3 is up Host 192.168.1.4 is up Host 192.168.1.5 is down Host 192.168.1.6 is down Host 192.168.255.1 is up Host 192.168.255.2 is down Ciscozine#
Example #3: Check the tcp ports 1-60000 on the 192.168.1.10 host; this is a good example to show how the script will advise you that the memory required is more than the free memory
Ciscozine#tclsh tftp://192.168.1.11/IOSmap.tcl -sT -p1-60000 192.168.1.10 Loading IOSmap.tcl from 192.168.1.11 (via FastEthernet0/0.2): ! [OK - 15912 bytes] Loading services.list from 192.168.1.11 (via FastEthernet0/0.2): ! [OK - 42121 bytes] Starting IOSmap 0.9 ( http://www.defaultroute.ca ) at 2012-02-07 13:26 Rome Free Memory on Platform = 76021848 / Memory required for this scan = 95208474 The resources estimated for your scan will exceed 75% of your available memory total of 95208474 Execution cannot proceed without impacting primary device functions Ciscozine#
Below the video that explain how IOSMap works:
Remember: Because routers are such critical devices, when adding new functions it is always important to gauge the impact of these new functions on performance in delivering their core functions. In particular, memory usage and cpu utilization are the two most important factors, both are easily measured. The memory usage of port scanning using TCL was especially interesting.
References:
Related Posts
- Senior Executives Say Cloud-Based Collaboration Leads to Higher Business Performance http://t.co/mG2W0O7z88
- Telefonica and Cisco Complete 4,000 kilometer 100Gbps IPoDWDM Trial http://t.co/7c0uqzH6bG
- Mozilla Releases Multiple Updates http://t.co/Kqldpe1MZ7
Email Updates
Archives
- May 2013
- April 2013
- March 2013
- February 2013
- December 2012
- November 2012
- October 2012
- September 2012
- August 2012
- July 2012
- June 2012
- May 2012
- April 2012
- March 2012
- February 2012
- December 2011
- November 2011
- October 2011
- September 2011
- August 2011
- July 2011
- June 2011
- May 2011
- April 2011
- March 2011
- February 2011
- January 2011
- December 2010
- November 2010
- October 2010
- September 2010
- July 2010
- June 2010
- May 2010
- April 2010
- March 2010
- February 2010
- January 2010
- December 2009
- November 2009
- October 2009
- September 2009
- August 2009
- July 2009
- June 2009
- May 2009
- April 2009
- March 2009
- February 2009
- January 2009
- December 2008
- November 2008
- October 2008
- September 2008

