Gheek.net

January 28, 2008

securecrt-jumpbox-telnet_vbs

Filed under: vbs — Tags: , , , , — lancevermilion @ 12:42 am

This script is very handy to use when you are using a program like SecureCRT and you have to use a bastion host to get inside a network.

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

' This script will provide a means of connecting to a remote system via a jump box.
' To utilze this script the profile must be created as follows.
'
' Create the session profile with the actual destination remote system FQDN or IP in the "Name" field.
' Input the jump box FQDN or IP in the "Hostname" field.  Upon connection you will
' be prompted for the username and password of the jump box and then the username and password
' for the destination remote system.
' ** The protocol must be set to that of the jump box, not that of the actual destination remote system.
' ** The protocol for the acutal remote system is specificed in this script, example "telnet or ssh".
'
' This script was written for use with DHL. Please contact Donnie Williams with any questions
' or concerns.

Sub Main

  Dim host
  host = crt.window.caption
  Dim arrHost
  arrHost = split(host, "-")
  host = arrHost(0)

  crt.Screen.Send "telnet " & host & VbCr

End Sub

securecrt-jumpbox-ssh_vbs

Filed under: vbs — Tags: , , , , — lancevermilion @ 12:40 am

This script is very handy to use when you are using a program like SecureCRT and you have to use a bastion host to get inside a network.

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

' This script will provide a means of connecting to a remote system via a jump box.
' To utilze this script the profile must be created as follows.
'
' Create the session profile with the actual destination remote system FQDN or IP in the "Name" field.
' Input the jump box FQDN or IP in the "Hostname" field.  Upon connection you will
' be prompted for the username and password of the jump box and then the username and password
' for the destination remote system.
' ** The protocol must be set to that of the jump box, not that of the actual destination remote system.
' ** The protocol for the acutal remote system is specificed in this script, example "telnet or ssh".
'
' This script was written for use with DHL. Please contact Donnie Williams with any questions
' or concerns.

Sub Main

  Dim host
  host = crt.window.caption
  Dim arrHost
  arrHost = split(host, "-")
  host = arrHost(0)

  Dim user
  user = crt.Dialog.Prompt("Enter your Login Name for " & host & ":", host )

  crt.Screen.Send "ssh -l " & user & " " & host & VbCr

  Dim pass
  pass = crt.Dialog.Prompt("Enter your Password for " & user & "@" & host & ":", host , "", True)

  crt.Screen.Send pass & VbCr


End Sub

Create a free website or blog at WordPress.com.