The ransomware that writes nothing — and everything stays locked | Stack of Truths

The ransomware that writes nothing — and everything stays locked | Stack of Truths
🔓 ZERO-WRITE RANSOMWARE / SMB SECURITY

The ransomware that writes nothing — and everything stays locked

📅 May 14, 2026 ⏱️ 7 min read 🦞 Pedro Jose 🔬 Research: Kim Dvash

Imagine walking into your office on a Monday morning. Your file server is online. Your drives are intact. Your backups are untouched. No ransom note. No encrypted files. No alerts from your SIEM, your EDR, or your storage logs.

And yet — every single file is locked. Your team can’t open anything. Your customers can’t access their documents. Your business is frozen.

This isn’t hypothetical. It’s called GhostLock. And it works today on every Windows domain that uses SMB file shares — which is almost all of them.

One API call. Zero writes. No patch.

Kim Dvash’s GhostLock research tool demonstrates something terrifying: a standard domain user with read access to an SMB share can lock every file on that share permanently. No administrator privileges. No encryption. No writes. No traces in your security stack.

The weapon? A single Windows API function that has existed since Windows NT 3.1: CreateFileW with dwShareMode = 0x00000000.

// One call. No writes. Every other client gets STATUS_SHARING_VIOLATION.
CreateFileW(
    "\\fileserver\\share\\document.pdf",
    GENERIC_READ,
    0x00000000,        // ← Exclusive deny-share
    NULL,
    OPEN_EXISTING,
    FILE_ATTRIBUTE_NORMAL,
    NULL
);

When a process opens a file with dwShareMode = 0, it’s telling Windows: “No one else can touch this file while I have it open.” Not read. Not write. Not even metadata access. Every other client gets STATUS_SHARING_VIOLATION.

Now scale that. GhostLock uses 32 threads to crawl an SMB share, discovering thousands of files in seconds. For each file, it acquires an exclusive deny-share handle. Then it simply waits.

The result? Ransomware-equivalent availability impact. No encryption. No writes. No ransom note. Just locked files.

⚠️ The Scary Part: No CVE exists for this. Microsoft has no patch to issue. This is correct, documented Windows API behavior that has existed for 30+ years. It’s not a vulnerability — it’s a feature being abused.

Why your security stack won’t catch it

This is where GhostLock becomes genuinely frightening. Compare it to traditional ransomware:

Detection Signal Encryption Ransomware GhostLock
Bulk write I/ODetectableNone
File rename / new extensionDetectableNone
Honey file triggeredWrite to canaryRead-open only
Behavioral AI (write rate)FiresNo writes
EDR on endpointShellcode / injectionLooks like file indexer
DLP / content inspectionBulk read anomalyIndistinguishable from backup
Network traffic anomalyBulk SMB writesIdentical to Word opening a doc
Storage session open-file countNot relevantOnly reliable signal

The only observable that identifies this attack lives inside the NAS session table — a metric virtually no enterprise SIEM currently ingests. Your EDR sees a process opening files. Your network monitoring sees normal SMB read traffic. Your DLP sees someone reading documents — which is indistinguishable from a backup job or an indexer.

📄 From the GhostLock research paper: “Applied across an entire share with 32 parallel threads, GhostLock locks hundreds of thousands of files in minutes. The author’s test environment: 4,821 files locked in 8.3 seconds.”

How the attack works

GhostLock’s attack flow is deceptively simple:

  1. Discover — Crawl the target SMB share using os.scandir() with 32 parallel threads. A 4,821-file share takes ~8 seconds.
  2. Lock — For each file, call CreateFileW(dwShareMode=0) to acquire an exclusive deny-share handle.
  3. Hold — Keep all handles open indefinitely (or for a set duration).
  4. Release — On Ctrl+C, release all handles and write a JSON + Markdown report.

The tool requires only:

  • A Windows 10 / Server 2016 or later machine
  • A domain user account with read access to the target share (no write needed)
  • A sentinel file created by an administrator (safety mechanism to prevent accidental misuse)

No third-party packages. No dependencies. Pure Python standard library.

