T06 · System Persistence
- Location
scripts/tools.py:87- Finding
Automatic Study Installs Cross-Session OS Scheduled Tasks
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This course automation skill includes persistent scheduled execution and broad stealth browser tampering that users should review carefully before installing.
Install only if you intentionally want automated Wangda course activity from a local Chrome profile and are comfortable with a recurring OS task plus a stealth extension that changes page behavior. Use a dedicated browser profile, avoid entering SMS codes where terminal history or logs are retained, verify scheduler cleanup after use, and do not open non-Wangda links in the automated browser.
scripts/tools.py:87Automatic Study Installs Cross-Session OS Scheduled Tasks
scripts/stealth-extension/manifest.json:6Anti-Detection Extension Modifies Browser APIs on Every Origin and Frame
scripts/subject_tools.py:21Substring-Based Domain Validation Accepts Attacker-Controlled Hosts
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.
return None
try:
with urllib.request.urlopen(f"http://localhost:{DEBUG_PORT}/json") as response:
pages = json.loads(response.read().decode())
pages = [p for p in pages if p.get("type") == "page"]
if not pages or tab_idx < 0 or tab_idx >= len(pages):
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.
return None
try:
with urllib.request.urlopen(f"http://localhost:{DEBUG_PORT}/json") as response:
pages = json.loads(response.read().decode())
pages = [p for p in pages if p.get("type") == "page"]
if not pages or tab_idx < 0 or tab_idx >= len(pages):
If the broader package truly includes stealth/anti-detection measures such as fingerprint tampering, debugger removal, interception of eval/timers, and defenses against page anti-automation logic, that behavior is far beyond legitimate study assistance and strongly suggests concealment of automated activity. Such evasion can facilitate unauthorized access, bypass platform protections, and hide malicious automation from site defenses or the user.
If the broader package truly includes stealth/anti-detection measures such as fingerprint tampering, debugger removal, interception of eval/timers, and defenses against page anti-automation logic, that behavior is far beyond legitimate study assistance and strongly suggests concealment of automated activity. Such evasion can facilitate unauthorized access, bypass platform protections, and hide malicious automation from site defenses or the user.
Referenced artifact was not completely inspected
所有可用工具指令请参考 `references/tools.md`,所有指令都应该通过 `python scripts/tools.py <command> <args>`的形式调用
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
from dotenv import load_dotenv
load_dotenv(
os.path.join(os.path.dirname(os.path.abspath(__file__)), ".env"), override=True
)
msg_id = 1
The manifest declares a content script named 'Stealth Anti-DevTools' that runs at document_start in the MAIN world on <all_urls> and all frames, explicitly to bypass anti-devtools detection. That behavior is unrelated to a course-learning skill for wangda.chinamobile.com and indicates a stealth/evasion capability that can interfere with page security logic or conceal other automation across arbitrary sites.
A global anti-devtools evasion mechanism is unjustified for a training/course assistant and is especially suspicious because it is framed as bypassing detection rather than enabling user-visible functionality. In this skill context, the capability increases danger because it can hide automation or tampering on unrelated websites and evade user or developer inspection.
This script performs extensive stealth, anti-debugging, and anti-analysis tampering in the page context, including hiding automation markers, altering timers, stripping debugger statements, and blocking page-clearing/navigation behavior. For a course-learning assistant limited to wangda.chinamobile.com workflows, these capabilities are unnecessary and strongly suggest an attempt to evade site defenses, conceal automation, and resist inspection by users or defenders.
The code contains explicit anti-devtools and anti-analysis logic: it clamps performance and Date timing, removes debugger statements from dynamic code execution, filters suspicious timer callbacks, and protects console methods from inspection traps. In the context of a learning assistant, this is dangerous because it impedes auditing and facilitates covert browser automation or policy-violating behavior while making investigation and debugging harder.
This block performs hidden browser automation through CDP and is expressly designed to avoid detection while issuing synthetic mouse events. In the context of a training-platform skill, stealth interaction is more dangerous because it can silently manipulate course state and undermine platform controls intended to detect non-human use.
The skill declares no explicit tool scope or permissions, yet its documented behavior relies on powerful capabilities including shell-style tool execution, browser/network interaction, and session file manipulation. Without a tight allowlist, an agent may invoke more capability than users reasonably expect, increasing the blast radius of prompt injection, misuse, or implementation bugs.
The activation rule is broad enough to trigger on general course-related requests or any mention of the wangda.chinamobile.com domain, which can cause the skill to engage in contexts the user did not specifically intend. Because the skill can perform login, session resets, course changes, and automated study actions, overbroad invocation raises the risk of unintended sensitive operations.
The skill content and instructions are entirely written in Chinese and implicitly assume Chinese-language interaction, but there is no statement offering language choice or explaining a required locale restriction. Under the policy, a forced language or locale without opt-in can be a natural-language policy violation.
The documentation instructs operators to input a phone number and SMS verification code, which are sensitive authentication factors, but provides no warning about secure handling, storage, logging, or masking. In a skill that automates login to a corporate learning platform, this increases the risk of credential leakage through terminal history, logs, screenshots, or session artifacts, potentially enabling unauthorized account access.
This code contains user-facing natural-language messages and docstrings in Chinese only, such as the exception description at L011 and many printed status/error messages elsewhere. The file does not offer a language choice or indicate that the skill is intentionally limited to Chinese-speaking users, which conflicts with the policy against forcing a specific language without user opt-in.
Data from a source is assigned to a variable that is later passed to a sink, creating a variable-mediated taint flow.
for i in range(len(msg)):
masked_msg[i] ^= mask[i % 4]
sock.sendall(header + masked_msg)
if not wait_for_response:
time.sleep(0.1)
Code issues a request to a loopback, link-local, or private-range host. This can reach internal services not meant to be exposed and is a common SSRF pivot.
def get_ws_url(port, tab_idx=0):
try:
with urllib.request.urlopen(f"http://localhost:{port}/json") as response:
pages = json.loads(response.read().decode())
pages = [p for p in pages if p.get("type") == "page"]
if not pages or tab_idx < 0 or tab_idx >= len(pages):
Code issues a request to a loopback, link-local, or private-range host. This can reach internal services not meant to be exposed and is a common SSRF pivot.
def get_ws_url(port, tab_idx=0):
try:
with urllib.request.urlopen(f"http://localhost:{port}/json") as response:
pages = json.loads(response.read().decode())
pages = [p for p in pages if p.get("type") == "page"]
if not pages or tab_idx < 0 or tab_idx >= len(pages):
Code issues a request to a loopback, link-local, or private-range host. This can reach internal services not meant to be exposed and is a common SSRF pivot.
def get_ws_url(port, tab_idx=0):
try:
with urllib.request.urlopen(f"http://localhost:{port}/json") as response:
pages = json.loads(response.read().decode())
pages = [p for p in pages if p.get("type") == "page"]
if not pages or tab_idx < 0 or tab_idx >= len(pages):
Code issues a request to a loopback, link-local, or private-range host. This can reach internal services not meant to be exposed and is a common SSRF pivot.
def get_ws_url(port, tab_idx=0):
try:
with urllib.request.urlopen(f"http://localhost:{port}/json") as response:
pages = json.loads(response.read().decode())
pages = [p for p in pages if p.get("type") == "page"]
if not pages or tab_idx < 0 or tab_idx >= len(pages):
Code issues a request to a loopback, link-local, or private-range host. This can reach internal services not meant to be exposed and is a common SSRF pivot.
def get_ws_url(port, tab_idx=0):
try:
with urllib.request.urlopen(f"http://localhost:{port}/json") as response:
pages = json.loads(response.read().decode())
pages = [p for p in pages if p.get("type") == "page"]
if not pages or tab_idx < 0 or tab_idx >= len(pages):
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
def kill_chrome():
user_data_dir = os.environ.get("_WANGDA_USER_DATA_DIR")
print("Closing existing Chrome instance (if any)...")
subprocess.run(
["pkill", "-if", f"chrome.*user-data-dir={user_data_dir}"],
stdout=subprocess.DEVNULL,
stderr=subprocess.DEVNULL,
Data from a source is assigned to a variable that is later passed to a sink, creating a variable-mediated taint flow.
def kill_chrome():
user_data_dir = os.environ.get("_WANGDA_USER_DATA_DIR")
print("Closing existing Chrome instance (if any)...")
subprocess.run(
["pkill", "-if", f"chrome.*user-data-dir={user_data_dir}"],
stdout=subprocess.DEVNULL,
stderr=subprocess.DEVNULL,
The start and navi functions accept arbitrary URLs and drive an authenticated Chrome profile outside the manifest's narrow wangda.chinamobile.com learning scope. In context, this is dangerous because it enables the skill to browse to attacker-chosen sites using the user's live browser session, increasing the risk of phishing, session abuse, or data access beyond the declared purpose.