hunting-suspicious-powershell-execution
Hunts malicious PowerShell using script-block (EID 4104) and module logging:
v1.0.03 התקנות+3 ב-7 ימים24 כוכביםApache-2.0סונכרן לפני 10 שעות
התקנה
עדיין אין לכם את ה-CLI של NotHoly? התקינו אותו קודם.
$ curl -fsSL https://notholy.com/install.sh | sh$ notholy skills install meltedinhex/hunting-suspicious-powershell-executionנכתב אל ~/.notholy/skills אחרי בדיקת החתימה וה-SHA-256.
חתימהחתום, ed25519
חבילה5c2a893c…63805edb
5c2a893c02b6…b76563805edb4 קבצים · 3.4 KBסריקהבינוני7 ממצאים
- command.pipe_to_shellSKILL.md:57
- command.base64_execSKILL.md:58
- command.pipe_to_shellSKILL.md:87
מקורgithub.com/meltedinhex/analyst-ai-pack/tree/main/skills/hunting-suspicious-powershell-execution@da7600a
הפריט הזה עדיין לא נכתב בעברית, ולכן הוא מוצג בשפה אחרת: English.
בעמוד הזה
When to Use
- You have PowerShell script-block (Event ID 4104) and/or module logging and want to hunt abuse.
- You are testing a hypothesis that attackers use encoded commands, download cradles, or AMSI/logging bypasses.
- You need to score and decode a large volume of PowerShell events into a triage queue.
Do not use simple keyword blocklists as the sole method — admins legitimately use many of the same cmdlets; score combinations and decode before judging.
Prerequisites
- Script-block logging enabled (Event ID 4104) and exported to a queryable store.
- A baseline of normal administrative PowerShell for your environment.
Workflow
Step 1: Collect script-block events
Pull EID 4104 script-block text (and EID 4103 module logging) over the hunt window. Reassemble multi-part script blocks before analysis.
Step 2: Score suspicious constructs
Weight combinations rather than single keywords: -EncodedCommand, IEX/Invoke-Expression
with Net.WebClient/Invoke-WebRequest, FromBase64String, -w hidden -nop, AMSI strings,
and [Ref].Assembly reflection.
python scripts/analyst.py score events.jsonStep 3: Decode payloads
Base64-decode -EncodedCommand (UTF-16LE) and recover layered encodings to read the real
intent (download URLs, in-memory loaders).
Step 4: Baseline and pivot
Compare against normal admin activity; for survivors, pull the parent process, user, host, and network connections to confirm.
Step 5: Confirm and operationalize
Validate true positives, escalate to IR, and convert the scoring logic into a detection rule.
Validation
- High-score events decode to coherent malicious intent, not benign admin scripts.
- Multi-part script blocks are reassembled before scoring (no truncated false negatives).
- Confirmed cases tie to a parent process and user consistent with intrusion.
Pitfalls
- Flagging single keywords (
IEXalone) and drowning in admin noise. - Forgetting
-EncodedCommandis UTF-16LE, producing garbled decodes. - Ignoring AMSI/logging-bypass attempts that precede the real payload.
References
- See
references/api-reference.mdfor the scorer/decoder. - Script-block logging docs and ATT&CK T1059.001 (linked in frontmatter).
הקבצים בגרסה הזו
references/11.3 KB
- api-reference.md1.3 KB
scripts/13.1 KB
- analyst.py3.1 KB
- LICENSE340 B
- SKILL.md3.2 KB
הרשאות
| הרשאה | הוצהר | נמצא בסריקה |
|---|---|---|
| קורא קבצים | לא | לא |
| כותב קבצים | לא | לא |
| מריץ פקודות shell | כן | כן |
| משתמש ברשת | כן | כן |
| משתמש במחברים | לא | לא |
| שולט בדפדפן | לא | לא |
ממצאי הסריקה
נבדק ב-13 בנוב׳ 2026
- בינוניתפקודה · command.pipe_to_shellSKILL.md:57
- בינוניתפקודה · command.base64_execSKILL.md:58
- בינוניתפקודה · command.pipe_to_shellSKILL.md:87
- בינוניתקובץ · סקריפט הרצה שמגיע עם הסקילscripts/analyst.py
- בינוניתפקודה · command.base64_execscripts/analyst.py:20
- בינוניתפקודה · command.pipe_to_shellscripts/analyst.py:21
- מידעקישור · קישורים לדומיינים חיצוניים
סריקה נקייה מורידה את הסיכון, אבל לא מוכיחה שהחבילה בטוחה. כדאי לקרוא מה מתקינים.
| גרסה | פורסמה | Commit | SHA-256 | חתימה | שינוי בהרשאות |
|---|---|---|---|---|---|
| v1.0.0 | 13 בנוב׳ 2026 | da7600a | 5c2a893c | חתומה | – |
עוד מ-meltedinhex
הכול מהמפרסם הזה- writing-yara-rules-from-reversed-codemeltedinhex/writing-yara-rules-from-reversed-code4
- validating-detections-with-atomic-testsmeltedinhex/validating-detections-with-atomic-tests4
- writing-suricata-and-snort-rulesmeltedinhex/writing-suricata-and-snort-rules3
- writing-sigma-detection-rulesmeltedinhex/writing-sigma-detection-rules3
עוד בקטגוריה DFIR וציד איומים
לקטגוריה- hunting-for-command-and-control-beaconingmukul975/hunting-for-command-and-control-beaconing5
- audit-context-buildingtrailofbits/audit-context-building4
- incident-response-forensicssecurityskills/incident-response-forensics3
- extracting-credentials-from-memory-dumpmukul975/extracting-credentials-from-memory-dump3
- analyzing-browser-forensics-with-hindsightmukul975/analyzing-browser-forensics-with-hindsight3
- forensics-ctfaeondave/forensics-ctf3
שאלו כל מה שהסקופ מאפשר.
יוצרים חשבון, מוסיפים קרדיטים ושואלים את השאלה הראשונה בצ׳אט או בטרמינל.
- 1/3
יצירת חשבון
פרטי או חברה. אפשר לעבור לחשבון חברה אחר כך בלי לאבד יתרה או מפתחות.
פרטיחברה - 2/3
הוספת קרדיטים
בכרטיס אשראי. תשלום לפי טוקן, בלי מנוי.
$5.00טעינה מינימלית - 3/3
שאלה ראשונה
בצ׳אט, או להתקין את ה-CLI ולהריץ notholy login בטרמינל.
$ notholy login