12 lines
1.1 KiB
Plaintext
12 lines
1.1 KiB
Plaintext
#!name=Microsoft Family Block
|
|
#!desc=拦截 Microsoft Family 中指定的 ProductId 购买请求 (9PNTSH5SKCL5等)
|
|
#!category=XBOX
|
|
#!author=Ah Long
|
|
|
|
[Script]
|
|
# logic: 检查 POST body 是否包含黑名单中的 ID
|
|
MS_Family_Block = type=http-request, pattern=^https://account\.microsoft\.com/family/api/buy/requests/complete(\?.*)?$, requires-body=1, max-size=0, script-path=https://raw.githubusercontent.com/XXhaos/Surge/refs/heads/main/Scripts/ms_family_block.js, script-update-interval=-1, timeout=10, debug=0, script-text=var targetIds=["9PNTSH5SKCL5","9nfmccp0pm67","9npbvj8lwsvn","9pcgszz8zpq2","9P54FF0VQD7R","9NCJZN3LBD3P","9P9CLTVLLHD6","9NHXDFLDBN6G"];var body=$request.body;if($request.method==="POST"&&body){var upperBody=body.toUpperCase();for(var i=0;i<targetIds.length;i++){if(upperBody.indexOf(targetIds[i].toUpperCase())!==-1){console.log("[MS-Block] Intercepted blocked ProductId: "+targetIds[i]);$done({response:{status:403,headers:{"Content-Type":"text/plain"},body:"Blocked by Surge Module"}});break}}$done({})}else{$done({})}
|
|
|
|
[MITM]
|
|
hostname = %APPEND% account.microsoft.com
|