View Single Post
  #1  
Old 07-13-2004, 02:49 PM
Elder's Avatar
Elder Elder is offline
Registered User
 
Join Date: May 2004
Posts: 2
Basic automated login script (BigBand 12k)

#$language = "VBScript"
#$interface = "1.0"

' This program is an automated login script for the
' BigBand (formerly ADC) Cuda 12000. It cycles through
' your logins and then sets timeout on the session to 0
' so your session will not be terminated due to inactivity.
' It can easily be modified to work for Cisco logins or
' for multiple types of equipment that require different username/
' password syntax as well.
' Written by Elder

Sub main
Dim login
Set text = crt.Screen
crt.Screen.Synchronous = True

'#########################################
'#Depending on if you come in via telnet
'#or via shell you may need to add a delay
'#for the CLI to load.
'#########################################

' text.WaitForString "root>", 5
login = "root>"
' MsgBox "Script paused for CLI to have time to load."

'#########################################
'# This section is for Cuda 12K logins.
'# It will try the root passwords for all
'# possible default password
'# configurations.
'#########################################

If text.WaitForString (login, 10) Then
text.Send "en root" & VbCr
text.WaitForString ":",1
text.Send "******" & vbCr
If text.WaitForString (login, 2) Then
text.Send "en root" & VbCr
text.WaitForString ":",1
text.Send "******" & VbCr
End If
If text.WaitForString (login, 2) Then
text.Send "en root" & VbCr
text.WaitForString ":",1
text.Send "******" & vbCr
If text.WaitForString (login, 2) Then
text.Send "en root" & VbCr
text.WaitForString ":",1
text.Send "******" & vbCr
End If
If text.WaitForString (login, 2) Then
text.Send "en root" & VbCr
text.WaitForString ":",1
text.Send "******" & VbCr
End If
If text.WaitForString (login, 2) Then
text.Send "en root" & VbCr
text.WaitForString ":",1
text.Send "******" & VbCr
End If
If text.WaitForString (login, 2) Then
text.Send "en root" & VbCr
text.WaitForString ":",1
text.Send "******" & VbCr
End If
If text.WaitForString (login, 2) Then
text.Send "en root" & VbCr
text.WaitForString ":",1
text.Send "******" & VbCr
End If
End If
text.Send "set timeout 0" & VbCr
crt.Screen.Synchronous = False
Exit Sub
End If
End Sub
Reply With Quote