-
Notifications
You must be signed in to change notification settings - Fork 214
/
hardware_fingerprint.py
72 lines (61 loc) · 2.22 KB
/
hardware_fingerprint.py
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
import random
import uuid
import string
import random_utils
class HardwareFingerprint:
"""
Hardware-related GUIDs
"""
def __init__(self):
self.hw_profile_guid = ("{%s}" % str(uuid.uuid4()))
self.performance_guid = ("{%s}" % str(uuid.uuid4()))
self.machine_guid = str(uuid.uuid4())
self.win_update_guid = str(uuid.uuid4())
self.system_client_id = self.__random_system_client_id()
def random_hw_profile_guid(self):
"""
:return: Hardware profile GUID
"""
return self.hw_profile_guid
def random_performance_guid(self):
"""
:return: Performance\BootCKCLSettings and Performance\BShutdownCKCLSettings GUID
"""
return self.performance_guid
def random_machine_guid(self):
"""
:return: Cryptography MachineGuid
"""
return self.machine_guid
def random_win_update_guid(self):
"""
:return: Windows update SusClientId
"""
return self.win_update_guid
def random_client_id_validation(self):
"""
:return: Windows update SusClientIdValidation
"""
return self.system_client_id
#############################################################################
# Internal methods
@staticmethod
def __random_id1():
random_id1 = random.choices(string.digits+string.ascii_uppercase, k=19)
random_id1_list = random_utils.disperse_string(random_id1)
return random_id1_list
@staticmethod
def __random_id2():
return random.choices(range(1, 255), k=5)
@staticmethod
def __random_system_client_id():
system_client_id = [0] * 0x08
system_client_id[0x00:0x03] = [0x06, 0x02, 0x28, 0x01]
system_client_id[0x04:0x06] = random.sample(range(1, 255), 3)
system_client_id[0x07] = 0
# 0x08 - Start random part of ID
system_client_id.extend(HardwareFingerprint.__random_id1())
system_client_id.extend([0, 6, 0])
system_client_id.extend(HardwareFingerprint.__random_id2())
system_client_id.extend(random_utils.disperse_string("None"))
return system_client_id