def generate_hardware_fingerprint(): hardware_fp = hardware_fingerprint.HardwareFingerprint() hive = "HKEY_LOCAL_MACHINE" # Hardware profile GUID registry_helper.write_registry( hive, "SYSTEM\CurrentControlSet\Control\IDConfigDB\Hardware Profiles\\0001", "HwProfileGuid", RegistryKeyType.REG_SZ, hardware_fp.random_hw_profile_guid()) # Machine GUID registry_helper.write_registry(hive, "SOFTWARE\Microsoft\Cryptography", "MachineGuid", RegistryKeyType.REG_SZ, hardware_fp.random_machine_guid()) # Windows Update GUID registry_helper.write_registry( hive, "SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate", "SusClientId", RegistryKeyType.REG_SZ, hardware_fp.random_win_update_guid()) registry_helper.write_registry( hive, "SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate", "SusClientIDValidation", RegistryKeyType.REG_BINARY, random_utils.bytes_list_to_array( hardware_fp.random_client_id_validation())) logger.info("Random Hardware profile GUID {0}".format( hardware_fp.random_hw_profile_guid())) logger.info("Random Hardware CKCL GUID {0}".format( hardware_fp.random_performance_guid())) logger.info("Random Machine GUID {0}".format( hardware_fp.random_machine_guid())) logger.info("Random Windows Update GUID {0}".format( hardware_fp.random_win_update_guid())) logger.debug("Random Windows Update Validation ID {0}".format( hardware_fp.random_win_update_guid()))
def generate_hardware_fingerprint(): """ Generate hardware-related identifiers: HwProfileGuid MachineGuid Volume ID SusClientId SusClientIDValidation """ hardware_fp = hardware_fingerprint.HardwareFingerprint() hive = "HKEY_LOCAL_MACHINE" # Hardware profile GUID logger.debug("Hardware Profiles\\0001 HwProfileGuid") registry_helper.write_value( key_hive=hive, key_path= "SYSTEM\\CurrentControlSet\\Control\\IDConfigDB\\Hardware Profiles\\0001", value_name="HwProfileGuid", value_type=RegistryKeyType.REG_SZ, key_value=hardware_fp.random_hw_profile_guid()) # Machine GUID logger.debug("Microsoft\\Cryptography MachineGuid") registry_helper.write_value(key_hive=hive, key_path="SOFTWARE\\Microsoft\\Cryptography", value_name="MachineGuid", value_type=RegistryKeyType.REG_SZ, key_value=hardware_fp.random_machine_guid()) # Windows Update GUID logger.debug("CurrentVersion\\WindowsUpdate SusClientId") registry_helper.write_value( key_hive=hive, key_path="SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\WindowsUpdate", value_name="SusClientId", value_type=RegistryKeyType.REG_SZ, key_value=hardware_fp.random_win_update_guid()) logger.debug("CurrentVersion\\WindowsUpdate SusClientIDValidation") registry_helper.write_value( key_hive=hive, key_path="SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\WindowsUpdate", value_name="SusClientIDValidation", value_type=RegistryKeyType.REG_BINARY, key_value=random_utils.bytes_list_to_array( hardware_fp.random_client_id_validation())) dir_name = os.path.join(os.path.dirname(__file__), "bin") volume_id = random_utils.random_volume_id() logger.info("VolumeID={0}".format(volume_id)) volume_id_path = os.path.join( dir_name, "VolumeID{0}.exe C: {1}".format("64" if is_x64os() else "", volume_id)) os.system(volume_id_path) logger.info("Random Hardware profile GUID {0}".format( hardware_fp.random_hw_profile_guid())) logger.info("Random Hardware CKCL GUID {0}".format( hardware_fp.random_performance_guid())) logger.info("Random Machine GUID {0}".format( hardware_fp.random_machine_guid())) logger.info("Random Windows Update GUID {0}".format( hardware_fp.random_win_update_guid())) logger.debug("Random Windows Update Validation ID {0}".format( hardware_fp.random_win_update_guid()))