telnet

Using conditional statements inside 'expect'

孤街浪徒 提交于 2019-12-28 05:16:26
问题 I need to automate logging into a TELNET session using expect , but I need to take care of multiple passwords for the same username. Here's the flow I need to create: Open TELNET session to an IP Send user-name Send password Wrong password? Send the same user-name again, then a different password Should have successfully logged-in at this point... For what it's worth, here's what I've got so far: #!/usr/bin/expect spawn telnet 192.168.40.100 expect "login:" send "spongebob\r" expect "password

Using conditional statements inside 'expect'

大兔子大兔子 提交于 2019-12-28 05:16:06
问题 I need to automate logging into a TELNET session using expect , but I need to take care of multiple passwords for the same username. Here's the flow I need to create: Open TELNET session to an IP Send user-name Send password Wrong password? Send the same user-name again, then a different password Should have successfully logged-in at this point... For what it's worth, here's what I've got so far: #!/usr/bin/expect spawn telnet 192.168.40.100 expect "login:" send "spongebob\r" expect "password

windows开启telnet服务步骤

不问归期 提交于 2019-12-25 22:35:54
1 打开“控制面板” 2 进入“程序和功能” 3 点击“启用或关闭windows功能” 4 勾选“Telnet 客户端” 1 打开 “控制面板” (1) 打开系统 “控制面板” ,将 查看方式换成大图标 或者小图标。 2 进入 “程序和功能” (1) 找到下面的 “程序和功能” ,并双击打开。 3 点击 “启用或关闭windows功能” (1) 找到下面的 “启用或关闭windows功能” ,并双击打开。 4 勾选 “Telnet 客户端” (1) 在右边弹框中,找到 “Telnet 客户端” 勾选上,并确定即可。 来源: https://www.cnblogs.com/huzhi/p/11193579.html

linux - telnet - script with expect

本小妞迷上赌 提交于 2019-12-25 16:25:47
问题 I was writing an expect-script which communicate with a server via telnet, but right now i need to evaluate the reply from server. Usage: ./edit.expect EXPECT script: #!/usr/bin/expect<br> spawn telnet ip port expect "HUH?" send "login testuser pass\r" expect "good" send "select 1\r" expect "good" send "me\r" expect "nick=testuser id=ID group=testgroup login=testuser" send "edit id=ID group=3\r" expect "good" send "quit\r" If i send the command "me" i get a reply from the server which i need

Batch file to telnet and run commands on a unix server

三世轮回 提交于 2019-12-25 08:34:15
问题 I'm stuck here, and I really can use your help. Here's my situation. Im looking forward to create a batch script which can access a unix server using telnet. Here the unix sever will ask for username/password. After it has authenticated the user, i want to preform some operations like chown on a perticular file. Here's what im looking to do : telnet open xyz.abc.com username password command 1 command 2 command 3 exit where xyz.abc.com is the unix server where i want to connect. username and

Connect to telnet via webpage

落花浮王杯 提交于 2019-12-25 08:16:17
问题 I'm new to telnet and sockets and right now I'm all confused over its concepts. So I can use some help here. So far I've created a simple telnet server using Node.js's package net . Here's a little snippet of that, function newSocket(socket) { sockets.push(socket); console.log('A new telnet connection!\n'); socket.on('data', function(data) { }); socket.on('end', function() { console.log('A Telnet socket disconnected!\n'); }); } var telnetServer = net.createServer(newSocket); telnetServer

Net::Telnet output of cmd timed-out

左心房为你撑大大i 提交于 2019-12-25 05:31:55
问题 I tried to build a little telnet script to gain contact with the Net::Telnet module in Perl and I struggle with a command timeout when I try to receive the output. $telnet = new Net::Telnet ( Timeout=>10); $telnet->errmode("return"); $telnet->open('192.168.0.187'); $telnet->waitfor('/Username: $/i'); $telnet->print('admin'); $telnet->waitfor('/Password: $/i'); $telnet->print('admin'); $telnet->waitfor('/admin >$/i'); @output = $telnet->cmd('show'); #$telnet->waitfor('/admin >$/i'); print

Connection is not being established

亡梦爱人 提交于 2019-12-25 05:29:14
问题 I have two running container for flume and hadoop. Let it be hadoop2 and flume2. I created these two containers from two images namely hadoop_alone and flume_alone. docker run -d -p 10.236.173.XX:8020:8020 -p 10.236.173.XX:50030:50030 -p 10.236.173.XX:50060:50060 -p 10.236.173.XX:50070:50070 -p 10.236.173.XX:50075:50075 -p 10.236.173.XX:50090:50090 -p 10.236.173.XX:50105:50105 --name hadoopservices hadoop_alone I get into hadoop container and checked for exposed ports. So All the ports are

Perl telnet does not wait for the end of the previous command

旧街凉风 提交于 2019-12-25 05:29:06
问题 Perl telnet does not wait for the end of the previous command. In the file infile.log I see the continuation of the command my @ config = $ telnet-> cmd ("sh run"); , but the script is already beginning to run the command print ("Format configuration", $ _, "\ n"); . As a result, I get an empty array @config. foreach (@linksys_sps){ print ("Connecting to ",$_,"\n"); my $telnet = new Net::Telnet ( Timeout=>10,Errmode=>'return',Input_Log => "infile.log"); $telnet->open($_); if ($telnet->errmsg)

curl not available by default, so what can my script use instead to GET/POST/PUT?

ぐ巨炮叔叔 提交于 2019-12-25 03:44:15
问题 I am writing a Nautilus script that currently uses curl to GET/POST/PUT to a REST service. Installing my script should be as simple as dropping a single file to ~/.gnome2/nautilus-scripts My concern is that many computers do not have curl installed. I need to use a tool that is available nearly everywhere. What would be a more widespread (should be installed by default on most distros) yet usable alternative to curl ? wget does not allow PUT. Maybe telnet ? 来源: https://stackoverflow.com