T07 · Tool Hijacking and Spoofing
- Location
scripts/zhanfu_http.py:164- Finding
Spoofable Plaintext Loopback API Can Capture Sensitive Credentials
- Content
View full analysis
dict[str, Any]: if is_mac() and action in MAC_UNSUPPORTED: raise RuntimeError(f"macOS 暂不支持 {action}") api_port = preferred_port() if port is None else int(port) bid = "" if browser_id in (None, "") else str(browser_id) payload = { "module": "WebDriverModule", "action": action, "browserId": bid, "args": args, } resp = requests.post( f"http://127.0.0.1:{api_port}", json=payload, headers={"Content-Type": "application/json"}, timeout=timeout, ) if not resp.text: raise RuntimeError(f"{action} 空响应 HTTP {resp.status_code}") return json.loads(resp.text) ``` Credentials are placed directly in this request: ```python data = call( "Login", args=json.dumps( {"username": ns.username, "password": ns.password, "isboss": True}, ensure_ascii=False, ), timeout=15, port=port, ) ``` The launcher attempts to identify the local service using only attacker-controlled response fields: ```python is_wd = data.get("module") == "WebDriverModule" or ( data.get("action") and ("returnObj" in data or "ret" in data) ) if not is_wd: return "foreign", None ``` ### Technical Analysis The Skill sends ZhanFu owner credentials, store credentials, and privileged store-management commands through unauthenticated HTTP on a loopback TCP port. Restricting the destination to `127.0.0.1` prevents direct remote interception, but does not authenticat ...[truncated 2092 chars]- Remediation
View remediation
