Tuesday, April 29, 2025

SSDT Hooking: A Personal Walkthrough of Kernel-Mode Intrigue (Uroboros Echoes)

 

 

SSDT Hooking: A Personal Walkthrough of Kernel-Mode Intrigue (Uroboros Echoes)

 

 

“To understand the immeasurable, the mind must be extraordinarily quiet, still.”
— Jiddu Krishnamurti

 

By Seeker(李标明) China

Independent Malware Analyst & Researcher

Download the Full Report (PDF)


Prologue: The Temple and the Kernel

Recently, I still climbed a mountain and visited the temple again and again, as you know from my last report, the IDT hooking report mentioned. Here I didn’t give up but kept moving to SSDT hooking; everything is very subtle and slow.

 

After discovering the IDT hooking, I got a bad cold, and I moved more slowly on my own kernel research. I couldn’t even think, and I also did not buy medicine but tried to drink a lot of water. And some stuff about driver knowledge I also need to learn. Sometimes I remembered I strongly felt the energy conversion from one place to another in my body. I felt good when I woke up, which was the only time I really felt those things deeply. I am also honestly saying: in the temple, I felt my finger and heart beating music-like, the feeling stronger than before, and now I like to do internal observation.


Sample choice: Uroboros

Yeah, it’s still the nation-state group APT called Turla.

 

Sample md5: ed785bbd156b61553aaf78b6f71fb37b                          


 

SSDT Hooking: the key and flow

KiSystemServiceStart is a critical internal function in the Windows kernel that acts as the entry point for system calls (syscalls) made from user mode to kernel mode. Due to the user-mode-to-kernel-mode flow, it happened before KeServiceDescriptorTable, so I tried to look for what happened inside.

 

As you see, this instruction loads the address of KeServiceDescriptorTable into register r10. The table KeServiceDescriptorTable holds the service descriptor table (SDT) for system calls.

Fig.1 snippet nt!KiSystemServiceStart
 

 

Following the base address to explore the structure of KeServiceDescriptorTable, which includes the ServiceTableBase (fffff800`02aad400) and Number of Services (hex 191 = 401 services).
Note: Debug on Windows 7 x64.

Fig.2 the structure of KeServiceDescriptorTable

 

 

Using the “dps fffff800`02aad400 L191” to dump memory as pointers and symbols, do it with the base address of the KiServiceTable (the SSDT) and L191 (decimal 401 entries). The highlighted values do not point to valid kernel code addresses (i.e., not within the ntoskrnl.exe or other legitimate kernel module address ranges like fffff800... or fffff880... etc.). And there are VA Type: NonAddressable and Memory Access Error.

Fig.3 invalid kernel code addresses

 

Conclusion: It is a malicious driver that has overwritten some SSDT entries and redirected these syscalls for control/monitoring. Based on the memory entries, this strongly implies that some SSDT entries have been hooked or tampered with.

 

 

In this analysis, I identified overwritten entries in the System Service Descriptor Table (SSDT), clearly demonstrating active SSDT hooking behavior by a kernel-mode component. While I did not pursue full tracing of the hook destination in this report, this confirms the presence of traditional kernel-level persistence — a technique historically used by advanced APTs such as Turla. This work follows my prior research into IDT hooking and continues my exploration of legacy rootkit techniques that remain relevant in modern threat landscapes.

 

Epilogue: What the Kernel Taught Me

There’s no other best solution but to understand what it is.


“Do or do not, there is no try.”
Master Yoda

End of Report

Labels: , , , ,

Wednesday, April 23, 2025

From SSDT to IDT: A Personal Walkthrough of Kernel-Mode Intrigue (Uroboros Echoes)

 

From SSDT to IDT: A Personal Walkthrough of Kernel-Mode Intrigue (Uroboros Echoes)

 

 

“To understand the immeasurable, the mind must be extraordinarily quiet, still.”
— Jiddu Krishnamurti

 

By Seeker(李标明) China

Independent Malware Analyst & Researcher

Download the Full Report (PDF)


Prologue: The Temple and the Kernel

Recently, I climbed a mountain and visited the temple before sitting down at my machine. The mountain I walked around and stood at a place to watch the trees, flowers, and feel the air flowing, which, by the way, let me get close to nature to clear my mind. And all the things running in my brain to think of the kernel-mode security, I sucked them and shifted from user mode to kernel mode. What is it? How doesn’t it work? What’s the difference between the user mode and kernel mode? And so on, I strongly felt that everything was moving forward slowly and subtly. It seems that something rebuilt my whole mindset, and it took too much energy from my body; I felt very tired. That’s why I came there and found a place to close my eyes, sit, and listen to my heart and pulse beating, and all the things became silent and body-like music, and the birds were singing the song very beautifully. Yeah, I become quieted again. And the habit I changed it to was coming back from the temple and taking a hot shower and drinking green tea or making a cup of coffee and then jumping into the water of kernel mode.


Sample choice: Uroboros

In order to put my research into practice, I began to learn from the history of rootkits. At the beginning, I first chose WinRing0.sys to study a kernel-mode sample without malicious but powerful code. A little bit moving, I picked Uroboros as my object of research, which is from the nation-state group APT called Turla.

 

Yeah, I have to say that Turla's ability should be respected, and the strong feeling I got from research later, even honestly, took my tears at a certain moment. I felt it was not only technique but spirit; it means a lot, and I suddenly realized the knowledge I mastered was the surface skill, but I did quickly turn to keep moving and seeking…

 

Sample md5: ed785bbd156b61553aaf78b6f71fb37b                          


Initial Assumptions: The Classic Hook Trap

Like many analysts, I began by assuming the most likely culprit: an SSDT (System Service Descriptor Table) hook. But the NtQuerySystemInformation function did not behave as expected. Something was off. When I disassembled it, I saw

Fig.1 suspicious sign

 

I suddenly become aware of the suspicious sign, the branching to the "?? ::NNGAKEGL::`string'" region. The control flow conditionally jumps from NtQuerySystemInformation to this ?? ::NNGAKEGL::\string'+0x3edd0`:This is not normal for a clean NtQuerySystemInformation. Comparing with the original design in ntoskrnl.exe, I had found nothing.

Fig.2 comparing to the original design

 

The symbol ?? ::NNGAKEGL::'string can be especially misleading — it looks strange, almost like obfuscation or injected garbage at first glance.

 

At first glance, my analysis of NtQuerySystemInformation hinted at something darker. The control flow appeared altered. There were signs — unexpected strings like ?? ::NNGAKEGL:: string, jumps that seemed to bypass logic.

 

I thought, is this a malicious code here?. But something told me not to jump to conclusions.


Shifting Perspective: uf and the Real Path

I continued to disassemble it. I saw further and found the real implementation under my nose:

Fig.3 disassemble with NtQuerySystemInformation

 

This led me to ExpQuerySystemInformation.

Fig.4 disassemble with ExpQuerySystemInformation.

 

Inside ExpQuerySystemInformation, I found these:

1. nt!_security_cookie

2. Call NT!ProbeForWrite

3. nt! MmUserProbeAddress

4. nt!_imp_CiInitialize <PERF>

 

This wasn’t malicious. It was secure. The syscall validated its parameters and guarded memory boundaries.

 

Until now, I haven’t found anything. I did temporarily pause and went to the mountain and did running sports. I did not know how to do the next step and just checked many kernel APIs and watched.


 

IDT Hooking: BSOD And int 0C3h

 

I continued to list modules with the command “lm” and found the unloaded modules, including Uroboros.sys, so I asked myself, “Am I wrong? What’s happened?” Naturally, I wanted to know and check if the Uroboros was still running, so I entered “g” in Windbg as follows.

Fig.5 lm and g

 

But suddenly I triggered a BSOD, and I was thinking, What's happening?" Many seconds later, it surprised me that the OS still rebooted normally and the service already existed.

Fig.6 BSOD And Persistence Service

 

This thing startled me; from user mode to kernel mode, it’s a whole different realm. And then it seems that it warned me of another thing: malware knows me, debugs, and does anti-memory forensics and anti-analysis strategies at a low level? So I tried to find which kernel API can be hooked. I checked, nt!IoCreateDevice as follows.

Fig.7 IDT hooking

 

It startled me again; the key finding, the presence of int 0C3h inside IoCreateDevice, is absolutely not normal behavior. And then, in order to check it out, I compared the source code and the standard API. 100%, I was sure. Yeah, as you know, asking AI, what’s this technique?

 

It told me IDT Hooking: Interrupt Descriptor Table (IDT) is used by the processor to manage interrupt handling. When you see an interrupt like int 0C3h, it typically means that a custom interrupt handler has been placed at that entry in the IDT.

 

I was very excited for this discovery! And I want to know more inside. I continued to ask and enter “!idt –a” to look for the address IDT.

Fig.8 the address IDT

 

It was a custom interrupt — and not a standard one. Absolutely a custom IDT hook shellcode, it did. Hooking the int 0C3h interrupt vector in the IDT (Interrupt Descriptor Table)

Fig.9 a custom IDT hook shellcode

 

It's a textbook stealth IDT shellcode behavior. It looks handcrafted and highly suspicious — likely part of a rootkit's custom communication or hook mechanism.

 

Yeah, but here I had to pause. The night has fallen, and my body tells me about my thirst for food. But I wanted to talk to you silently: "I dreamed of chasing a snake during my lunch break."


Beyond the SSDT: Calculating Truth

I went further and began examining KiServiceTable:

dq nt! KiServiceTable L20

 

The entries were cryptic. I misread the format at first, believing the addresses were direct. I paused. Then recalculated based on the syscall base offset logic. I used the wrong formula to calculate the address in 64-bit Win7 but tried many times and finally found the right way. Kernel-mode security research needs very clear and real deep understanding.

Fig.10 the entry calculation formula


Inner Realization: The Path is Not Always Obvious

This wasn’t just a reverse engineering task. It was a meditation. I saw how my early assumptions clouded my vision. I rushed to find hooks, like chasing shadows in the fog.

 

Only when I slowed down, let go of judgment, and followed the flow calmly did I see the truth.

 

That let me remember about 12 years ago, I did research on the vision of Jiddu Krishnamurti, He often said, Go with your heart and mindset. Seeing without judgment.


Epilogue: What the Kernel Taught Me

I went back to the mountain and the temple again and again; the habit, the vision, and the mindset rebuilt as time passed.

What the important things I learned were

1.     Unknown is the known, I need to do it with curiosity and courage.

2.     Kernel-mode Security is not quick wins; it’s a whole different realm — one of architectural thinking and clarity. Keep learning, being silent, and embracing the slow pace. it is not surface-level tricks.

3.     Being fully present and lonely is real.

 

The most important thing is a pause, not an end but a journey. To be honest with yourself.

“Do or do not, there is no try.”
Master Yoda

End of Report

Labels: , , , ,

Tuesday, April 8, 2025

The Evolution of APT36’s Crimson RAT: Tracking Variants and Feature Expansion Over the Years

 



“To understand the immeasurable, the mind must be extraordinarily quiet, still.”
— Jiddu Krishnamurti

 

By Seeker(李标明) China

Independent Malware Analyst & Researcher

Download the Full Report (PDF)


Summary

 

APT36, also known as The Transparent Tribe, ProjectM, Mythic Leopard, or Earth Karkaddan, is a cyber espionage threat organization associated with Pakistan. The organization has carried out cyber espionage activities against the Indian defense, government, and education sectors.

 

Recently I have been focused on a many-year Crimson RAT of variants about APT36. It is a very intriguing thing we can observe: the history of evolution about Crimson RAT variants, which goes from the basic functionalities to becoming a professional design, which goes from the simple to the complicated, the below I would like to share with them.

 

 

Technique analysis


Crimson RAT V1.0.0.0
At version 1.0.0.0, I collected three variants; they were named rlbwrarhsa, drmaiprave, and jivarthr_edis. And compiled in different years, yeah, such as 2019, 2021, and 2023. The basic functionalities are designed as remote access trojans: upload GIF, download file, delete a file, kill a process, capture screen, enumerate and exfiltrate processes information, and so on. And the command's response from the server only used simple string prefix “rlbwrarhsa-“ concatenation, string insertion, and changes to the logic conditions to do obfuscation for evasion. After all, it uses string comparisons and tries to do evasion. And the main common feature or skill is using different characters, like “| or !,” to split strings to handle obfuscation.

Fig1. Command obfuscation technique (2019,2021,2023)

 

The above different variants are very similar, and the structure, the functionalities, the logic, and the design are not to change a lot. I do more detailed work to check them out and make a table to record as follows.

Fig.2 the detailed functionalities table

 

 

Crimson RAT V2.1.0.0

At version v2.1.0.0, I do research on the name Kosovo; obviously, it is a big change. The structure, the functionalities, the logic, and the design become more complicated. From the below, we can see a more extensive functionalities list on the table, which is shared with different commands in Logic Branch; the structure and the design also become complicated.

Fig.3 the extensive functionalities

 

The extensive functionalities

It’s a surprise that the Crimson RAT variant embedded a command for loading the malware usbworm. Which means it can do lateral movment through removable media like usbAnd it’s intent on expanding the surface of attacking and maybe more commands to add for loading other network weapons through the Crimson RAT channel in the future. It shows that APT36 plans to make the basic RAT to support a more integrated technique design.

Fig.4 support usbworm spreading

 

Another new finding is developing a functionality for splitting a source file into multiple small files, and in real attacks, it has the requirement for exfiltrating a big file, which may be to evade the traffic detection.

Fig.5 splitting a source file

 

In order to confirm if the Crimson RAT is running, it starts a process and checks repeatedly (up to 10 times) whether the application still exists.

Fig.6 check repeatedly

 

 

The extensive evasion techniques

At version 2.1.0.0, the Crimson RAT uses ComputeStringHash to do evasion; it is a compiler-generated method that calculates a hash of a string, which can hide string comparisons and avoid static string detection.

Fig.7 hide string comparisons with ComputeStringHash

 

Another evasion technique for anti-VM/anti-analysis with querying hardware serials like Win32_BaseBoard.SerialNumber or querying CPU id information.

Fig.8 anti-VM/anti-analysis

 

The use of a byte array to store a hostname like richa-sharma.ddns[.]net instead of a plain string as version 1.0.0.0 is a common evasion technique, and the ddns[.]net is a Dynamic DNS domain, commonly used by attackers for Command & Control (C2) servers, as follows:

Fig.9 byte array set by a Dynamic DNS domain

 

 

Conclusion

From the above Crimson RAT analysis, compare the history variants of both version 1.0.0 and version 2.1.0.0. The APT36 group is also very positive about expanding their abilities and improving their exclusive network weapons according to the real attack, from the basic to professional functionalities, from the simple to complicated; we can see the threat actors are growing. Let’s pay more attention to.

 

 

MITRE ATT&CK TTP Mapping
Crimson RAT V1.0.0.0 (
rlbwrarhsa)


MITRE ATT&CK TTP Mapping
Crimson RAT V2.1.0.0 (
Kosovo)

IOCs

Files:

Name

Version

MD5

Rlbwrarhsa

v1.0.0.0

8a1f4a512fe9edbcc62ba4b1c3e08f0a

Drmaiprave

v1.0.0.0

77c29d464efcae961424ae050453ef11

jivarthr_edis

v1.0.0.0

fed22809d70062733cd1c34e16b75c05

Kosovo

V2.1.0.0

e40e0a71efd051374be1663e08f0dbd8

 

Sha256

ecd7d7a27a2a043919a233bb91e3b009c05b7c81ff132a7c29228e1c45d2b6a6

f5e7b8dddd4137ac008186a4c5e9cb644dc1bbddb61612c29c2087b1efe48974

63f96f77786b8499ce4e08a1883a1d5569563da14b507390cfcbd7b37c5dfb9a

947e75dc1f9b8a6d74a6d55afa7513ed86db907965cf0935ebb26c17f0ec6c5d

 

 

Network:
rlbwrarhsa

IP101[.]155.260.18

Default Port: 6828

 

drmaiprave

IP10[.]105.106.118

Default Port: 6188


jivarthr_edis

101[.]125.206.108

Default Port: 6859

 

Kosovo

richa-sharma.ddns[.]net

Default Port: 10101


Host:
Kosovo

pdb_path
D:\Projects\Wibemax\Windows RAT\1 Windows 10 Client\Sunny\2022-06-17 Richa\W8P Sunny\obj\Debug\Kosovo.pdb
Application.StartupPath + "\\exc.txt"

End.

Labels: , , ,