A new rat in the valley: SAFERAT
Key takeaways
- Discovery of a new malware “SafeRat” attributed to the Silver Fox group
- Description of SafeRat’s operation
- Discovery of a new “UUIDLoader” loader
- Establishing a link with ValleyRat and Silver Fox
- Script for extracting loader payloads
- IOCs, detection guide, and sample list
This article details a new malicious code, SafeRat, which we attribute to the APT group Silver Fox.
First, we will describe this new code, its operation, capabilities and specificities.. We will look at certain interesting functionalities such as the silent deployment of an RMM (Remote Monitoring and Management) solution. We will also cover the elements identified in the wild, and notably the presumed victimology.
We will then focus on a sample that clearly stands out, and analyze a loader that will allow us to establish a link with the group Silver Fox. We will also share code to extract the payload from these at the end of this article.
We will also see a second loader dating from late May 2025 we named UUIDLoader.
Finally, we will provide several detection guidances in order to detect this specific threat.
SAFERAT Malware Analysis
SAFERAT is a trojan, written in C++, which has the particularity of being both very simple and having numerous capabilities. It presents itself as a DLL, loaded by a signed and legitimate executable (side-loading technique), typically embedded in a ZIP file and sent by email.
It does not include code obfuscation mechanisms or string encryption. The name “SafeRat” even comes from the malware itself:
Once loaded, it will instantiate its network routines and contact its control server via RAW TCP. It does not possess network encapsulation mechanisms nor proxy usage, and uses the CTcpClient ( https://github.com/embeddedmz/socket-cpp ) library.
Its communication protocol is extremely simple; it will simply encapsulate its data as follows:
| WORD | WORD | DWORD | DWORD | Remaining |
|---|---|---|---|---|
| Total size -4 | \xC0\xFF |
DATA Compressed size | DATA Decompressed size | ZLIB compressed DATA |
The data sent by the malware is XOR-encrypted with a 16-byte key (hardcoded in the code) before compression. Data received by the control server is not encrypted. DATA will then indicate a command or response ID in its 1st byte.
During the first data transmission, the malware will send the following information about the user:
- System IP address
- System name
- User account name
- Date and time of infection
- Malware path
- Presence of running antivirus and instant messaging products
- Process PID
- Uptime since last contact
- Local Admin status (yes/no)
- Value of the registry key
HKCU\Software\<computer>:Group(specified by the malware, see below) - Content of the registry key
HKCU\Software\<computer>:Remark(specified by the malware, see below) - Content of the registry key
HKCU\Software\<computer>:Time(date and time of first infection)
The following antivirus products are searched for:
360sd.exe(360 Safe)360tray.exe(360 Total Security)AliYunDun.exe(Alibaba Cloud Shield)aswEngSrv.exe(Avast)avgnt.exe(Avira)Avp.exe(Kaspersky)BaradAgent.exe(Tencent Cloud Monitor)Bdagent.exe(Bitdefender)Egui.exe(ESET NOD32)HipsTray.exe(Huorong / 火绒)kxetray.exe(Kingsoft / 金山毒霸)MCPR.exe(McAfee)Nissrv.exe(Miscrosoft Defender)NortonSecurity.exe(Norton)QQPCTray.exe(Tencent PC Manager)sepWscSvc64.exe(Symantec)
The following instant messaging software is searched for:
Telegram.exeWeChat.exeWeChatApp.exe
Subsequently, the malware will send, in real time, all the window titles that gain focus, which suggests very strong interactivity with the user controlling them. It is also noted that a specific message notifies the launch of a Telegram.exe process.
The malware supports several commands:
| Opcode | Name | Parameters | C2 Return | Notes |
|---|---|---|---|---|
| 0x00 | Shutdown/Reboot | 1 byte flags ExitWindowsEx | — | Restarts the system |
| 0x02 | Kill agent | — | — | Clean shutdown |
| 0x03 | Set Remark | string | — | Operator tag, re-exfiltrated in beacon |
| 0x04 | Set Group | string | — | Campaign group, re-exfiltrated in beacon |
| 0x06–0x0F,0x11,0x12 | Load plugin | PE binary + context | — | Reflective load, export “base” called, 12 thread slots |
| 0x10 | Update config | 0x104 bytes XOR-0x46-Base64 | — | Restarts with new C2 config |
| 0x13 | Install/Steal Sunlogin | path + installer binary | opcode 0xD9 + fastcode+password | Installs Sunlogin if absent, silent theft |
| 0x14 | Drop plugin 32-bit | path + PE | — | Creation and execution of %TEMP%\Plugin32.exe with arguments -connect IP:1111 |
| 0x15 | Kill 360 & persist | — | 0xDA/0xD9 | Degrades 360tray token, installs scheduled task |
| 0x16 | Run PE in RAM | PE binary | — | Execution of exe in RAM |
The most interesting commands are the following:
- The
Set GroupandSet Remarkcommands allow data to be saved in the registry in a fixed key. This allows the controller to store (without encryption) contextual data (likely notes) on the victim system. This is a very clear inheritance from the Gh0st malware ( https://github.com/yuanyuanxiang/Gh0st ). - The
Kill 360 & Persistcommand allows the Integrity Level of the360Tray.exeprocess to be lowered toLow, effectively rendering it inoperable. It subsequently installs persistence via asystem64scheduled task executing the binary at user logon. - The
Install/Steal Sunlogincommand allows the SunLogin RMM ( https://awesun.aweray.com/en ) to be silently installed, then exfiltrates the credentials, subsequently allowing for graphical control. - The multiple
Run plugincommands allow up to 12 plugins to be executed concurrently in RAM. A plugin is a DLL file exporting abasefunction, which will be called and will benefit from the malware’s communication tunnel. - The
Drop Plugincommand copies and executes an executable in%temp%, specifying-connect %s:1111as arguments
A single root version is present; it is globally the same modified binary. The samples share two elements:
- Compilation Timestamp :
2026-01-05 06:28:06 UTC - Rich Header Hash : 5ab27d4a6ac2950bc04982f11286f42f
The differences in size or data between the samples are explained by the fact that some of them seem to have been extracted in RAM and then rebuilt. However, it is the same original binary.
Since the code does not encrypt any data, it is quite simple to write a YARA rule identifying critical character strings (see appendix).
We can also search for potentially signing routines such as cryptographic loops:
Analysis of the May-June 2026 campaign
All files consist of a DLL (e.g., nvdaHelperRemote.dll) loaded by a legitimate and signed executable (e.g., nvdaHelperRemoteLoader.exe) that has been renamed (e.g., to View.exe). The files were compiled in January 2026, and submissions on VirusTotal were found mainly in January, then starting from the end of May.
We can find the following names for ZIP files, suggesting the victimology:
RBI.zipStatement of May.zipStatement of June.zipLaporan Bulan Juni.zip(“June Report”, Indonesian )Invoice Bulan Mei.zip(“May Invoice”, Indonesian )Pernyataan_Pajak.zip(“Tax_Return”, Indonesian )TERLAMPIR.zip(“Attached”, Indonesian )Terlampir update dari kami terimakasih (Buka di komputer).zip(“Attached update from us thank you (Open on computer)”, Indonesian )PT WADYA PRIMA.zipupdate invoice.zipCBDT.zip
In these, the signed file was renamed to:
Open to View.exeOpen Now.exeBaca.exe(“Read”, Indonesian )View Details.exeExamine.exeCek.exe(“Check”, Indonesian )Tap to Open.exeCheck.exeConsult.exeInspect.exe1Claim.exeView Now.exeGo to View.exeRead.exeView.exeVerify.exeClick to Open.exeKetuk untuk Membuka.exe(“Tap to Open”, Indonesian )Query.exeLihat detail.exe(“View details”, Indonesian )Browse.exePeriksa.exe(“Check”, Indonesian )Open.exeClique para visualizar.exe
The sideloading DLLs are:
| Malicious DLL filename | Legitimate executable importing the DLL |
|---|---|
jli.dll |
javaw.exe (JAVA) |
libglib-2.0-0.dll |
gspawn-win64-helper.exe (Inkscape) |
libintl-8.dll |
gspawn-win64-helper.exe (Inkscape) |
xii_ecd_api.dll |
Unknown (VGNLab) |
libfabric.dll |
fi_info.exe (Intel MPI) |
OCefClient.dll |
OCefsubprocess.exe (OriginLab) |
gxl_3d_x64.dll |
GpuTest.exe (Geeks3D.com) |
nvdaHelperRemote.dll |
nvdaHelperRemoteLoader.exe (NonVisualDesktopAccess) |
Two interesting elements can be noted here:
- The use of
jli.dllas sideload is relatively common in ZIP phishing, and is not a discriminating element of this campaign. - The use of
xii_ecd_api.dllis interesting because it is signed by the company Fuzhou Geek Yanxuan, a Chinese company manufacturing “gaming” hardware such as mechanical keyboards or mice, under the VGNLAB brand. It is possible that the operators in charge of packaging the sideloads draw inspiration from software present on their systems.
The majority of samples uploaded via unique Web type sources come from Asia:
The control servers are the following:
192[.]163.167.137:8000: AS138995 (Singapore)108[.]187.41.140:8000: AS138995 (United States)192[.]229.87.194:8000: AS138995 (Singapore)2[.]16.164.120:80: AS20940 (Germany)
DONUTLoader
A binary stands out in this campaign because it was submitted in January, has 2.16.164[.]120 (located in Germany) as C2 server and uses port 80:
6fc82b4e6a944a3f7bce7a39276ed5246a5d78d17a75ba36a7dd39873c852f3a
More importantly, it was not packaged in a ZIP, but in an EXE loader: f5cf6da7fd383b6c6bba599dc9df4d5ea13a0792047dd14b44e94ceba9689f84 . It was submitted from Europe on January 12, 2026, which is, if the compilation timestamp is correct, 7 days after the malware compilation. All these elements differ from the other samples, all submitted in a phishing ZIP from Asian countries.
Using similarity search in our exalyze.io platform, we find another similar loader, 531e61e5376d7e7aff0a33752074fc1914039273545ddbeeb408866ad8889270 which possesses almost exactly the same compilation timestamp (within 1 second). The latter, however, was uploaded in May 2025.
See function matching in Exalyze
In both cases, these are two versions of the same relatively simple loader that installs itself in persistence (identical point), loads a resource, decrypts it, and executes it in memory:
The cryptographic loop identified at the end of the installation in persistence is a simple implementation of RC4. The key is present at the beginning of the embedded resource, and flags at its startup indicate in particular whether an anti-sandbox mechanism (at least 40 processes must be present) must be used, and whether persistence must be established.
If the first payload is extracted from the sample, we find a shellcode, followed by a SafeRAT binary. The shellcode used to load the binary is DONUT: https://github.com/TheWover/donut. In our case, no persistence and no anti-sandbox mechanism are used.
Our second payload uses the same shellcode. After extraction, the extracted binary e194ff05fc8d0dc2faabb74171509f10b2426de734664da0a1a109b8ce7c2c77 turns out to be ValleyRat malware. This behavior is also described in the article https://www.cloudsek.com/blog/silver-fox-targeting-india-using-tax-themed-phishing-lures#stage-3-donutloader .
UUIDLoader
By analyzing similar phishings, we have also identified a second loader 253f5d49f3a3a9709bde100be46d5f526823b336a9ff2a35b096fabaefd3fb57 used to embed SafeRAT, which we named UUIDLoader. The code is also a DLL sideload here, which will:
- Load a list of
UUIDsin the form of character strings via theUuidFromStringAAPI - Decrypt the identified data via a
XORdecryption routine with key derivation - If the data is a PE format file, the header is overwritten with pseudo-random data (
GetTickCount) - Execute the payload via a call to
EnumDateFormatsA(orSetThreadpoolWait) by passing the decrypted payload as a callback parameter. In practice, the payload here is a DONUT type shellcode, similar to the one identified in DONUTLoader.
We note a large number of mechanisms aimed at preventing emulation:
- Resort to graphical functions to allocate memory, such as
CreateDIBSection - Resort to opaque predicates to complicate reading the decryption routine
- Overwrite the PE header of the payload if it is present
- Call the payload via a function taking a callback as a parameter
The compilation of the 8 loaders is much more recent: it is between May 25, 2026 and June 12, 2026. The main differences between the codes lie mainly in the presence or absence of more advanced obfuscation mechanisms (imports resolved thanks to a checksum, opaque predicates, the routine used to trigger code execution, and the XOR key used).
Regarding statistics in terms of legitimate sideload executable usage, control server, and phishing filename, we find the same elements as for SafeRat:
- DLL names
nvdaHelperRemote.dll,jli.dll,xii_ecd_api.dllorOCefClient.dll - ZIP archives with names like
RBI.ziporLaporan Bulan Juni.zip - C2 Server
192[.]163.167.137
If we examine these samples, we obviously find that they share similarities (sometimes complex to identify given the fairly rapid evolution of the code on anti-emulation mechanisms), but another sample appears, which we did not already know:
The shared code is the XOR decryption routine of the payload embedded in the UUIDLoaders:
The sample c904cdac849fdbb49274a3c075db8845791e923250d08d558a4115936ef44405 is ultimately indeed a UUIDLoader, however the latter does not load a SafeRat and is a version visibly earlier than those identified in June. The latter was compiled on May 7 and then submitted on May 13, 2026 in RBI.zip and Laporan Rekening Bulan Mei.zip archives. This is a UUIDLoader loader that executes another type of shellcode, and which does not embed a DONUT to load a SafeRat, the payload being particularly small, which explains why we had not already identified it.
This is a stager for ValleyRat, as described in the article https://www.zscaler.com/blogs/security-research/technical-analysis-latest-variant-valleyrat.
Links with ValleyRat and Silver Fox
We have therefore seen links with ValleyRat, since DONUTLoader and UUIDLoader have visibly served to load the latter as well as SafeRat.
ValleyRat has been documented several times in the past:
- https://www.proofpoint.com/us/blog/threat-insight/chinese-malware-appears-earnest-across-cybercrime-threat-landscape
- https://research.checkpoint.com/2025/cracking-valleyrat-from-builder-secrets-to-kernel-rootkits/
- https://www.zscaler.com/blogs/security-research/technical-analysis-latest-variant-valleyrat
We can find links with ValleyRat samples via similarity search in Exalyze, even if this similarity is based on public libraries such as CTcpClient:
We find an inheritance between the three codes Gh0st, ValleyRat and SafeRat: ValleyRat is strongly inspired by Gh0st, and we find code from ValleyRat in SafeRat and therefore code inherited from Gh0st.
The victimology and the modus operandi are also similar to those described in attacks involving SilverFox and their tools such as ValleyRat or AtlasRat, notably in the following articles:
- https://securelist.com/tr/silver-fox-tax-notification-campaign/120038/
- https://www.proofpoint.com/us/blog/threat-insight/ta4922-suspected-chinese-crime-group-going-global
Remarks
- According to CheckPoint, the source code of ValleyRat is likely to have been widely shared among several Chinese-origin actors.
- The modus operandi observed (ZIP archive with sideload used in phishing to target Asian countries) remains generally standard and common to several different actors.
Detection Leads
SafeRat is relatively simple to detect with YARA rules. The detection of executables launched from a .zip file is also implementable.
Some specific elements can be searched for:
- The various DLLs used to perform sideloading remain fairly uncommon; it is possible to search for them in non-standard folders.
- The Registry Values
HKCU\SOFTWARE\<computer>:GroupandHKCU\SOFTWARE\<computer>:Remark, if the attacker has specified elements. Obtaining them can provide context on an ongoing compromise. The registry valueHKCU\SOFTWARE\<computer>:Timeis systematically present. - The
system64scheduled task executing at the main user’s logon. - The presence of the
SunLoginsoftware, if the latter is not currently used legitimately on the perimeter. - A “Run” registry key installing a
Windows Securitypersistence can indicate an infection by the loader. - A process including
-connect IP:1111in the command line (plugin).
Since the malware does not encrypt its downstream communications and uses a fixed encryption key, it is possible to sign them.
Conclusion
In view of the identified elements, we estimate it is very likely that:
- SafeRat has been used at least by the APT group Silver Fox. We establish this possibility based on the use of loaders linked in the past to Silver Fox: DonutLoader linked to Silver Fox was used to embed a SafeRat code. UUIDLoader was also identified as embedding a ValleyRat shellcode used by Silver Fox.
- SafeRat is a product whose development is strongly inspired by ValleyRat and consequently by Gh0st. Since the ValleyRat code apparently circulated, we cannot establish whether these are the same developers.
The Chinese cyber ecosystem where certain developments are used by several groups of attackers and where several groups can target identical entities in a similar way complicates this analysis.
SafeRat distinguishes itself from other tools by the fact that it contains comparatively less code than them. Its inability to use a proxy, protocol encapsulation, strong encryption, an absence of code concealment, and the specific targeting of instant messaging means seem to point to a tool aimed at individuals or less-protected entities. Particular attention is paid to antivirus products. We will note a native capacity to deploy and install an RMM of Chinese origin, SunLogin. From a development point of view, its code is simple, but effective. However, it will be noted that the majority of these codes are detected by antivirus products.
Regarding the version packaged in a loader, in view of the temporality (use 5 days after compilation in a different packaging, and phishing campaign 5 months later) we estimate it possible that it is a test version, although it could also be a deployment made hastily for a specific need.
Remark a TLP AMBER version of this blog post has been shared with selected ExaTrack partners. More information can be provided upon request.
appendix A : system IOCs
| Value | Description |
|---|---|
%systemroot%\System32\Tasks\systm64 |
Scheduled task |
Global\SafeRatOnlineMutex |
Mutex |
HKCU\SOFTWARE\<computername>:Group |
RegistryValue Group |
HKCU\SOFTWARE\<computername>:Time |
RegistryValue indicating first infection date and time |
HKCU\SOFTWARE\<computername>:Remark |
RegistryValue Remark |
-connect %s:1111 |
Parameter given to plugins |
jli.dll libglib-2.0-0.dll libintl-8.dll xii_ecd_api.dll libfabric.dll OCefClient.dll gxl_3d_x64.dll nvdaHelperRemote.dll |
Malicious DLL filename. Legitimate filename but can be searched in non common paths |
| SunLogin | Chinese RMM used by the operator. Not malicious but uncommon outside of several countries |
\SOFTWARE\Microsoft\Windows\CurrentVersion\Run:Windows Security |
RegistryValue Windows Security |
appendix B : C2 servers
192[.]163.167.137108[.]187.41.140192[.]229.87.1942[.]16.164.120207[.]56.138.28
appendix C : SHA256 hashes
SafeRat
Remark A lot of other samples can be identified in online analysis platforms, however most of them consist in the same files, extracted in RAM.
- 2c84a59bd6cdcad7e2e94425b9199a676171a8071199d54d6ffc360e4b76e045
- 6fc82b4e6a944a3f7bce7a39276ed5246a5d78d17a75ba36a7dd39873c852f3a
- e792e012473f945787a6228b876407d0f98fc824a456b5412f6991a726c816d7
- fb3c378838e806a74a5d8b228d054ed8c74e7d2cc8c76ce899b8046a386d72e1
Phishing ZIP files
- 01e368e76f47cf1852399d1b503228c2e1a7d701e4cc672350071e17039cb6ca
- 0b7294a12642958a4a518c872a22186fa5fd9187cb175dc2a99aa1307bbcf8e0
- 0eab8022280de796ce07b4702aed94eecebf2421d9c7e479d0d9b1476e32ae39
- 11106a7b33d81c8af62ecd0e76679ead28a6a71b45a04e5883c2e493ee3ed09c
- 1754f93e71f2c28a5c68d4f36de5c1f66a9ef8ee52635a46d54c3c701e488ab5
- 18ba335720a5fd49510811937b762d6e882a6fd0aa15ef73b9290f413664e4a7
- 1a63eabb0ff4c7739b038cde4db5b797c501de594cec1e2ebce09b4ab84a0044
- 1b89cbd0c33372ea7c34e3e1b47a643f9426dc89a0927a932578526799f12015
- 1e45a6ac936c048d3cbb77ad8417da051013080a8beee4c8ab74f3ca3201dac1
- 1fa50c65a7f00e53d3fb799b45dccdcb621ee8a89b91223bdeca3fec5bc79a56
- 20fe8157dd9c429b06414326a33e206041de1d390b6bef15470c5907cc31526c
- 21e74121e9fc55422530690ac9e1a08ccf34691c0ed04507966ba1461b3cfc4b
- 2d7707b1cdde3877ceecf06ad0672e2f56892e14d540720c3aec250de8c45f44
- 2ecc53cb0838bb48e7a76b0135b01c2e9561dbb06a6dc4938e0248ce9bd4e687
- 397aa936e65ec95094e55d7b92047516e6deb1f9db180c0fdc6891b90c5b3958
- 3de165f06f24d3e20626c23f843cfee851696113744a4477bb4c728b5f08cac8
- 3f9183914a026750501bfb7fa337fa77c9e145f835f2da6c2957490ba280e3e2
- 3fbc3a459e5d3ba59a14d171e7f12b58c92f9890693d5762bef153a35f6a90e9
- 40b464036b1ca5bc0ef0ccc814fe7164cf7d25924f03bacbeaed4c52a3e10cbd
- 433bcaa5d3f6316e67627825f3a9ddffb846d6c55443fe4dd536c540ae729da3
- 43b39d1186e0693bce8b24f40a99dfe7121c439d8781cca3ae498459edffd372
- 4ce4f29f8af6076cc207ff1b1b195850cb00cd0d7edb0d2c27fc2e21f879b4d0
- 4e13caaa47091d8a072ab0c22d1193fa45da9e9289577a7790add161ac527d10
- 4ed1ad00377abab9a531e42a959ba9d8b8beada24c206cd36ec9a9b134639ca5
- 52855524f5d74ed2169f18ff843cef4651dc45caff0b1f76b0771b589c005795
- 5751ebc85dc74c7ee63b9acfe42f8480b3bc8c3b6fbc1a7da750cbc62b284ee0
- 5b9f60b0dfc4a9afa4ae13ea4d22940587f0d4d82e504843c87fd374c96cb35c
- 60fdf557380e8491067a7a16afa9e53987619d01aa4558c71c2cc7df18cbc767
- 651ab5f27cde3b1d8d5809e58b0655b6254b023dfb191e21da43485f2f14e95d
- 684c8aceae524978cb7249e2d63150c3efa544005cb654311a0b3895d9cfa7ee
- 6c1c8e105f3c58f3847c69624f466cf51620929d6f24bbb3d6d3fd452aae9c25
- 6c2fe2948e1dfd62792296514fce47d167c1a0ea7c4285c94b2d8a8e29a330f6
- 6fcad0e424b2dca99a242400aceb2071a2aead43269092e14737f3fea7106f00
- 705e9d8b8777ff03c3baaa64c95369fc7f118eca13507b41879011f21e5a7044
- 71f68cb728ea7f00578bb95cd78d006d10a1086f919407c12b514bdc23383cb6
- 74696bda62d1eac37098dc8171e9818a16b6dc9af971829f49ddec6cddcb6775
- 7aefba9d897f2ec4eadd1bf77910c1689d0109ac1e6b8d96ebbf9ced1daf37fd
- 7c90665c596feb13924f096c1048071ddbb35e9592dfdcc9061d3792058be2a3
- 7e1de01b331c6cb7f01dbf42cd7cdd3a2f718abd1864340a118c776ee9262293
- 8004caab1359a0408d958b30d1f944b7063d1825625e5fd6af737183eeb88383
- 803c8dec5e52253d79fa955d33e53f307caaf5217d84ec278b2887fbacd369bd
- 84eab22a1acf6c03126ce39e5b2453f830d134d3cf9d2bd356278b4c581ee7e6
- 8af56f646ff1549dd2206b2a46f88a5a7aa3c19acf9775f37ecfb39be46ed0a5
- 8c2595230364ded7b4c293f25eb6b2695514515a0ec67dc4733c4c3c1963d476
- 8cbcb11bff7e3d20100a772a07e6b7b18d89f74b0ce6c592af9494911a3179e3
- 93eb1f63eda09848e331c534919242f7efe4a9067d0c79d1a5f0e0f626b9e76f
- 9a6502803f553315c9c5295c8c60fccf71f73a49c9822b92e250008beec22163
- 9e690ad9ad3f8a7aa1583179326928c42e6277be91dca807fb7d21f20f8ee305
- a27b9917ec5c89a17a5f8628bc019141749cf752e1bbb7a2cb3004f671d2eaa5
- a4252a57bf045ad23899bdff815da6e710459839d8bc11315bca07719030e6b7
- a7c0e85bc65ab6b1743796b268b3052db9ef20bb54b79ccdfae3f1251dc68eae
- ad27c4ad638f983a5e84018f622e65c1bec2a59103b4d2f743fdae8bfd187cb0
- b0e885948d6bcf6174d58d84bcb6489679b486060e53b7dcfe086e615f8baaed
- b431272aa91156ec4b6fdb66d212b427a5ccd2304a7a945f16b8efcbaf0bafcb
- b5c6b78db70a167f36b9fe7c88df4377a6b8faaadade9efb830ad8cead8132ff
- b73a188c19b57b1c1ecdcaee9cbd56f3274d334648725903d8e0983dfa60aff3
- b977105438f9628b9bdc21768e0662fabb67997b31e40d0e4f58dcaaa894ebd6
- d23b419cf545a6c7dad7e5a6d769a733004d8b3d191fc66cc6f285f0c5d76b17
- e77c69c35c31087a785857b2e39b653574fcfe3eb9533d92f1a85a3cc0eadd30
- e837329b713fc6a5b133cd64576593a31457748a2d0a2c5c6407c5b5168bdeaa
- f3788b3cbcda4bc659ac697aa6742609df40c33cdc60f0dc32bdd0caa5c4b95f
- f5cf6da7fd383b6c6bba599dc9df4d5ea13a0792047dd14b44e94ceba9689f84
DonutLoader
This list is not exhaustive as this blogpost does not cover this specific threat.
- 531e61e5376d7e7aff0a33752074fc1914039273545ddbeeb408866ad8889270
- f5cf6da7fd383b6c6bba599dc9df4d5ea13a0792047dd14b44e94ceba9689f84
UUIDLoader
- 295e0f3a1d7bb9abeae37806ae886b921d40b143c3226796b14f314e8ab8f31a
- 9664222497fc5a452e998ccde26c6b2bd92b6f4d2003b01f123326191cf88877
- 20a1eb889bbfae659485d49fbdc4e6dbbf54921b883950311362368d42e4499d
- 2cd958f26b193a8465a63b01150a9f1638dc1a9e4169ee7d56cdc2f15797be48
- 253f5d49f3a3a9709bde100be46d5f526823b336a9ff2a35b096fabaefd3fb57
- e63ac91d2bc21f0dd05f546f92112162ce8200cf97b59f6c46f608d1a6365502
- eea353c05e471ba615247f247c75af999fb1e96dc2f755d6305b975d7fe218f5
- f451e09601afb79b2e57bf46b394de7f218abacaed7f3c47d0359ec1517e725c
- c904cdac849fdbb49274a3c075db8845791e923250d08d558a4115936ef44405
appendix D : YARA rules
rule SafeRatStrings
{
meta:
description = "SafeRat specific strings"
author = "ExaTrack"
// this rule will not resist light modifications, but with careful selection it might be
// split into different rules which can target specific features :)
strings:
$proc1 = "Telegram.exe" ascii
$proc2 = "WeChatApp.exe" ascii
$proc3 = "360tray.exe" ascii
$proc4 = "multitip.exe" ascii
$proc5 = "xrk.exe" ascii
$dbg1 = "%s --> Error: %d, EC: %d" ascii
$dbg2 = "---------------> Client Worker Thread 0x%08X stoped <---------------" ascii
$dbg3 = "<C-CNNID: %Iu> OnSend() event should not return 'HR_ERROR' !!" ascii
$str1 = "SunloginClient" wide
$str2 = "-connect %s:1111" ascii
$str3 = "sysmt64" ascii
$str4 = "SOFTWARE\\%s\\" ascii
$str5_1 = "Plug" ascii
$str5_2 = "in32" ascii
$str5_3 = ".exe" ascii
$str6 = "Global\\SafeRatOnlineMutex" ascii
$lib1 = "AVCTcpClientListener" ascii
$lib2 = "deflate 1.2.13 Copyright 1995-2022 Jean-loup Gailly and Mark Adler" ascii
$lib3 = "CTcpPackClientT" ascii
condition:
uint16(0) == 0x5A4D and all of them
}
rule SilverFoxDonutLoaderStrings {
meta:
description = "SilverFox DonutLoader specific strings"
author = "ExaTrack"
strings:
$str1 = "Software\\Microsoft\\Windows\\CurrentVersion\\Run" ascii
$str2 = "CreateToolhelp32Snapshot" ascii
$str3 = "Windows Security" ascii
$str5 = "mscoree.dll" wide
condition:
uint16(0) == 0x5A4D and all of them
}
rule SilverFoxDonutLoader {
meta:
description = "SilverFox DonutLoader code"
author = "ExaTrack"
strings:
$rc4_1 = {8BC1884C142083E07F488D5201FFC10FB604288884141F0100003BCE7CE2}
$rc4_2 = {8D470125FF0000807D09FFC80D00FFFFFFFFC0}
$rc4_3 = {4C8D442420450FB60C384103D181E2FF000080}
$rc4_4 = {4863C2488D4C24204803C80FB60141880438448809410FB60C384903C90FB6C10FB64C042041300E49FFC64983EA01}
$proc_1 = {33D248899C248002000041B834020000C744242038020000}
$resrc_1 = {0F1040100F1048200F10100F294424300F1040300F294C244066480F7ED30F10484048C1EB200F294424500F1040500F294C24600F1048600F294424700F1040700F298C2480000000F20F108880000000660F7ED00F295424200F29842490000000F20F118C24A0000000}
condition:
uint16(0) == 0x5A4D and all of them
}
Appendix E: SURICATA rules
alert tcp any any -> any any (
msg:"SAFERAT keepalive header generic";
flow:established;
content:"|11 00 C0 FF 11 00 00 00 01 00 00 00|";
dsize:21;
sid:1000001;
rev:1;
)
alert tcp any any -> any any (
msg:"SAFERAT keepalive key 8FA24DC719E36B5E923AF17CB845D621";
flow:established;
content:"|11 00 C0 FF 11 00 00 00 01 00 00 00 78 9C EB 03 00 00 8F 00 8F|";
dsize:21;
sid:1000002;
rev:1;
)
alert tcp any any -> any any (
msg:"SAFERAT HELLO header";
flow:established;
content:"|C0 FF|";
offset:2;
content:"|00 00 48 03 00 00|";
distance:2;
sid:1000003;
rev:1;
)
Appendix F : SIGMA rules
title: SafeRat HKCU SOFTWARE Group/Remark
status: experimental
description: >
SafeRat HKCU SOFTWARE Group/Remark registry key
author: "ExaTrack"
date: 2026-06-30
logsource:
category: registry_event
product: windows
detection:
selection:
EventType: SetValue
TargetObject|re: '^HKU\\.*\\SOFTWARE\\[^\\]+\\(Group|Remark|Time)$'
condition: selection
level: high
title: SafeRat systm64 scheduled task
status: experimental
description: >
SafeRat systm64 scheduled task, runs at logon
author: "ExaTrack"
date: 2026-06-30
logsource:
product: windows
service: security
detection:
selection:
EventID: 4698
TaskName|contains: 'systm64'
condition: selection
level: high
title: SunLogin RMM presence
status: experimental
description: >
Detects execution of SunLogin RMM, used with saferat
author: "ExaTrack"
date: 2026-06-30
logsource:
category: process_creation
product: windows
detection:
selection_process:
- Image|endswith: '\xrk.exe'
- ParentImage|endswith: '\xrk.exe'
- CommandLine|contains: 'xrk.exe'
condition: selection_process
falsepositives:
- Legitimate usage of SunLogin RMM by IT
level: medium
title: SunLogin RMM install
status: experimental
description: >
Detects SunLogin RMM installation, might be done by SafeRat operators. Matches on VersionInfo as the filename is custom
author: "ExaTrack"
date: 2026-06-30logsource:
category: process_creation
product: windows
definition: 'Requires Sysmon EventID 1 with VersionInfo fields enabled, or equivalent EDR telemetry'
detection:
selection_company:
Copyright|contains:
- 'Oray Information Technology'
selection_product:
Product|contains:
- 'SunLoginClient'
selection_description:
Description|contains:
- 'SunLoginClient'
condition: 1 of selection_*
title: DONUTLoader Windows Security Persistance Run Key
status: experimental
description: >
Detects Windows Security Run key creation, used by DONUTLoader
author: "ExaTrack"
date: 2026-06-30
logsource:
category: registry_event
product: windows
detection:
selection:
EventType: SetValue
TargetObject|contains:
- '\Software\Microsoft\Windows\CurrentVersion\Run\'
TargetObject|endswith: 'Windows Security'
condition: selection
level: high
title: SafeRat Plugin32 temporary file
status: experimental
description: >
Detects SafeRat's Plugin32.exe temporary file creation
author: "ExaTrack"
date: 2026-06-30
logsource:
category: file_event
product: windows
detection:
selection:
TargetFilename|contains: '\AppData\Local\Temp\Plugin32.exe'
condition: selection
level: high
title: SafeRat plugin32.exe commandline -connect IP:1111
status: experimental
description: >
Detects the commandline provided to plugins dropped by SafeRat. Plugin name is likely to be plugin32.exe or plugin32<tick>.exe.
author: "ExaTrack"
date: 2026-06-30
logsource:
category: process_creation
product: windows
detection:
selection:
CommandLine|contains: '-connect '
selection_port:
CommandLine|re: '-connect\s+\d{1,3}(\.\d{1,3}){3}:1111\b'
condition: selection and selection_port
level: high
Appendix G : DONUTLoader extraction payload Script
import sys
import struct
import pefile
RESOURCE_NAME = 100 # RCDATA/100
HEADER_SIZE = 0x88
KEY_SIZE = 128
def rc4(key: bytes, data: bytes) -> bytes:
S = list(range(256))
j = 0
for i in range(256):
j = (j + S[i] + key[i % len(key)]) & 0xFF
S[i], S[j] = S[j], S[i]
out = bytearray(len(data))
i = j = 0
for n, byte in enumerate(data):
i = (i + 1) & 0xFF
j = (j + S[i]) & 0xFF
S[i], S[j] = S[j], S[i]
out[n] = byte ^ S[(S[i] + S[j]) & 0xFF]
return bytes(out)
def get_rcdata_100(pe: pefile.PE) -> bytes:
rt_rcdata = pefile.RESOURCE_TYPE['RT_RCDATA']
for entry in pe.DIRECTORY_ENTRY_RESOURCE.entries:
if entry.id != rt_rcdata:
continue
for res_id in entry.directory.entries:
if res_id.id != RESOURCE_NAME:
continue
data_entry = res_id.directory.entries[0].data
rva, size = data_entry.struct.OffsetToData, data_entry.struct.Size
return pe.get_memory_mapped_image()[rva:rva + size]
raise ValueError("RCDATA/100 not found")
def extract(path: str):
pe = pefile.PE(path)
res = get_rcdata_100(pe)
anti_sandbox_flag, persist_flag = struct.unpack_from("<II", res, 0)
key = res[8:8 + KEY_SIZE]
encrypted_payload = res[HEADER_SIZE:]
decrypted = rc4(key, encrypted_payload)
print(f"[*] anti_sandbox_flag = {anti_sandbox_flag}")
print(f"[*] persist_flag = {persist_flag}")
print(f"[*] RC4 key = {key.hex()}")
print(f"[*] payload size = {len(decrypted)} bytes")
out_path = path + ".decrypted.bin"
with open(out_path, "wb") as f:
f.write(decrypted)
print(f"[+] decrypted shellcode written to {out_path}")
if __name__ == "__main__":
if len(sys.argv) != 2:
print(f"usage: {sys.argv[0]} <saferat_loader.exe>")
sys.exit(1)
extract(sys.argv[1])