首页 > 其他分享 >SSH协议中隧道与代理的用法测试

SSH协议中隧道与代理的用法测试

时间:2023-02-05 19:32:29浏览次数:56  
标签:隧道 kali 192.168 用法 SSH Linux root 211.138 ssh

一、测试拓扑

eth1:10.1.1.100        eth0:192.168.211.130                        eth0:192.168.211.138      eth1:20.1.1.200

               I                  |                                                            |                           |           

                     Kali1                                                            Kali2                       

参考链接:​​https://blog.csdn.net/KNIGH_YUN/article/details/125707874​

Windows 10已经安装OpenSSH客户端,也可以手动安装OpenSSH服务器,也同样支持这些参数:

C:\Users\xlladmin>ssh --help
unknown option -- -
usage: ssh [-46AaCfGgKkMNnqsTtVvXxYy] [-B bind_interface]
[-b bind_address] [-c cipher_spec] [-D [bind_address:]port]
[-E log_file] [-e escape_char] [-F configfile] [-I pkcs11]
[-i identity_file] [-J [user@]host[:port]] [-L address]
[-l login_name] [-m mac_spec] [-O ctl_cmd] [-o option] [-p port]
[-Q query_option] [-R address] [-S ctl_path] [-W host:port]
[-w local_tun[:remote_tun]] destination [command]


C:\Users\xlladmin>

二、本地转发(-L)

--就是在本地开启一个监听端口,通过连接本地的这个端口,从ssh隧道连接到指定IP的端口,对方看到的是ssh服务器的地址。

#在Kali1上执行
┌──(root㉿kali)-[~]
└─# ssh -NL 10022:20.1.1.200:22 [email protected]
[email protected]'s password:

┌──(root㉿kali)-[~]
└─# netstat -an|grep 10022
tcp 0 0 127.0.0.1:10022 0.0.0.0:* LISTEN
tcp6 0 0 ::1:10022 :::* LISTEN


┌──(root㉿kali)-[~]
└─# ssh [email protected] -p 10022
[email protected]'s password:
Linux kali 5.14.0-kali2-amd64 #1 SMP Debian 5.14.9-2kali1 (2021-10-04) x86_64


The programs included with the Kali GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.


Kali GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Fri Feb 3 21:05:35 2023 from 20.1.1.200
┏━(Message from Kali developers)

┃ We have kept /usr/bin/python pointing to Python 2 for backwards
┃ compatibility. Learn how to change this and avoid this message:
┃ ⇒ https://www.kali.org/docs/general-use/python3-transition/

┗━(Run: “touch ~/.hushlogin” to hide this message)
┌──(root

标签:隧道,kali,192.168,用法,SSH,Linux,root,211.138,ssh
From: https://blog.51cto.com/u_333234/6038338

相关文章