Sunday, February 17, 2008

Synchronizing the Software Clock to the Hardware Clock on a Cisco Router

The router is a 2811 Cisco ISR, it has the following configuration regarding its clock settings:

!
clock timezone eastern -5
clock summer-time eastern recurring
!

Here is the current time on the router:

Certchaser#show clock
*10:10:41.235 eastern Sun Feb 17 2008

The actual time is 10:04

Setting the clock on the router can correct the time setting, currently this router is fast by about six minutes

Certchaser#show clock
*10:14:35.055 eastern Sun Feb 17 2008

Certchaser#clock set 10:09:00 february 17 2008

*Feb 17 15:09:00.000: %SYS-6-CLOCKUPDATE: System clock has been updated from 10:15:23 eastern Sun Feb 17 2008 to 10:09:00 eastern Sun Feb 17 2008, configured from console by console.

Certchaser#show clock
10:09:08.659 eastern Sun Feb 17 2008

After a reload the router returns to its incorrect time settings, this was verified by writing the config and reloading the router, then comparing to the current time on a PC. This router has a hardware clock, changing the software clock on the router does not update the hardware clock. The command to update the hardware clock is clock update-calendar The hardware clock can be displayed with the command show calendar

Certchaser#show clock
10:27:10.159 eastern Sun Feb 17 2008

Certchaser#show calendar
10:27:14 eastern Sun Feb 17 2008

Certchaser#clock set 10:21:00 february 17 2008

Feb 17 15:21:00.000: %SYS-6-CLOCKUPDATE: System clock has been updated from 10:27:36 eastern Sun Feb 17 2008 to 10:21:00 eastern Sun Feb 17 2008, configured from console by console.

Certchaser#clock update-calendar

Certchaser#show clock
10:21:19.083 eastern Sun Feb 17 2008

Certchaser#show calendar
10:21:27 eastern Sun Feb 17 2008

Friday, February 15, 2008

Ping A Group of IP Addresses with a Script on Cisco Routers and Switches

Here is a quick rundown of the scripts to ping multiple IPs on a Cisco Router or Switch.

IOS Router Using Tcl

Use the show ip aliases command to collect the IP addresses from all of the devices you would like to ping, and paste the results into notepad. Do a find and replace for Interface, and all of the blank space up to the IP address. Replace with nothing, leaving only the IP addresses.

Router#show ip aliases
Address Type IP Address Port
Interface 10.2.2.2
Interface 10.3.3.3
Interface 10.1.1.1
Interface 10.4.4.4

Then paste the IP addresses into the following script

tclsh



foreach ip {

10.2.2.2
10.3.3.3
10.1.1.1
10.4.4.4
} {ping $ip}

Router#tclsh
Router(tcl)#foreach ip {
10.1.1.1
10.2.2.2
10.3.3.3
10.4.4.4
} {ping $ip}

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.2.2.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/4 ms
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.3.3.3, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/4 ms
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.1.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/4 ms
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.4.4.4, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/4 ms

type tclquit to exit from Tcl Shell

IOS Switch Using a Macro


Use the show ip aliases command to collect the IP addresses from all of the devices you would like to ping, and paste the results into notepad. Do a find and replace for Interface, and all of the blank space up to the IP address. replace with "do ping "


Switch#show ip aliases
Address Type IP Address Port
Interface 10.2.2.2
Interface 10.3.3.3
Interface 10.1.1.1
Interface 10.4.4.4

Then paste the IP addresses into the following script

enable
conf t

macro name ping
do ping 10.2.2.2
do ping 10.3.3.3
do ping 10.1.1.1
do ping 10.4.4.4
@

Macro global apply ping

Switch#enable
Switch#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#
Switch(config)#macro name ping
Enter macro commands one per line. End with the character '@'.
do ping 10.2.2.2
do ping 10.3.3.3
do ping 10.1.1.1
do ping 10.4.4.4
@
Switch(config)#
Switch(config)#Macro global apply ping

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.2.2.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/4 ms
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.3.3.3, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/4 ms
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.1.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/1 ms
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.4.4.4, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/4 ms

Thursday, February 14, 2008

Cracking level 7 Encrypted Cisco Passwords

This is a cool way to see the passwords generated by service password-encryption, check out this link!