多账号设备画像: 设备/指纹/风控数据归类 + 每账号独立画像全链接入
- 实测校验矩阵: hdid+app_version 硬锚(APP_SIGN_NOT_MATCH), fingerprint 换→safe_auth滑块(自动过), device_id/机型/safedeviceid 直接过 - 定位注册接口: df/token+collect(sdid每次新值), wsapi dfpReport链(未破解) - tools/huya_device_profile.py: 每账号画像生成/持久化(幂等) - app_login_flow.login_cred / full_web_cookie 接入画像, 端到端出全套cookie
This commit is contained in:
@@ -5,11 +5,18 @@
|
||||
不再需要复用设备信封的原nonce —— 任意账号用 目标uid+k1 本地重算即过bind!
|
||||
依赖: k1 设备常量(evidence/nonce_k1.json 或默认值, 不随账号变)。
|
||||
|
||||
多账号设备隔离 (2026-08-26 实测): 每账号生成独立设备画像
|
||||
(tools/huya_device_profile.get_profile) —— fingerprint/device_id/机型随机,
|
||||
hdid+app_version 为设备注册硬锚共用一个金样本。首次换画像触发 safe_auth
|
||||
滑块自动过验。证书 P1 的 fingerprint 用该账号画像的指纹, 保持全链一致。
|
||||
|
||||
用法: .venv/bin/python tools/full_web_cookie.py <账号> <密码>
|
||||
.venv/bin/python tools/full_web_cookie.py <账号> <密码> --new-device
|
||||
产出: 打印全部cookie并写 evidence/web_cookies_full.txt
|
||||
"""
|
||||
import sys, json, re, hashlib, time, base64
|
||||
ACCT, PWD = sys.argv[1], sys.argv[2]
|
||||
FORCE_NEW_DEV = "--new-device" in sys.argv
|
||||
sys.argv = [sys.argv[0]]
|
||||
from urllib.parse import quote
|
||||
sys.path.insert(0, 'scripts'); sys.path.insert(0, 'tools')
|
||||
@@ -19,6 +26,7 @@ from nonce_forge import K1_DEFAULT, gen_nonce
|
||||
from probe_huya_qr_bind import QrRole, web_behavior
|
||||
from core.huya.device_fingerprint import get_huya_sdid
|
||||
from app_login_flow import QrAuthRequiredError, login_cred
|
||||
from huya_device_profile import get_profile
|
||||
|
||||
|
||||
def real_uid(acct: str) -> int:
|
||||
@@ -34,16 +42,20 @@ def real_uid(acct: str) -> int:
|
||||
|
||||
|
||||
print(f"== 账号 {ACCT} ==")
|
||||
# 0) 每账号独立设备画像 (首次生成并持久化; 换机身份触发滑块自动过验)
|
||||
DEV = get_profile(ACCT, force_new=FORCE_NEW_DEV)
|
||||
print(f"设备画像: {DEV['vendor']} {DEV['model']} fp={DEV['fingerprint'][:12]}...")
|
||||
|
||||
# 1) 登录取 cred (safe_auth滑块自动过)
|
||||
try:
|
||||
cred = login_cred(ACCT, PWD)
|
||||
cred = login_cred(ACCT, PWD, device_info=DEV)
|
||||
except QrAuthRequiredError as e:
|
||||
print('❌', e); sys.exit(2)
|
||||
except Exception as e:
|
||||
print(f'❌ 登录未返回cred: {e}'); sys.exit(1)
|
||||
print('新鲜cred:', len(cred), cred[:8].hex())
|
||||
|
||||
# 2) 取真实uid + 本地重算nonce 铸证
|
||||
# 2) 取真实uid + 本地重算nonce 铸证 (P1指纹用本账号画像, 全链设备一致)
|
||||
uid = real_uid(ACCT)
|
||||
env = Envelope.load()
|
||||
orig = base64.b64decode(env.cert_b64)
|
||||
@@ -51,7 +63,7 @@ f = parse_p1(decrypt_cert(orig))
|
||||
st = int(time.time() * 1000)
|
||||
rnd = gen_nonce(uid, K1_DEFAULT, service_time_ms=st, counter=0)
|
||||
print(f"本地nonce: uid={uid} st={st} rnd={rnd.hex()}")
|
||||
P1 = build_p1(f["app_id"], f["fingerprint"], cred, rnd=rnd)
|
||||
P1 = build_p1(f["app_id"], DEV["fingerprint"].encode(), cred, rnd=rnd)
|
||||
cert = base64.b64encode(forge_cert(P1, key_idx=orig[1])).decode()
|
||||
assert len(cert) == env.cert_len, (len(cert), env.cert_len)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user