|
|
|
@ -1,4 +1,4 @@
|
|
|
|
|
// Fingerprint of Firefox 96
|
|
|
|
|
// Fingerprint of Firefox 99
|
|
|
|
|
|
|
|
|
|
package client
|
|
|
|
|
|
|
|
|
@ -22,26 +22,30 @@ func (f *Firefox) composeExtensions(serverName string, keyShare []byte) []byte {
|
|
|
|
|
common.CryptoRandRead(ret[42:107])
|
|
|
|
|
return ret
|
|
|
|
|
}
|
|
|
|
|
// extension length is always 399, and server name length is variable
|
|
|
|
|
var ext [12][]byte
|
|
|
|
|
// extension length is always 401, and server name length is variable
|
|
|
|
|
var ext [15][]byte
|
|
|
|
|
ext[0] = addExtRec([]byte{0x00, 0x00}, generateSNI(serverName)) // server name indication
|
|
|
|
|
ext[1] = addExtRec([]byte{0x00, 0x17}, nil) // extended_master_secret
|
|
|
|
|
ext[2] = addExtRec([]byte{0xff, 0x01}, []byte{0x00}) // renegotiation_info
|
|
|
|
|
suppGroup, _ := hex.DecodeString("000c001d00170018001901000101")
|
|
|
|
|
ext[3] = addExtRec([]byte{0x00, 0x0a}, suppGroup) // supported groups
|
|
|
|
|
ext[4] = addExtRec([]byte{0x00, 0x0b}, []byte{0x01, 0x00}) // ec point formats
|
|
|
|
|
ext[5] = addExtRec([]byte{0x00, 0x23}, nil) // session ticket
|
|
|
|
|
ALPN, _ := hex.DecodeString("000c02683208687474702f312e31")
|
|
|
|
|
ext[5] = addExtRec([]byte{0x00, 0x10}, ALPN) // app layer proto negotiation
|
|
|
|
|
ext[6] = addExtRec([]byte{0x00, 0x05}, []byte{0x01, 0x00, 0x00, 0x00, 0x00}) // status request
|
|
|
|
|
ext[7] = addExtRec([]byte{0x00, 0x33}, composeKeyShare(keyShare)) // key share
|
|
|
|
|
suppVersions, _ := hex.DecodeString("080304030303020301")
|
|
|
|
|
ext[8] = addExtRec([]byte{0x00, 0x2b}, suppVersions) // supported versions
|
|
|
|
|
ext[6] = addExtRec([]byte{0x00, 0x10}, ALPN) // app layer proto negotiation
|
|
|
|
|
ext[7] = addExtRec([]byte{0x00, 0x05}, []byte{0x01, 0x00, 0x00, 0x00, 0x00}) // status request
|
|
|
|
|
delegatedCredentials, _ := hex.DecodeString("00080403050306030203")
|
|
|
|
|
ext[8] = addExtRec([]byte{0x00, 0x22}, delegatedCredentials) // delegated credentials
|
|
|
|
|
ext[9] = addExtRec([]byte{0x00, 0x33}, composeKeyShare(keyShare)) // key share
|
|
|
|
|
suppVersions, _ := hex.DecodeString("0403040303")
|
|
|
|
|
ext[10] = addExtRec([]byte{0x00, 0x2b}, suppVersions) // supported versions
|
|
|
|
|
sigAlgo, _ := hex.DecodeString("001604030503060308040805080604010501060102030201")
|
|
|
|
|
ext[9] = addExtRec([]byte{0x00, 0x0d}, sigAlgo) // Signature Algorithms
|
|
|
|
|
ext[10] = addExtRec([]byte{0x00, 0x1c}, []byte{0x40, 0x01}) // record size limit
|
|
|
|
|
// len(ext[0]) + 218 + 4 + len(padding) = 399
|
|
|
|
|
ext[11] = addExtRec([]byte{0x00, 0x0d}, sigAlgo) // Signature Algorithms
|
|
|
|
|
ext[12] = addExtRec([]byte{0x00, 0x2d}, []byte{0x01, 0x01}) // psk key exchange modes
|
|
|
|
|
ext[13] = addExtRec([]byte{0x00, 0x1c}, []byte{0x40, 0x01}) // record size limit
|
|
|
|
|
// len(ext[0]) + 238 + 4 + len(padding) = 401
|
|
|
|
|
// len(padding) = 177 - len(ext[0])
|
|
|
|
|
ext[11] = addExtRec([]byte{0x00, 0x15}, make([]byte, 177-len(ext[0]))) // padding
|
|
|
|
|
ext[14] = addExtRec([]byte{0x00, 0x15}, make([]byte, 159-len(ext[0]))) // padding
|
|
|
|
|
var ret []byte
|
|
|
|
|
for _, e := range ext {
|
|
|
|
|
ret = append(ret, e...)
|
|
|
|
@ -57,8 +61,8 @@ func (f *Firefox) composeClientHello(hd clientHelloFields) (ch []byte) {
|
|
|
|
|
clientHello[3] = hd.random // random
|
|
|
|
|
clientHello[4] = []byte{0x20} // session id length 32
|
|
|
|
|
clientHello[5] = hd.sessionId // session id
|
|
|
|
|
clientHello[6] = []byte{0x00, 0x24} // cipher suites length 36
|
|
|
|
|
cipherSuites, _ := hex.DecodeString("130113031302c02bc02fcca9cca8c02cc030c00ac009c013c014009c009d002f0035000a")
|
|
|
|
|
clientHello[6] = []byte{0x00, 0x22} // cipher suites length 34
|
|
|
|
|
cipherSuites, _ := hex.DecodeString("130113031302c02bc02fcca9cca8c02cc030c00ac009c013c014009c009d002f0035")
|
|
|
|
|
clientHello[7] = cipherSuites // cipher suites
|
|
|
|
|
clientHello[8] = []byte{0x01} // compression methods length 1
|
|
|
|
|
clientHello[9] = []byte{0x00} // compression methods
|
|
|
|
|