V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  cnt2ex  ›  全部回复第 4 页 / 共 13 页
回复总数  257
1  2  3  4  5  6  7  8  9  10 ... 13  
2022-02-04 19:42:14 +08:00
回复了 cnt2ex 创建的主题 Linux 如何绕过本地路由?
@tomychen 抓到的是 HTTP 的包。

wireshark 在物理网卡上抓包,大部分流量是 VPN 的加密流量。少部分是 LLDP/mDNS 之类的流量。
然后就是正文楼里提到的 HTTP 流量。并且该 http 请求得到了响应(证明的确从物理网卡上出去并得到了响应),返回内容大概是这样

HTTP/1.1 204 No Content
Server: Apache/2.4.18 (Ubuntu)
X-NetworkManager-Status: online
Connection: close

路由表我省略了一些本地路由和 VPN 服务器的路由,但是我 ping HTTP 请求的目标地址,ICMP 是没有直接走物理网卡的,物理网卡抓不到 ICMP 相关的包,而在 VPN 的网卡上可以抓到,说明该 ICMP 的确是走了 VPN ,所以我排除了路由表的问题。

我对这抱的最大的疑问就是,原来程序不需要 root 权限就可以简单绕过系统的路由表?不仅仅是 ICMP ,连 HTTP 也是。
2022-01-21 16:42:23 +08:00
回复了 cnt2ex 创建的主题 Linux 如何绕过本地路由?
@Ljcbaby
@tomychen

我发现如果通过-I 选项,指定接口 ping ,的确能从本地接口直接出去。但是如果-I 给的是地址,依然会按照路由表,走 vpn 接口。但文档好像没写这两个做法的区别。
-I interface
interface is either an address, or an interface name. If interface is an address, it sets source address
to specified interface address. If interface in an interface name, it sets source interface to specified
interface.

除此之外,我发现系统的 ping 命令没有 setuid ,但是有 CAP_NET_RAW 。我把 ping 命令拷贝一份过后(此时没有 CAP_NET_RAW 了),依然可以通过-I 选项指定接口 ping 出去。原来 linux 的系统路由表是可以没有 root 权限就能绕过的吗?


@xuanbg
@Kinnice
应该不是路由规则的问题,ping 35.224.170.84 是从 vpn 接口出去的,ip route get 35.224.170.84 也是显示走 vpn 的接口。
1  2  3  4  5  6  7  8  9  10 ... 13  
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   932 人在线   最高记录 6543   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 29ms · UTC 22:37 · PVG 06:37 · LAX 15:37 · JFK 18:37
Developed with CodeLauncher
♥ Do have faith in what you're doing.