Skip to content
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

Disorder strategy from byeDPI #323

Merged
merged 8 commits into from
Nov 13, 2024
Merged

Conversation

PeterZhizhin
Copy link
Contributor

Allows to send TCP packets out of order

This is achieved by sending some packets with TTL=1, and then setting TTL back to normal.

Tested with the following command:

go run *.go -timeout 1000 -transport "override:host=104.16.208.90|disorder:0|split:123" -method HEAD -v https://meduza.io/   

This splits the TCP request at position 123, at SNI record: medu is in packet 0, za.io is in packet 1.
The network filters will receive a packet containing za.io first, then another packet with medu.

The receiver will then reassemble the packets in it's TCP stack.

Can be combined with tlsfrag as well like this:

go run *.go -timeout 1000 -transport "override:host=104.16.208.90|disorder:0|tlsfrag:1" -method HEAD -v https://meduza.io/ 

Copy link

google-cla bot commented Nov 9, 2024

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

Copy link
Contributor

@fortuna fortuna left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Thanks for the contribution. I have a few notes.

x/disorder/writer.go Outdated Show resolved Hide resolved
x/disorder/writer.go Outdated Show resolved Hide resolved
x/disorder/writer.go Outdated Show resolved Hide resolved
x/disorder/writer.go Outdated Show resolved Hide resolved
x/disorder/writer.go Outdated Show resolved Hide resolved
x/configurl/disorder.go Outdated Show resolved Hide resolved
@PeterZhizhin
Copy link
Contributor Author

Made changes to address comments, thanks!

# Examples

Packet splitting - To split outgoing streams on bytes 2 and 123, you can use:

split:2|split:123

Disorder transport - Send some of the packets out of order
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Disorder transport - Send some of the packets out of order
Disorder transport - Send some of the packets out of order:


disorder:0|split:123

Split at position 123, then send packet 0 of 123 bytes (from splitting) out of order. The network filter will first receive packet 1, only then packet 0.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Split at position 123, then send packet 0 of 123 bytes (from splitting) out of order. The network filter will first receive packet 1, only then packet 0.
Split at position 123, then send packet 0 of 123 bytes (from splitting) out of order. The network filter will first receive packet 1, only then packet 0. This is done by setting the hop limit for the write to 1, and then restoring it. It will be sent with its original hop limit on retransmission.

x/disorder/stream_dialer.go Outdated Show resolved Hide resolved
x/disorder/stream_dialer.go Outdated Show resolved Hide resolved
x/disorder/writer.go Outdated Show resolved Hide resolved
x/disorder/writer.go Outdated Show resolved Hide resolved
x/disorder/writer.go Outdated Show resolved Hide resolved
x/disorder/writer.go Outdated Show resolved Hide resolved
x/disorder/stream_dialer.go Outdated Show resolved Hide resolved
x/configurl/doc.go Outdated Show resolved Hide resolved
Copy link
Contributor

@fortuna fortuna left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the changes and contributions! This looks good. I made a couple of minor edits.

x/disorder/stream_dialer.go Outdated Show resolved Hide resolved
x/disorder/writer.go Outdated Show resolved Hide resolved
x/disorder/writer.go Outdated Show resolved Hide resolved
x/disorder/writer.go Outdated Show resolved Hide resolved
x/disorder/writer.go Outdated Show resolved Hide resolved
@fortuna fortuna merged commit 2725bce into Jigsaw-Code:main Nov 13, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants