Skip to content

Commit 9f3115b

Browse files
committed
Changed peetprint, ordering extensions
1 parent fb5f6db commit 9f3115b

File tree

3 files changed

+19
-14
lines changed

3 files changed

+19
-14
lines changed

README.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,9 @@ I wanted to extend JA3, so I created my own TLS fingerprint algorithm. It's bett
3636
It looks like this:
3737

3838
```
39-
supported-tls-versions|supported-protocols|supported-groups|supported-signature-algorithms|psk-key-exchange-mode|certificate-compression-algorithms|cipher-suites|extensions
39+
supported-tls-versions|supported-protocols|supported-groups|supported-signature-algorithms|psk-key-exchange-mode|certificate-compression-algorithms|cipher-suites|sorted-extensions
4040
```
41+
4142
"-" is used as the seperator.
4243

4344
**supported-tls-versions**: Seperated list of supported TLS versions as sent in the `supported_versions` extension.
@@ -54,7 +55,7 @@ supported-tls-versions|supported-protocols|supported-groups|supported-signature-
5455

5556
**cipher-suites**: Seperated list of the supported cipher suites.
5657

57-
**extensions**: Seperated list of the supported extensions.
58+
**sorted-extensions**: Sorted list of the supported extensions. (Sorted because of order randomization used by chrome)
5859

5960
All TLS GREASE values must be replaced with "GREASE".
6061

fingerprint_tls.go

+14-10
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package main
22

33
import (
44
"fmt"
5+
"sort"
56
"strconv"
67
"strings"
78
)
@@ -149,6 +150,9 @@ func CalculatePeetPrint(parsed ClientHello, j JA3Calculating) (string, string) {
149150
}
150151
}
151152

153+
// Sort extensions because the order is randomized
154+
sort.Strings(j.PeetPrintExtensions)
155+
152156
tls_versions := strings.Join(versions, "-") // Comma seperated list of supported TLS versions as sent in the `supported_versions` extension. TODO
153157
protos := strings.Join(tmp, "-") // Comma seperated list of supported HTTP versions as sent in the `application_layer_protocol_negotiation` extension. http/1.0 => 1.0, http/1.1 => 1.1, http/2 => 2
154158
sig_als := joinInts(parsed.SignatureAlgorithms, "-") // Comma seperated list of supported signatue algorithms as sent in the `signature_algorithms` extension.
@@ -158,16 +162,16 @@ func CalculatePeetPrint(parsed ClientHello, j JA3Calculating) (string, string) {
158162
suites := strings.Join(j.PeetPrintCiphers, "-") // Cipher suites
159163
extensions := strings.Join(j.PeetPrintExtensions, "-") // Extensions
160164

161-
// if debug {
162-
// fmt.Println("tls_versions:", tls_versions)
163-
// fmt.Println("protos:", protos)
164-
// fmt.Println("signature algs:", sig_als)
165-
// fmt.Println("key_mode:", key_mode)
166-
// fmt.Println("comp_algs:", comp_algs)
167-
// fmt.Println("groups:", groups)
168-
// fmt.Println("cipher suites:", suites)
169-
// fmt.Println("extensions:", extensions)
170-
// }
165+
// if debug {
166+
// fmt.Println("tls_versions:", tls_versions)
167+
// fmt.Println("protos:", protos)
168+
// fmt.Println("signature algs:", sig_als)
169+
// fmt.Println("key_mode:", key_mode)
170+
// fmt.Println("comp_algs:", comp_algs)
171+
// fmt.Println("groups:", groups)
172+
// fmt.Println("cipher suites:", suites)
173+
// fmt.Println("extensions:", extensions)
174+
// }
171175

172176
fp := fmt.Sprintf("%v|%v|%v|%v|%v|%v|%v|%v", tls_versions, protos, groups, sig_als, key_mode, comp_algs, suites, extensions)
173177
return fp, GetMD5Hash(fp)

structs.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ type TLSDetails struct {
1515
JA3 string `json:"ja3"`
1616
JA3Hash string `json:"ja3_hash"`
1717

18-
PeetPrint string `json:"peetprint (WIP)"`
19-
PeetPrintHash string `json:"peetprint_hash (WIP)"`
18+
PeetPrint string `json:"peetprint"`
19+
PeetPrintHash string `json:"peetprint_hash"`
2020

2121
ClientRandom string `json:"client_random"`
2222
SessionID string `json:"session_id"`

0 commit comments

Comments
 (0)