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

--def-ttl doesn't work on Windows (7): setsockopt IP_TTL: 10022 #146

Open
EvgenKo423 opened this issue Sep 21, 2024 · 4 comments
Open

--def-ttl doesn't work on Windows (7): setsockopt IP_TTL: 10022 #146

EvgenKo423 opened this issue Sep 21, 2024 · 4 comments

Comments

@EvgenKo423
Copy link

EvgenKo423 commented Sep 21, 2024

Environment: Windows 7 SP1. ByeDPI v0.13.1+ at least.
Reproduce Steps:

  1. Run proxy with ciadpi.exe -i 127.0.0.1 --def-ttl 4;
  2. Try to open any website.

Expected Result: TTL is set.
Actual Result: Error setsockopt IP_TTL: 10022.

new event: fd: 220, evt: EV_ACCEPT, mod_iter: 0
accept: fd=116
new event: fd: 116, evt: EV_REQUEST, mod_iter: 1
setsockopt IP_TTL: 10022
ss error: 0
close: fds=116,-1, recv: 0,0, rounds: 0,0

This happens only for new connections, --ttl for fake works.

@dartvader316
Copy link
Contributor

Possibly problem like here:

https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-connect

If the connection is not completed immediately, the client should wait for connection completion before attempting to set socket options using setsockopt. Calling setsockopt while a connection is in progress is not supported.

@hufrea
Copy link
Owner

hufrea commented Sep 23, 2024

I suggest just removing this option for Windows. Setting TTL after connection may not give the expected effect and will only confuse.

@EvgenKo423
Copy link
Author

EvgenKo423 commented Sep 23, 2024

Related to #90, --def-ttl works when socket is forced to IPv4 with --conn-ip.

TBH, I don't understand how this option may help with TTL detection: the DPI can just compare the fake TTL with TTL from previous packet and if they mismatch then it was changed.
On the other hand, from my observations of how Russian DPI works, in some cases (e.g. googlevideo.com) setting --def-ttl per group in itself can be used as a bypass method (which is currently not supported). ;-)

@hufrea
Copy link
Owner

hufrea commented Sep 23, 2024

This option can help to bypass mobile traffic tethering detection. TTL already needed to be changed (due to disorder, fake), so this side function was added.

Related to #90, --def-ttl works when socket is forced to IPv4 with --conn-ip.

It seems that mapped-addresses support should be disabled for Windows, but then there will be difficulties with --conn-ip.

hufrea pushed a commit that referenced this issue Oct 15, 2024
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

No branches or pull requests

3 participants