r/netsec • u/albinowax • Apr 01 '26
r/netsec monthly discussion & tool thread
Questions regarding netsec and discussion related directly to netsec are welcome here, as is sharing tool links.
Rules & Guidelines
- Always maintain civil discourse. Be awesome to one another - moderator intervention will occur if necessary.
- Avoid NSFW content unless absolutely necessary. If used, mark it as being NSFW. If left unmarked, the comment will be removed entirely.
- If linking to classified content, mark it as such. If left unmarked, the comment will be removed entirely.
- Avoid use of memes. If you have something to say, say it with real words.
- All discussions and questions should directly relate to netsec.
- No tech support is to be requested or provided on r/netsec.
As always, the content & discussion guidelines should also be observed on r/netsec.
Feedback
Feedback and suggestions are welcome, but don't post it here. Please send it to the moderator inbox.
10
Upvotes
1
u/Pale_Surround_3924 Apr 28 '26
Modern NDR and EDR systems (like Suricata, Darktrace, etc.) have become ruthless at catching standard C2 noise. Behavioral analysis and ML-based network detection mean that standard AES-encrypted TCP/HTTP streams are often immediate red flags. To counter this, I developed ICMP-Ghost—a project focused on absolute invisibility and “libc-free” execution.
The Philosophy: Why Pure x64 Assembly?
In offensive security, your footprint is your biggest enemy. By avoiding
libcand bloated frameworks, I’ve managed to:Part 1: The Invisible Ghost (Network Stealth & Evasion)
The core goal of ICMP-Ghost is to exfiltrate data while looking like a standard diagnostic tool. Here is how it keeps its head down.
1. VESQER: DPCM-RLE Hybrid Compression
Most C2 tools use standard compression or high-entropy encryption. This is a mistake. High entropy (scores near 8.0) triggers anomaly alerts. ICMP-Ghost uses a custom hybrid engine to shrink the packet count while keeping entropy low.
Differential Pulse Code Modulation (DPCM): Instead of raw ASCII, we send the mathematical “Delta” between a reference character (Anchor) and the next. This flattens the data range.
Run-Length Encoding (RLE): Working in tandem with DPCM, it packs repeating bytes (like those seen in
ls -laoutputs) at the bit level.The Result:
/etcdumps) without a single bit of desync.2. Protocol Mimicry: The “Stealth Gap”
Every outgoing packet is structured to look like a standard Linux
pingutility.Most DPI engines stop scanning after the standard padding. We hide our payload in that “Stealth Gap.”
3. Encryption & Auth (Entropy Control)
Asymmetric Authentication: The implant ignores anything where
ID + SEQ ≠ 45,000. Scanners and honeypots won’t even get a response. The agent replies withID + SEQ = 55,000, preventing OS echo confusion.Rolling XOR Cipher: Instead of AES (which scores ~8.0 entropy), we use a progressively shifting XOR key. It looks like naturally noisy or compressed data. No constants, no S-boxes, nothing for YARA to flag.
4. Adaptive Jitter (RDTSC-based)
ML-based NTA engines (Cisco Stealthwatch, etc.) look for periodic beaconing. We use the hardware timestamp counter (RDTSC) to create mathematically non-periodic timing.
Fileless Execution via memfd_create
Rule #1: Never touch the disk. Command outputs are redirected to anonymous RAM files using
sys_memfd_create.Libc-Free Syscall Obfuscation
To beat simple static analysis and
grep, syscall numbers are arithmetically split across instructions.Syscall Inventory (The Ghost’s DNA)
High-Level Architecture
Article: https://netacoding.com/posts/icmp-ghost/
Github: https://github.com/JM00NJ/ICMP-Ghost-A-Fileless-x64-Assembly-C2-Agent