Tuesday, May 06, 2008

Cisco Switch 3500XL: password recovery

I found one Cisco Catalyst 3500 XL on the storage room, haven't been used for a while therefore we will play with it. After reboot I noticed it has a password (as it should) on it so the first step is to change it (I am sure the networking guys would not mind :) )

The process is as follows:
Cisco official information:
http://www.cisco.com/warp/public/474/pswdrec_2900xl.html


My notes:
Turn on the power of the Catalyst 3500XL while pressing the "MODE" button. Wait until the light on port 1 is off (and the rest still on). You should see the following information:

C3500XL Boot Loader (C3500-HBOOT-M) Version 12.0(5.2)XU, MAINTENANCE INTERIM SOF
TWARE
Compiled Mon 17-Jul-00 18:42 by ayounes
starting...
Base ethernet MAC Address: 00:04:c1:c4:ed:10
Xmodem file system is available.

The system has been interrupted prior to initializing the
flash filesystem. The following commands will initialize
the flash filesystem, and finish loading the operating
system software:

flash_init
load_helper
boot

switch: flash_init --------------> run the "flash_init" command
Initializing Flash...
flashfs[0]: 112 files, 3 directories
flashfs[0]: 0 orphaned files, 0 orphaned directories
flashfs[0]: Total bytes: 3612672
flashfs[0]: Bytes used: 2776576
flashfs[0]: Bytes available: 836096
flashfs[0]: flashfs fsck took 3 seconds.
...done Initializing Flash.
Boot Sector Filesystem (bs:) installed, fsid: 3
Parameter Block Filesystem (pb:) installed, fsid: 4
switch: load_helper --------------> run the "load_helper" command
switch: dir flash: --------------> run the "dir flash:" command (colon included)
Directory of flash:/

2 -rwx 1645807 c3500XL-c3h2s-mz-120.5.2-XU.bin ----> current image loaded
3 -rwx 94680 c3500XL-diag-mz-120.5.2-XU
4 drwx 6784 html
111 -rwx 272 env_vars
112 -rwx 1020 vlan.dat
114 -rwx 25 snmpengineid
115 -rwx 5606 config.txt
116 -rwx 3436 config.text ----> configuration file loaded

836096 bytes available (2776576 bytes used)
switch:
switch: rename flash:config.text flash:config.old -----------> backup the current configuration file
switch: dir flash:
Directory of flash:/

2 -rwx 1645807 c3500XL-c3h2s-mz-120.5.2-XU.bin
3 -rwx 94680 c3500XL-diag-mz-120.5.2-XU
4 drwx 6784 html
111 -rwx 272 env_vars
112 -rwx 1020 vlan.dat
114 -rwx 25 snmpengineid
115 -rwx 5606 config.txt
116 -rwx 3436 config.old

836096 bytes available (2776576 bytes used)
switch:

switch: boot -----------> run the "boot" to initialize the system. The image will be loaded but no configuration file will be found forcing the system to enter into setup mode.

Loading "flash:c3500XL-c3h2s-mz-120.5.2-XU.bin"...##############################
################################################################################
#############################################

File "flash:c3500XL-c3h2s-mz-120.5.2-XU.bin" uncompressed and installed, entry p
oint: 0x3000
executing...

Restricted Rights Legend

Use, duplication, or disclosure by the Government is
subject to restrictions as set forth in subparagraph
(c) of the Commercial Computer Software - Restricted
Rights clause at FAR sec. 52.227-19 and subparagraph
(c) (1) (ii) of the Rights in Technical Data and Computer
Software clause at DFARS sec. 252.227-7013.

cisco Systems, Inc.
170 West Tasman Drive
San Jose, California 95134-1706



Cisco Internetwork Operating System Software
IOS (tm) C3500XL Software (C3500XL-C3H2S-M), Vers
TERIM SOFTWARE
Copyright (c) 1986-2000 by cisco Systems, Inc.
Compiled Mon 17-Jul-00 18:29 by ayounes
Image text-base: 0x00003000, data-base: 0x00301F3C


