Skip to content

Commit 30a8281

Browse files
authored
Merge pull request #2179 from HackTricks-wiki/update_VECT__Ransomware_by_design__Wiper_by_accident_20260428_193227
VECT Ransomware by design, Wiper by accident
2 parents e845c06 + abaa941 commit 30a8281

1 file changed

Lines changed: 18 additions & 1 deletion

File tree

src/generic-methodologies-and-resources/basic-forensic-methodology/malware-analysis.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -609,6 +609,20 @@ struct Header {
609609
- Once verified, the bot sends a `MsgType=0` body carrying the operator-defined **group string** (e.g. `android-postboot-rt`). If the group is enabled, the C2 responds with `MsgType=2 (confirm)`, after which tasking (MsgType 5–12) begins.
610610
- Supported verbs include SOCKS-style TCP/UDP proxying (residential proxy monetization), reverse shell / single command exec, file read/write, and **Mirai-compatible DDoSBody** payloads (same `AtkType`, `Duration`, `Targets[]`, `Flags[]` layout).
611611

612+
## Partial-encryption ransomware: lost stream-cipher nonces
613+
614+
Some ransomware families partially encrypt files for speed, but when they use a **stream cipher** independently on multiple chunks, **every encrypted region needs its own persisted nonce/IV**. If the sample generates a fresh nonce per chunk and overwrites the same 12-byte buffer inside the loop, then appends only the final value to disk, the previous chunks become **cryptographically unrecoverable** even if the attacker later shares the key.
615+
616+
Typical broken pattern:
617+
618+
```c
619+
for (i = 0; i < 4; i++) {
620+
randombytes_buf(nonce, 12); // same buffer reused each round
621+
crypto_stream_chacha20_ietf_xor(chunk, chunk, len, nonce, key);
622+
}
623+
write(fd, nonce, 12); // only the last nonce survives
624+
```
625+
612626
## References
613627
614628
- [Unit42 – Evolving Tactics of SLOW#TEMPEST: A Deep Dive Into Advanced Malware Techniques](https://unit42.paloaltonetworks.com/slow-tempest-malware-obfuscation/)
@@ -628,5 +642,8 @@ struct Header {
628642
- Kimwolf Android TV Botnet: ENS-Based C2 Evasion, TLS+ECDSA C2 Protocol, and Large-Scale Proxy/DDoS Operations – [blog.xlab.qianxin.com](https://blog.xlab.qianxin.com/kimwolf-botnet-en/)
629643
- [Check Point Research – GachiLoader: Defeating Node.js Malware with API Tracing](https://research.checkpoint.com/2025/gachiloader-node-js-malware-with-api-tracing/)
630644
- [Nodejs-Tracer – GitHub](https://github.com/CheckPointSW/Nodejs-Tracer)
645+
- [Check Point Research – VECT: Ransomware by design, Wiper by accident](https://research.checkpoint.com/2026/vect-ransomware-by-design-wiper-by-accident/)
646+
- [Libsodium documentation – ChaCha20 stream cipher APIs](https://doc.libsodium.org/advanced/stream_ciphers/chacha20)
647+
- [RFC 8439 – ChaCha20 and Poly1305 for IETF Protocols](https://www.rfc-editor.org/rfc/rfc8439)
631648
632-
{{#include ../../banners/hacktricks-training.md}}
649+
{{#include ../../banners/hacktricks-training.md}}

0 commit comments

Comments
 (0)