telnet

getting the line in shell script

纵然是瞬间 提交于 2019-12-11 14:59:39
问题 Im trying to get all " RESP:0,sucess;" in line- Enter command:RESP:0,sucess;- here is my codes.how will I take it? **for i in {2..4} do date CMDCount="CMD"$i eval CMD="$"$CMDCount echo "server CMD "${CMD}""${CMDCount}""; echo "" (sleep 1;echo $login; sleep 1;echo ${CMD}; sleep 1;echo $logout;sleep 1)|telnet localhost 9685 sleep 1 done** the output is like these: server CMD xxxxxxxxxxxxxxxxxxxxxxxxxxxxCMD2 Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. CONNECTING TO xxx.

Socket not writable while using `telnet-client`

廉价感情. 提交于 2019-12-11 14:31:54
问题 I am using the following code to perform telnet using NodeJS but it is throwing socket not writable error 'use strict' const Telnet = require('telnet-client') async function run() { let connection = new Telnet() let params = { host: 'linux0203', port: 2345, shellPrompt: '/ # ', timeout: 1500 } try { await connection.connect(params) } catch(error) { // handle the throw (timeout) } let res = await connection.exec('uptime') console.log('async result:', res) } run() Error: (node:23452)

Negotiating echo with telnet client

混江龙づ霸主 提交于 2019-12-11 14:20:56
问题 For some reason, I want to create a server for the standard Telnet application as client to connect to. I wrote a basic TCP server in C++, its purpose is to serve an interactive menu, so I have to set ECHO on my side. When the client connects, I send IAC WILL ECHO to it, and I expected to get IAC DO ECHO . To my surprise, what I get is IAC DO ECHO , IAC WON'T ECHO , IAC DON'T ECHO . Three messages one by one. And the client is still echoing by itself. What am I doing wrong? What do those

Java - socket.isConnected returns true to ANY ip address using port 80

限于喜欢 提交于 2019-12-11 13:12:38
问题 I am trying to establish communication with a device on my local network via the use of Socket , and verify the connection using the Socket.isConnected() method - seems simple enough, but I am getting some strange behavior. Currently, I instantiate an unconnected socket with the no-arg Socket() constructor, and then, when ready, connect to the server (which is on port 80 for the device). Here is a snippet of the code: deviceSocket = new Socket(); ... SocketAddress deviceSocketAddress = new

TcpClient Stream streamReader.ReadToEnd() for Telnet

无人久伴 提交于 2019-12-11 13:11:53
问题 I developing a bidirection dialog between a server and a device using a telnet connection. I would like to wait and get the read buffer before sending the next command. I tryed to use this: TcpClient tcpClient; NetworkStream networkStream; StreamWriter streamWriter; tcpClient = new TcpClient("10.0.0.51", 23); networkStream = tcpClient.GetStream(); StreamReader streamReader = new StreamReader(networkStream); networkStream.ReadTimeout = 500; while(wline!="exit"){ Console.Write(streamReader

Which Java Telnet or openSSH library?

*爱你&永不变心* 提交于 2019-12-11 11:53:29
问题 I need to make a small test program in java which has to communicate with remote Windows server using telnet, or openSSH. Which library would you suggest to use? I'd like to use a well documented and stable library. 回答1: I would use JSch (and do). It's not too large to learn quickly. It's used in: Ant(1.6 or later). JSch has been used for Ant's sshexec and scp tasks. Eclipse(3.0). Our Eclipse-CVSSSH2 plug-in has been included in Eclipse SDK 3.0. This plug-in will allow you to get ssh2

how to test my ldap server url using telnet

邮差的信 提交于 2019-12-11 11:23:56
问题 i have an ldap server on my local and remote. I could telnet to my local ldap url, but i have trouble telnet to my remote. telnet www.ilovebears.com 389 and i get an empty screen with a blinking cursor. is this because of some socket configuration or that the port isn't available? 回答1: telnet www.ilovebears.com 389 and i get an empty screen with a blinking cursor That's exactly what you should get. LDAP doesn't speak Telnet. All you can accomplish with a Telnet client is to establish that the

How to fetch a binary file from a remote embeded system using telnet?

六月ゝ 毕业季﹏ 提交于 2019-12-11 11:17:20
问题 I have a remote embedded system and it is telnet-able. How can I fetch a binary file from it using ruby? If it were a text file, I could have used: con = Net::Telnet::new("Host"=>ip,"Timeout"=>200) #Host not host File.open("fetched_file","w+") do |f| con.cmd("cat /ect/file") {|data| f.write(data)} end But this wouldn't work for binary file you won't get desirable data by cat ing it. 回答1: establish your telnet connection then send the command: uuencode filename - to the remote host, replacing

Netcat drops incoming packets

强颜欢笑 提交于 2019-12-11 11:04:55
问题 I use bash commands on a Ubuntu machine for controlling a measurement instrument. Both machines are connected to the same LAN. The measurement instrument listens on TCP port 5025 for SCPI commands. The standard test - asking for the instrument's ID - works nicely: mjh@Ubuntu:~$ echo "*IDN?" | netcat 192.168.0.10 5025 Rohde&Schwarz,ZVL-3,12345 But when I query for data (I expect 1818 ASCII characters), netcat just returns immediately: mjh@Ubuntu:~$ echo "TRAC? TRACE1" | netcat 192.168.0.10

SSH and telnet to localhost using python

萝らか妹 提交于 2019-12-11 09:39:37
问题 I am new to python and if the question is very nooby i apologize. Simply put i need to write a script that connects to remote via ssh then telnets to localhost and execute a command on a shell there. I am using Python 2.4.3. I have read alot of similar questions here , and alot of people suggest to use modules such as Paramiko, Pexpect etc. However this is out of question - i am supposed to use only "native" 2.4.3 libraries. I have tried messing around with subprocess module and i have