# Interactive mode
python ghostlock.py

# CLI mode — lock everything indefinitely
python ghostlock.py "\\fileserver\share\dept" `
    --existing-folder `
    --confirm-existing-lock `
    --hold-indefinite

Why this changes how we think about ransomware

For years, the cybersecurity industry has focused on detecting writes. Encryption writes to disk. File renaming writes to disk. Ransom notes write to disk.

GhostLock writes nothing. It achieves the same business impact — denial of access to critical data — without ever triggering a single write-based alert.

This is a paradigm shift. Defenders have been looking for the wrong signals.

The attack also highlights a deeper problem: excessive file access. Your standard domain user has read access to thousands of files they don’t need. In a least-privilege model, a marketing employee shouldn’t be able to lock engineering design documents. But in most organizations, they can.

🎯 Key Takeaway for Defenders: The only reliable detection signal for GhostLock is the open-file count per session inside your NAS or file server. If your SIEM isn’t ingesting SMB session metrics, you’re blind to this attack. Start now.

The sentinel safety mechanism

The GhostLock tool itself includes a thoughtful safety feature: a sentinel file named .ghostlock_authorized must exist in any target directory before the tool will lock existing files.

New-Item -ItemType File "\\server\share\targetfolder\.ghostlock_authorized"

This prevents accidental execution. But an attacker who has compromised a domain user can easily create this file themselves — they have write access to the share? Wait, no. The attacker doesn’t need write access to create the sentinel. They need write access to that specific directory. But in many organizations, standard users can write to at least one share. That’s all it takes to bootstrap the attack.

The research behind GhostLock

Kim Dvash’s full research paper, “GhostLock: SMB Deny-Share Handles as a Zero-Privilege Availability Weapon” (May 2026), is available on Zenodo. The research site is ghostlock.io.

The tool is intended for authorized security testing and research only. Running GhostLock against any system without explicit written authorization is illegal and unethical.

🦞 Stack of Truths note: I reached out to Kim Dvash after reviewing this research. This is the kind of offensive security thinking that separates real red teams from compliance checkbox exercises. It’s not about finding CVEs. It’s about understanding how documented features can be weaponized.

How to protect your organization

There’s no patch for GhostLock. But there are mitigations:

  • Monitor SMB session open-file counts — This is the only reliable detection signal. Ingest NAS session metrics into your SIEM. Alert on any single session opening thousands of files without closing them.
  • Implement file-level least privilege — Users shouldn’t have read access to files they don’t need for their job. Regular access reviews reduce the blast radius.
  • Shorten SMB session timeouts — Aggressive session timeouts can force handle releases, though an attacker can simply re-acquire them.
  • Deploy file server behavioral analytics — Look for anomalous open-file patterns, especially from unexpected processes or user accounts.
  • Test your own environment — Authorized penetration testing should include deny-share handle abuse scenarios. If you’re not testing for this, you’re assuming you’re safe. You’re not.
🔴 Bottom line: Every organization using Windows file shares is vulnerable to GhostLock today. Your existing security stack will not detect it. The only question is whether an attacker has already used it against you.

Final thoughts

GhostLock is a wake-up call. It proves that our detection strategies are still stuck in the 2010s, looking for writes and encryption where modern attackers don’t need them.

The next generation of ransomware won’t encrypt your files. It will just lock them. No ransom note. No alerts. No trace. Your business will grind to a halt, and you won’t know why until a researcher tells you.

Don’t wait for that call.

🦞 Want to test if your SMB shares are vulnerable?

I offer authorized penetration testing that includes deny-share handle abuse scenarios. DM me first. Quick chat. Then we book a call if we’re a fit.

No Calendly. Just a human who breaks things (with permission) for a living.

Oh hi there 👋
It’s nice to meet you.

Sign up to receive awesome content in your inbox, every month.

We don’t spam! Read our privacy policy for more info.

Leave a Reply

Your email address will not be published. Required fields are marked *


You cannot copy content of this page

error

Enjoy this blog? Please spread the word :)

Follow by Email
YouTube
YouTube
LinkedIn
LinkedIn
Share