by akari-sora
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. Mirror; canonical repo and issues: gitlab.com/aa22396584/synology-nas-cli
# Add to your Claude Code skills
git clone https://github.com/akari-sora/synology-nas-cliGuides for using ai agents skills like synology-nas-cli.
See how synology-nas-cli compares with popular alternatives.
synology-nas-cli is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by akari-sora. 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. Mirror; canonical repo and issues: gitlab.com/aa22396584/synology-nas-cli. It has 65 GitHub stars.
synology-nas-cli's catalog security scan is still queued. You can run an instant dependency and prompt-injection check now with the "Scan for vulnerabilities" button above.
Clone the repository with "git clone https://github.com/akari-sora/synology-nas-cli" and add it to your Claude Code skills directory (see the Installation section above).
synology-nas-cli is primarily written in Python. It is open-source under akari-sora on GitHub, so you can review or fork the full source.
Yes. SkillsLLM lists many other AI Agents skills you can browse and compare side by side. Open the AI Agents category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh synology-nas-cli against similar tools.
No comments yet. Be the first to share your thoughts!
Available after the catalog security scan passes.
⚠️ Third-Party Software Notice
This skill is third-party open-source software developed and hosted independently on GitHub. SkillsLLM is an informational directory and does not control or maintain the underlying repository.
Any security checks, ratings, or warnings displayed by SkillsLLM are automated and limited in scope. They do not constitute a security certification or guarantee that the software is safe, error-free, or free from malicious code, vulnerabilities, compromised dependencies, or prompt-injection risks.
Review the source code, permissions, dependencies, and configuration before installing or running any third-party skill. Use is at your own risk. To the maximum extent permitted by applicable law, SkillsLLM is not liable for losses arising from third-party software.
The deep catalog scan for this skill is still queued. Run an instant dependency check now instead.
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.
English · 繁體中文 · 简体中文 · 日本語 · 한국어 · Deutsch · Español · Français
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.
flowchart LR
A["nas incident<br/>read-only audit"] --> B["nas incident fix --dry-run<br/>plan: before → after"]
B --> C["nas incident fix --yes<br/>apply, read back, audit again"]
C --> D["nas alert-deploy<br/>check every 10 min → webhook"]
A -.->|files being encrypted| E["nas incident contain<br/>freeze the encryptor"]
E --> F["nas incident rescue<br/>memory capture → key search"]
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.
| Item | What nas incident reports |
What nas incident fix changes |
|---|---|---|
dsm_version |
FAIL if the DSM build is older than the SA-26:13 fixed build for its branch, or on a branch with no SA-26:13 fix (DSM 7.1 and older); PASS if patched |
With --upgrade: downloads the newest official .pat for the model, runs PreCheck, installs, and reboots |
sa_26_14_packages |
Checks installed packages against Synology-SA-26:14 (Calendar, MailStation, PHP 7.3–8.4): FAIL if a vulnerable version is running, WARN if installed but stopped |
Stops running vulnerable packages (--only packages) |
firewall |
FAIL when the firewall is off and the NAS holds a public IP itself (e.g. dials PPPoE), WARN when off behind NAT, or FAIL/WARN when interfaces accept unmatched traffic or rules allow any source (source_ip: all) |
Enables the firewall, adds allow rules for this computer's /32 (as DSM logged it) plus IPv4 allowed_networks on LAN interfaces, sets every non-global interface policy to drop, and removes allow-any-source rules (--only firewall) |
quickconnect |
FAIL when QuickConnect or QuickConnect automatic router port forwarding is enabled |
Turns off QuickConnect and its UPnP router port forwarding (--only quickconnect) |
router_port_forwarding |
FAIL when DSM has enabled UPnP/NAT-PMP port-forwarding rules on the router |
Disables all router port-forwarding rules managed by DSM (--only router_port_forwarding) |
public_ports |
Only with --probe: opens TCP connections from this machine to DSM and file-service ports on the NAS's public IP (FAIL if any port answers) |
Covered by firewall, quickconnect, and router_port_forwarding |
external_signins |
FAIL when the connection log contains successful sign-ins from source addresses outside allowed_networks |
None (investigate unauthorized access; see docs/INCIDENT-C3RB3R.md) |
failed_signins |
WARN when failed sign-ins in the last --hours (default 24) exceed --failed-threshold (default 20) |
Mitigated by firewall and autoblock |
autoblock |
FAIL when AutoBlock is disabled |
Enables AutoBlock (10 attempts within 5 minutes, permanent block) and allow-lists this computer's IP plus IPv4 allowed_networks (and 127.0.0.1 if incident.autoblock_allow_loopback is true) (--only autoblock) |
smb_min_protocol |
FAIL when SMB is enabled and allows SMB1 (smb_min_protocol=0), WARN when SMB is off but minimum protocol is SMB1 |
Raises minimum SMB protocol to SMB2 (smb_min_protocol=1, smb_max_protocol=3) (--only smb_min_protocol) |
admin_account |
FAIL when the built-in admin account is enabled (expired: normal) |
Disables the built-in admin account via a temporary root task after checking that another enabled administrator exists and the current session is not admin (--only admin_account) |
snapshot_schedule:<share> |
Per shared folder: FAIL if no snapshot schedule exists, the schedule is disabled, or the newest scheduled snapshot is older than snapshot_max_age_hours (default 26 h) |
Creates a daily snapshot schedule (03:30 default) and a 14-day retention policy on shares that have no schedule yet; gated on a clean --ransom-scan in the same run or --i-know-snapshots-may-rotate (--only snapshots) |
snapshot_worm:<share> |
FAIL when the immutable-snapshot (WORM) lock is enabled on a model whose SYNO.DisasterRecovery.Retention info lacks worm (DSM accepts the API call and scheduled snapshots silently stop) |
Turns off the unsupported WORM lock on affected shares so scheduled snapshots resume; gated like snapshots (--only snapshot_worm) |
ransomware_files |
Only with --scan: searches shares via File Station for *.L0CK3D, *.LOCK3D, and read-me3.txt (FAIL if any match is found) |
None (incident response re |