-
Notifications
You must be signed in to change notification settings - Fork 1
Update database and various fix #2
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
Open
AnCry1596
wants to merge
43
commits into
charxhit:master
Choose a base branch
from
AnCry1596:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
43 commits
Select commit
Hold shift + click to select a range
06b0957
New JA3 for Safari mobile
NgaoDaCoPho 4887a40
Add fix for Python 3.12+
NgaoDaCoPho 7ac5a6d
Make it work with default tlslite-ng
NgaoDaCoPho e2256fd
Update database, handshake fix
NgaoDaCoPho e49989d
Database Update
NgaoDaCoPho 1d70092
Delete .claude directory
AnCry1596 44ae309
Remove cladue
NgaoDaCoPho 399f837
Update .gitignore
AnCry1596 ba243a3
Merge branch 'master' of https://github.com/AnCry1596/httpx-tls
NgaoDaCoPho 25d4d4e
Merge branch 'master' of https://github.com/AnCry1596/httpx-tls
NgaoDaCoPho 4597e07
Database update
NgaoDaCoPho 36804a5
README update
NgaoDaCoPho 2b724a7
Delete .claude directory
AnCry1596 592b857
Add new mapping, update DB
NgaoDaCoPho b9af996
Add Firefox upto 143
NgaoDaCoPho 2fe512d
Update a fix for database
NgaoDaCoPho 995aa2e
Update README
NgaoDaCoPho d3aabae
Fix
NgaoDaCoPho cf9c3a5
Update requirements.txt
NgaoDaCoPho 9cb2189
Fix problem with chrome iOS
NgaoDaCoPho 5d8e093
Fix for Edge iOS
NgaoDaCoPho 4b6101b
Added Chrome 141
NgaoDaCoPho e9d32f4
Fix akamai for Firefox Mobile 136-143 and Chromium 141
NgaoDaCoPho ea6d751
Added support for SamsungBrowser
NgaoDaCoPho 37f4b36
Added Support for YandexBrowser and DuckDuckGo
NgaoDaCoPho c34a74e
Added Support for Vivaldi
NgaoDaCoPho 77e6f51
Added Support for Google Apps
NgaoDaCoPho fba2fda
Better User Agent Parsing and Handle mostly Posible useragent
NgaoDaCoPho 48964da
Fix UA parsing Gone wrong on Safari iOS 26
NgaoDaCoPho 9ee4f6e
Move akamai string of Firefox and Chrome to MacOS, fix Wrong Safari D…
NgaoDaCoPho 9a0a732
Move to Cleaned ja3 string for Chrome And Firefox
NgaoDaCoPho 3ab0bb0
Added Firefox 144, Fix for Chrome 120-141
NgaoDaCoPho 7f92add
Added Akamai string for Firefox 144 Desktop and Mobile
NgaoDaCoPho ee785ab
Fix Safari 18
NgaoDaCoPho 44dbc1f
Ignore SETTINGS_NO_RFC7540_PRIORITIES
NgaoDaCoPho 4d499fa
Random TLS extension order
NgaoDaCoPho 23066b8
Update setup.py
NgaoDaCoPho 195cf99
Update setup.py
NgaoDaCoPho 0df3c10
Added Chrome 142
NgaoDaCoPho 3355760
Added support for Firefox 145
NgaoDaCoPho 89e9e0c
Add Chrome 143
NgaoDaCoPho 24a7ed9
Add Firefox 146
NgaoDaCoPho 46bb234
Add Support for chrome 144
NgaoDaCoPho File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,140 @@ | ||
| # Random TLS Extension Order Feature | ||
|
|
||
| ## Overview | ||
|
|
||
| Random TLS extension order is **enabled by default** in httpx-tls. This feature randomizes the order of TLS extensions in the ClientHello message to help avoid fingerprinting and make connections less predictable while maintaining full protocol compatibility. | ||
|
|
||
| ## Why Randomize Extension Order? | ||
|
|
||
| TLS fingerprinting tools and WAFs often use the specific order of TLS extensions as part of their fingerprinting process. By randomizing the extension order: | ||
|
|
||
| - **Reduces fingerprinting**: Each connection can have a different extension order | ||
| - **Maintains compatibility**: All required extensions are still sent, just in random order | ||
| - **Bypasses detection**: Some security systems key on specific extension patterns | ||
|
|
||
| ## Usage | ||
|
|
||
| ### Default Behavior (Randomization Enabled) | ||
|
|
||
| By default, all TLS profiles have randomization enabled: | ||
|
|
||
| ```python | ||
| from httpx_tls import AsyncTLSClient | ||
| from httpx_tls.profiles import TLSProfile | ||
|
|
||
| # Randomization is enabled by default | ||
| client = AsyncTLSClient( | ||
| tls_config=TLSProfile.create_from_version('chrome', 120) | ||
| ) | ||
|
|
||
| # Or with JA3 string | ||
| profile = TLSProfile.create_from_ja3(ja3) # Randomization enabled by default | ||
|
|
||
| # Or with user agent | ||
| profile = TLSProfile.create_from_useragent(user_agent) # Randomization enabled by default | ||
| ``` | ||
|
|
||
| ### Disabling Randomization (for exact JA3 matching) | ||
|
|
||
| If you need exact JA3 fingerprint matching, you can disable randomization: | ||
|
|
||
| ```python | ||
| from httpx_tls.profiles import TLSProfile | ||
| from httpx_tls import AsyncTLSClient | ||
|
|
||
| # Disable in TLSProfile creation | ||
| profile = TLSProfile.create_from_ja3(ja3, randomize_extensions=False) | ||
|
|
||
| # Or when creating from version | ||
| profile = TLSProfile.create_from_version('chrome', 120, randomize_extensions=False) | ||
|
|
||
| # Or in AsyncTLSClient | ||
| client = AsyncTLSClient( | ||
| tls_config=profile, | ||
| randomize_tls_extensions=False | ||
| ) | ||
| ``` | ||
|
|
||
| ### Direct TLSProfile Instantiation | ||
|
|
||
| ```python | ||
| from httpx_tls.profiles import TLSProfile | ||
|
|
||
| # With randomization (default) | ||
| profile = TLSProfile( | ||
| tls_version=(3, 4), | ||
| ciphers=[4865, 4866, 4867], | ||
| extensions=[51, 23, 13, 45, 65281, 5, 43], | ||
| groups=[29, 23, 24] | ||
| # randomize_extensions=True is the default | ||
| ) | ||
|
|
||
| # Without randomization | ||
| profile = TLSProfile( | ||
| tls_version=(3, 4), | ||
| ciphers=[4865, 4866, 4867], | ||
| extensions=[51, 23, 13, 45, 65281, 5, 43], | ||
| groups=[29, 23, 24], | ||
| randomize_extensions=False | ||
| ) | ||
| ``` | ||
|
|
||
| ## Example Output | ||
|
|
||
| **Without randomization:** | ||
| ``` | ||
| Extensions: [51, 23, 13, 45, 65281, 5, 43] | ||
| ``` | ||
|
|
||
| **With randomization (3 different runs):** | ||
| ``` | ||
| Run 1: [13, 23, 43, 65281, 51, 5, 45] | ||
| Run 2: [43, 45, 5, 13, 23, 65281, 51] | ||
| Run 3: [45, 23, 51, 13, 65281, 5, 43] | ||
| ``` | ||
|
|
||
| ## Implementation Details | ||
|
|
||
| ### Changes Made | ||
|
|
||
| 1. **profiles.py**: | ||
| - Added `randomize_extensions` parameter to `TLSProfile.__init__()` | ||
| - Implemented `_randomize_extension_order()` method | ||
| - Updated `_set_order()` to apply randomization and enable `extension_order` | ||
| - Re-enabled the previously commented-out `settings.extension_order` assignment | ||
|
|
||
| 2. **client.py**: | ||
| - Added `randomize_tls_extensions` parameter to `AsyncTLSClient.__init__()` | ||
| - Automatically applies randomization flag to TLSProfile if provided | ||
|
|
||
| ### Technical Notes | ||
|
|
||
| - Extension randomization uses Python's `random.shuffle()` for unpredictable ordering | ||
| - All extensions from the original profile are preserved, only the order changes | ||
| - The randomization happens at profile creation time | ||
| - Each new TLSProfile instance with randomization enabled will have a different order | ||
|
|
||
| ## Security Considerations | ||
|
|
||
| - **Compatibility**: Randomizing extension order is generally safe and maintains TLS protocol compatibility | ||
| - **Fingerprint Variation**: Each connection will have a unique fingerprint when randomization is enabled | ||
| - **Performance**: Minimal overhead - randomization happens once during profile creation | ||
|
|
||
| ## Testing | ||
|
|
||
| Run the included test and example scripts: | ||
|
|
||
| ```bash | ||
| # Run basic tests | ||
| python test_randomization.py | ||
|
|
||
| # Run usage examples | ||
| python example_random_extensions.py | ||
| ``` | ||
AnCry1596 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| ## Related Files | ||
|
|
||
| - [profiles.py](httpx_tls/profiles.py) - TLS profile implementation with randomization | ||
| - [client.py](httpx_tls/client.py) - AsyncTLSClient with randomization support | ||
| - [test_randomization.py](test_randomization.py) - Test script | ||
| - [example_random_extensions.py](example_random_extensions.py) - Usage examples | ||
AnCry1596 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.