-
Notifications
You must be signed in to change notification settings - Fork 4.8k
TPROXY: Prevent TCP loopback #5114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
还有这个能改到 tunnel 入站吗 |
|
|
|
this is not off-topic, you can check the code, although the results are the same. |
UDP好像出于一些原因没有这个问题(实测) |
|
|
|
This change in the tcpworker.callback function causes the SNI proxy mode in Dokodemo to stop working, because in this mode the dest is equal to the local address. Only after the router performs the dispatch and sniffs the real destination does the actual dest become known. If the goal is to prevent loopback, it should be done after the sniffing has been done and the real destination has been identified. {
"listen": "127.0.0.1",
"port": "443,8443,2096,2053,2083,2087",
"protocol": "tunnel",
"settings": {
"network": "tcp",
"followRedirect": true
},
"sniffing": {
"enabled": true,
"destOverride": [
"tls",
"http",
"quic"
]
},
"streamSettings": {
"sockopt": {
"tproxy": "tproxy"
}
}
} |
|
改到 tunnel 入站内应该没啥问题吧,localAddr 判断可能也行? |
|
啧 放错地方了 |
|
@rldlive @Fangliding |
|
|
|
啧 搞错了 新旧代码是一样的 都没问题 |
一个简单的透明代理配置 带一个private地址直连的路由 直接 curl 127.0.0.1:+端口就炸掉 有人说一些无聊的本地应用可能扫本地端口然后扫到炸掉 |
重新看了一下甚至是Windows Windows上的tproxy甚至没有意义 理论上应该拒绝启动的 只是史山还是开了起来而已 |
|
不是,我的意思是他们这是什么用法,SNI 分流? |
|
任意门进去的tls流量 嗅探系统是可以看到里面的sni的 然后可以加之分流什么的 |
|
开 TPROXY/Redirect 的目的就是为了劫持流量,如果流量原本的目标就是 Tunnel 入站,还开什么 TPROXY |
|
就很搞笑,看到 SNI proxy mode 我都不知道 Dokodemo 啥时候有这 mode 了后面的我也没看, 不要乱起名词啊,说个 for SNI proxy/shunt 我都看得懂,一个 mode 说出口给我整不会了 |
|
洗洗睡吧( |
|
@Fangliding I have an old TV device where it is not possible to install xray-core or anything else but I need this TV to make the connection to "example.com" on port 443 through proxy. These are logs from 25.9.5: 25.9.11 there is only an error repeated multiple times: |
|
@rldlive 尝试删除 |
|
@RPRX |
|
@Fangliding 要不把这 followRedirect 删了改成自动判断有没有 sockopt tproxy 算了 |
|
followRedirect is also used for MitM |
|
本来只是透明代理专用的话应该可以的 现在这么看被动了又不好动了 |
根据透明代理的原理 它是获取localaddr获得得到地址的 如果有程序出于不知道什么目的直连这个端口那它就会无限尝试自己连自己最后一个请求就把核心打oom
找了一圈没找到什么办法判断一个conn是直连还是来自透明代理模块 目前的方法是检查目标地址是否和监听地址相等 对于监听0000的入站 先检查端口是否相同再用系统调用获得全部本地ip检查目标ip是否等于本地ip(先检查port的原因是syscall比较昂贵)
如果有更好的方法欢迎指出 网上大多数透明代理资料甚至还是ray周边的
甚至是我自己写的文档