bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: /dev/tcp telnet negotiation


From: Illia Bobyr
Subject: Re: /dev/tcp telnet negotiation
Date: Fri, 29 Apr 2011 11:25:42 -0500
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.17) Gecko/20110414 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.10

On 4/28/2011 7:09 AM, Allan Pinto wrote:
>
> Hi,
> i run a lot telnet scripts using /dev/tcp for cisco routers, lately we
> have newer models of cisco routers which have ios-xr which is based on
> linux and also some mikrotik routers which are again based on linux,
> on these devices when i run my script all i get is  ÿý^Xÿý
> ÿý#ÿý'ÿý$ÿý! in my output, no username prompt, on the same device if
> if use a netcat -T option which is for telnet negotiation, it works,
> Could anyone guide me in the right direction where i can achieve the
> same using /dev/tcp
> below example script
>
> #!/bin/bash
>
> exec 3<>/dev/tcp/$1/23
> sleep 1
> echo -e "username">&3
> echo -e "password">&3
> echo -e "sh ver">&3
> #sleep 2
> echo -e "logout">&3
> cat<&3 > $1.txt
>

Hi,

Telnet is not just a pipe.  It is a real protocol.  Though, rather a 
simple one.
What you see is a telnet options negotiation.
See http://www.faqs.org/rfcs/rfc854.html for details.

Ilya Bobyr



reply via email to

[Prev in Thread] Current Thread [Next in Thread]