mirror of https://github.com/cbeuw/Cloak
Update chrome fingerprint
This commit is contained in:
parent
68f47f1d49
commit
f67ae6e644
|
|
@ -1,4 +1,4 @@
|
||||||
// Fingerprint of Chrome 97
|
// Fingerprint of Chrome 99
|
||||||
|
|
||||||
package client
|
package client
|
||||||
|
|
||||||
|
|
@ -46,7 +46,7 @@ func (c *Chrome) composeExtensions(serverName string, keyShare []byte) []byte {
|
||||||
|
|
||||||
// extension length is always 403, and server name length is variable
|
// extension length is always 403, and server name length is variable
|
||||||
|
|
||||||
var ext [17][]byte
|
var ext [18][]byte
|
||||||
ext[0] = addExtRec(makeGREASE(), nil) // First GREASE
|
ext[0] = addExtRec(makeGREASE(), nil) // First GREASE
|
||||||
ext[1] = addExtRec([]byte{0x00, 0x00}, generateSNI(serverName)) // server name indication
|
ext[1] = addExtRec([]byte{0x00, 0x00}, generateSNI(serverName)) // server name indication
|
||||||
ext[2] = addExtRec([]byte{0x00, 0x17}, nil) // extended_master_secret
|
ext[2] = addExtRec([]byte{0x00, 0x17}, nil) // extended_master_secret
|
||||||
|
|
@ -62,16 +62,18 @@ func (c *Chrome) composeExtensions(serverName string, keyShare []byte) []byte {
|
||||||
ext[10] = addExtRec([]byte{0x00, 0x12}, nil) // signed cert timestamp
|
ext[10] = addExtRec([]byte{0x00, 0x12}, nil) // signed cert timestamp
|
||||||
ext[11] = addExtRec([]byte{0x00, 0x33}, makeKeyShare(keyShare)) // key share
|
ext[11] = addExtRec([]byte{0x00, 0x33}, makeKeyShare(keyShare)) // key share
|
||||||
ext[12] = addExtRec([]byte{0x00, 0x2d}, []byte{0x01, 0x01}) // psk key exchange modes
|
ext[12] = addExtRec([]byte{0x00, 0x2d}, []byte{0x01, 0x01}) // psk key exchange modes
|
||||||
suppVersions, _ := hex.DecodeString("0a9A9A0304030303020301") // 9A9A needs to be a GREASE
|
suppVersions, _ := hex.DecodeString("069A9A03040303") // 9A9A needs to be a GREASE
|
||||||
copy(suppVersions[1:3], makeGREASE())
|
copy(suppVersions[1:3], makeGREASE())
|
||||||
ext[13] = addExtRec([]byte{0x00, 0x2b}, suppVersions) // supported versions
|
ext[13] = addExtRec([]byte{0x00, 0x2b}, suppVersions) // supported versions
|
||||||
ext[14] = addExtRec([]byte{0x00, 0x1b}, []byte{0x02, 0x00, 0x02}) // compress certificate
|
ext[14] = addExtRec([]byte{0x00, 0x1b}, []byte{0x02, 0x00, 0x02}) // compress certificate
|
||||||
ext[15] = addExtRec(makeGREASE(), []byte{0x00}) // Last GREASE
|
applicationSettings, _ := hex.DecodeString("0003026832")
|
||||||
// len(ext[1]) + 170 + len(ext[16]) = 403
|
ext[15] = addExtRec([]byte{0x44, 0x69}, applicationSettings) // application settings
|
||||||
// len(ext[16]) = 233 - len(ext[1])
|
ext[16] = addExtRec(makeGREASE(), []byte{0x00}) // Last GREASE
|
||||||
// 2+2+len(padding) = 233 - len(ext[1])
|
// len(ext[1]) + 175 + len(ext[16]) = 403
|
||||||
// len(padding) = 229 - len(ext[1])
|
// len(ext[16]) = 228 - len(ext[1])
|
||||||
ext[16] = addExtRec([]byte{0x00, 0x15}, make([]byte, 229-len(ext[1]))) // padding
|
// 2+2+len(padding) = 228 - len(ext[1])
|
||||||
|
// len(padding) = 224 - len(ext[1])
|
||||||
|
ext[17] = addExtRec([]byte{0x00, 0x15}, make([]byte, 224-len(ext[1]))) // padding
|
||||||
var ret []byte
|
var ret []byte
|
||||||
for _, e := range ext {
|
for _, e := range ext {
|
||||||
ret = append(ret, e...)
|
ret = append(ret, e...)
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ func TestComposeExtension(t *testing.T) {
|
||||||
keyShare, _ := hex.DecodeString("690f074f5c01756982269b66d58c90c47dc0f281d654c7b2c16f63c9033f5604")
|
keyShare, _ := hex.DecodeString("690f074f5c01756982269b66d58c90c47dc0f281d654c7b2c16f63c9033f5604")
|
||||||
|
|
||||||
result := (&Chrome{}).composeExtensions(serverName, keyShare)
|
result := (&Chrome{}).composeExtensions(serverName, keyShare)
|
||||||
target, _ := hex.DecodeString("8a8a00000000000f000d00000a6769746875622e636f6d00170000ff01000100000a000a00088a8a001d00170018000b00020100002300000010000e000c02683208687474702f312e31000500050100000000000d0012001004030804040105030805050108060601001200000033002b00298a8a000100001d0020690f074f5c01756982269b66d58c90c47dc0f281d654c7b2c16f63c9033f5604002d00020101002b000b0a3a3a0304030303020301001b00030200024a4a000100001500d2000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000")
|
target, _ := hex.DecodeString("3a3a00000000000f000d00000a6769746875622e636f6d00170000ff01000100000a000a00080a0a001d00170018000b00020100002300000010000e000c02683208687474702f312e31000500050100000000000d0012001004030804040105030805050108060601001200000033002b00296a6a000100001d0020690f074f5c01756982269b66d58c90c47dc0f281d654c7b2c16f63c9033f5604002d00020101002b000706dada03040303001b0003020002446900050003026832eaea000100001500cd00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000")
|
||||||
for p := 0; p < len(result); p++ {
|
for p := 0; p < len(result); p++ {
|
||||||
if result[p] != target[p] {
|
if result[p] != target[p] {
|
||||||
if result[p]&0x0F == 0xA && target[p]&0x0F == 0xA &&
|
if result[p]&0x0F == 0xA && target[p]&0x0F == 0xA &&
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue