$npx -y skills add meltedinhex/analyst-ai-pack --skill extracting-and-classifying-stringsExtracts ASCII and Unicode strings from a binary and classifies them into
| 1 | # Extracting and Classifying Strings |
| 2 | |
| 3 | ## When to Use |
| 4 | |
| 5 | - You are triaging a sample and want quick investigative leads from its readable strings. |
| 6 | - You need both ASCII and UTF-16LE (Unicode) strings, which many tools miss by default. |
| 7 | - You want strings grouped by meaning (URLs, paths, registry, commands) rather than a flat dump. |
| 8 | |
| 9 | **Do not use** plaintext strings as the whole story for packed/obfuscated samples — the useful |
| 10 | strings may be encrypted; pair with entropy checks and deobfuscation (FLOSS) when the dump is |
| 11 | sparse. |
| 12 | |
| 13 | ## Prerequisites |
| 14 | |
| 15 | - Python (stdlib) or `strings`/FLOSS; the sample handled inertly in the lab. |
| 16 | |
| 17 | ## Safety & Handling |
| 18 | |
| 19 | - Extract strings from the inert file; never execute the sample. |
| 20 | - Defang any URLs/IPs before putting them in a report or ticket. |
| 21 | |
| 22 | ## Workflow |
| 23 | |
| 24 | ### Step 1: Extract ASCII and Unicode strings |
| 25 | |
| 26 | Pull printable runs at a minimum length (default 4–5) for both ASCII and UTF-16LE encodings to |
| 27 | avoid missing Windows wide strings. |
| 28 | |
| 29 | ```bash |
| 30 | python scripts/analyst.py strings sample.bin --min-len 5 |
| 31 | ``` |
| 32 | |
| 33 | ### Step 2: Classify by category |
| 34 | |
| 35 | Bucket strings into URLs, IPs, domains, file paths, registry keys, mutex/event names, suspicious |
| 36 | commands, and API names so leads surface immediately. |
| 37 | |
| 38 | ### Step 3: Prioritize leads |
| 39 | |
| 40 | Promote network indicators, command lines, and suspicious API references to the top; defang |
| 41 | network artifacts for safe handling. |
| 42 | |
| 43 | ### Step 4: Recognize obfuscation |
| 44 | |
| 45 | A near-empty or junk-only dump signals packing/string obfuscation; route to entropy analysis and |
| 46 | FLOSS/manual deobfuscation. |
| 47 | |
| 48 | ## Validation |
| 49 | |
| 50 | - Both ASCII and Unicode strings are extracted (Windows wide strings are not missed). |
| 51 | - Strings are grouped into useful categories, not a flat list. |
| 52 | - A sparse/garbage dump is correctly read as an obfuscation signal, not "clean". |
| 53 | |
| 54 | ## Pitfalls |
| 55 | |
| 56 | - Extracting ASCII only and missing UTF-16LE strings. |
| 57 | - Treating a packed sample's empty dump as benign. |
| 58 | - Reporting live URLs/IPs without defanging. |
| 59 | |
| 60 | ## References |
| 61 | |
| 62 | - See [`references/api-reference.md`](references/api-reference.md) for the string extractor. |
| 63 | - binutils strings and FLOSS (linked in frontmatter). |