免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
楼主: heon1978
打印 上一主题 下一主题

自动telnet并且自动运行对方shell。 [复制链接]

论坛徽章:
0
1 [报告]
发表于 2003-01-23 14:02 |显示全部楼层

自动telnet并且自动运行对方shell。

#!/usr/bin/expect

spawn telnet [lindex $argv 0]
set user [lindex $argv 1]
set passwd [lindex $argv 2]
expect "*login:"
send "$user\n"
expect "*Password:"
send "$passwd\n"
expect {
       "*Login incorrect" { send_user "incorrect user or name"; exit }
       "*" {
                   system cat /etc/passwd;
                   system ls -l
                   exit
             }
       }


用法:
./getrpass.expect host user passwd

好使
我昨天刚装的
先装tcl,再装expect

http://www.chinaunix.net/cgi-bin/bbs/topic.cgi?forum=11&topic=1666&show=0

论坛徽章:
0
2 [报告]
发表于 2003-01-23 17:34 |显示全部楼层

自动telnet并且自动运行对方shell。

装tcl的目录和expect的目录要在一个目录下
装完tcl把生成的库cp到/usr/lib下
万无一失

红袖原来是shell专家,失敬
帮忙看看我的那篇sendmail发附件的问题呀

论坛徽章:
0
3 [报告]
发表于 2003-01-23 17:37 |显示全部楼层

自动telnet并且自动运行对方shell。

沉底了
http://chinaunix.net/forum/viewtopic.php?t=6729

论坛徽章:
0
4 [报告]
发表于 2003-01-23 17:41 |显示全部楼层

自动telnet并且自动运行对方shell。

原帖由 "heon1978" 发表:
试了一下,发现Tcl 有问题,讲一下Tcl的安装步骤.
请讲一下是应该装Tcl,还是X:
如果是装X,那么怎么装.

x就是图形界面,cde,gnome,kde
如果没有down了装
tcl安装:
./configure --enable-gcc(if gcc is not default)
make
make install
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP