Getting the pre-login banner from server with VBScript - WeOnlyDo Discussion board

Getting the pre-login banner from server with VBScript (wodSSH / wodSSH.NET)

by Marvin, Thursday, July 01, 2021, 03:33 (1029 days ago)

Hi,
I am testing using wodSSH to replace w3sock in vbscripts that i use telnet and ssh. I am able to make wodSSH work with my testing vbscripts, however there is one issue i cannot figure out how to do. How to get the pre-login banner sent by the telnet or ssh server. I need the banner data to choose the login credentials and choose script telnet actions. Can you help me with getting the pre-login banner? Here is a sample of what i am using for testing (which works well):


On Error Resume Next
Set connTelnet = CreateObject("WeOnlyDo.wodSSHCom")
connTelnet.Hostname = 10.10.1.100
connTelnet.Protocol = 1 'telnet
connTelnet.Blocking = True
connTelnet.StripANSI = True
connTelnet.Login = "user"
connTelnet.Password = "password"
connTelnet.Prompt = "user>"
connTelnet.AllocatePty = False
connTelnet.DataReady = 0
err.Clear
connTelnet.Connect
telnetErr = err.Description
 'banner = connTelnet.Banner <- doesn't work, hangs right here
 'wscript.echo banner <- returns blank
connTelnet.WaitFor "user>"
buffOpen = connTelnet.Execute("ipconfig /all" & VbCrLf)
connTelnet.Execute "exit" & VbCrLf, "\n"
connTelnet.Disconnect
wscript.echo "telnetErr = " & telnetErr '& VbCrLf & "buffOpen: " & buffOpen

Complete thread: