Back to skill

Security audit

反偷拍排查

Security checks for vulnerabilities and agentic risk

Overview

This privacy-checking skill needs review because scans can exceed the approved range, passive-only claims are inaccurate, and phone-reset guidance omits data-loss warnings.

Prefer a corrected version that respects exact scan ranges and accurately describes wireless transmissions. Connecting to hotel Wi-Fi does not itself authorize scanning other devices. Review the full dependency list before approving installation, keep reports private, and preserve evidence and backups before uninstalling apps or considering a phone reset. These concrete concerns support Review; the artifacts do not establish malicious intent.

Vulnerability Patterns
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Output HandlingUnvalidated Output Injection, Cross-Context Output, Unbounded Output
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • YARA SignaturesMalware Match, Webshell Match, Cryptominer Match
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (27)

The workflow recommends a factory reset without warning that it can erase user data and potential evidence.

High
Category
Output Handling
Confidence
99% confidence
Finding

The guidance recommends uninstalling suspicious applications and potentially factory-resetting the phone without warning about irreversible data and evidence loss. This is particularly dangerous in a workflow that also supports evidence preservation: the safety-check branch can destroy artifacts before the forensic branch begins.

Content

No source excerpt is available for this finding.

YARA rule 'offensive_tool_references': References to well-known offensive security tools [hacktools]

High
Category
YARA Match
Confidence
70% confidence
Finding

YARA rule matched a hack tool or exploit indicator (offensive tools, reconnaissance, privilege escalation, or exploit frameworks).

Content

Scanner excerpt · scripts/wifi_scan.sh (reported line 85)May include surrounding context.

sh
'inet [0-9.]+' | awk '{print $2}' | cut -d/ -f1)"
  fi
  [[ -z "$ip" ]] && return
  echo "${ip%.*}.0/24"
}

if [[ -z "$SUBNET" ]]; then
  SUBNET="$(get_subnet)"
  if [[ -z "$SUBNET" ]]; then
    echo "无法确定本地子网,请用 --subnet 指定(如 192.168.1.0/24)" >&2
    exit 1
  fi
fi

echo "▶ 扫描子网: $SUBNET" >&2

if have_nmap; then
  echo "▶ [nmap] 主机发现..." >&2
  nmap -sn -T4 "$SUBNET" -oG "$NMAP_HOSTS" >/dev/null 2>&1
  if [[ "$DO_PORTSCAN" -eq 1 ]]; then
    echo "▶ [nmap] 端口扫描(监控相关端口: ${SURVEIL_PORTS})..." >&2
    nmap -Pn -p "$SURVEIL_PORTS" --open "$SUBNET" -oG "$NMAP_PORTS" >/dev/null 2>&1
  fi
else
  case "$(uname -s)" in
    Darwin)   NMAP_HINT="brew install nmap";;
    MINGW*|MSYS*|CYGWIN*) NMAP_HINT="winget install Insecure.Nmap(勾选 Npcap);勿用 WSL2";;
    Linux)    if [[ -n "${TERMUX_VERSION:-}" ]]; then NMAP_HINT="pkg install nmap"; else NMAP_HINT="sudo apt install nmap 或 dnf install nmap"; fi;;
    *)

Skill declares no tool scope ('permissions' or 'allowed-tools') but code capabilities were detected: env, file_read, file_write, shell.

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding

Without declared permissions the skill's intent is opaque and cannot be validated.

Content

No source excerpt is available for this finding.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · references/platforms.md (reported line 26)May include surrounding context.

md
- 权限(TCC 隐私机制,均为一次性授权):
  - **蓝牙(阶段②必需)**:宿主 App(运行 Python 的终端 / WorkBuddy)需在 **系统设置 → 隐私与安全性 → 蓝牙** 开启;列表没有就点 ➕ 手动添加。⚠️ 典型症状:进程无任何报错即被中止(**退出码 134 / SIGABRT**)= 权限被拒;授权后**需重启宿主 App** 再跑。
  - **本地网络(阶段①可能触发)**:首次扫描可能弹「"XXX"想要访问本地网络」——点允许;误点拒绝则到 隐私与安全性 → 本地网络 重新开启。
- 已知问题(Wi-Fi 勘察):**macOS Sequoia 起,`airport -s` 在非提权模式下不再返回 AP 的 BSSID**(连接 BSSID 也为空)。脚本会照常给出 SSID/信号/信道/加密/当前连接,并如实标注「无法做同名多 MAC 仿冒比对」;如需 BSSID,需 `sudo airport -s` 或 CoreWLAN(pyobjc,非默认安装)。Windows `netsh`、Linux `nmcli` 不受影响,仍可取 BSSID。

### Windows(原生 Python + Git Bash)
- 前提:Python(python.org 或 winget 安装,勾选 Add to PATH)。**阶段①⑤用 `wifi_scan.py`/`generate_report.py` 在 PowerShell/CMD 直接跑即可,不需要 Git Bash**;仅 `.sh` 后备脚本需要 Git Bash。

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · scripts/platform_check.sh (reported line 114)May include surrounding context.

