telnet

python telnet and put the message in a particular log file

[亡魂溺海] 提交于 2019-12-08 07:36:27
hi I am coding the python script to login telnet and it has to write log file to op.txt the absolute path is /netperf/mntpt/array1/home/prg_use/op.txt the python code ptlog.py import getpass import sys import telnetlib import time host ="12.12.1.123" user ="user_name" passwd ="telnet_password" tn = telnetlib.Telnet(host) tn.read_until("login: ") tn.write(user + "\n") tn.read_until("Password: ") tn.write(passwd + "\n") tn.write("touch op.txt \n") time.sleep(5) tn.write("lr \n") str_all=tn.read_until("$") #f=open("/netperf/mntpt/array1/home/prg_use/op.txt", "w") f=open("op.txt", "w") f.write(str

Telnet to login with username and password to mail Server

主宰稳场 提交于 2019-12-08 07:17:29
问题 I am having some issues trying to connect through telnet to a mail server.The main problem that I am having is that I need to create a script that logs me to the destination and I can't find a way to echo the password. What I tried: telnet host -l username ; echo 'password' And still it asks for my password.Is there any way to fix this or I am doing something wrong? 回答1: First of all, you can use eval : eval "{ echo user_name; sleep 1; echo pass; sleep 1; echo '?'; sleep 5; }" | telnet host

How to use a string variable as a telnet command in a vbscript?

荒凉一梦 提交于 2019-12-08 05:38:24
问题 I'm trying to run a Powershell script that will call a batch script that will start a telnet session and run the following command: mediaGet("gei",1) Thanks to this stackoverflow question Is it possible to use a batch file to establish a telnet session, send a command and have the output written to a file? I have written two scripts: telnet.bat start telnet.exe 162.100.10.10 cscript telnet.vbs telnet.vbs set OBJECT=WScript.CreateObject("WScript.Shell") Dim cmd cmd = "mediaGet("gei",1) WScript

Hpux telnet using socket

混江龙づ霸主 提交于 2019-12-08 05:24:42
问题 o Sun OS, UTS, AIX etc. But, when the same program is run with HP UX on the other end, we are unable to receive the response from the HP UX box (B.11.31 O/S). sSocket = socket(AF_INET,SOCK_STREAM,0); connect(sSocket,(struct sockaddr *)&sin,sizeof(sin); ierr = read(sSocket,szBuffer,BUF_LEN-1); When the read is called, we get junk messages like this Message received :ÿý$ Message received :ÿýÿþÿý Message received :ÿü!ÿû This code was working for all the other OSs like I stated earlier. Can

Linux script telnet HEAD request [duplicate]

被刻印的时光 ゝ 提交于 2019-12-08 04:26:23
问题 This question already has answers here : Scripting an HTTP header request with netcat (5 answers) Closed 5 years ago . So basically I'm trying to do something fairly easy; I'm trying to make a script to telnet to the microsoft server and requesting the HEAD of the page. But as expected, it doesn't work. If I just enter it manually into the console it works, but when executing the script doesn't work at all. This is the script I made: echo "telnet $1 $2" sleep 10 echo "HEAD $3 HTTP/1.0" echo

Auto exit Telnet command back to prompt without human intervention ^] quit close exit code 1

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-07 14:52:05
问题 I'm running telnet command on a host for a given port (which is open), it returns 0 (success). For trying telnet manually, I type the following command, then I press control+bracket i.e. ^] , then press Enter key, then I get to telnet> prompt, where if I type close or quit , it comes back to the $ prompt and seeing exit status of last command shows 0 for (success) as port 2878 is open (as per the telnet command's output). [vagrant@myvagrant /tmp] $ telnet `hostname` 2878 Trying 127.0.0.1...

How do I use Python libs such as Paramiko for chain connections with Telnet and SSH

烈酒焚心 提交于 2019-12-07 08:00:26
问题 Similar to a question asked here: SSH and telnet to localhost using python I'm trying to find a solution to the following problem: From Server A (full rights) over Jumhost B (no sudo), I want to connect to several Network devices using Python (one after another is enough, it doesn't have to be in the same time). With SSH only this would be no problem but a lot of devices use Telnet only (I know that this isn't secure, but it wasn't my decision to do it like that). After research I came across

Launch VLC in Java and connect to it via rc interface

末鹿安然 提交于 2019-12-07 04:29:27
问题 I've already seen this thread, but I'm still having an issue: starting vlc player in java It appears the Java bindings for VLC are no longer under active development and do not support everything possible on the command line anyway. Given the following code, I can't launch VLC from a Java application on Mac OS 10.5.8 (Java 1.6) and then connect to it via the rc interface through the Terminal or another Java application. public class Main { public static void main(String[] args) { String s =

远程登录:telnet与ssh

Deadly 提交于 2019-12-07 03:38:41
1,什么是远程登录 远程登录是用户使用ssh,telnet等命令,登录到一台远程服务器进行操作,使自己的计算机暂时成为远程主机的一个仿真终端的过程。 登录系统后所有的操作都是对远程主机的操作,仿真终端等效于一个非智能的机器,它只负责把用户输入的每个信息回显在本地终端屏幕上,再将主机输出的每个信息回显在本地终端屏幕上。。 远程登录是现代网络中最重要的手段之一,几乎所有的网络设备都提供远程登录功能,Linux系统的远程登录功能更为强大。 2, telnet 为了适应异构环境,Telnet协议定义了数据和命令在Internet上的传输方式,此定义被称作网络虚拟终端NVT(Net Virtual Terminal)。它的应用过程如下: 对于发送的数据:客户机软件把来自用户终端的按键和命令转化为 格式,并发送到服务器,服务器软件将收到的数据和命令,从NVT格式转换为远程需要的格式。 对于返回的数据:远程服务器将数据从远程机器的格式转换为NVT格式,而本地客户机将将接收到的 格式数据在转换为本地的格式。 3,SSH SSH是英文Secure shell 的缩写形式,它是目前较可靠,专为远程登录会话和其他网络服务提供安全性的协议。利用SSH协议可以有效防止远程管理过程中的信息泄漏问题。 3.1 什么是SSH? 传统的网络服务程序,如:ftp、POP和telnet在本质上都是不安全的

Can not use command telnet in git bash

一曲冷凌霜 提交于 2019-12-06 22:32:45
问题 I try to use the command telnet in Git Bash, but it shows this error: bash:telnet: command not found My operating system is Windows 10. Any idea is appreciated. 回答1: That's because telnet is not provided with git. In windows, you need to go to control panel, programs, turn windows features on/off and enable the telnet client. 回答2: To add on to @lostbard's answer and @signonsridhar's comment, telnet utility need to be invoked with winpty to work on git bash. Example: MINGW64 ~ $ which telnet