Tools
T1654CyberChef
CyberChef recipe reference for SOC analysts — Base64, hex dump, XOR, regex, hash, JSON/XML prettify, and entropy calculation. The most-used daily analyst tool.
View on Graph
What CyberChef Is
CyberChef is a web-based tool developed by GCHQ for analyzing, decoding, and transforming data. It runs entirely in the browser — no data leaves your computer. It works by chaining operations (functions) into recipes (pipelines) that process data step by step.
- Every operation takes input, transforms it, and passes it to the next operation. This piped workflow mirrors how analysts think: “Decode Base64, then decompress gzip, then extract strings.”
- CyberChef has over 350 operations including encoding/decoding, compression, cryptography (encryption, hashing, HMAC), data parsing (JSON, XML, hex), extraction (regex, strings), and net-specific tools (IP format conversion, MAC parsing).
- The tool is available online (gchq.github.io/CyberChef) or can be run locally as a desktop app via a browser.
Recipe Reference — What Analysts Actually Use
Recipe 1: Decode Base64-Encoded Payloads
Malware, obfuscated PowerShell, and web shells commonly use Base64 encoding.
Recipe flow:
From Base64 → (optional) Decompress (Broil Gunzip or Raw Inflate) → View
Analyst use case: An alert shows SQLkgZQByAGUAdABhAGQAbgBhAHQAcwAgAHMAeQBzAGQAbQBpAG4A... in a PowerShell command line. Decode Base64, then decode UTF-16 to reveal the original command.
| Variant | Operation | Input Example |
|---|---|---|
| Standard Base64 | From Base64 | U0VOVElORUwvMjAyNi9FbnVt |
| Base64 with custom alphabet | From Base64 → alphabet field | Base64 with -_ instead of +/ (URL-safe) |
| Base64 multiple iterations | From Base64 x3 | Common anti-analysis — encode multiple times |
| Base64 in two parts | Concatenate parts, then From Base64 | Split across HTTP headers or cookie values |
Recipe 2: XOR Brute Force / Known Key Decryption
Malware often uses single-byte XOR or multi-byte XOR to obfuscate strings.
Recipe flow:
XOR Brute Force (or XOR) → Output
Single-byte XOR find key:
Input: 1b3c120202647d15033c5c5d12797d151b0508040b3c6465
Operation: XOR Brute Force → Key length 1 → Check output for readable text
Multi-byte XOR decode:
Input (hex): a1b2c3d4e5f6a1b2c3d4e5f6
Operation: XOR → Key: <known key> → Output
Analyst use case: A sample contains data that looks like random bytes but has periodic patterns. Single-byte XOR brute force with key length 1 reveals a readable string — the malware command string.
Recipe 3: Hex Dump and Reverse
Malware samples, shellcode, and network traffic often need hex inspection.
Recipe flow:
To Hex (or From Hex) → (optional) To Hexdump → View
| Operation | What It Does | When to Use |
|---|---|---|
| To Hex | Convert data to hex string | View binary data in hex format |
| From Hex | Convert hex string to binary/data | Reconstruct executable, file, or original data |
| To Hexdump | Format as standard hex dump (offset + bytes + ASCII) | Analyze shellcode, PE headers, network packet payloads |
| From Hexdump | Convert hex dump back to binary | Reconstruct from analyzer output, tcpdump payload |
Analyst use case: A Wireshark PCAP extract shows bytes 4D 5A 90 00 03 00 00 00 04 00 00 00 FF FF 00 00 B8 00 00 00 00 00 00 00 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 .... The 4D 5A (MZ) header confirms it is a Windows PE executable. Use From Hex to extract and analyze the binary.
Recipe 4: Hash Computation and Verification
Recipe flow:
Input data → (select hash) MD5/SHA1/SHA256/SHA512 → Output
| Operation | Use | Length |
|---|---|---|
| MD5 | Quick checksum, malware hash lookup (VirusTotal) | 128 bits (32 hex chars) |
| SHA1 | Git, file integrity, legacy checksum | 160 bits (40 hex chars) |
| SHA2 (256) | Modern file integrity, certificate signatures | 256 bits (64 hex chars) |
| SHA2 (512) | Higher security requirements | 512 bits (128 hex chars) |
| NT Hash | Windows NTLM password hash format | 32 hex chars |
Analyst use case: A file was downloaded from a suspicious URL. Compute its SHA256 hash and compare against known malware hashes in your threat intel platform (like MISP) or on VirusTotal.
Recipe 5: String Extraction
Recipe flow:
Input → Strings → (optional) Filter → Extract
| Operation | What It Extracts | Configuration |
|---|---|---|
| Strings | Human-readable strings from binary data | Minimum length (default 4) |
| Extract IP addresses | IPv4 and IPv6 addresses from text | Regex filter \b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b |
| Extract URLs | URL patterns from text/data | https?://[^\s"'<>]+ |
| Extract email addresses | Email patterns | [a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,} |
| Extract file paths | File system paths from text | Both Windows and Unix paths |
Analyst use case: A memory dump file (analyzed with Volatility). Run Strings to extract all readable strings, then Extract URLs to find C2 endpoints, then Extract IP addresses to find all IPs in the sample.
Recipe 6: JSON / XML Prettify and Parse
Logs, API responses, and configuration files are frequently in JSON or XML format.
Recipe flow:
Input (minified JSON/XML) → JSON to CSV or Syntax highlighter → Output
| Operation | What It Does |
|---|---|
| Syntax highlighter | Colorize JSON, XML, SQL, Python, or other formats |
| JSON to CSV | Convert JSON array to CSV format for spreadsheet analysis |
| XML to JSON | Convert XML structure to JSON representation |
| JPath expression | Extract specific elements from JSON using JPath queries |
| Defang URL/Email | Neutralize malicious URLs for documentation |
Recipe 7: Entropy Calculation
Entropy measures randomness. High-entropy data is often compressed, encrypted, or encoded — characteristic of malware payloads.
Recipe flow:
Input → Entropy → Output (1-8 scale)
Entropy interpretation:
| Entropy Value | Likely Meaning |
|---|---|
| 0-2.5 | Plain text, known file format headers, sparse data |
| 2.5-4.5 | Compressed data, packed executables, encoded text |
| 4.5-6.0 | Encrypted data, high-compression archives, randomized data |
| 6.0-8.0 | Encrypted data, cryptographically random data |
Analyst use case: You have a suspicious file with a .txt extension but entropy of 7.2. That is not plain text — it is compressed, encrypted, or encoded data.
Recipe 8: Defang URLs and Emails
When documenting findings, you need to represent malicious URLs and emails without making them clickable.
Recipe flow:
Input URL → Defang URL → Output
| Input | Output |
|---|---|
https://malware.com/payload.exe | hXXps://malware[.]com/payload[.]exe |
attacker@evil.com | attacker[@]evil[.]com |
192.168.1.100 | 192[.]168[.]1[.]100 |
Quick Reference — Most Common Operations
| Category | Operation | Hotkey | Description |
|---|---|---|---|
| Decode | From Base64 | F1 | Decode Base64-encoded data |
| Decode | From Hex | F2 | Convert hex string to binary |
| Encode | To Base64 | F3 | Encode data to Base64 |
| Encode | To Hex | F4 | Convert binary to hex string |
| Crypto | XOR | F5 | XOR data with a key |
| Crypto | XOR Brute Force | F6 | Brute force single-byte XOR key |
| Hash | SHA2 (256) | F7 | Compute SHA256 hash |
| Hash | MD5 | F8 | Compute MD5 hash |
| Extract | Strings | F9 | Extract printable strings |
| Compress | Gunzip | F10 | Decompress gzip-compressed data |
| Net | Defang URL | F11 | Defang URL |
| Analyze | Entropy | F12 | Calculate Shannon entropy |
Recipe Combinations — Common Analyst Workflows
Malware String Analysis
Input: Suspicious file/sample
1. Entropy → Check if packed/encrypted
2. Strings → Extract all strings
3. Extract URLs → Find C2 endpoints
4. Extract IP addresses → Find all IPs
5. From Base64 → Decode any Base64-encoded strings found
6. XOR Brute Force → Try single-byte XOR on obfuscated sections
7. Output: C2 domains, IPs, XOR keys, plaintext strings
Web Shell / PHP Shell Analysis
Input: Suspected web shell PHP file
1. Syntax highlighter → Check for malicious PHP code
2. From Base64 → Decode any Base64 payloads
3. Strings → Extract readable content (credentials, IPs, timestamps)
4. Defang URL → Create documentation-safe version
5. Output: Confirmation of malicious intent + IOC extraction
PCAP Payload Extraction
Input: Hex dump from packet capture
1. From Hexdump → Convert to binary
2. From Hex (if hex only) → Convert hex string to binary
3. (Optional) To Hexdump → Verify reconstruction
4. Strings → Extract readable content
5. Output: Reconstructed file or payload
Related
- Azure Sentinel — detection and response for T1654 techniques
- Elastic Security — detection and response for T1654 techniques
- Log Sources Overview — covers the log sources overview concepts
