
nas: a zero-dependency Python CLI + MCP server for Synology DSM 7. One-command audit and fix for the C3RB3R / .L0CK3D ransomware campaign; hand it to your AI agent.
Audit a Synology NAS against the C3RB3R / .L0CK3D ransomware campaign with one command, fix what it finds with a second, and keep running DSM from the terminal afterwards.
Canonical repository, releases and issues: https://gitlab.com/aa22396584/synology-nas-cli
nas is a zero-dependency Python CLI (standard library only, Python 3.8+, so it also runs on DSM itself) and stdio MCP server for the Synology DSM 7 Web API: status, health, logs, packages, volumes, Tailscale, DSM upgrades, scheduled health alerts pushed to a webhook, and an incident audit and remediation tool built during the October 2026 C3RB3R / .L0CK3D campaign against internet-exposed Synology NAS boxes (Synology-SA-24:20, SA-26:13, SA-26:14).
Not affiliated with Synology Inc. "Synology", "DSM" and "QuickConnect" are trademarks of Synology Inc.
nas incident fixPaste either prompt into Claude Code, Codex, Cursor, Gemini CLI, OpenCode, Grok Bot, or any tool-using AI agent (Grok Bot setup, skills and alert routine: docs/GROK-BOT.md):
English prompt:
Use https://github.com/akari-sora/synology-nas-cli to audit and fix my Synology NAS at https://192.0.2.10:5001. Follow docs/AGENT-RUNBOOK.md.
繁體中文提示詞:
使用 https://github.com/akari-sora/synology-nas-cli 檢查並修復我的 Synology NAS(位址:https://192.0.2.10:5001),照著 docs/AGENT-RUNBOOK.md 的步驟執行。
./bin/nas --version.nas setup: Runs nas setup --json --no-input ... to write ~/.config/synology-nas-cli/config.json (mode 0600), signs in once to verify credentials, and pins DSM's TLS certificate SHA-256 fingerprint on first use.nas doctor: Runs nas doctor --json to verify configuration, credentials, origin reachability, TLS pin, login, DSM version against SA-26:13, 2-step verification status, administrator capabilities, and clock skew.nas incident: Runs nas incident --json (and optionally --probe --scan) for a read-only audit of DSM version, vulnerable packages, firewall, QuickConnect, UPnP router rules, public ports, external and failed sign-ins, AutoBlock, SMB1, built-in admin, snapshot schedules, the unsupported-model WORM lock trap, ransom notes, and CVE-2024-10441 exploit attempts.nas incident fix --dry-run --json --ransom-scan and shows every planned change (before -> after), the exact DSM Web API calls, and the corresponding DSM web UI path.nas incident fix --yes: Applies the approved plan in order (snapshot_worm → snapshots → packages → smb_min_protocol → quickconnect → router_port_forwarding → autoblock → admin_account → firewall, plus optional --rotate-password and --upgrade), reads every setting back to verify, and re-runs the audit.--deep and alert-deploy: Runs nas incident --deep --json (one read-only root collector via Task Scheduler checking root-only logs, crontabs, /bin binaries, accounts, SSH keys, and /proc) and nas alert-deploy --json --test (10-minute health and security monitoring pushed to a webhook).https://192.0.2.10:5001, plus a VPN/Tailscale URL if used).op://VAULT/ITEM/password, a password command, or the OS keychain).192.0.2.0/24)./docker/.nas-cli-deploy, used by --deep and alert-deploy).nas setup exits 3 with "field": "otp", provide the current 6-digit code; --trust-device stores DSM's trusted-device token (0600) so subsequent commands do not need a code.nas incident fix --yes runs (and choose whether to include --rotate-password or --upgrade).Full agent specification: docs/AGENT-RUNBOOK.md.
nas incident is read-only. Each item prints PASS, WARN, FAIL or SKIP with a one-line hint (--json outputs structured JSON; schema in schemas/incident.schema.json). Exit status is 1 when any item is FAIL.