From e41c9a75943b591dd58c0ec8c8efeae92d1e9cda Mon Sep 17 00:00:00 2001 From: Yifei Kong Date: Wed, 15 Jan 2025 00:44:42 +0800 Subject: [PATCH] Working h2 fingerprints for firefox --- chrome/patches/curl-impersonate.patch | 16 +-- tests/signatures/firefox_100.0_win10.yaml | 120 ----------------- tests/signatures/firefox_102.0_win10.yaml | 120 ----------------- tests/signatures/firefox_109.0_win10.yaml | 120 ----------------- tests/signatures/firefox_117.0.1_win10.yaml | 120 ----------------- tests/signatures/firefox_91.6.0esr_win10.yaml | 121 ------------------ tests/signatures/firefox_95.0.2_win10.yaml | 120 ----------------- tests/signatures/firefox_98.0_win10.yaml | 120 ----------------- 8 files changed, 8 insertions(+), 849 deletions(-) delete mode 100644 tests/signatures/firefox_100.0_win10.yaml delete mode 100644 tests/signatures/firefox_102.0_win10.yaml delete mode 100644 tests/signatures/firefox_109.0_win10.yaml delete mode 100644 tests/signatures/firefox_117.0.1_win10.yaml delete mode 100644 tests/signatures/firefox_91.6.0esr_win10.yaml delete mode 100644 tests/signatures/firefox_95.0.2_win10.yaml delete mode 100644 tests/signatures/firefox_98.0_win10.yaml diff --git a/chrome/patches/curl-impersonate.patch b/chrome/patches/curl-impersonate.patch index 8c921e0d..6db3938a 100644 --- a/chrome/patches/curl-impersonate.patch +++ b/chrome/patches/curl-impersonate.patch @@ -1521,7 +1521,7 @@ 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..c71d7bbcf +index 000000000..9b9f11cd0 --- /dev/null +++ b/lib/impersonate.c @@ -0,0 +1,1227 @@ @@ -2707,7 +2707,7 @@ index 000000000..c71d7bbcf + .tls_grease = true + }, + { -+ .target = "firefox120", /* not working */ ++ .target = "firefox133", + .httpversion = CURL_HTTP_VERSION_2_0, + .ssl_version = CURL_SSLVERSION_TLSv1_2 | CURL_SSLVERSION_MAX_DEFAULT, + .ciphers = @@ -2729,23 +2729,23 @@ index 000000000..c71d7bbcf + "TLS_RSA_WITH_AES_128_CBC_SHA," + "TLS_RSA_WITH_AES_256_CBC_SHA", + .http_headers = { -+ "User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:121.0) Gecko/20100101 Firefox/121.0", -+ "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8", ++ "User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:134.0) Gecko/20100101 Firefox/134.0", ++ "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", + "Accept-Language: en-US,en;q=0.5", -+ "Accept-Encoding: gzip, deflate, br", ++ "Accept-Encoding: gzip, deflate, br, zstd", + "Upgrade-Insecure-Requests: 1", + "Sec-Fetch-Dest: document", + "Sec-Fetch-Mode: navigate", + "Sec-Fetch-Site: none", + "Sec-Fetch-User: ?1", ++ "Priority: u=0, i", + "Te: trailers" + }, -+ .http2_settings = "1:65536;4:131072;5:16384", ++ .http2_settings = "1:65536;2:0;4:131072;5:16384", + .http2_window_update = 12517377, + .http2_pseudo_headers_order = "mpas", -+ .http2_streams = "3:0:0:201,5:0:0:101,7:0:0:1,9:0:7:1,11:0:3:1,13:0:0:241", + .tls_extension_order = NULL, -+ .tls_grease = true ++ .tls_grease = false + }, + { + /* Last one must be NULL. */ diff --git a/tests/signatures/firefox_100.0_win10.yaml b/tests/signatures/firefox_100.0_win10.yaml deleted file mode 100644 index 3f9afd58..00000000 --- a/tests/signatures/firefox_100.0_win10.yaml +++ /dev/null @@ -1,120 +0,0 @@ -browser: - mode: regular - name: firefox - os: win10 - version: 100.0 -name: firefox_100.0_win10 -signature: - http2: - frames: - - frame_type: HEADERS - headers: - - 'user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:100.0) Gecko/20100101 - Firefox/100.0' - - 'accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8' - - 'accept-language: en-US,en;q=0.5' - - 'accept-encoding: gzip, deflate, br' - - 'upgrade-insecure-requests: 1' - - 'sec-fetch-dest: document' - - 'sec-fetch-mode: navigate' - - 'sec-fetch-site: none' - - 'sec-fetch-user: ?1' - - 'te: trailers' - pseudo_headers: - - :method - - :path - - :authority - - :scheme - tls_client_hello: - ciphersuites: - - 4865 - - 4867 - - 4866 - - 49195 - - 49199 - - 52393 - - 52392 - - 49196 - - 49200 - - 49162 - - 49161 - - 49171 - - 49172 - - 156 - - 157 - - 47 - - 53 - comp_methods: - - 0 - extensions: - - type: server_name - - length: 0 - type: extended_master_secret - - length: 1 - type: renegotiation_info - - length: 14 - supported_groups: - - 29 - - 23 - - 24 - - 25 - - 256 - - 257 - type: supported_groups - - ec_point_formats: - - 0 - length: 2 - type: ec_point_formats - - length: 0 - type: session_ticket - - alpn_list: - - h2 - - http/1.1 - length: 14 - type: application_layer_protocol_negotiation - - length: 5 - status_request_type: 1 - type: status_request - - length: 10 - sig_hash_algs: - - 1027 - - 1283 - - 1539 - - 515 - type: delegated_credentials - - key_shares: - - group: 29 - length: 32 - - group: 23 - length: 65 - length: 107 - type: keyshare - - length: 5 - supported_versions: - - TLS_VERSION_1_3 - - TLS_VERSION_1_2 - type: supported_versions - - length: 24 - sig_hash_algs: - - 1027 - - 1283 - - 1539 - - 2052 - - 2053 - - 2054 - - 1025 - - 1281 - - 1537 - - 515 - - 513 - type: signature_algorithms - - length: 2 - psk_ke_mode: 1 - type: psk_key_exchange_modes - - length: 2 - record_size_limit: 16385 - type: record_size_limit - - type: padding - handshake_version: TLS_VERSION_1_2 - record_version: TLS_VERSION_1_0 - session_id_length: 32 diff --git a/tests/signatures/firefox_102.0_win10.yaml b/tests/signatures/firefox_102.0_win10.yaml deleted file mode 100644 index 6c01f528..00000000 --- a/tests/signatures/firefox_102.0_win10.yaml +++ /dev/null @@ -1,120 +0,0 @@ -browser: - mode: regular - name: firefox - os: win10 - version: 102.0 -name: firefox_102.0_win10 -signature: - http2: - frames: - - frame_type: HEADERS - headers: - - 'user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 - Firefox/102.0' - - 'accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8' - - 'accept-language: en-US,en;q=0.5' - - 'accept-encoding: gzip, deflate, br' - - 'upgrade-insecure-requests: 1' - - 'sec-fetch-dest: document' - - 'sec-fetch-mode: navigate' - - 'sec-fetch-site: none' - - 'sec-fetch-user: ?1' - - 'te: trailers' - pseudo_headers: - - :method - - :path - - :authority - - :scheme - tls_client_hello: - ciphersuites: - - 4865 - - 4867 - - 4866 - - 49195 - - 49199 - - 52393 - - 52392 - - 49196 - - 49200 - - 49162 - - 49161 - - 49171 - - 49172 - - 156 - - 157 - - 47 - - 53 - comp_methods: - - 0 - extensions: - - type: server_name - - length: 0 - type: extended_master_secret - - length: 1 - type: renegotiation_info - - length: 14 - supported_groups: - - 29 - - 23 - - 24 - - 25 - - 256 - - 257 - type: supported_groups - - ec_point_formats: - - 0 - length: 2 - type: ec_point_formats - - length: 0 - type: session_ticket - - alpn_list: - - h2 - - http/1.1 - length: 14 - type: application_layer_protocol_negotiation - - length: 5 - status_request_type: 1 - type: status_request - - length: 10 - sig_hash_algs: - - 1027 - - 1283 - - 1539 - - 515 - type: delegated_credentials - - key_shares: - - group: 29 - length: 32 - - group: 23 - length: 65 - length: 107 - type: keyshare - - length: 5 - supported_versions: - - TLS_VERSION_1_3 - - TLS_VERSION_1_2 - type: supported_versions - - length: 24 - sig_hash_algs: - - 1027 - - 1283 - - 1539 - - 2052 - - 2053 - - 2054 - - 1025 - - 1281 - - 1537 - - 515 - - 513 - type: signature_algorithms - - length: 2 - psk_ke_mode: 1 - type: psk_key_exchange_modes - - length: 2 - record_size_limit: 16385 - type: record_size_limit - - type: padding - handshake_version: TLS_VERSION_1_2 - record_version: TLS_VERSION_1_0 - session_id_length: 32 diff --git a/tests/signatures/firefox_109.0_win10.yaml b/tests/signatures/firefox_109.0_win10.yaml deleted file mode 100644 index 8810080e..00000000 --- a/tests/signatures/firefox_109.0_win10.yaml +++ /dev/null @@ -1,120 +0,0 @@ -browser: - mode: regular - name: firefox - os: win10 - version: 109.0 -name: firefox_109.0_win10 -signature: - http2: - frames: - - frame_type: HEADERS - headers: - - 'user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 - Firefox/109.0' - - 'accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8' - - 'accept-language: en-US,en;q=0.5' - - 'accept-encoding: gzip, deflate, br' - - 'upgrade-insecure-requests: 1' - - 'sec-fetch-dest: document' - - 'sec-fetch-mode: navigate' - - 'sec-fetch-site: none' - - 'sec-fetch-user: ?1' - - 'te: trailers' - pseudo_headers: - - :method - - :path - - :authority - - :scheme - tls_client_hello: - ciphersuites: - - 4865 - - 4867 - - 4866 - - 49195 - - 49199 - - 52393 - - 52392 - - 49196 - - 49200 - - 49162 - - 49161 - - 49171 - - 49172 - - 156 - - 157 - - 47 - - 53 - comp_methods: - - 0 - extensions: - - type: server_name - - length: 0 - type: extended_master_secret - - length: 1 - type: renegotiation_info - - length: 14 - supported_groups: - - 29 - - 23 - - 24 - - 25 - - 256 - - 257 - type: supported_groups - - ec_point_formats: - - 0 - length: 2 - type: ec_point_formats - - length: 0 - type: session_ticket - - alpn_list: - - h2 - - http/1.1 - length: 14 - type: application_layer_protocol_negotiation - - length: 5 - status_request_type: 1 - type: status_request - - length: 10 - sig_hash_algs: - - 1027 - - 1283 - - 1539 - - 515 - type: delegated_credentials - - key_shares: - - group: 29 - length: 32 - - group: 23 - length: 65 - length: 107 - type: keyshare - - length: 5 - supported_versions: - - TLS_VERSION_1_3 - - TLS_VERSION_1_2 - type: supported_versions - - length: 24 - sig_hash_algs: - - 1027 - - 1283 - - 1539 - - 2052 - - 2053 - - 2054 - - 1025 - - 1281 - - 1537 - - 515 - - 513 - type: signature_algorithms - - length: 2 - psk_ke_mode: 1 - type: psk_key_exchange_modes - - length: 2 - record_size_limit: 16385 - type: record_size_limit - - type: padding - handshake_version: TLS_VERSION_1_2 - record_version: TLS_VERSION_1_0 - session_id_length: 32 diff --git a/tests/signatures/firefox_117.0.1_win10.yaml b/tests/signatures/firefox_117.0.1_win10.yaml deleted file mode 100644 index 88aaafd1..00000000 --- a/tests/signatures/firefox_117.0.1_win10.yaml +++ /dev/null @@ -1,120 +0,0 @@ -browser: - mode: regular - name: firefox - os: win10 - version: 117.0.1 -name: firefox_117.0.1_win10 -signature: - http2: - frames: - - frame_type: HEADERS - headers: - - 'user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 - Firefox/117.0' - - 'accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8' - - 'accept-language: en-US,en;q=0.5' - - 'accept-encoding: gzip, deflate, br' - - 'upgrade-insecure-requests: 1' - - 'sec-fetch-dest: document' - - 'sec-fetch-mode: navigate' - - 'sec-fetch-site: none' - - 'sec-fetch-user: ?1' - - 'te: trailers' - pseudo_headers: - - :method - - :path - - :authority - - :scheme - tls_client_hello: - ciphersuites: - - 4865 - - 4867 - - 4866 - - 49195 - - 49199 - - 52393 - - 52392 - - 49196 - - 49200 - - 49162 - - 49161 - - 49171 - - 49172 - - 156 - - 157 - - 47 - - 53 - comp_methods: - - 0 - extensions: - - type: server_name - - length: 0 - type: extended_master_secret - - length: 1 - type: renegotiation_info - - length: 14 - supported_groups: - - 29 - - 23 - - 24 - - 25 - - 256 - - 257 - type: supported_groups - - ec_point_formats: - - 0 - length: 2 - type: ec_point_formats - - length: 0 - type: session_ticket - - alpn_list: - - h2 - - http/1.1 - length: 14 - type: application_layer_protocol_negotiation - - length: 5 - status_request_type: 1 - type: status_request - - length: 10 - sig_hash_algs: - - 1027 - - 1283 - - 1539 - - 515 - type: delegated_credentials - - key_shares: - - group: 29 - length: 32 - - group: 23 - length: 65 - length: 107 - type: keyshare - - length: 5 - supported_versions: - - TLS_VERSION_1_3 - - TLS_VERSION_1_2 - type: supported_versions - - length: 24 - sig_hash_algs: - - 1027 - - 1283 - - 1539 - - 2052 - - 2053 - - 2054 - - 1025 - - 1281 - - 1537 - - 515 - - 513 - type: signature_algorithms - - length: 2 - psk_ke_mode: 1 - type: psk_key_exchange_modes - - length: 2 - record_size_limit: 16385 - type: record_size_limit - - type: padding - handshake_version: TLS_VERSION_1_2 - record_version: TLS_VERSION_1_0 - session_id_length: 32 diff --git a/tests/signatures/firefox_91.6.0esr_win10.yaml b/tests/signatures/firefox_91.6.0esr_win10.yaml deleted file mode 100644 index 247cacc9..00000000 --- a/tests/signatures/firefox_91.6.0esr_win10.yaml +++ /dev/null @@ -1,121 +0,0 @@ -browser: - mode: regular - name: firefox - os: win10 - version: 91.6.0esr -name: firefox_91.6.0esr_win10 -signature: - http2: - frames: - - frame_type: HEADERS - headers: - - 'user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 - Firefox/91.0' - - 'accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8' - - 'accept-language: en-US,en;q=0.5' - - 'accept-encoding: gzip, deflate, br' - - 'upgrade-insecure-requests: 1' - - 'sec-fetch-dest: document' - - 'sec-fetch-mode: navigate' - - 'sec-fetch-site: none' - - 'sec-fetch-user: ?1' - - 'te: trailers' - pseudo_headers: - - :method - - :path - - :authority - - :scheme - tls_client_hello: - ciphersuites: - - 4865 - - 4867 - - 4866 - - 49195 - - 49199 - - 52393 - - 52392 - - 49196 - - 49200 - - 49162 - - 49161 - - 49171 - - 49172 - - 156 - - 157 - - 47 - - 53 - - 10 - comp_methods: - - 0 - extensions: - - type: server_name - - length: 0 - type: extended_master_secret - - length: 1 - type: renegotiation_info - - length: 14 - supported_groups: - - 29 - - 23 - - 24 - - 25 - - 256 - - 257 - type: supported_groups - - ec_point_formats: - - 0 - length: 2 - type: ec_point_formats - - length: 0 - type: session_ticket - - alpn_list: - - h2 - - http/1.1 - length: 14 - type: application_layer_protocol_negotiation - - length: 5 - status_request_type: 1 - type: status_request - - length: 10 - sig_hash_algs: - - 1027 - - 1283 - - 1539 - - 515 - type: delegated_credentials - - key_shares: - - group: 29 - length: 32 - - group: 23 - length: 65 - length: 107 - type: keyshare - - length: 5 - supported_versions: - - TLS_VERSION_1_3 - - TLS_VERSION_1_2 - type: supported_versions - - length: 24 - sig_hash_algs: - - 1027 - - 1283 - - 1539 - - 2052 - - 2053 - - 2054 - - 1025 - - 1281 - - 1537 - - 515 - - 513 - type: signature_algorithms - - length: 2 - psk_ke_mode: 1 - type: psk_key_exchange_modes - - length: 2 - record_size_limit: 16385 - type: record_size_limit - - type: padding - handshake_version: TLS_VERSION_1_2 - record_version: TLS_VERSION_1_0 - session_id_length: 32 diff --git a/tests/signatures/firefox_95.0.2_win10.yaml b/tests/signatures/firefox_95.0.2_win10.yaml deleted file mode 100644 index 55fee0ae..00000000 --- a/tests/signatures/firefox_95.0.2_win10.yaml +++ /dev/null @@ -1,120 +0,0 @@ -browser: - mode: regular - name: firefox - os: win10 - version: 95.0.2 -name: firefox_95.0.2_win10 -signature: - http2: - frames: - - frame_type: HEADERS - headers: - - 'user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:95.0) Gecko/20100101 - Firefox/95.0' - - 'accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8' - - 'accept-language: en-US,en;q=0.5' - - 'accept-encoding: gzip, deflate, br' - - 'upgrade-insecure-requests: 1' - - 'sec-fetch-dest: document' - - 'sec-fetch-mode: navigate' - - 'sec-fetch-site: none' - - 'sec-fetch-user: ?1' - - 'te: trailers' - pseudo_headers: - - :method - - :path - - :authority - - :scheme - tls_client_hello: - ciphersuites: - - 4865 - - 4867 - - 4866 - - 49195 - - 49199 - - 52393 - - 52392 - - 49196 - - 49200 - - 49162 - - 49161 - - 49171 - - 49172 - - 156 - - 157 - - 47 - - 53 - comp_methods: - - 0 - extensions: - - type: server_name - - length: 0 - type: extended_master_secret - - length: 1 - type: renegotiation_info - - length: 14 - supported_groups: - - 29 - - 23 - - 24 - - 25 - - 256 - - 257 - type: supported_groups - - ec_point_formats: - - 0 - length: 2 - type: ec_point_formats - - length: 0 - type: session_ticket - - alpn_list: - - h2 - - http/1.1 - length: 14 - type: application_layer_protocol_negotiation - - length: 5 - status_request_type: 1 - type: status_request - - length: 10 - sig_hash_algs: - - 1027 - - 1283 - - 1539 - - 515 - type: delegated_credentials - - key_shares: - - group: 29 - length: 32 - - group: 23 - length: 65 - length: 107 - type: keyshare - - length: 5 - supported_versions: - - TLS_VERSION_1_3 - - TLS_VERSION_1_2 - type: supported_versions - - length: 24 - sig_hash_algs: - - 1027 - - 1283 - - 1539 - - 2052 - - 2053 - - 2054 - - 1025 - - 1281 - - 1537 - - 515 - - 513 - type: signature_algorithms - - length: 2 - psk_ke_mode: 1 - type: psk_key_exchange_modes - - length: 2 - record_size_limit: 16385 - type: record_size_limit - - type: padding - handshake_version: TLS_VERSION_1_2 - record_version: TLS_VERSION_1_0 - session_id_length: 32 diff --git a/tests/signatures/firefox_98.0_win10.yaml b/tests/signatures/firefox_98.0_win10.yaml deleted file mode 100644 index 7deeda7e..00000000 --- a/tests/signatures/firefox_98.0_win10.yaml +++ /dev/null @@ -1,120 +0,0 @@ -browser: - mode: regular - name: firefox - os: win10 - version: 98.0 -name: firefox_98.0_win10 -signature: - http2: - frames: - - frame_type: HEADERS - headers: - - 'user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:98.0) Gecko/20100101 - Firefox/98.0' - - 'accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8' - - 'accept-language: en-US,en;q=0.5' - - 'accept-encoding: gzip, deflate, br' - - 'upgrade-insecure-requests: 1' - - 'sec-fetch-dest: document' - - 'sec-fetch-mode: navigate' - - 'sec-fetch-site: none' - - 'sec-fetch-user: ?1' - - 'te: trailers' - pseudo_headers: - - :method - - :path - - :authority - - :scheme - tls_client_hello: - ciphersuites: - - 4865 - - 4867 - - 4866 - - 49195 - - 49199 - - 52393 - - 52392 - - 49196 - - 49200 - - 49162 - - 49161 - - 49171 - - 49172 - - 156 - - 157 - - 47 - - 53 - comp_methods: - - 0 - extensions: - - type: server_name - - length: 0 - type: extended_master_secret - - length: 1 - type: renegotiation_info - - length: 14 - supported_groups: - - 29 - - 23 - - 24 - - 25 - - 256 - - 257 - type: supported_groups - - ec_point_formats: - - 0 - length: 2 - type: ec_point_formats - - length: 0 - type: session_ticket - - alpn_list: - - h2 - - http/1.1 - length: 14 - type: application_layer_protocol_negotiation - - length: 5 - status_request_type: 1 - type: status_request - - length: 10 - sig_hash_algs: - - 1027 - - 1283 - - 1539 - - 515 - type: delegated_credentials - - key_shares: - - group: 29 - length: 32 - - group: 23 - length: 65 - length: 107 - type: keyshare - - length: 5 - supported_versions: - - TLS_VERSION_1_3 - - TLS_VERSION_1_2 - type: supported_versions - - length: 24 - sig_hash_algs: - - 1027 - - 1283 - - 1539 - - 2052 - - 2053 - - 2054 - - 1025 - - 1281 - - 1537 - - 515 - - 513 - type: signature_algorithms - - length: 2 - psk_ke_mode: 1 - type: psk_key_exchange_modes - - length: 2 - record_size_limit: 16385 - type: record_size_limit - - type: padding - handshake_version: TLS_VERSION_1_2 - record_version: TLS_VERSION_1_0 - session_id_length: 32