-
Notifications
You must be signed in to change notification settings - Fork 19
Add WeirdSplitter #45
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
rawErr := rawConn.Control(func(fd uintptr) { | ||
if isIPv6 { | ||
err = syscall.SetsockoptInt(int(fd), syscall.IPPROTO_IPV6, syscall.IPV6_UNICAST_HOPS, 1) | ||
} else { | ||
err = syscall.SetsockoptInt(int(fd), syscall.IPPROTO_IP, syscall.IP_TTL, 1) | ||
} | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a succinct code comment on what this approach does to bypass censorship or link to existing projects using this technique?
Is it similar to what's discussed here? #46
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GoodbyeDPI commit e28cb526
ValdikSS wrote:
Some websites (or more precisely, TLS terminators/balancers) can't
handle segmented TLS ClientHello packet properly, requiring the whole
ClientHello in a single segment, otherwise the connection gets dropped.
However they still operate with a proper TCP stack.
Cheat on them: send the latter segment first (with TCP SEQ "in the future"),
the former segment second (with "current" SEQ), allowing OS TCP
stack to combine it in a single TCP read().
But we don't have privileges, so we should implement this with setting TTL. The TCP stack transmits the segment with TTL=1 first, then we restore TTL option before the TCP stack retransmits, this idea is mentioned in #46 too.
if len(b) < 2 { | ||
return conn.Write(b) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you think we should add a code comment on why len(b) < 2
won't work?
(to my untrained eye, it isn't obvious)
intra/dialers/weird_split.go
Outdated
type WeirdSplitter struct { | ||
*net.TCPConn | ||
Used bool | ||
Size int |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A code comment on how clients should set this field? To half of MSS/MTU? Or, some arbitrary value greater than 0 will do (and why)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know. splitHello()
choose where the upstream segment to be split randomly.
https://github.com/celzero/firestack/blob/n2/intra/dialers/retrier.go#L343-L359
And should I rename this field position?
DialWithWeirdSplitRandomOffset() reuses splitHello()
Suggest a name please. |
Following current dialers (
|
6f83e2c
to
c24c1a0
Compare
@ignoramous Why does weirdsplitter not cause desynchronization? Why is the sequence number of the server inconsistent with the sequence number of censor ? |
WeirdSplitter can access some websites that cannot handle handshake messages that are fragmented to multiple TCP segments. (e.g.
www.itu.int
)