Photo Gallery
Member List
Search
Calendars
FAQ
Ticket List
Log Out
Forums
Register
Login
My Profile
Inbox
Address Book
My Subscription
My Forums
password recovery on Cisco routers
Logged in as: Guest
arrSession:exec spGetSession 2,16,28020
Active Users: There are
0
members and
0
guests.
Users viewing this topic: none
Printable Version
All Forums
>>
[Scripting]
>>
Post a VBScript
>> password recovery on Cisco routers
Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page:
[1]
Login
Message
<< Older Topic
Newer Topic >>
password recovery on Cisco routers -
11/14/2005 7:54:47 PM
Mauzer
Posts: 1
Score: 0
Joined: 11/13/2005
Status:
offline
Here is a simpl script that automates password recovery procedure on Cisco routers (Cisco 805 in that case).
#$language = "VBScript" #$interface = "1.0" Sub main Set WshShell = CreateObject("WScript.Shell") crt.Screen.Synchronous = True crt.Screen.WaitForString "POST ......" wshshell.Sendkeys "^{BREAK}" crt.Screen.WaitForString "boot# " crt.Screen.Send "set ios-conf=2142" & VbCr crt.Screen.WaitForString "boot# " crt.Screen.Send "boot" &VbCr crt.Screen.WaitForString "Would you like to enter the initial configuration dialog? [yes/no]: " crt.Screen.Send "no" &VbCr crt.Screen.WaitForString "!" crt.Screen.Send VbCr crt.Screen.Send VbCr crt.Screen.Send VbCr crt.Screen.Send VbCr crt.Screen.Send VbCr crt.Screen.Send VbCr crt.Screen.Send VbCr crt.Screen.Send VbCr newenpwd = crt.Dialog.Prompt("Enter NEW ENABLE password", "ENABLE password", "", True) newvtypwd = crt.Dialog.Prompt("Enter NEW VTY(TELNET) password", "VTY (TELNET) password", "", True) crt.Screen.WaitForString ">" crt.Screen.Send "en" &VbCr crt.Screen.WaitForString "#" crt.Screen.Send "cop sta run" & VbCr crt.Screen.WaitForString "?" crt.Screen.Send VbCr crt.Screen.WaitForString "#" crt.Screen.Send "conf t" &VbCr crt.Screen.WaitForString "#" crt.Screen.Send "config-register 0x2102" &VbCr crt.Screen.WaitForString "#" crt.Screen.Send "ena sec" & " " & newenpwd & VbCr crt.Screen.WaitForString "#" crt.Screen.Send "int s0" & VbCr crt.Screen.WaitForString "#" crt.Screen.Send "no shut" & VbCr crt.Screen.WaitForString "#" crt.Screen.Send "int e0" & VbCr crt.Screen.WaitForString "#" crt.Screen.Send "no shut" & VbCr crt.Screen.WaitForString "#" wshshell.Sendkeys "^Z" crt.Screen.WaitForString "console" crt.Screen.Send VbCr crt.Screen.WaitForString "#" crt.Screen.Send "conf t" & VbCr crt.Screen.WaitForString "#" crt.Screen.Send "line vty 0 4" & VbCr crt.Screen.WaitForString "#" crt.Screen.Send "pass" & " " & newvtypwd & VbCr crt.Screen.WaitForString "#" crt.Screen.Send "login" & VbCr crt.Screen.WaitForString "#" wshshell.Sendkeys "^Z" crt.Screen.WaitForString "console" crt.Screen.Send VbCr crt.Screen.WaitForString "#" crt.Screen.Send "cop ru sta" & VbCr crt.Screen.WaitForString "]" crt.Screen.Send VbCr crt.Screen.Synchronous = False end sub
< Message edited by
Snipah
--
11/15/2005 2:40:02 AM
>
Revisions: 1
|
Post #: 1
RE: password recovery on Cisco routers -
12/5/2005 3:17:11 AM
kirrilian
Posts: 628
Score: 3
Joined: 3/15/2005
From:
Status:
offline
One thing to note, I believe this requires secureCRT to be installed for this script to work.
_____________________________
Have you searched
here
?
VBScript Fundamentals
My Site
(in reply to
Mauzer
)
Post #: 2
If you found our site useful please link to us
<a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>
.
All Forums
>>
[Scripting]
>>
Post a VBScript
>> password recovery on Cisco routers
Page:
[1]
Jump to:
Select a Forum
All Forums
----------------------
[Welcome]
- - Forum Rules
- - Test Posting Messages
- - New Member Area/Introduction
[Scripting]
- - WSH & Client Side VBScript
- - WSH & Client Side VBScript Tutorial
- - Post a VBScript
- - Windows PowerShell
- - ASP
- - ASP.NET
- - Windows Script Components
[General Forum]
- - Other Programming/Scripting Languages
- - Suggestions & Feedback
- - Off-Topic Lounge
New Messages
No New Messages
Hot Topic w/ New Messages
Hot Topic w/o New Messages
Locked w/ New Messages
Locked w/o New Messages
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
Forum Software ©
ASPPlayground.NET
Advanced Edition
2.5.5 ANSI