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

Update client.ImpersonateXXX methods #407

Merged
merged 1 commit into from
Dec 17, 2024

Conversation

rosahaj
Copy link
Contributor

@rosahaj rosahaj commented Dec 5, 2024

Commit fb51d5b changed the client.ImpersonateXXX methods to always use the latest TLS fingerprint provided by uTLS for the relevant browser (utls.HelloXXX_Auto). Unfortunately this creates a mismatch between the TLS fingerprint and the other browser settings (such as User-Agent headers) since the latter are not changed automatically with every uTLS version upgrade. It's quite easy for bot detection tools to detect this mismatch, with a pretty low chance of false positives. I suggest sticking with fixed version TLS fingerprints instead and manually updating the uTLS.ClientHelloId alongside other browser settings whenever new uTLS fingerprints become available.

I've used Chrome 120, Firefox 120 and Safari 16.6 on a fresh MacOS 13 installation to check for relevant commonHeaders changes. My findings are:

  • Safari: User-Agent doesn't appear to change on minor version upgrades (e.g. 16 -> 16.6). Likely no changes necessary except on major version upgrades.
  • Firefox: Only the User-Agent changed, all other headers remained unchanged.
  • Chrome: The User-Agent, Sec-CH-UA and Accept headers changed when comparing v113 to v120.

Going forward, I believe it makes sense to manually check all three browser for header changes every time a new browser version is used.

I've also noticed that client.ImpersonateChrome() had a rather uncommon Accept-Language header value of "zh-CN,zh;q=0.9,en;q=0.8,zh-TW;q=0.7,it;q=0.6" (i.e. Chinese, English, Italian). To minimize fingerprinting opportunities, I suggest sticking with the Accept-Language value used on a fresh browser install when the system language is set to Chinese (Simplified). For Chrome 120, that's zh-CN,zh;q=0.9.

@imroc
Copy link
Owner

imroc commented Dec 17, 2024

Thanks

@imroc imroc merged commit 9d71470 into imroc:master Dec 17, 2024
2 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.

2 participants