Skip to content

Commit 4362bb0

Browse files
committed
Add Tor 14.5
1 parent dd9330e commit 4362bb0

5 files changed

Lines changed: 284 additions & 2 deletions

File tree

bin/curl_tor145

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#!/usr/bin/env bash
2+
3+
# Find the directory of this script
4+
dir=${0%/*}
5+
6+
# The list of ciphers can be obtained by looking at the Client Hello message in
7+
# Wireshark, then converting it using the cipherlist array at
8+
"$dir/curl-impersonate" \
9+
--ciphers "TLS_AES_128_GCM_SHA256,TLS_CHACHA20_POLY1305_SHA256,TLS_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256,TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA,TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA,TLS_RSA_WITH_AES_128_GCM_SHA256,TLS_RSA_WITH_AES_256_GCM_SHA384,TLS_RSA_WITH_AES_128_CBC_SHA,TLS_RSA_WITH_AES_256_CBC_SHA" \
10+
--curves X25519:P-256:P-384:P-521:ffdhe2048:ffdhe3072 \
11+
--signature-hashes ecdsa_secp256r1_sha256,ecdsa_secp384r1_sha384,ecdsa_secp521r1_sha512,rsa_pss_rsae_sha256,rsa_pss_rsae_sha384,rsa_pss_rsae_sha512,rsa_pkcs1_sha256,rsa_pkcs1_sha384,rsa_pkcs1_sha512,ecdsa_sha1,rsa_pkcs1_sha1 \
12+
-H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:128.0) Gecko/20100101 Firefox/128.0' \
13+
-H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' \
14+
-H 'Accept-Language: en-US,en;q=0.5' \
15+
-H 'Accept-Encoding: gzip, deflate, br, zstd' \
16+
-H 'Upgrade-Insecure-Requests: 1' \
17+
-H 'Sec-GPC: 1' \
18+
-H 'Sec-Fetch-Dest: document' \
19+
-H 'Sec-Fetch-Mode: navigate' \
20+
-H 'Sec-Fetch-Site: none' \
21+
-H 'Sec-Fetch-User: ?1' \
22+
-H "Priority: u=0, i" \
23+
-H 'TE: trailers' \
24+
--http2 \
25+
--http2-settings '1:65536;2:0;4:131072;5:16384' \
26+
--http2-pseudo-headers-order 'mpas' \
27+
--http2-window-update 12517377 \
28+
--http2-stream-weight 42 \
29+
--http2-stream-exclusive 0 \
30+
--compressed \
31+
--ech grease \
32+
--tls-extension-order "0-23-65281-10-11-16-5-34-51-43-13-28-65037" \
33+
--tls-delegated-credentials "ecdsa_secp256r1_sha256:ecdsa_secp384r1_sha384:ecdsa_secp521r1_sha512:ecdsa_sha1" \
34+
--tls-record-size-limit 4001 \
35+
--tls-key-shares-limit 3 \
36+
--cert-compression zlib,brotli,zstd \
37+
--tls-signed-cert-timestamps \
38+
--tls-use-firefox-tls13-ciphers \
39+
"$@"

patches/curl.patch

Lines changed: 70 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1514,10 +1514,10 @@ index 93cc2d44f..52e80ce9c 100644
15141514
* Store nghttp2 version info in this buffer.
15151515
diff --git a/lib/impersonate.c b/lib/impersonate.c
15161516
new file mode 100644
1517-
index 000000000..e2cb10a9a
1517+
index 000000000..0ce4c3be5
15181518
--- /dev/null
15191519
+++ b/lib/impersonate.c
1520-
@@ -0,0 +1,1434 @@
1520+
@@ -0,0 +1,1502 @@
15211521
+#include "curl_setup.h"
15221522
+
15231523
+#include <curl/curl.h>
@@ -2435,6 +2435,7 @@ index 000000000..e2cb10a9a
24352435
+ .http2_settings = "1:65536;2:0;4:131072;5:16384",
24362436
+ .http2_window_update = 12517377,
24372437
+ .http2_pseudo_headers_order = "mpas",
2438+
+ .http2_stream_exclusive = 0,
24382439
+ .cert_compression = "zlib,brotli,zstd",
24392440
+ .ech = "grease",
24402441
+ .tls_session_ticket = true,
@@ -2499,6 +2500,7 @@ index 000000000..e2cb10a9a
24992500
+ .http2_settings = "1:65536;2:0;4:131072;5:16384",
25002501
+ .http2_window_update = 12517377,
25012502
+ .http2_pseudo_headers_order = "mpas",
2503+
+ .http2_stream_exclusive = 0,
25022504
+ .cert_compression = "zlib,brotli,zstd",
25032505
+ .ech = "grease",
25042506
+ .tls_session_ticket = true,
@@ -2948,6 +2950,72 @@ index 000000000..e2cb10a9a
29482950
+ .tls_use_new_alps_codepoint = false,
29492951
+ .tls_signed_cert_timestamps = true,
29502952
+ .tls_grease = true
2953+
+ },
2954+
+ {
2955+
+ .target = "tor145", // tor 14.5, based on firefox 128
2956+
+ .alias = "tor145",
2957+
+ .httpversion = CURL_HTTP_VERSION_2_0,
2958+
+ .ssl_version = CURL_SSLVERSION_TLSv1_2 | CURL_SSLVERSION_MAX_DEFAULT,
2959+
+ .ciphers =
2960+
+ "TLS_AES_128_GCM_SHA256,"
2961+
+ "TLS_CHACHA20_POLY1305_SHA256,"
2962+
+ "TLS_AES_256_GCM_SHA384,"
2963+
+ "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,"
2964+
+ "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,"
2965+
+ "TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256,"
2966+
+ "TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256,"
2967+
+ "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,"
2968+
+ "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,"
2969+
+ "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA,"
2970+
+ "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA,"
2971+
+ "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA,"
2972+
+ "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA,"
2973+
+ "TLS_RSA_WITH_AES_128_GCM_SHA256,"
2974+
+ "TLS_RSA_WITH_AES_256_GCM_SHA384,"
2975+
+ "TLS_RSA_WITH_AES_128_CBC_SHA,"
2976+
+ "TLS_RSA_WITH_AES_256_CBC_SHA",
2977+
+ .http_headers = {
2978+
+ "User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:128.0) Gecko/20100101 Firefox/128.0",
2979+
+ "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
2980+
+ "Accept-Language: en-US,en;q=0.5",
2981+
+ "Accept-Encoding: gzip, deflate, br, zstd",
2982+
+ "Sec-GPC: 1",
2983+
+ "Upgrade-Insecure-Requests: 1",
2984+
+ "Sec-Fetch-Dest: document",
2985+
+ "Sec-Fetch-Mode: navigate",
2986+
+ "Sec-Fetch-Site: none",
2987+
+ "Sec-Fetch-User: ?1",
2988+
+ "Priority: u=0, i",
2989+
+ "Te: trailers"
2990+
+ },
2991+
+ .curves = "X25519:P-256:P-384:P-521:ffdhe2048:ffdhe3072",
2992+
+ .sig_hash_algs =
2993+
+ "ecdsa_secp256r1_sha256,"
2994+
+ "ecdsa_secp384r1_sha384,"
2995+
+ "ecdsa_secp521r1_sha512,"
2996+
+ "rsa_pss_rsae_sha256,"
2997+
+ "rsa_pss_rsae_sha384,"
2998+
+ "rsa_pss_rsae_sha512,"
2999+
+ "rsa_pkcs1_sha256,"
3000+
+ "rsa_pkcs1_sha384,"
3001+
+ "rsa_pkcs1_sha512,"
3002+
+ "ecdsa_sha1,"
3003+
+ "rsa_pkcs1_sha1",
3004+
+ .alpn = true,
3005+
+ .http2_settings = "1:65536;2:0;4:131072;5:16384",
3006+
+ .http2_window_update = 12517377,
3007+
+ .http2_pseudo_headers_order = "mpas",
3008+
+ .http2_stream_exclusive = 0,
3009+
+ .cert_compression = "zlib,brotli,zstd",
3010+
+ .ech = "grease",
3011+
+ .tls_session_ticket = true,
3012+
+ .tls_extension_order = "0-23-65281-10-11-16-5-34-51-43-13-28-65037",
3013+
+ .tls_delegated_credentials = "ecdsa_secp256r1_sha256:ecdsa_secp384r1_sha384:ecdsa_secp521r1_sha512:ecdsa_sha1",
3014+
+ .tls_record_size_limit = 4001,
3015+
+ .tls_grease = false,
3016+
+ .tls_signed_cert_timestamps = true,
3017+
+ .tls_key_shares_limit = 3,
3018+
+ .use_firefox_tls13_ciphers = true
29513019
+ }
29523020
+};
29533021
+
Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
browser:
2+
name: tor
3+
os: macOS
4+
version: 14.5
5+
signature:
6+
http2:
7+
frames:
8+
- frame_type: SETTINGS
9+
settings:
10+
- key: 1
11+
value: 65536
12+
- key: 2
13+
value: 0
14+
- key: 4
15+
value: 131072
16+
- key: 5
17+
value: 16384
18+
stream_id: 0
19+
- frame_type: WINDOW_UPDATE
20+
stream_id: 0
21+
window_size_increment: 12517377
22+
- frame_type: HEADERS
23+
headers:
24+
- 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:128.0) Gecko/20100101 Firefox/128.0'
25+
- 'accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'
26+
- 'accept-language: en-US,en;q=0.5'
27+
- 'accept-encoding: gzip, deflate, br, zstd'
28+
- 'upgrade-insecure-requests: 1'
29+
- 'sec-gpc: 1'
30+
- 'sec-fetch-dest: document'
31+
- 'sec-fetch-mode: navigate'
32+
- 'sec-fetch-site: none'
33+
- 'sec-fetch-user: ?1'
34+
- 'priority: u=0, i'
35+
- 'te: trailers'
36+
pseudo_headers:
37+
- :method
38+
- :path
39+
- :authority
40+
- :scheme
41+
stream_id: 15
42+
tls_client_hello:
43+
ciphersuites:
44+
- 4865
45+
- 4867
46+
- 4866
47+
- 49195
48+
- 49199
49+
- 52393
50+
- 52392
51+
- 49196
52+
- 49200
53+
- 49162
54+
- 49161
55+
- 49171
56+
- 49172
57+
- 156
58+
- 157
59+
- 47
60+
- 53
61+
comp_methods:
62+
- 0
63+
extensions:
64+
- type: server_name
65+
- length: 0
66+
type: extended_master_secret
67+
- length: 1
68+
type: renegotiation_info
69+
- length: 16
70+
supported_groups:
71+
- 29
72+
- 23
73+
- 24
74+
- 25
75+
- 256
76+
- 257
77+
type: supported_groups
78+
- ec_point_formats:
79+
- 0
80+
length: 2
81+
type: ec_point_formats
82+
- alpn_list:
83+
- h2
84+
- http/1.1
85+
length: 14
86+
type: application_layer_protocol_negotiation
87+
- length: 5
88+
status_request_type: 1
89+
type: status_request
90+
- length: 10
91+
sig_hash_algs:
92+
- 1027
93+
- 1283
94+
- 1539
95+
- 515
96+
type: delegated_credentials
97+
- key_shares:
98+
- group: 4588
99+
length: 1216
100+
- group: 29
101+
length: 32
102+
- group: 23
103+
length: 65
104+
length: 1327
105+
type: keyshare
106+
- length: 5
107+
supported_versions:
108+
- TLS_VERSION_1_3
109+
- TLS_VERSION_1_2
110+
type: supported_versions
111+
- length: 24
112+
sig_hash_algs:
113+
- 1027
114+
- 1283
115+
- 1539
116+
- 2052
117+
- 2053
118+
- 2054
119+
- 1025
120+
- 1281
121+
- 1537
122+
- 515
123+
- 513
124+
type: signature_algorithms
125+
- length: 2
126+
record_size_limit: 4001
127+
type: record_size_limit
128+
- length: 0
129+
type: encrypted_client_hello
130+
handshake_version: TLS_VERSION_1_2
131+
record_version: TLS_VERSION_1_0
132+
session_id_length: 32

tests/targets.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,10 @@
9191
- null
9292
- null
9393
- firefox_135.0.1_macOS
94+
- - curl_tor145
95+
- null
96+
- null
97+
- tor_14.5_macOS
9498

9599
# Test libcurl-impersonate by loading it with LD_PRELOAD to an app
96100
# linked against the regular libcurl and setting the
@@ -195,3 +199,7 @@
195199
- CURL_IMPERSONATE: firefox135
196200
- libcurl-impersonate
197201
- firefox_135.0.1_macOS
202+
- - minicurl
203+
- CURL_IMPERSONATE: tor145
204+
- libcurl-impersonate
205+
- tor_14.5_macOS

win/bin/curl_tor145.bat

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
:: The list of ciphers can be obtained by looking at the Client Hello message in
2+
:: Wireshark, then converting it using the cipherlist array at
3+
4+
@echo off
5+
"%~dp0curl.exe" ^
6+
--ciphers "TLS_AES_128_GCM_SHA256,TLS_CHACHA20_POLY1305_SHA256,TLS_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256,TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA,TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA,TLS_RSA_WITH_AES_128_GCM_SHA256,TLS_RSA_WITH_AES_256_GCM_SHA384,TLS_RSA_WITH_AES_128_CBC_SHA,TLS_RSA_WITH_AES_256_CBC_SHA" ^
7+
--curves X25519:P-256:P-384:P-521:ffdhe2048:ffdhe3072 ^
8+
--signature-hashes ecdsa_secp256r1_sha256,ecdsa_secp384r1_sha384,ecdsa_secp521r1_sha512,rsa_pss_rsae_sha256,rsa_pss_rsae_sha384,rsa_pss_rsae_sha512,rsa_pkcs1_sha256,rsa_pkcs1_sha384,rsa_pkcs1_sha512,ecdsa_sha1,rsa_pkcs1_sha1 ^
9+
-H "User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:128.0) Gecko/20100101 Firefox/128.0" ^
10+
-H "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" ^
11+
-H "Accept-Language: en-US,en;q=0.5" ^
12+
-H "Accept-Encoding: gzip, deflate, br, zstd" ^
13+
-H "Upgrade-Insecure-Requests: 1" ^
14+
-H "Sec-GPC: 1" ^
15+
-H "Sec-Fetch-Dest: document" ^
16+
-H "Sec-Fetch-Mode: navigate" ^
17+
-H "Sec-Fetch-Site: none" ^
18+
-H "Sec-Fetch-User: ?1" ^
19+
-H "Priority: u=0, i" ^
20+
-H "TE: Trailers" ^
21+
--http2 ^
22+
--http2-settings "1:65536;2:0;4:131072;5:16384" ^
23+
--http2-pseudo-headers-order "mpas" ^
24+
--http2-window-update 12517377 ^
25+
--http2-stream-weight 42 ^
26+
--http2-stream-exclusive 0 ^
27+
--compressed ^
28+
--ech grease ^
29+
--tls-extension-order "0-23-65281-10-11-16-5-34-51-43-13-28-65037" ^
30+
--tls-delegated-credentials "ecdsa_secp256r1_sha256:ecdsa_secp384r1_sha384:ecdsa_secp521r1_sha512:ecdsa_sha1" ^
31+
--tls-record-size-limit 4001 ^
32+
--tls-key-shares-limit 3 ^
33+
--cert-compression zlib,brotli,zstd ^
34+
--tls-signed-cert-timestamps ^
35+
%*

0 commit comments

Comments
 (0)