From 9d3a3ff5260345142b9923724060afc3e03d8a71 Mon Sep 17 00:00:00 2001 From: Yifei Kong Date: Mon, 2 Dec 2024 14:36:15 +0800 Subject: [PATCH] Add Chrome 131 Android --- README.md | 1 + chrome/curl_chrome131_android | 39 +++++ chrome/patches/curl-impersonate.patch | 54 ++++++- .../chrome_131.0.6778.81_android.yaml | 151 ++++++++++++++++++ tests/targets.yaml | 8 + 5 files changed, 251 insertions(+), 2 deletions(-) create mode 100755 chrome/curl_chrome131_android create mode 100644 tests/signatures/chrome_131.0.6778.81_android.yaml diff --git a/README.md b/README.md index d72d8df0..8705e827 100644 --- a/README.md +++ b/README.md @@ -58,6 +58,7 @@ The following browsers can be impersonated. | ![Chrome](https://raw.githubusercontent.com/alrra/browser-logos/main/src/chrome/chrome_24x24.png "Chrome") | 124 | 124.0.6367.60 | macOS Sonoma | `chrome124` | [curl_chrome124](chrome/curl_chrome124) | | ![Chrome](https://raw.githubusercontent.com/alrra/browser-logos/main/src/chrome/chrome_24x24.png "Chrome") | 131 | 131.0.6778.86 | macOS Sonoma | `chrome131` | [curl_chrome131](chrome/curl_chrome131) | | ![Chrome](https://raw.githubusercontent.com/alrra/browser-logos/main/src/chrome/chrome_24x24.png "Chrome") | 99 | 99.0.4844.73 | Android 12 | `chrome99_android` | [curl_chrome99_android](chrome/curl_chrome99_android) | +| ![Chrome](https://raw.githubusercontent.com/alrra/browser-logos/main/src/chrome/chrome_24x24.png "Chrome") | 131 | 131.0.6778.81 | Android 14 | `chrome131_android` | [curl_chrome131_android](chrome/curl_chrome131_android) | | ![Edge](https://raw.githubusercontent.com/alrra/browser-logos/main/src/edge/edge_24x24.png "Edge") | 99 | 99.0.1150.30 | Windows 10 | `edge99` | [curl_edge99](chrome/curl_edge99) | | ![Edge](https://raw.githubusercontent.com/alrra/browser-logos/main/src/edge/edge_24x24.png "Edge") | 101 | 101.0.1210.47 | Windows 10 | `edge101` | [curl_edge101](chrome/curl_edge101) | | ![Safari](https://github.com/alrra/browser-logos/blob/main/src/safari/safari_24x24.png "Safari") | 15.3 | 16612.4.9.1.8 | MacOS Big Sur | `safari15_3` | [curl_safari15_3](chrome/curl_safari15_3) | diff --git a/chrome/curl_chrome131_android b/chrome/curl_chrome131_android new file mode 100755 index 00000000..fd1cd052 --- /dev/null +++ b/chrome/curl_chrome131_android @@ -0,0 +1,39 @@ +#!/usr/bin/env bash + + +# The only difference from desktop is the absense of MLKEM + + +# Find the directory of this script +dir=${0%/*} + +# The list of ciphers can be obtained by looking at the Client Hello message in +# Wireshark, then converting it using this reference +# https://wiki.mozilla.org/Security/Cipher_Suites +"$dir/curl-impersonate-chrome" \ + --ciphers TLS_AES_128_GCM_SHA256,TLS_AES_256_GCM_SHA384,TLS_CHACHA20_POLY1305_SHA256,ECDHE-ECDSA-AES128-GCM-SHA256,ECDHE-RSA-AES128-GCM-SHA256,ECDHE-ECDSA-AES256-GCM-SHA384,ECDHE-RSA-AES256-GCM-SHA384,ECDHE-ECDSA-CHACHA20-POLY1305,ECDHE-RSA-CHACHA20-POLY1305,ECDHE-RSA-AES128-SHA,ECDHE-RSA-AES256-SHA,AES128-GCM-SHA256,AES256-GCM-SHA384,AES128-SHA,AES256-SHA \ + --curves X25519:P-256:P-384 \ + -H 'sec-ch-ua: "Google Chrome";v="131", "Chromium";v="131", "Not_A Brand";v="24"' \ + -H 'sec-ch-ua-mobile: ?0' \ + -H 'sec-ch-ua-platform: "Android"' \ + -H 'Upgrade-Insecure-Requests: 1' \ + -H 'User-Agent: Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Mobile Safari/537.36' \ + -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7' \ + -H 'Sec-Fetch-Site: none' \ + -H 'Sec-Fetch-Mode: navigate' \ + -H 'Sec-Fetch-User: ?1' \ + -H 'Sec-Fetch-Dest: document' \ + -H 'Accept-Encoding: gzip, deflate, br, zstd' \ + -H 'Accept-Language: en-US,en;q=0.9' \ + -H 'Priority: u=0, i' \ + --http2 \ + --http2-settings '1:65536;2:0;4:6291456;6:262144' \ + --http2-window-update 15663105 \ + --http2-stream-weight 256 \ + --http2-stream-exclusive 1 \ + --compressed \ + --ech GREASE \ + --tlsv1.2 --alps --tls-permute-extensions \ + --cert-compression brotli \ + --tls-grease \ + "$@" diff --git a/chrome/patches/curl-impersonate.patch b/chrome/patches/curl-impersonate.patch index d6f2fc2d..8c921e0d 100644 --- a/chrome/patches/curl-impersonate.patch +++ b/chrome/patches/curl-impersonate.patch @@ -1521,10 +1521,10 @@ index 80e183480..8ee390b7e 100644 * Store nghttp2 version info in this buffer. diff --git a/lib/impersonate.c b/lib/impersonate.c new file mode 100644 -index 000000000..0a0cce2a4 +index 000000000..c71d7bbcf --- /dev/null +++ b/lib/impersonate.c -@@ -0,0 +1,1177 @@ +@@ -0,0 +1,1227 @@ +#include "curl_setup.h" + +#include @@ -2147,6 +2147,56 @@ index 000000000..0a0cce2a4 + .tls_grease = true + }, + { ++ .target = "chrome131_android", ++ .httpversion = CURL_HTTP_VERSION_2_0, ++ .ssl_version = CURL_SSLVERSION_TLSv1_2 | CURL_SSLVERSION_MAX_DEFAULT, ++ .ciphers = ++ "TLS_AES_128_GCM_SHA256," ++ "TLS_AES_256_GCM_SHA384," ++ "TLS_CHACHA20_POLY1305_SHA256," ++ "ECDHE-ECDSA-AES128-GCM-SHA256," ++ "ECDHE-RSA-AES128-GCM-SHA256," ++ "ECDHE-ECDSA-AES256-GCM-SHA384," ++ "ECDHE-RSA-AES256-GCM-SHA384," ++ "ECDHE-ECDSA-CHACHA20-POLY1305," ++ "ECDHE-RSA-CHACHA20-POLY1305," ++ "ECDHE-RSA-AES128-SHA," ++ "ECDHE-RSA-AES256-SHA," ++ "AES128-GCM-SHA256," ++ "AES256-GCM-SHA384," ++ "AES128-SHA," ++ "AES256-SHA", ++ .curves = "X25519:P-256:P-384", ++ .npn = false, ++ .alpn = true, ++ .alps = true, ++ .tls_permute_extensions = true, ++ .tls_session_ticket = true, ++ .cert_compression = "brotli", ++ .http_headers = { ++ "sec-ch-ua: \"Google Chrome\";v=\"131\", \"Chromium\";v=\"131\", \"Not_A Brand\";v=\"24\"", ++ "sec-ch-ua-mobile: ?0", ++ "sec-ch-ua-platform: \"Android\"", ++ "Upgrade-Insecure-Requests: 1", ++ "User-Agent: Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Mobile Safari/537.36", ++ "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7", ++ "Sec-Fetch-Site: none", ++ "Sec-Fetch-Mode: navigate", ++ "Sec-Fetch-User: ?1", ++ "Sec-Fetch-Dest: document", ++ "Accept-Encoding: gzip, deflate, br, zstd", ++ "Accept-Language: en-US,en;q=0.9", ++ "Priority: u=0, i" ++ }, ++ .http2_settings = "1:65536;2:0;4:6291456;6:262144", ++ .http2_window_update = 15663105, ++ .http2_stream_weight = 256, ++ .http2_stream_exclusive = 1, ++ .ech = "GREASE", ++ .tls_extension_order = NULL, ++ .tls_grease = true ++ }, ++ { + .target = "edge99", + .httpversion = CURL_HTTP_VERSION_2_0, + .ssl_version = CURL_SSLVERSION_TLSv1_2 | CURL_SSLVERSION_MAX_DEFAULT, diff --git a/tests/signatures/chrome_131.0.6778.81_android.yaml b/tests/signatures/chrome_131.0.6778.81_android.yaml new file mode 100644 index 00000000..6a927b76 --- /dev/null +++ b/tests/signatures/chrome_131.0.6778.81_android.yaml @@ -0,0 +1,151 @@ +# NOTE: this file is not generated by dpkt, due to a bug: https://github.com/kbandla/dpkt/issues/665 +# The only difference from Chrome 131 is: X25519Kyber768 was replaced by MLKEM +browser: + name: chrome + os: android14 + version: 131.0.6778.81 +signature: + options: + tls_permute_extensions: true + http2: + frames: + - frame_type: SETTINGS + settings: + - key: 1 + value: 65536 + - key: 2 + value: 0 + - key: 4 + value: 6291456 + - key: 6 + value: 262144 + stream_id: 0 + - frame_type: WINDOW_UPDATE + stream_id: 0 + window_size_increment: 15663105 + - frame_type: HEADERS + headers: + - 'sec-ch-ua: "Google Chrome";v="131", "Chromium";v="131", "Not_A Brand";v="24"' + - 'sec-ch-ua-mobile: ?0' + - 'sec-ch-ua-platform: "Android"' + - 'upgrade-insecure-requests: 1' + - 'user-agent: Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Mobile Safari/537.36' + - 'accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7' + - 'sec-fetch-site: none' + - 'sec-fetch-mode: navigate' + - 'sec-fetch-user: ?1' + - 'sec-fetch-dest: document' + - 'accept-encoding: gzip, deflate, br, zstd' + - 'accept-language: en-US,en;q=0.9' + - 'priority: u=0, i' + pseudo_headers: + - :method + - :authority + - :scheme + - :path + stream_id: 1 + tls_client_hello: + ciphersuites: + - GREASE + - 4865 + - 4866 + - 4867 + - 49195 + - 49199 + - 49196 + - 49200 + - 52393 + - 52392 + - 49171 + - 49172 + - 156 + - 157 + - 47 + - 53 + comp_methods: + - 0 + extensions: + - length: 0 + type: GREASE + - alps_alpn_list: + - h2 + length: 5 + type: application_settings + - length: 2 + psk_ke_mode: 1 + type: psk_key_exchange_modes + - algorithms: + - 2 + length: 3 + type: compress_certificate + - key_shares: + - group: GREASE + length: 1 + - group: 4588 + length: 1216 + - group: 29 + length: 32 + length: 1263 + type: keyshare + - length: 7 + supported_versions: + - GREASE + - TLS_VERSION_1_3 + - TLS_VERSION_1_2 + type: supported_versions + - length: 1 + type: renegotiation_info + - length: 0 + type: encrypted_client_hello + - length: 0 + type: extended_master_secret + - ec_point_formats: + - 0 + length: 2 + type: ec_point_formats + - length: 5 + status_request_type: 1 + type: status_request + - length: 0 + type: session_ticket + - length: 12 + supported_groups: + - GREASE + - 29 + - 23 + - 24 + type: supported_groups + - length: 0 + type: signed_certificate_timestamp + - alpn_list: + - h2 + - http/1.1 + length: 14 + type: application_layer_protocol_negotiation + - length: 18 + sig_hash_algs: + - 1027 + - 2052 + - 1025 + - 1283 + - 2053 + - 1281 + - 2054 + - 1537 + type: signature_algorithms + - type: server_name + - data: !!binary | + AA== + length: 1 + type: GREASE + handshake_version: TLS_VERSION_1_2 + record_version: TLS_VERSION_1_0 + session_id_length: 32 +third_party: + akamai_hash: 52d84b11737d980aef856699f885ca86 + akamai_text: 1:65536;2:0;4:6291456;6:262144|15663105|0|m,a,s,p + ja3_hash: b41f2b186c3c82a6fc1bb88dad6eb562 + ja3_text: 771,4865-4866-4867-49195-49199-49196-49200-52393-52392-49171-49172-156-157-47-53,27-13-65281-18-43-0-35-10-5-51-11-16-17513-65037-23-45,4588-29-23-24,0 + ja3n_hash: dee19b855b658c6aa0f575eda2525e19 + ja3n_text: 771,4865-4866-4867-49195-49199-49196-49200-52393-52392-49171-49172-156-157-47-53,0-5-10-11-13-16-18-23-27-35-43-45-51-17513-65037-65281,4588-29-23-24,0 + user_agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 diff --git a/tests/targets.yaml b/tests/targets.yaml index 04ef0141..a054ce7e 100644 --- a/tests/targets.yaml +++ b/tests/targets.yaml @@ -47,6 +47,10 @@ - null - null - chrome_131.0.6778.86_macOS +- - curl_chrome131_android + - null + - null + - chrome_131.0.6778.81_android14 - - curl_chrome99_android - null - null @@ -131,6 +135,10 @@ - CURL_IMPERSONATE: chrome131 - libcurl-impersonate-chrome - chrome_131.0.6778.86_macOS +- - minicurl + - CURL_IMPERSONATE: chrome131_android + - libcurl-impersonate-chrome + - chrome_131.0.6778.81_android14 - - minicurl - CURL_IMPERSONATE: chrome99_android - libcurl-impersonate-chrome