
Unit 42 Uncovers PEERSTITCH, a Stealthy FortiGate Implant
PEERSTITCH is a memory-resident ARM64 implant that Unit 42 found in a September 2024 telecom intrusion (cluster CL-STA-0954, aka UNC5820). Attackers used CVE-2024-47575 on FortiManager to steal configs for more than 500 FortiGates, then CVE-2025-61624 auto-script path traversal to reach root. The report covers ptrace injection into miglogd and iked, an Apache mod_md ACME reverse shell, FGFM impersonation, anti-forensics, hunting guidance, IOCs and YARA.
What it is
PEERSTITCH is a memory-resident Linux ARM64 implant for FortiOS, found by Unit 42 in a September 2024 intrusion at a telecom managed service provider (cluster CL-STA-0954, aka UNC5820). Unit 42 says the post-exploitation tradecraft overlaps with intrusions attributed to suspected nation-state actors. The entry point was CVE-2024-47575 on a central FortiManager. From it the attackers took running configs, credentials and private keys for more than 500 managed FortiGates, including client firewalls.
How it works
- Initial access. An unauthenticated attacker sends crafted requests to the FMG-Access channel (TCP 541). The attackers registered a rogue Virtual FortiGate named
localhost(serial FMG-VMTM23017412) from 45.32.41[.]202, later 198.199.122[.]22. They then built a config archive named.tmand exfiltrated it. - Credential recovery. Passwords in the configs are stored as reversible ciphertext. Unit 42 brute-forced admin and SSL/VPN passwords from the stolen files. The attackers used legitimate credentials for SSL/VPN sessions from 23.240.77[.]233 and 47.18.167[.]159.
- Sniffing. After a long dwell period, the attackers pushed sniffer configs through FortiManager. These captured HTTP and 11 other services, then TFTP (UDP 69), RADIUS (UDP 1812/1813) and LDAP (TCP 389) on core perimeter firewalls.
- Root. CVE-2025-61624 is a path traversal in the CLI
system.auto-scriptengine. The object name is not sanitized, so an authenticated admin, even a super_admin, can write a script anywhere as root. The attackers used the name../../../../setup. - Implant delivery. The script fetched five files from hxxp[:]//23.240.77[.]233:8085/ into
/data2/template/. The injector was saved aslldprx. - Injection.
lldprxfinds/bin/miglogdand/bin/ikedthrough/proc, attaches withPTRACE_SEIZE, and maps a 16 KB RWX region. It writes a 1,344-byte payload, NOPs three offsets and writes a 20-byte trampoline. The two daemons pass tags to each other by writing to/proc/<pid>/mem, looking for the markers8550and169.254.0.1in traffic. Whenikedfinds a matching tag, it skips default FortiOS security validation. - Second C2 path. An auto-script wrote
../../tmp/apache2/conf/md-acme.conf. It points Apachemod_mdat an attacker ACME server, mapsMDChallengeDns01to/bin/node, and setsMDRenewMode always. Shell commands injected into the challenge domain name give a repeating SSH reverse shell to 23.240.77[.]233:8084. - Management impersonation. An admin account named
FortiGateCloudpulled full configs over FGFM (TCP 541), although the victim had no FortiManager Cloud tenant.
flowchart TD
A[Stolen FortiManager serial and trust material] --> B{How was FortiManager impersonated?}
B -->|Path 1| C[CVE-2024-26009 FGFM auth bypass]
B -->|Path 2| D[Reuse exfiltrated trust material]
C --> E[FortiGateCloud account pulls configs]
D --> EWhat to do
Unit 42's detection table, hashes and YARA rule were not in the page text available here, so take them from the original report. The page does support these checks:
- Look on FortiGates for auto-script objects with traversal names (
../../../../setup,../../tmp/apache2/conf/md-acme.conf). - Look for files in
/data2/template/(index.js,index.wasm,ipssem.js,lldprx) and for anmd-acme.confthat setsMDChallengeDns01to/bin/node. - Look for a
FortiGateCloudadmin account on devices with no FortiGate Cloud enrollment. - Look for unexpected sniffer configs, and for gaps in logs or in the tunnel management interface.
- Check for the commands the attackers ran to hide their work:
killall -9 miglogd
killall -9 syslogd
diagnose debug crashlog clear- Check FortiManager for a device named
localhostand for a.tmarchive. - Review SSL/VPN logins and FGFM traffic from the IPs above.
- Rotate every credential, certificate and key held by FortiManager. Unit 42 says stolen trust material stays valid after patching until it is rotated.
- Palo Alto Threat Prevention signatures 95788 and 96788 cover CVE-2024-47575.
Caveats
- Unit 42 examined only the provider's environment, not the client networks. Client exposure is of config and credential material, not confirmed intrusion.
- The FGFM impersonation is a medium-confidence assessment. The evidence does not separate CVE-2024-26009 from direct reuse of stolen trust material.
- The use of CVE-2024-26008 to drop the management tunnel is possible but unconfirmed, because logs did not capture the traffic.
- Unit 42 rules out CVE-2025-59718, CVE-2025-59719 and the FG-IR-26-060 SSO issues, since they need FortiCloud SSO enrollment.
- The page gives no affected FortiOS or FortiManager version ranges. Check the Fortinet PSIRT advisories it lists.
Organisations named here
- CL-STA-0954
- FGFM
- FortiJump
- PEERSTITCH
- ptrace injection
- UNC5820
CVEs named here
- CVE-2024-47575
- CVE-2025-61624
- CVE-2024-26009
- CVE-2024-26008
- CVE-2025-59718
- CVE-2025-59719
Technologies named here
- Advanced WildFire
- Fortinet FortiManager
- Advanced URL Filtering
- FortiOS
- Advanced DNS Security
- Cortex Xpanse
- YARA
- Node.js
- FortiManager
- FortiGate
- Apache
- Advanced IP Defense
- Cyber Threat Alliance (CTA)
- Device Security
- Emscripten / WebAssembly (index.js, index.wasm)
- FGFM protocol (FortiGate to FortiManager, TCP port 541)
- FortiGate SSL/VPN
- Fortinet FortiGate firewalls (more than 500 managed devices had configurations exfiltrated)
- Next-Generation Firewall with Advanced Threat Prevention
- ptrace
- Unit 42 Incident Response
- Virtual FortiGate (rogue device registered to FortiManager)
Techniques named here
- Exploit Public-Facing Application
- Path traversal
- Apache mod_md ACME DNS-01 challenge abuse
- Configuration and credential theft
- Covert cross-process IPC via /proc/<pid>/mem
- Exploitation for privilege escalation via path traversal
- Indicator removal and defense evasion
- Management platform impersonation over FGFM
- Network sniffing via pushed sniffer configurations
- Offline password brute-forcing of recoverable ciphertext
- Process memory patching and injection
- Rogue device registration
- Valid accounts over SSL/VPN
Threat actors named here
- FortiBleed
- CL-STA-0954 (aka UNC5820; Unit 42 cluster behind the September 2024 intrusion against a telecommunications managed service provider; post-exploitation overlaps with suspected nation-state activity)
- PEERSTITCH (novel memory-resident Linux ARM64 implant for FortiOS; injects into miglogd and iked)
Related in Threat Intel
Reverse Engineering the Six Stages of MacSync Stealer and RAT
AI-Coded Malware | Analyzing Vibe-Coded AD Enumeration | Huntress
