RedSun: How Windows Defender Becomes the Write Primitive
A Windows privilege-escalation PoC that chains Cloud Files, reparse points, and native NT file operations into one deeply ironic attack path.
- RedSun’s central trick is not evasion. It is turning Windows Defender’s remediation path into a privileged write primitive.
- The PoC works because several ordinary Windows subsystems line up in a dangerous sequence, including Cloud Files, reparse points, shadow-copy enumeration, and native NT file operations.
- Its novelty is not any single primitive. It is the way a cloud-managed file state changes the behavior of a security product that should have been the last thing helping the attacker.
- RedSun is a reminder that modern Windows attack surface often lives in the seams between features, not inside a single broken component.
The Strange Part: Defender Is the Helper
RedSun is interesting because it inverts the usual defender-versus-attacker script. The PoC allegedly tricks Windows Defender into rewriting a malicious file back to its original location, and that write becomes the privilege-escalation path.
That is the whole judo move. Instead of fighting the platform’s protections head-on, the exploit uses a legitimate remediation path as the thing that touches a protected target. The result is a security bug that looks, at first glance, like a feature doing its job.
When Windows Defender realizes that a malicious file has a cloud tag, for whatever stupid and hilarious reason, the antivirus that's supposed to protect decides that it is a good idea to just rewrite the file it found again to it's original location. The PoC abuses this behaviour to overwrite system files and gain administrative privileges.
Who Built It, and What They Actually Published
The repository is a minimal research drop from Nightmare-Eclipse/RedSun. It is not a product, and it is not trying to be polished. It is a single-purpose PoC with one job: demonstrate the chain.
That matters because the repo’s structure tells you what kind of artifact this is. A flat codebase, a single C++ file, and no attempt at abstraction usually means the author is optimizing for exploit clarity, not maintainability.
The Attack Chain, at a Glance
The shortest way to understand RedSun is as a sequence of normal Windows behaviors that become dangerous when chained together. A bait file gets marked as cloud-managed, Defender touches it, the write path is redirected, and the protected target becomes the destination instead of the source.
The interesting part is that none of the ingredients are exotic by themselves. Cloud files, reparse points, VSS enumeration, and NT-native file operations all belong to normal Windows plumbing. RedSun’s novelty is in how it arranges them.
How the PoC Stages the Write
The code leans on native APIs instead of higher-level Win32 convenience wrappers. That gives the author more direct control over file disposition, rename behavior, and object-manager namespace lookup, which is exactly where a race-oriented PoC wants to live.
// Conceptual shape of the primitive, not a full listing.
// The exploit wants the write to land somewhere else.
NtSetInformationFile(hFile, &info, sizeof(info), FileRenameInformation);
NtSetInformationFile(hFile, &disp, sizeof(disp), FileDispositionInformationEx);
// Reparse logic and cloud-managed state influence where Defender's write goes.
That’s why going under Win32 matters. When you stay at the NT layer, you can work with the file system as the kernel sees it, not as a friendly API wants to present it. In a race-heavy exploit, that difference is the whole game.
Why Cloud Tags Are the Real Twist
The cloud-tag detail is what makes RedSun feel fresh. Cloud Files exists to let Windows treat remote or placeholder-backed content as first-class files, which is great for sync and storage integration. It is also a rich source of unintended behavior when a security product interacts with it.
That is the deeper pattern here. RedSun does not need a memory corruption bug or an exotic kernel exploit. It uses an ordinary trust boundary, cloud-managed file state, and a privileged remediation step to create a write primitive that should not exist.
| Technique | Trigger | Privileged actor abused | Main redirection primitive | Why RedSun is different |
|---|---|---|---|---|
| Junction or symlink LPE | A privileged process follows a filesystem link | Installer, service, or cleanup task | Directory redirection | Relies on path confusion alone, without security software in the loop |
| Reparse-point file write abuse | A privileged write lands on a redirected path | Backup, repair, or cleanup logic | Reparse point or mount point | Uses file system semantics, but not Defender’s remediation behavior |
| Generic AV tampering | Antivirus acts on a detected threat | Antimalware service | Quarantine, delete, or replace workflow | Focuses on AV behavior, but usually not as the write target itself |
| RedSun | Cloud-tagged malicious file meets Defender remediation | Windows Defender | Cloud Files state plus redirection chain | Turns protection logic into the privileged writer and folds in modern Windows subsystems |
RedSun’s twist is not that it uses a redirect. Plenty of old bugs do that. The twist is that the redirect is apparently reached through a security product’s own cleanup path, which is a much stranger and more modern kind of abuse.
How This Differs From Older LPE Tricks
Classic local privilege escalation often depends on one narrow mistake. A service writes where it should not. A junction catches the write. A privileged installer follows a link. RedSun sits in the same family, but the choreography is newer and more layered.
Instead of a single confused write, RedSun reportedly combines cloud-file handling, shadow-copy enumeration, NT-native file operations, and reparse-point redirection. That makes it feel less like a single bug and more like an emergent failure mode in a feature-rich OS.
It also changes the defensive lesson. The problem is not only broken validation. It is the interaction between components that were each reasonable in isolation.
What RedSun Says About Modern Windows
RedSun is a small PoC with a big implication. As Windows accumulates cloud integration, remediation logic, and low-level file-system features, the number of surprising control surfaces grows too. Security features become part of the attack surface simply because they are powerful enough to act on files.
That is why this repository is worth reading even if you never touch exploit development. It is a compact example of how modern systems fail: not in one obvious place, but in the seams between trusted subsystems.