Initializing C3500XL flash...
flashfs[1]: 112 files, 3 directories
flashfs[1]: 0 orphaned files, 0 orphaned directories
flashfs[1]: Total bytes: 3612672
flashfs[1]: Bytes used: 2776576
flashfs[1]: Bytes available: 836096
flashfs[1]: flashfs fsck took 3 seconds.
flashfs[1]: Initialization complete.
...done Initializing C3500XL flash.
C3500XL POST: System Board Tes
C3500XL POST: Daughter Card Test: Passed
C3500XL POST: CPU Buffer Test: Passed
C3500XL POST: CPU Notify RAM Test: Passed
C3500XL POST: CPU Interface Test: Passed
C3500XL POST: Testing Switch Core: Passed
C3500XL POST: Testing Buffer Table: Passed
C3500XL POST: Data Buffer Test: Passed
C3500XL POST: Configuring Switch Parameters: Passed
C3500XL POST: Ethernet Controller Test: Passed
C3500XL POST: MII Test: Passed
cisco WS-C3548-XL (PowerPC403) processor (revision 0x01) with 16384K/1024K bytes
of memory.
Processor board ID XXXHNNHHXXX, with hardware revision 0x00
Last reset from power-on

Processor is running Enterprise Edition Software
Cluster command switch capable
Cluster member switch capable
48 FastEthernet/IEEE 802.3 interface(s)
2 Gigabit Ethernet/IEEE 802.3 interface(s)

32K bytes of flash-simulated non-volatile configuration memory.
Base ethernet MAC Address: 00:04:c1:c4:ed:10
Motherboard assembly number: 73-3903-07
Power supply part number: 34-0971-01
Motherboard serial number: XXXNNNNNXXX
Motherboard serial number: XXXNNNNNXXX
Model revision number: A0
Motherboard revision number: B0
Model number: WS-C3548-XL-EN
System serial number: XXXHNNHHXXX
C3500XL INIT: Complete

00:00:34: %SYS-5-RESTART: System restarted --
Cisco Internetwork Operating System Software
IOS (tm) C3500XL Software (C3500XL-C3H2S-M), Version 12.0(5.2)XU, MAINTENANCE IN
TERIM SOFTWARE
Copyright (c) 1986-2000 by cisco Systems, Inc.
Compiled Mon 17-Jul-00 18:29 by ayounes

--- System Configuration Dialog ---

At any point you may enter a question mark '?' for help.
Use ctrl-c to abort configuration dialog at any prompt.
Default settings are in square brackets '[]'.

Continue with configuration dialog? [yes/no]: n -----------> Enter "n" to not use the configuration dialog
Press RETURN to get started. -----------> PRESS ENTER


Switch>
Switch>enable -----------> Run the "enable" command to go into Privileged mode.
Switch#dir flash: -----------> Check the flash to see the "config.old" file is there.
Directory of flash:/

2 -rwx 1645807 Jul 18 2000 01:47:40 c3500XL-c3h2s-mz-120.5.2-XU.bin
3 -rwx 94680 Jul 18 2000 01:47:40 c3500XL-diag-mz-120.5.2-XU
4 drwx 6784 Jul 18 2000 01:47:41 html
111 -rwx 272 Jan 01 1970 00:00:21 env_vars
112 -rwx 1020 Mar 08 1993 04:11:03 vlan.dat
114 -rwx 25 Mar 17 2005 13:29:07 snmpengineid
115 -rwx 5606 Mar 01 1993 00:39:03 config.txt
116 -rwx 3436 Mar 08 1993 02:48:59 config.old

3612672 bytes total (836096 bytes free)
Switch#rename flash:config.old flash:config.text -----------> Restore the config.old to config.text
Destination filename [config.text]? -----------> PRESS ENTER
Switch#

