Strange Returns - WeOnlyDo Discussion board

Strange Returns (wodSSH / wodSSH.NET)

by Simon, Monday, April 27, 2009, 15:30 (5477 days ago)

Hi,

Following the last succeful help, i am going to post another similar question.

We have a router, and a Cisco Unity Express blade in it (this is a linux based computer running in the router.

If i use standard windows telnet it works fine. but when i am using the following code

ssh1.Send( service-module integrated-Service-Engine 1/0 session + vbLf)
System.Threading.Thread.Sleep(1000)
If ssh1.DataReady > 0 Then
a = ssh1.Receive
TextBox1.Text = TextBox1.Text & a
Application.DoEvents()
ssh1.DataReady = 0
End If
ssh1.Send(vbCrLf)
a = ssh1.WaitFor( regex:[#>]$ , 10)
TextBox1.Text = TextBox1.Text & a
Application.DoEvents()
If ssh1.DataReady > 0 Then
a = ssh1.Receive
TextBox1.Text = TextBox1.Text & a
Application.DoEvents()
ssh1.DataReady = 0
End If
pos = 7
ssh1.Send( sh run|include user[0-z ]+ber x224217303x22 & vbCr)
System.Threading.Thread.Sleep(3000)
If ssh1.DataReady > 0 Then
a = ssh1.Receive
TextBox1.Text = TextBox1.Text & a
Application.DoEvents()
ssh1.DataReady = 0
End If
Application.DoEvents()


I am getting wierd responses (as shown below)


service-module integrated-Service-Engine 1/0 session
Trying 10.196.7.2, 2066 ... Open
CC



This is the Milan Router.


No unauthorised access is permitted.

The equipment now being accessed and information available through
this equipment is confidential and proprietary, and may be accessed
or used only as specifically authorized. All other access or use
is prohibited and is subject to legal action.


MILACUE11>>
MILACUE1>
MILACUE11>> sh run|include user[0-z ]+ber x224217303x22
MILACUE11>> sh run|include user[0-z ]+ber x224217303x22 username VMasDDDD phonenumber 4217303

MILACUE1>


As you can see it is listing it twice with some wierd characters in random places.

This does cause issues because i was waiting for the MILACUE1> but it apears many times.

Any help would be most greatful.


Complete thread: