srv-guard@1.0.3
CAUTION· static onlyPublisher claims: "服务器安全防护一体化能力:扫描漏洞、修复漏洞、感知攻击、防御攻击,并生成安全报告。 当需要对 Linux 服务器进行安全加固、漏洞巡检、入侵检测或应急防御时加载此 Skill。 触发词:服务器安全、漏洞扫描、漏洞修复、攻击感知、入侵检测、安全加固、封禁 IP。 English triggers: server security hardening, vulnerability scan, patch/audit Linux config, intrusion detection, brute-force log analysis, block malicious IP, security report." Observed in sandbox: static analysis only — behavior not yet observed.
Coverage
Static only; nothing was run yet.The label rests on the code, the instruction files and the publisher. The honeypot run replaces this verdict when it completes.
Is [email protected] safe to install?
KillerSkills analysed it statically (a sandbox run is pending) on 2026-11-08 and scored it 46/100 (Caution). It is not known to be malicious, but it has behaviour or code a security policy should decide on before install. Notable findings: Privileged sudo command; Access to sensitive file paths; Access to sensitive file paths. Summary: static analysis only — behavior not yet observed.
Behavior trace
Queued for honeypot run · static analysis onlyThis version has not been detonated yet. The score above counts behavior as unknown (50/100), so it cannot read Verified until the honeypot run completes and replaces this verdict.
Static findings
- `--no-tls` 会打印显式警告:令牌与 sudo 密码将以明文经过回环。Fix: Build commands from fixed arguments; do not interpolate untrusted strings into a shell.sh = run_cmd(target, "stat -c '%a %n' /etc/shadow", timeout=5)Fix: Stop enumerating or reading credential locations; take secrets from a declared environment variable the user sets on purpose.f"/etc/passwd: {user} 第二字段为空", user=user))Fix: Stop enumerating or reading credential locations; take secrets from a declared environment variable the user sets on purpose.out.append(finding("CFG-08", "sudo NOPASSWD 配置(受限命令)", "LOW", "config",Fix: Build commands from fixed arguments; do not interpolate untrusted strings into a shell.msg = ("修复需要 root/sudo 权限,当前用户非 root:已拒绝执行,未对目标做任何变更。"Fix: Build commands from fixed arguments; do not interpolate untrusted strings into a shell.- 更安全的替代方案:直接用 root 启动 `sudo python scripts/web_ui.py`,全程不传输密码。Fix: Build commands from fixed arguments; do not interpolate untrusted strings into a shell.sev = "HIGH" if any(p in str(info["patterns"]) for p in ["sqlmap", "nikto", "/etc/passwd", "%3Cscript"]) else "MEDIUM"Fix: Stop enumerating or reading credential locations; take secrets from a declared environment variable the user sets on purpose.out.append(finding("CFG-08", "sudo NOPASSWD 高危命令", "HIGH", "config", ln.strip()))Fix: Build commands from fixed arguments; do not interpolate untrusted strings into a shell.r = run_cmd(target, "grep -r 'NOPASSWD' /etc/sudoers /etc/sudoers.d/ 2>/dev/null", timeout=5)Fix: Stop enumerating or reading credential locations; take secrets from a declared environment variable the user sets on purpose.- 密码只在本次请求内使用:经 loopback 传输,作为 stdin 传给 `sudo -S -p '' --`,**不进 argv、不进环境变量、不写日志/审计/会话、不落盘**,用后从页面输入框清除。Fix: Build commands from fixed arguments; do not interpolate untrusted strings into a shell.WEB_SCAN_PATTERNS = [r'\.env\b', r'\.git/', r'wp-admin', r'phpmyadmin', r'%3Cscript', r'/etc/passwd',Fix: Stop enumerating or reading credential locations; take secrets from a declared environment variable the user sets on purpose."请用 root 或已授权的 sudo 账号重试。")Fix: Build commands from fixed arguments; do not interpolate untrusted strings into a shell.out.append(finding("CFG-09", "/etc/shadow 权限异常", "HIGH", "config",Fix: Stop enumerating or reading credential locations; take secrets from a declared environment variable the user sets on purpose.- 勾选「以管理员权限修复」后必须填写 sudo 密码;**仅 `local` 目标可用**,远程主机请改用 root 登录或已配置 `NOPASSWD` 的 sudo 账号。Fix: Build commands from fixed arguments; do not interpolate untrusted strings into a shell.r = run_cmd(target, "awk -F: '$2==\"\" {print $1}' /etc/passwd", timeout=5)Fix: Stop enumerating or reading credential locations; take secrets from a declared environment variable the user sets on purpose."""sudo 密码错误或无 sudo 权限。"""Fix: Build commands from fixed arguments; do not interpolate untrusted strings into a shell.proc = subprocess.run(Fix: Build commands from fixed arguments, never from interpolated strings; prefer an API client over shelling out.proc = subprocess.run(Fix: Build commands from fixed arguments, never from interpolated strings; prefer an API client over shelling out.| `/root/.ssh/id_rsa` | 仅在**不存在**时生成,并临时 `chmod 644` 触发 CFG-06 | 删除本脚本创建的密钥 |Fix: Request the narrowest permission that works; replace wildcards with the exact paths or hosts.python attack_defend.py --input monitor-result.json --target <...> --dry-run [--apply] [--action block|harden|alert] [--output defend-result.json]Fix: Remove the call, or declare the host in frontmatter and explain in the README what is sent and why.sudo = shutil.which("sudo")Fix: Build commands from fixed arguments; do not interpolate untrusted strings into a shell.执行: python scripts/security_report.py --scan scan-result.json [--fix fix-result.json] [--monitor monitor-result.json] [--defend defend-result.json] --output report.htmlFix: Remove the call, or declare the host in frontmatter and explain in the README what is sent and why.- root 权限(`sudo bash tests/linux_e2e.sh`)Fix: Build commands from fixed arguments; do not interpolate untrusted strings into a shell.p = subprocess.run(argv, input=str(password) + "\n", capture_output=True, text=True,Fix: Build commands from fixed arguments, never from interpolated strings; prefer an API client over shelling out."""用 sudo 执行脚本:密码只经 stdin 交给 sudo,不进 argv、不进日志、不落盘。"""Fix: Build commands from fixed arguments; do not interpolate untrusted strings into a shell.p = subprocess.run([sys.executable, str(path), *args], capture_output=True,Fix: Build commands from fixed arguments, never from interpolated strings; prefer an API client over shelling out.ssh user@vm 'sudo bash /tmp/server-security-guard/tests/linux_e2e.sh'Fix: Build commands from fixed arguments; do not interpolate untrusted strings into a shell.python vuln_fix.py --input scan-result.json --dry-run [--apply] [--items CFG-01,CFG-03] [--output fix-result.json]Fix: Remove the call, or declare the host in frontmatter and explain in the README what is sent and why.raise SudoAuthError("sudo 失败次数过多,已临时锁定,请 5 分钟后再试")Fix: Build commands from fixed arguments; do not interpolate untrusted strings into a shell.sudo bash tests/linux_extra.shFix: Build commands from fixed arguments; do not interpolate untrusted strings into a shell.| 端口 `18443` | 启动 HTTPS 网页端做自检 | 退出时 kill |Fix: Build commands from fixed arguments; do not interpolate untrusted strings into a shell.commands=[cmd], rollback=[f"chmod {orig} {shlex.quote(keyfile)}"] if orig != "?" else [],Fix: Request the narrowest permission that works; replace wildcards with the exact paths or hosts.# sudo bash tests/linux_e2e.shFix: Build commands from fixed arguments; do not interpolate untrusted strings into a shell.p = subprocess.run(cmd, capture_output=True, text=True, timeout=60)Fix: Build commands from fixed arguments, never from interpolated strings; prefer an API client over shelling out.cmd = f"chmod 600 {shlex.quote(keyfile)}"Fix: Request the narrowest permission that works; replace wildcards with the exact paths or hosts.sudo python3 scripts/attack_defend.py --target local --input monitor.json --action harden --applyFix: Build commands from fixed arguments; do not interpolate untrusted strings into a shell.python security_report.py --scan scan-result.json [--fix fix-result.json] [--monitor monitor-result.json] [--defend defend-result.json] --output report.html [--target name]Fix: Remove the call, or declare the host in frontmatter and explain in the README what is sent and why.# 1) 网页端「管理员权限」真实 apply:非 root 启动 UI,用 sudo 提权改 /etc/ssh/sshd_configFix: Build commands from fixed arguments; do not interpolate untrusted strings into a shell.mkdir -p /root/.ssh && chmod 700 /root/.sshFix: Request the narrowest permission that works; replace wildcards with the exact paths or hosts.[ -n "$WEBUI_PID" ] && kill "$WEBUI_PID" 2>/dev/nullFix: Build commands from fixed arguments; do not interpolate untrusted strings into a shell.# 关键:勾选管理员权限 + 密码(该机 NOPASSWD,sudo -S 会忽略密码但仍走 sudo 路径)Fix: Build commands from fixed arguments; do not interpolate untrusted strings into a shell.chmod 644 "$KEY"Fix: Request the narrowest permission that works; replace wildcards with the exact paths or hosts.echo "必须以 root 运行(sudo bash tests/linux_e2e.sh)" >&2Fix: Build commands from fixed arguments; do not interpolate untrusted strings into a shell.# 需 root:sudo bash tests/linux_extra.shFix: Build commands from fixed arguments; do not interpolate untrusted strings into a shell.h "1) 网页端 + sudo 真实 apply"Fix: Build commands from fixed arguments; do not interpolate untrusted strings into a shell.Cost to the agent
Tokens estimated at four characters each. Skills load their instruction text when triggered; the figure is what that costs.
Known vulnerabilities
Vulnerability advisories (OSV) cover npm and PyPI packages; this registry has no advisory database.
What would make this Verified
34 points to 80 · weights: behavior 45%, static 25%, prompt 15%, publisher 15%- Unclaimed publisher≈ +8 on the totalClaim cmccadmin12: a verified publisher gets +50 on publisher trust. It is free and usually instant with GitHub sign-in.
- Privileged sudo command≈ +4 on the totalBuild commands from fixed arguments; do not interpolate untrusted strings into a shell.
- Access to sensitive file paths≈ +4 on the totalStop enumerating or reading credential locations; take secrets from a declared environment variable the user sets on purpose.
- New publisher≈ +3 on the totalTime clears this on its own after 14 and 30 days. Claiming the handle (+50) is the fastest way past it.
- Python subprocess execution detected≈ +2 on the totalBuild commands from fixed arguments, never from interpolated strings; prefer an API client over shelling out.
- File permission modification command≈ +2 on the totalRequest the narrowest permission that works; replace wildcards with the exact paths or hosts.