---
description: Obfuscate/harden payload — evasion, encoding, anti-analysis
---

# Harden Payload

## Pre-Read Skills
```
view_file: ~/.gemini/skills/knowledge/SKILL.md
view_file: ~/.gemini/skills/mindset/SKILL.md
```

## Steps

1. **Read Current Payload**
   ```
   view_file on the payload/tool code
   ```

2. **Plan Evasion Layers**
   Using `knowledge` skill evasion techniques and `mindset` evasion upgrades table:
   - Identify current detection surface
   - Plan obfuscation chain

3. **Apply Obfuscation**
   Based on language:
   - **PHP**: Variable randomization, XOR strings, gzdeflate, hex-encoded functions
   - **Python**: PyArmor, marshal, string encryption
   - **JavaScript**: AST-based obfuscation, control flow flattening, WebAssembly
   - **Rust/Go**: Strip symbols, UPX, anti-debug checks
   - **PowerShell**: AMSI bypass, ETW patch, string concatenation

4. **Anti-Analysis Features**
   From `knowledge` skill binary hardening:
   - Sandbox detection, debugger detection
   - Self-delete, process name check
   - Indirect syscalls (Hell's Gate / Halo's Gate)

5. **Test Detection & Verify**
   Check functionality still works and detection status.

6. **Report**
   Obfuscation layers applied, before/after hash, detection status.
