telnet

How can I screen-scrape output from telnet in Perl?

我只是一个虾纸丫 提交于 2019-12-01 16:23:20
I can setup a telnet connection in Perl no problems, and have just discovered Curses, and am wondering if I can use the two together to scrape the output from the telnet session. I can view on a row, column basis the contents of STDOUT using the simple script below: use Curses; my $win = new Curses; $win->addstr(10, 10, 'foo'); $win->refresh; my $thischar=$win->inch(10,10); print "Char $thischar\n"; And using the below I can open a telnet connection and send \ receive commands with no problem: use net::telnet; my $telnet = new Net::Telnet (Timeout => 9999,); $telnet->open($ipaddress) or die

How can I screen-scrape output from telnet in Perl?

风格不统一 提交于 2019-12-01 15:13:00
问题 I can setup a telnet connection in Perl no problems, and have just discovered Curses, and am wondering if I can use the two together to scrape the output from the telnet session. I can view on a row, column basis the contents of STDOUT using the simple script below: use Curses; my $win = new Curses; $win->addstr(10, 10, 'foo'); $win->refresh; my $thischar=$win->inch(10,10); print "Char $thischar\n"; And using the below I can open a telnet connection and send \ receive commands with no problem

How to capture and feed telnet using php and shell scripting?

*爱你&永不变心* 提交于 2019-12-01 14:34:23
This is what i want to accomplish using php (possibly using exce()?): telnet to a whois registrar using a program called proxychains: proxychains telent whois.someregistrar 43 if failed -> try 1 again feed a domain name to the connection: somedomainname.com capture data returned by the registrar to php I have no experience with shell scripting so how do i capture the event in which telnet is connected and hangs for input and how do i "feed" it? Am i totaly off here or is this the right way to go about it? EDIT: i see python have a good way to handel this using expect drew010 Here is a basic

Python - telnet - automation APC PDU

本秂侑毒 提交于 2019-12-01 12:59:53
I am attempting to automation turning off connected devices to an APC PDU using python's built in telnet functionality. I believe I am able to enter in the username and password, but I cannot proceed after that. My code is as follows: telnet_session = telnetlib.Telnet(host=self.apc_ip) self.logger.info("Entering APC Username") telnet_session.read_until("User Name :") telnet_session.write(self.apc_username + "\n") self.logger.info("Entering APC Password") telnet_session.read_until("Password :") telnet_session.write(self.apc_password + "\n") sleep(2) print telnet_session.read_all() I'm running

How do I handle parallel reads and writes on a TcpStream?

折月煮酒 提交于 2019-12-01 12:14:51
问题 I read Idiomatic way to handle writes to a TcpStream while waiting on read, but I'm still unsure of how to handle this. I'm connecting to a Rust binary via Telnet and would like to send "commands" and receive "status". Almost like a simple echo server. 回答1: I ended up cloning the stream and it's working fine: let second_stream = stream.try_clone().expect("Cannot clone stream"); let mut reader = BufferedReader::new(second_stream); let mut writer = BufferedWriter::new(stream); 回答2: Just an

How do I use fsockopen() to open a Telnet connection with a password?

不问归期 提交于 2019-12-01 12:01:44
I'd like to access a camera through it's Telnet capability. The problem is, it has Password-protection. This is no problem when doing it via Terminal, as I just use telnet 10.30.blah.blah then enter my password when prompted. But in php, I don't see the opportunity to input a password. $con = fsockopen("10.30.blah.blah", 25); $msg = "camera move left"; fwrite($con, $msg); Anybody have any ideas? UPDATE : I tried just using fputs to output the password as @Cfreak said, but still to no avail. If I do exactly what the script is trying in terminal, it works. Here's the code now: $con = fsockopen(

Telnet Server

删除回忆录丶 提交于 2019-12-01 06:08:28
I would like to implement a telnet server in C. How would I proceed with this? Which RFCs should I look at? This is important to me, and I would appreciate any help. For very basic telnet (just telnet to a port and echo bytes), there's not much to do. Read from a socket, process it (in an echo server, do nothing), spit back a result. You could implement a simple MUD-style server without knowing anything in any RFCs. But if you're really concerned about RFCs, RFC 854 might be a starting point. http://www.faqs.org/rfcs/rfc854.html If you are serious about network programming I would highly

如何检测远程主机上的某个端口是否开启

橙三吉。 提交于 2019-12-01 04:52:11
1、安装telnet。我的win7下就没有telnet,在cmd下输入telnet提示没有该命令。于是我们进入控制面板---->程序---->打开或关闭windows功能。然后等一段时间,在出来的对话框把telnet客户端和telnet服务器勾选上,其他的不用管,然后点击确定。这样就安装好了telnet组件了。 2、 下面开始测试某个端口是否开启,比如我测的是10.10.11.245的80这个端口。在cmd下输入 start /min telnet 10.10.11.245 80 之后会出现一个窗口,是最小化的,你等一会,如果窗口自动关闭了,说明端口是关闭的或主机ping不通,反之端口开放. 比如这个80端口是开放的,就出现如图所以的窗口,否则窗口关闭。 3、你可以用自己的机子做实验.在CMD下输入netstat -anp tcp可以查看当前主机tcp开放了哪些端口. 来源: https://www.cnblogs.com/xiaogou/p/11655662.html

Telnet Server

允我心安 提交于 2019-12-01 04:08:18
问题 I would like to implement a telnet server in C. How would I proceed with this? Which RFCs should I look at? This is important to me, and I would appreciate any help. 回答1: For very basic telnet (just telnet to a port and echo bytes), there's not much to do. Read from a socket, process it (in an echo server, do nothing), spit back a result. You could implement a simple MUD-style server without knowing anything in any RFCs. But if you're really concerned about RFCs, RFC 854 might be a starting

开启linux平台ftp/telnet服务

末鹿安然 提交于 2019-12-01 03:55:26
在安装好Redhat以后,需要设置Ftp和 telnet 服务文件,才能启动Ftp和 telnet 服务,可以通过远程控制进行开启。 1.1、用root用户登录,进入终端命令模式; 1.2、开启ftp服务。 cd /etc/xinetd.d ,编辑ftp服务的配置文件gssftp的设置: 图1 开启ftp服务设置. vi gssftp ,将 修改两项内容: (1)server_args = -l –a 去掉-a 改为server_args = -l (2)disable=yes改为disable=no (3)保存退出。 1.3、开启 telnet 服务 cd /etc/xinetd.d ,察看 telnet 服务的配置文件krb5- telnet 的设置: 图2 开启 telnet 服务设置 vi krb5- telnet , (1)将disable=yes,改为disable=no,保存退出。 1.4、激活服务: telnet /ftp 是挂在 xinetd 底下的,所以自然只要重新激活 xinetd 就能够将 xinetd 里头的设定重新读进来,所以刚刚设定的 telnet /ftp自然也就可以被激活。 激活目录和命令: cd /etc/rc.d/init.d/ service xinetd restart 有时会提示命令不存在,需要加上命令的路径 [root