Skip to content

Commit

Permalink
added chrome 117 with changed h2 fingerprint;
Browse files Browse the repository at this point in the history
  • Loading branch information
bogdanfinn committed Sep 21, 2023
1 parent eba9f13 commit 716d7b1
Show file tree
Hide file tree
Showing 4 changed files with 137 additions and 1 deletion.
101 changes: 101 additions & 0 deletions profiles/internal_browser_profiles.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,107 @@ import (
tls "github.com/bogdanfinn/utls"
)

var Chrome_117 = ClientProfile{
clientHelloId: tls.ClientHelloID{
Client: "Chrome",
RandomExtensionOrder: false,
Version: "117",
Seed: nil,
SpecFactory: func() (tls.ClientHelloSpec, error) {
return tls.ClientHelloSpec{
CipherSuites: []uint16{
tls.GREASE_PLACEHOLDER,
tls.TLS_AES_128_GCM_SHA256,
tls.TLS_AES_256_GCM_SHA384,
tls.TLS_CHACHA20_POLY1305_SHA256,
tls.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,
tls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
tls.TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,
tls.TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,
tls.TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256,
tls.TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256,
tls.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA,
tls.TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA,
tls.TLS_RSA_WITH_AES_128_GCM_SHA256,
tls.TLS_RSA_WITH_AES_256_GCM_SHA384,
tls.TLS_RSA_WITH_AES_128_CBC_SHA,
tls.TLS_RSA_WITH_AES_256_CBC_SHA,
},
CompressionMethods: []uint8{
tls.CompressionNone,
},
Extensions: []tls.TLSExtension{
&tls.UtlsGREASEExtension{},
&tls.PSKKeyExchangeModesExtension{[]uint8{
tls.PskModeDHE,
}},
&tls.SNIExtension{},
&tls.ALPNExtension{AlpnProtocols: []string{"h2", "http/1.1"}},
&tls.SignatureAlgorithmsExtension{SupportedSignatureAlgorithms: []tls.SignatureScheme{
tls.ECDSAWithP256AndSHA256,
tls.PSSWithSHA256,
tls.PKCS1WithSHA256,
tls.ECDSAWithP384AndSHA384,
tls.PSSWithSHA384,
tls.PKCS1WithSHA384,
tls.PSSWithSHA512,
tls.PKCS1WithSHA512,
}},
&tls.SupportedVersionsExtension{[]uint16{
tls.GREASE_PLACEHOLDER,
tls.VersionTLS13,
tls.VersionTLS12,
}},
&tls.ALPSExtension{SupportedProtocols: []string{"h2"}},
&tls.SupportedCurvesExtension{[]tls.CurveID{
tls.CurveID(tls.GREASE_PLACEHOLDER),
tls.X25519,
tls.CurveP256,
tls.CurveP384,
}},
&tls.UtlsExtendedMasterSecretExtension{},

&tls.SessionTicketExtension{},
&tls.UtlsCompressCertExtension{[]tls.CertCompressionAlgo{
tls.CertCompressionBrotli,
}},
&tls.SCTExtension{},
&tls.StatusRequestExtension{},
&tls.KeyShareExtension{[]tls.KeyShare{
{Group: tls.CurveID(tls.GREASE_PLACEHOLDER), Data: []byte{0}},
{Group: tls.X25519},
}},
&tls.RenegotiationInfoExtension{Renegotiation: tls.RenegotiateOnceAsClient},
&tls.SupportedPointsExtension{SupportedPoints: []byte{
tls.PointFormatUncompressed,
}},
&tls.UtlsGREASEExtension{},
&tls.UtlsPaddingExtension{GetPaddingLen: tls.BoringPaddingStyle},
},
}, nil
},
},
settings: map[http2.SettingID]uint32{
http2.SettingHeaderTableSize: 65536,
http2.SettingEnablePush: 0,
http2.SettingInitialWindowSize: 6291456,
http2.SettingMaxHeaderListSize: 262144,
},
settingsOrder: []http2.SettingID{
http2.SettingHeaderTableSize,
http2.SettingEnablePush,
http2.SettingInitialWindowSize,
http2.SettingMaxHeaderListSize,
},
pseudoHeaderOrder: []string{
":method",
":authority",
":scheme",
":path",
},
connectionFlow: 15663105,
}

var Chrome_112 = ClientProfile{
clientHelloId: tls.HelloChrome_112,
settings: map[http2.SettingID]uint32{
Expand Down
3 changes: 2 additions & 1 deletion profiles/profiles.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
tls "github.com/bogdanfinn/utls"
)

var DefaultClientProfile = Chrome_112
var DefaultClientProfile = Chrome_117

var MappedTLSClients = map[string]ClientProfile{
"chrome_103": Chrome_103,
Expand All @@ -18,6 +18,7 @@ var MappedTLSClients = map[string]ClientProfile{
"chrome_110": Chrome_110,
"chrome_111": Chrome_111,
"chrome_112": Chrome_112,
"chrome_117": Chrome_117,
"safari_15_6_1": Safari_15_6_1,
"safari_16_0": Safari_16_0,
"safari_ipad_15_6": Safari_Ipad_15_6,
Expand Down
28 changes: 28 additions & 0 deletions tests/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ import (
)

func TestClients(t *testing.T) {
t.Log("testing chrome 117")
chrome_117(t)
time.Sleep(2 * time.Second)
t.Log("testing firefox 117")
firefox_117(t)
time.Sleep(2 * time.Second)
Expand Down Expand Up @@ -461,6 +464,31 @@ func firefox_108(t *testing.T) {
compareResponse(t, "firefox", clientFingerprints[firefox][tls.HelloFirefox_108.Str()], resp)
}

func chrome_117(t *testing.T) {
options := []tls_client.HttpClientOption{
tls_client.WithClientProfile(profiles.Chrome_117),
}

client, err := tls_client.NewHttpClient(nil, options...)
if err != nil {
t.Fatal(err)
}

req, err := http.NewRequest(http.MethodGet, peetApiEndpoint, nil)
if err != nil {
t.Fatal(err)
}

req.Header = defaultHeader

resp, err := client.Do(req)
if err != nil {
t.Fatal(err)
}

compareResponse(t, "chrome", clientFingerprints[chrome][profiles.Chrome_117.GetClientHelloStr()], resp)
}

func firefox_117(t *testing.T) {
options := []tls_client.HttpClientOption{
tls_client.WithClientProfile(profiles.Firefox_117),
Expand Down
6 changes: 6 additions & 0 deletions tests/client_test_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ const (

var clientFingerprints = map[string]map[string]map[string]string{
chrome: {
profiles.Chrome_117.GetClientHelloStr(): map[string]string{
ja3String: "771,4865-4866-4867-49195-49199-49196-49200-52393-52392-49171-49172-156-157-47-53,45-0-16-13-43-17513-10-23-35-27-18-5-51-65281-11-21,29-23-24,0",
ja3Hash: "1ddf8a0ebd957d10c1ab320b10450028",
akamaiFingerprint: "1:65536,2:0,4:6291456,6:262144|15663105|0|m,a,s,p",
akamaiFingerprintHash: "90224459f8bf70b7d0a8797eb916dbc9",
},
tls.HelloChrome_112.Str(): map[string]string{
ja3String: "771,4865-4866-4867-49195-49199-49196-49200-52393-52392-49171-49172-156-157-47-53,45-51-17513-43-0-11-5-23-16-10-65281-27-18-35-13-21,29-23-24,0",
ja3Hash: "7f052aeccc9b50e9b3a43a02780539b2",
Expand Down

0 comments on commit 716d7b1

Please sign in to comment.