python---pexpect的ssh模拟ssh登陆

python—pexpect的ssh使用

使用的pexpect模拟kali linux客户端ssh登陆另外一台kali linux服务器
1、前提两台kali linux 机器,
kali linux 客户端 192.168.100.139
kali linux 服务器 192.168.100.140

2、使用客户端192.168.100.139 ssh能够登陆进去192.168.100.140

root@kali:~# 
root@kali:~# ifconfig#本机客户端
eth0      Link encap:Ethernet  HWaddr 00:0c:29:ad:34:08  
          inet addr:192.168.100.139  Bcast:192.168.100.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:fead:3408/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2025172 errors:0 dropped:1370 overruns:0 frame:0
          TX packets:220482 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:292858397 (279.2 MiB)  TX bytes:21145429 (20.1 MiB)
          Interrupt:19 Base address:0x2000 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:3287 errors:0 dropped:0 overruns:0 frame:0
          TX packets:3287 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:216736 (211.6 KiB)  TX bytes:216736 (211.6 KiB)

root@kali:~# 
root@kali:~# ssh root@192.168.100.140
The authenticity of host '192.168.100.140 (192.168.100.140)' can't be established.
ECDSA key fingerprint is 2c:10:cc:7b:9d:37:ef:25:1b:90:aa:36:18:fb:96:29.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.100.140' (ECDSA) to the list of known hosts.
root@192.168.100.140's password: 

The programs included with the Kali
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

徐为波

看着给就好了,学习写作有点累!

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值