Switch#rename flash:config.old flash:config.text
Destination filename [config.text]?
Switch#copy flash:config.text system:running-config -----------> Copy the configuration file into memory
Destination filename [running-config]? -----------> PRESS ENTER

Switch#
Switch# -----------> At this point you can run a "show running" command to check the configuration of the switch

witch#config t -----------> Enter the "config t" command to enter the configuration global mode.
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#enable secret secret -----------> change the enable password
Switch(config)#enable password password -----------> change the password password
Switch(config)#line vty 0 15 -----------> change the telnet password
Switch(config-line)#password telnet
Switch(config-line)#login
Switch(config-line)#^Z
Switch#
Switch#config t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#line con 0
Switch(config-line)#password console -----------> change the console password
Switch(config-line)#^Z
Switch#
Switch#write memory -----------> Save configuration into memory
Building configuration...
Switch#


Done, reboot the switch and now you have full access.

Cisco Routers - Basic notes

I am playing with Cisco routers now, this are be my notes:

Internal Components:
  • RAM. Random access memory. This is the working buffer memory.
  • ROM. Read only memory. contains bootstrap process and basic (most of times) IOS for basic functionality (as recover password)
  • FLASH MEMORY. Stores full image of IOS.--
  • NVRAN. non valitle RAM. Does not loose power when turn off.
  • - start up configuration file

Boot process:
  • a. Power on
  • b. Power on Self Test (POST) (check memory, and cards).
  • c. bootstrap from ROM
  • d. looks in FLASH for IOS
  • e. loads the IOS into RAM from FLASH
  • f. IOS looks for configuration in NVRAM
  • f.1 If found it load the IOS into FLASH Memory
  • f.2 If not found executes teh auto setup mode (menu driven system).

Contexts:
router> ----> user mode (show config, telnet, basic)
router# ----> priviliged mode (show commands, pings, save config, backup)
router(config)# ----> global configuraiton mode (configuration interfaces, security, hostname)
Control - Z is to move from global configuration mode to priviliged mode.

Conectivity:
console port password -----> line con 0
auxiliary port password ---> line aux 0
telnet password -----------> line vty 0 4


Set up a passwords:
On the glboal configuration mode run the following commands to set up a password for the enable command:

router(config)# enable password xxxxxxxxxxx (sets the password but it is shown on screen)
router(config)# enable secret xxxxxxxxxxxxx (sets an encrypted enable password, once secret is enabled password by itself don't work anymore)

To set up password for different access:

router#
router(config)#line console 0 | line auxiliary 0 | line vty 0 4
router(config-line)# login (to ask for prompt)
router(config-line)# password xxxxxxxxxxxxx (to set up the passwod)
control-Z

To encrypt all passwords runt the following command:
router(config)service password-encryption

To set up a banner:
router(config)#banner motd $ message message message $
(Note $ is the delimeter and can be anything, just check to have spaces at the end and beginning)

Setting up an IP on an ehternet port:
A show running-config shows that I have one fastethernet port not configured, set as:
interface FastEthernet0
no ip address
shutdown
speed auto

I will change it to:

interface FastEthernet0
no ip address
shutdown
speed auto

To do this run:

1721-router#config t ---------> to enter global configuraiton mode
Enter configuration commands, one per line. End with CNTL/Z.
1721-router(config)#interface f0 ----> to enter configuration of fastethernet 0
1721-router(config-if)#ip address 192.168.1.3 255.255.255.0
1721-router(config-if)#no shutdown ----> to activate
1721-router(config-if)#
*Mar 1 07:56:30.838: %LINK-3-UPDOWN: Interface FastEthernet0, changed state top ----> that means I have physical connectivity
*Mar 1 07:56:31.838: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEther,change to up ------> shows I have encapsulation. Connections to another host.
1721-router#ping 192.168.1.1 ----> to test that is working I ping a pc on the network
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.1, timeout is 2 seconds:
.!!!!
Success rate is 80 percent (4/5), round-trip min/avg/max = 1/1/1 ms
1721-router#

To save the configuration:
router#copy running-config start-config ----> for IOS version 12 and above
router#write memmory ---------> before IOS version 12

Example:
1721-router#copy run star
Destination filename [startup-config]?
Building configuration...
[OK]
1721-router#

To backup config:
router#copy run tftp --> this copy the running configuration TO the tftp server (will ask for details)
router#copy tftp run/start --> this copy the running configuration FROM the tftp server (will ask for details)
(NOT TESTED YET)



my passwords:
enable password/secret
console console
aux aux
telnet1-4 telnet
telnet0 telnet0

Sunday, May 04, 2008

Notes on my D-Link DWL-G520+ with Ubuntu 8.04

Don't recall how I install the board, I think that I just plug it in and Ubuntu did it's magic (long gone the days of having to install modules, recompile kernels, etc).

So the board was recognized but when I tried to log into my wireless network my pc froze, halted, stop working, didn't answer, etc. . The process was quite simple, turn on the pc and on the nm-applet select the essid of my home network. Enter the key or passphrase and done.

The problem starts at this moment, the pc is complete frozen. No mouse, ctrl-alt-backspace, ast-f1/f9, ssh to it, nothing.. no response at all. Therefore the next step was to unplug it and start again but after the 3rd attempt it was obvious that there was a problem somewhere.

My guess is that the nm-applet is trying to execute itself without sudo therefore a pop up asking for the password should appear but that never happened and the pc goes into frozen mode waiting for somebody/something to enter the sudo password to continue. (at least that is my theory). To go around this what I did was to add the details manually on the configuration file. The steps are below:

The D-Link DWL-G520+ is recoganized as follows:
richard:/etc/network$ lspci
05:09.0 Network controller: Texas Instruments ACX 111 54Mbps Wireless Interface
40:00.0 Ethernet controller: Broadcom Corporation NetXtreme BCM5751 Gigabit Ethernet PCI Express (rev 01)
richard$

on /etc/network/interfaces you enter the following settings for your wlan0.

richard:/etc/network$ more interfaces
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
address 192.168.1.1
netmask 255.255.255.0
gateway 192.168.1.1

auto wlan0
iface wlan0 inet dhcp
wireless-key
wireless-essid
richard:/etc/network$

Finally you restart you network devices:

sudo /etc/init.d/networking restart

and done.. that connects you to your home wireless network. (forget about the eht0, that is for something else).

If somebody reads this, follow it as last resource. Google quite a lot first and when you find the correct solution let me know.

good luck.

Tips to register to freenode irc (ubuntu and asterisk)

Notes from http://www.wikihow.com/Register-a-User-Name-on-Freenode

1. Join the Freenode network. Open your favorite IRC client and type:
/server irc.freenode.net

2. Idintfiy your nick.
/msg NickServ IDENTIFY

3. Change your user name to the user name you have chosen. Suppose you chose the nick "rocketship". Type the following in the window titled Freenode:
/nick rocketship

4. Register your nick or user name. Type the following command and replace "your_password" with a password that will be easy to remember.
/msg nickserv register your_password

5. Associate a valid email address with your user name. This step is important because it will allow you to assign a new password in case you forget the current one. Type the following:
/msg nickserv set email your-email

If you want your email address to remain private, use the following command:
/msg nickserv set hide email on

6. Register an alternate nickname using the same password. If you would like to register an alternate nickname, repeat the same procedure, using steps 2 to 4.

7. Link your two user names. This will make your two nicknames function as one in various ways. For example, you will not have to sign in each time you wish to change your nickname. Many people change their nicknames to a variant that indicates that they are absent. The linked nicknames will also share memos (messages sent through MemoServ), access to channels, etc. Type the following, when you are using your secondary nickname:
/msg nickserv link your_primary_nick your_password

8. Identify with Nickserv. Each time you connect, you should sign in, or "identify" yourself, using the following command:
/msg nickserv identify your_password

ragblogin+unitedkingdon+argentina