Conversation
|
|
|
|
|
|
( |
已经可以了,只是无法搭配 dialerProxy, |
|
|
|
|
嗯,我也只测试了 dialerProxy 部分, |
|
看了下 Splice 对于出站只需要读方向的 raw conn,对于入站只需要写方向的 raw conn,而 header-custom 和 fragment 都满足这一要求,所以可以直接默认 tcpmask 支持解 wrap 简单测试了下 tcp header-custom 以及有无 tcpmask 的 splice 下的行为和之前一样 明天再测下 udp 的 header-custom 以及 conn 清理细节方面应该就可以了
|
1ca3c57 to
f66ed82
Compare
|
改了下,去掉 OnCloseHeaderError,增加 ServersError,可选在不同 clients 位置过来的数据不对时回应的不同错误 |
|
header-custom 的话直接照抄 noises 吧有 str 方便些,如果 rand 就只读取长度、不验证内容 顺便把 fragment 和 noises break 过来吧,
|
|
Wait 不太需要单独 noise,就放 header-custom 的 UDP 里,可以加个选项 times,1 的话就是只发一次,带 delay 的话就是单独发 |
|
header-custom 的 TCP 同理也要加 delay 这个选项,不 delay 的话要粘包发送,都先等有数据吧确保 delay 的准确性 值得注意的是 header-custom UDP 有 delay 时两端可以不同,可能就出站/入站先发几个包给 GFW 演一下, |
|
对于 UDP 就默认它可能会丢包然后有 delay 的就是不验证对端包吧,比如入站写了 client 但有 delay,只发自己 server 的就行 |
CopyRawConnIfExist 只在 freedom 出站和 xtls 里用到,freedom 里在 responseDone,获取 inbound 的 conn 用 tc.ReadFrom 如果有,ReadFrom 也只是影响这个流的写,读不会影响,所以出站只需要 unwrap 后的 read,入站只需要 unwrap 后的 write
合一起也可以,我想的是可以在整个连接周期只发一次,或者可设置重置时间,感觉已经打通的四元组再发没啥意义 |
|
Splice 的话你可能没看 ReadFrom() 里的实现,Linux 要知道两端的 fd 才能对拷,不然实际上是基于 buffer 的 copy,没用到 Splice
|
哦哦,
都改成 str 吗,我怀疑 str 能否表示完全 0-255,还有对于中文不知道用的是啥编码 |
|
tcp 流粘包不太好实现,不知道后面会接收多少才会到下一个包头 |
header 要做验证,noise 不用验证,还是分开好点 |
|
@LjhAUMEM 那你把 mKCP 的拆成另一个 PR 吧 |
|
@LjhAUMEM UDP header-custom 有 delay 代表单独发,自然也不需要验证,这样可行? |
udp header 现在因为都会合包到数据的头部所有没有 delay 配置项,加个 delay 区分 noise 太牵强了,而且也只能写在前面,不如单独的 mask
|
done |
|
@LjhAUMEM 你说的修了 race condition 是 XDNS 和 XICMP 对吧 |
|
是的,xdns/xicmp 那个 2/2 分钟一次的 clean,修复了可能的崩溃 |
|
又改了下标题,想了下还是把改成允许多次 copy 那个 refactor 加上吧, |
|
|
|
|
|
|
|
Would it make sense to add an optional fallback dest for header-custom? Right now if a client sends unexpected data, server replies with errors[] and drops. But a real service wouldn't just drop - it would keep serving normally. This makes it possible to fingerprint: connect, send garbage, see if you get a proper service response or just a disconnect. If header-custom had something like a "fallback" field pointing to a local address, unrecognized connections could be forwarded to a real service instead of being dropped. Any probe would get a fully working service behind it, no way to tell it apart from a normal server. This also means SS AEAD and VMess users get fallback support, not just VLESS/Trojan. "settings": {
"clients": [...],
"servers": [...],
"errors": [...],
"fallback": "127.0.0.1:22"
}Optional, no breaking changes, if not set works as before. |
|
|
|
The server will only send an error and disconnect when clients are configured; otherwise, it will only send a banner.
|
|
|
|
One more thought - what about adding a few more packet types for dynamic responses? rand already exists, but something like randint (random number in range) would help make responses look less static without adding any external dependencies or fallback logic. Right now if someone probes the server multiple times, they get byte-identical responses every time. With randint you could vary numeric parts of the response naturally, like counters or session ids in protocol responses. Something like: {"type": "randint", "min": 0, "max": 255} Would just emit a random integer in that range as bytes. Combined with existing str/hex types you could build responses that look slightly different each time, like a real service would. Not a priority, just an idea for later. |
目前加的也是我自己会用的,
|
Good idea. The range can be limited during generation, and the verification logic can remain unchanged, only verifying the length. |
|
please dont forget about this) |
tcp 包单元
delay: Int32Range 单位毫秒,为 0 会自动与前面合包
rand: int32 随机长度
type: packet type (array, str, hex, base64)
packet: []byte
tcp 对话序列: tcp 包单元 array
tcp header-custom settings
clients: tcp 对话序列 array,与 servers 遵循一发一收
servers: tcp 对话序列 array,与 clients 遵循一收一发
errors: tcp 对话序列 array,仅服务端,对于 clients 发来的验证不通过触发,无 clients 则不会触发
udp 包单元
rand: int32 随机长度
type: packet type (array, str, hex, base64)
packet: []byte
udp header-custom settings
client: udp 包单元 array,总是合并后加入每个 udp 包头,对于 rand 包单元则只验证长度
server: udp 包单元 array,总是合并后加入每个 udp 包头,对于 rand 包单元则只验证长度
from freedom
只修改配置的 interval 为 delay,其他与原来不变
from freedom
udp 包单元
rand: Int32Range 随机长度
type: packet type (array, str, hex, base64)
packet: []byte
delay: Int32Range 单位毫秒,发送一个 item 后延迟多少
noise settings
reset Int32Range 单位秒,对于同个连接周期已经发送过的 addr 进行 reset 后重新发送,默认 0 为全局同个 addr 只发送一次
noise: udp 包单元 array
修复 finalmask/udp dialer proxy
重构 finalmask/udp
xhttp h3 套上 finalmask/udp
伪装 ssh banner,对应
SSH-2.0-OpenSSH_10.0p2 Debian-7\r\n伪装 socks5 user pass 代理 example.com
对应 hex
伪装 smtp 587 starttls,一般搭配 raw + tls/reality
其他实现 tls 内层应该还会进行一次 smtp 验证,所以此 header 不防主动探测,
但骗下 DPI 还是没问题