-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsealedResults.go
More file actions
110 lines (87 loc) · 2.58 KB
/
sealedResults.go
File metadata and controls
110 lines (87 loc) · 2.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
package main
import (
"encoding/base64"
"encoding/json"
"fmt"
"log"
"os"
"github.com/fingerprintjs/go-sdk/v8"
"github.com/joho/godotenv"
)
func base64Decode(input string) []byte {
output, err := base64.StdEncoding.DecodeString(input)
if err != nil {
log.Fatal(err)
}
return output
}
func main() {
err := godotenv.Load()
if err != nil {
fmt.Println("[sealedResults error] Error while loading env", err)
return
}
sealedResult := base64Decode(os.Getenv("BASE64_SEALED_RESULT"))
key := base64Decode(os.Getenv("BASE64_SEALED_RESULT_KEY"))
keys := []fingerprint.DecryptionKey{
{
Key: key,
Algorithm: fingerprint.AlgorithmAES256GCM,
},
}
unsealedResponse, err := fingerprint.UnsealEventsResponse(sealedResult, keys)
if err != nil {
fmt.Println("Unseal error:", err)
return
}
var response = *unsealedResponse
if response.Bot != nil {
fmt.Printf("Got response with Botd: %v \n", response.Bot)
}
if response.Identification != nil {
stringResponse, _ := json.Marshal(response.Identification)
fmt.Printf("Got response with Identification: %s \n", string(stringResponse))
}
if response.Emulator != nil {
fmt.Printf("Got response with Emulator: %v \n", response.Emulator)
}
if response.IPInfo != nil {
fmt.Printf("Got response with IpInfo: %v \n", response.IPInfo)
}
if response.Incognito != nil {
fmt.Printf("Got response with Incognito: %v \n", response.Incognito)
}
if response.RootApps != nil {
fmt.Printf("Got response with RootApps: %v \n", response.RootApps)
}
if response.ClonedApp != nil {
fmt.Printf("Got response with ClonedApp: %v \n", response.ClonedApp)
}
if response.FactoryResetTimestamp != nil {
fmt.Printf("Got response with FactoryReset: %v \n", response.FactoryResetTimestamp)
}
if response.Jailbroken != nil {
fmt.Printf("Got response with Jailbroken: %v \n", response.Jailbroken)
}
if response.Frida != nil {
fmt.Printf("Got response with Frida: %v \n", response.Frida)
}
if response.IPBlockList != nil {
fmt.Printf("Got response with IPBlockList: %v \n", response.IPBlockList)
}
if response.PrivacySettings != nil {
fmt.Printf("Got response with PrivacySettings: %v \n", response.PrivacySettings)
}
if response.VirtualMachine != nil {
fmt.Printf("Got response with VirtualMachine: %v \n", response.VirtualMachine)
}
if response.VPN != nil {
fmt.Printf("Got response with VPN: %v \n", response.VPN)
}
if response.Proxy != nil {
fmt.Printf("Got response with Proxy: %v \n", response.Proxy)
}
if response.Tampering != nil {
fmt.Printf("Got response with Tampering: %v \n", response.Tampering)
}
}