sh
"Android (Termux)")
        pkg install -y nmap && NMAP="yes" || echo "  ✗ pkg 安装失败,请手动执行: pkg install nmap";;
      *)
        if have apt-get; then sudo apt-get install -y nmap && NMAP="yes" || echo "  ✗ apt 安装失败,请手动执行: sudo apt install nmap"
        elif have dnf; then sudo dnf install -y nmap && NMAP="yes" || echo "  ✗ dnf 安装失败,请手动执行: sudo dnf install nmap"
        else echo "  ✗ 未识别的包管理器,请手动安装 nmap"; fi;;
    esac

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · scripts/platform_check.sh (reported line 115)May include surrounding context.

sh
pkg install -y nmap && NMAP="yes" || echo "  ✗ pkg 安装失败,请手动执行: pkg install nmap";;
      *)
        if have apt-get; then sudo apt-get install -y nmap && NMAP="yes" || echo "  ✗ apt 安装失败,请手动执行: sudo apt install nmap"
        elif have dnf; then sudo dnf install -y nmap && NMAP="yes" || echo "  ✗ dnf 安装失败,请手动执行: sudo dnf install nmap"
        else echo "  ✗ 未识别的包管理器,请手动安装 nmap"; fi;;
    esac
  fi

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · references/platforms.md (reported line 36)May include surrounding context.

md
- 蓝牙要求 Win10 16299+(bleak WinRT 后端);老系统请升级。

### Linux
- 安装:`pip install netaddr`(可选)、`pip install bleak`(需 BlueZ ≥ 5.43);nmap 可选(`sudo apt install nmap`)。
- 已知问题:主动 ARP 探测可能需要 root;`wifi_scan.py` 的 ping+ARP 回退路径无需 root。

### Android(Termux)

The scanner uses Bleak's default active scanning despite explicitly promising passive-only listening.

Medium
Category
Excessive Agency
Confidence
99% confidence
Finding

BleakScanner defaults to active scanning, so this implementation can transmit BLE scan requests despite repeatedly promising passive-only listening. That violates the advertised operating boundary and can make the scanner's presence observable to nearby devices, which matters in an anti-tracking context.

Content

No source excerpt is available for this finding.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · scripts/platform_check.sh (reported line 76)May include surrounding context.

sh
NMAP_HINT="pkg install nmap"
    BLEAK_HINT="(不可用)bleak 仅支持打包成 App 的 Python,Termux 无 Java 桥";;
  *)
    NMAP_HINT="sudo apt install nmap 或 dnf install nmap"
    BLEAK_HINT="pip install bleak(需 BlueZ >= 5.43)";;
esac

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · scripts/platform_check.sh (reported line 114)May include surrounding context.

sh
"Android (Termux)")
        pkg install -y nmap && NMAP="yes" || echo "  ✗ pkg 安装失败,请手动执行: pkg install nmap";;
      *)
        if have apt-get; then sudo apt-get install -y nmap && NMAP="yes" || echo "  ✗ apt 安装失败,请手动执行: sudo apt install nmap"
        elif have dnf; then sudo dnf install -y nmap && NMAP="yes" || echo "  ✗ dnf 安装失败,请手动执行: sudo dnf install nmap"
        else echo "  ✗ 未识别的包管理器,请手动安装 nmap"; fi;;
    esac

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · scripts/platform_check.sh (reported line 115)May include surrounding context.

sh
pkg install -y nmap && NMAP="yes" || echo "  ✗ pkg 安装失败,请手动执行: pkg install nmap";;
      *)
        if have apt-get; then sudo apt-get install -y nmap && NMAP="yes" || echo "  ✗ apt 安装失败,请手动执行: sudo apt install nmap"
        elif have dnf; then sudo dnf install -y nmap && NMAP="yes" || echo "  ✗ dnf 安装失败,请手动执行: sudo dnf install nmap"
        else echo "  ✗ 未识别的包管理器,请手动安装 nmap"; fi;;
    esac
  fi

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · scripts/wifi_scan.sh (reported line 94)May include surrounding context.

sh
case "$(uname -s)" in
    Darwin)   NMAP_HINT="brew install nmap";;
    MINGW*|MSYS*|CYGWIN*) NMAP_HINT="winget install Insecure.Nmap(勾选 Npcap);勿用 WSL2";;
    Linux)    if [[ -n "${TERMUX_VERSION:-}" ]]; then NMAP_HINT="pkg install nmap"; else NMAP_HINT="sudo apt install nmap 或 dnf install nmap"; fi;;
    *)        NMAP_HINT="安装 nmap(见 references/platforms.md)";;
  esac
  echo "▶ 未检测到 nmap,回退到 ping + ARP 表探测(厂商识别能力弱)。建议: $NMAP_HINT" >&2

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/wifi_scan.py (reported line 69)May include surrounding context.

python
"""探测本机在默认路由网卡上的 IPv4。"""
    if IS_MACOS:
        try:
            iface = subprocess.run(
                ["route", "-n", "get", "default"], capture_output=True, text=True, timeout=5
            ).stdout
            m = re.search(r"interface:\s+(\S+)", iface)

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/wifi_scan.py (reported line 74)May include surrounding context.

python
).stdout
            m = re.search(r"interface:\s+(\S+)", iface)
            if m:
                out = subprocess.run(
                    ["ipconfig", "getifaddr", m.group(1)], capture_output=True, text=True, timeout=5
                ).stdout.strip()
                if out:

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/wifi_scan.py (reported line 83)May include surrounding context.

python
pass
    elif IS_WIN:
        try:
            out = subprocess.run(
                ["powershell", "-NoProfile", "-Command",
                 "(Get-NetIPConfiguration | Where-Object {$_.IPv4DefaultGateway} "
                 "| Select-Object -First 1).IPv4Address.IPAddress"],

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/wifi_scan.py (reported line 95)May include surrounding context.

python
pass
    else:  # Linux / Termux
        try:
            out = subprocess.run(
                ["ip", "route", "get", "1.1.1.1"], capture_output=True, text=True, timeout=5
            ).stdout
            # 形如 "1.1.1.1 via 192.168.31.1 dev wlan0 src 192.168.31.98"

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/wifi_scan.py (reported line 128)May include surrounding context.

python
def ping_one(ip):
    try:
        r = subprocess.run(ping_args() + [ip], capture_output=True, timeout=4)
        return ip if r.returncode == 0 else None
    except Exception:
        return None

The scanner ignores the supplied subnet prefix and probes an entire /24, potentially exceeding the authorized scan range.

Medium
Category
Excessive Agency
Confidence
100% confidence
Finding

ping_sweep discards the CIDR prefix and always probes addresses .1 through .254 under the supplied first three octets. An authorized narrow range such as a /28 or /32 therefore causes probes outside that range, followed by TCP scans of responding hosts; this violates the skill's explicit scan-scope boundary.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/wifi_scan.py (reported line 153)May include surrounding context.

python
arp = {}
    try:
        if IS_WIN:
            out = subprocess.run(["arp", "-a"], capture_output=True, text=True, timeout=10).stdout
            # "  192.168.31.1  3c-84-6a-11-22-33  动态"
            for m in re.finditer(r"(\d+\.\d+\.\d+\.\d+)\s+([0-9a-fA-F-]{17})\b", out):
                ip, mac = m.group(1), m.group(2).lower().replace("-", ":")

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/wifi_scan.py (reported line 161)May include surrounding context.

python
arp[ip] = mac
        else:
            if IS_MACOS:
                out = subprocess.run(["arp", "-a", "-n"], capture_output=True, text=True, timeout=10).stdout
                for m in re.finditer(r"\((\d+\.\d+\.\d+\.\d+)\)\s+at\s+([0-9a-fA-F:]{17})", out):
                    arp[m.group(1)] = m.group(2).lower()
            else:

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/wifi_scan.py (reported line 165)May include surrounding context.

python
for m in re.finditer(r"\((\d+\.\d+\.\d+\.\d+)\)\s+at\s+([0-9a-fA-F:]{17})", out):
                    arp[m.group(1)] = m.group(2).lower()
            else:
                out = subprocess.run(["ip", "neigh", "show"], capture_output=True, text=True, timeout=10).stdout
                for line in out.splitlines():
                    f = line.split()
                    if "lladdr" in f:

The fallback scanner can probe hosts outside the specified, authorized subnet.

Medium
Category
Excessive Agency
Confidence
99% confidence
Finding

The fallback discards the requested CIDR prefix and pings addresses 1–254 in the corresponding /24, so an authorized narrower range such as /28 is expanded without consent. It also reads the full ARP table without subnet filtering, allowing cached out-of-scope hosts to receive TCP probes on platforms whose ARP output matches the probe parser.

Content

No source excerpt is available for this finding.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · scripts/wifi_survey.py (reported line 19)May include surrounding context.

python
实现与依赖:
  - 全部依赖系统自带命令行,零第三方依赖:
    macOS   : airport(Apple80211 私有框架,无需 sudo 即可扫描)
    Windows : netsh wlan
    Linux   : nmcli(NetworkManager)或 iw
    Termux  : termux-wifi-scaninfo(需授予 Wi-Fi 权限)

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/wifi_survey.py (reported line 51)May include surrounding context.

python
def _run(cmd, timeout=20):
    try:
        return subprocess.run(cmd, capture_output=True, text=True, timeout=timeout).stdout
    except Exception as ex:
        log(f"  (执行失败 {cmd[0] if cmd else '?'}:{ex})")
        return ""

Wi-Fi scanning is described as strictly passive, but the Linux backend can initiate active scans.

Medium
Category
Excessive Agency
Confidence
99% confidence
Finding

The Linux backend uses nmcli wifi list, which can trigger a rescan, and an iw scan command without a passive restriction. These can transmit probe requests despite repeated promises of passive, no-packet operation, undermining informed authorization and potentially exposing the user's wireless presence during a privacy-sensitive investigation.

Content

No source excerpt is available for this finding.