wangluozhe / requests-go

go版requests的python版本,支持tls,http2,ja3指纹自定义
MIT License
161 stars 44 forks source link

json.decoder.JSONDecodeError 和 requests_go.tls_client.exceptions.TLSClientExeption: [Errno requests_go error:] {"err": "Get "https://tls.peet.ws/api/all": Extension {{ 41 }} is not Supported by requests please raise an issue"} #7

Closed xmsley614 closed 1 year ago

xmsley614 commented 1 year ago

代码: import requests_go as requests from requests_go import tls_config

url = "https://tls.peet.ws/api/all"

tc = { "ip": "46.2X2.120.2X0:X8185", "http_version": "h2", "method": "GET", "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36 Edg/113.0.1774.42", "tls": { "ciphers": [ "TLS_GREASE (0x0A0A)", "TLS_AES_128_GCM_SHA256", "TLS_AES_256_GCM_SHA384", "TLS_AES_256_GCM_SHA384", "TLS_CHACHA20_POLY1305_SHA256", "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256", "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256", "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384", "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384", "TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256", "TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256", "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" ], "extensions": [ { "name": "TLS_GREASE (0x1a1a)" }, { "name": "signature_algorithms (13)", "signature_algorithms": [ "ecdsa_secp256r1_sha256", "rsa_pss_rsae_sha256", "rsa_pkcs1_sha256", "ecdsa_secp384r1_sha384", "rsa_pss_rsae_sha384", "rsa_pkcs1_sha384", "rsa_pss_rsae_sha512", "rsa_pkcs1_sha512" ] }, { "name": "compress_certificate (27)", "algorithms": [ "brotli (2)" ] }, { "name": "extensionRenegotiationInfo (boringssl) (65281)", "data": "00" }, { "name": "supported_versions (43)", "versions": [ "TLS_GREASE (0x3a3a)", "TLS 1.3", "TLS 1.2" ] }, { "name": "status_request (5)", "status_request": { "certificate_status_type": "OSCP (1)", "responder_id_list_length": 0, "request_extensions_length": 0 } }, { "name": "supported_groups (10)", "supported_groups": [ "TLS_GREASE (0xdada)", "X25519 (29)", "P-256 (23)", "P-384 (24)" ] }, { "name": "server_name (0)", "server_name": "tls.peet.ws" }, { "name": "extended_master_secret (23)", "master_secret_data": "", "extended_master_secret_data": "" }, { "name": "ec_point_formats (11)", "elliptic_curves_point_formats": [ "0x00" ] }, { "name": "application_layer_protocol_negotiation (16)", "protocols": [ "h2", "http/1.1" ] }, { "name": "application_settings (17513)", "protocols": [ "h2" ] }, { "name": "session_ticket (35)", "data": "" }, { "name": "signed_certificate_timestamp (18)" }, { "name": "key_share (51)", "shared_keys": [ { "TLS_GREASE (0xdada)": "00" }, { "X25519 (29)": "a1490a9b5befd4f082ec22b2e266801d8b109338fa489850eaef690bb0f3b73e" } ] }, { "name": "psk_key_exchange_modes (45)", "PSK_Key_Exchange_Mode": "PSK with (EC)DHE key establishment (psk_dhe_ke) (1)" }, { "name": "TLS_GREASE (0x8a8a)" }, { "name": "padding (21)", "padding_data_length": 84 }, { "name": "pre_shared_key (41)", "data": "0077007178db8ed43c857de3d77f3f894f347c6eb450fc49c281d400c51dc8a3d6abfa0aaffc17cd48740565f210dfeee5114d13a43979f7bceabf683abaaf845f0cd9eaad2c082e825557e57e71080e1ed4f0f077916ad2cdf2f2bf765ea618331399d1e6dfd8a081e42e4c4d55445b618ed60c8288372594002120630603ea4af9dc6a217b90866b1ecdb3acf5a36df0caf0390c0fe6ac85bba0c8" } ], "tls_version_record": "771", "tls_version_negotiated": "772", "ja3": "771,4865-4866-4866-4867-49195-49199-49196-49200-52393-52392-49171-49172-156-157-47-53,13-27-65281-43-5-10-0-23-11-16-17513-35-18-51-45-21-41,29-23-24,0", "ja3_hash": "381c25b3c93ee9479c9779ccc3913aab", "peetprint (WIP)": "GREASE-772-771|2-1.1|GREASE-29-23-24|1027-2052-1025-1283-2053-1281-2054-1537|1|2|GREASE-4865-4866-4866-4867-49195-49199-49196-49200-52393-52392-49171-49172-156-157-47-53|GREASE-13-27-65281-43-5-10-0-23-11-16-17513-35-18-51-45-GREASE-21-41", "peetprint_hash (WIP)": "0d5e5059f841ef4dab8aee7fdf3067af", "client_random": "c8f31344d7ef378858192cdd70d765decadf94af90d450862c6d4b2545616f3b", "session_id": "ce1dcc698f6342f5f428c14098cf749d8313cc575ab4903d94f5eaaf8094db2f" }, "http2": { "akamai_fingerprint": "1:65536,2:0,3:1000,4:6291456,6:262144|15663105|0|m,a,s,p", "akamai_fingerprint_hash": "46cedabdca2073198a42fa10ca4494d0", "sent_frames": [ { "frame_type": "SETTINGS", "length": 30, "settings": [ "HEADER_TABLE_SIZE = 65536", "ENABLE_PUSH = 0", "MAX_CONCURRENT_STREAMS = 1000", "INITIAL_WINDOW_SIZE = 6291456", "MAX_HEADER_LIST_SIZE = 262144" ] }, { "frame_type": "WINDOW_UPDATE", "length": 4, "increment": 15663105 }, { "frame_type": "HEADERS", "stream_id": 1, "length": 408, "headers": [ ":method: GET", ":authority: tls.peet.ws", ":scheme: https", ":path: /api/all", "pragma: no-cache", "cache-control: no-cache", "sec-ch-ua: \\"Microsoft Edge\\";v=\\"113\\", \\"Chromium\\";v=\\"113\\", \\"Not-A.Brand\\";v=\\"24\", "dnt: 1", "sec-ch-ua-mobile: ?0", "user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36 Edg/113.0.1774.42", "sec-ch-ua-platform: \\"Windows\", "accept: /", "sec-fetch-site: same-origin", "sec-fetch-mode: cors", "sec-fetch-dest: empty", "referer: https://tls.peet.ws/", "accept-encoding: gzip, deflate, br", "accept-language: zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6,zh-TW;q=0.5,ja;q=0.4" ], "flags": [ "EndStream (0x1)", "EndHeaders (0x4)", "Priority (0x20)" ], "priority": { "weight": 220, "depends_on": 0, "exclusive": 1 } } ] } } tls_conf = tls_config.to_tls_config(tc) response = requests.get(url, tls_config=tls_conf) print(response.text)

xmsley614 commented 1 year ago

IP地址文本中,X=3

wangluozhe commented 1 year ago

暂时不支持41扩展,请在ja3中删除此扩展