8

icmp tunnel - ssooking

 2 years ago
source link: https://ssooking.github.io/2020/11/icmp-tunnel/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

icmp tunnel

icmptunnel 是一种在 ICMP 回显请求和响应 (ping) 数据包中隧道传输 IP 流量的工具,可以帮助我们在严格的网络环境下传输payload。

git clone https://github.com/jamesbarlow/icmptunnel.git
cd icmptunnel
make

该工具仅适用于Linux,首先需要禁用客户端和服务器上的ICMP响应,防止响应ping数据。

echo 1 > /proc/sys/net/ipv4/icmp_echo_ignore_all

在服务器端,启动icmptunnel服务,并为隧道接口分配一个IP地址。

# ./icmptunnel –s
opened tunnel device: tun0
(ctrl-z)
# bg
# /sbin/ifconfig tun0 10.0.0.1 netmask 255.255.255.0

在客户端,将 icmptunnel 指向服务器,并分配一个 IP 地址。

# ./icmptunnel <server>
opened tunnel device: tun0
connection established.
(ctrl-z)
# bg
# /sbin/ifconfig tun0 10.0.0.2 netmask 255.255.255.0

此时,拥有了一个通过 ICMP数据包传输的点对点隧道。服务器端是10.0.0.1,客户端是10.0.0.2。在客户端,尝试通过 SSH 连接到服务器:

将远程服务器用作SOCKS代理:

ssh -D 8080 -N [email protected]

然后将本地浏览器的代理设置为8080端口

在 Linux和Windows 上,用户模式程序需要提升权限才能与原始套接字交互,需要在隧道两端的主机均拥有root 或本地管理员权限。

https://labs.f-secure.com/tools/pivot-with-ping/


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK