Skillpedia
التحليل وجداول البيانات35k · #7646

analyzing-powershell-script-block-logging

ما الذي تفعله

تحلل هذه المهارة سجلات PowerShell لتجد الأوامر المشبوهة أو المتنكرة. تبحث عن الأساليب التي يستخدمها القراصنة لتشغيل كود ضار على Windows.

متى تستخدمها

  • ✓عندما تحقق في حادث أمني.
  • ✓عندما تريد بناء تنبيهات تكشف الأنشطة الخطيرة.
  • ✓عندما تريد التحقق مما إذا كان الأمن يلتقط الهجمات المعروفة.

رابط المهارة

https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/analyzing-powershell-script-block-logging/SKILL.md

انسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.

طريقة الاستخدام

أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.

رسالة جاهزة للصق

استخدم هذه المهارة لمساعدتي: https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/analyzing-powershell-script-block-logging/SKILL.md اقرأ ملف SKILL.md في هذا الرابط ونفّذ تعليماته لمهمتي.
تريد أن يجد الذكاء الاصطناعي مهارات مثل هذه بنفسه؟ثبّت خادم Skillpedia MCP المجاني: سطر واحد، ويبحث في 15,000+ مهارة قبل كل مهمة.ثبّته في دقيقة واحدة →

مثال على ما تطلبه من الذكاء الاصطناعي

“حلّل ملف سجل PowerShell هذا وأخبرني إن كان هناك شيء مريب.”

5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.

كيف تعمل

تقرأ هذه المهارة سجلات PowerShell، وتجمع أجزاء النصوص التي انقسمت، وتبحث عن أنماط هجوم شائعة، مثل الأوامر المشفرة أو محاولات تعطيل الأمان.

المحتوى التقني (ملف SKILL.md الأصلي)

النص الأصلي من المؤلف، مباشرة من GitHub.

Analyzing PowerShell Script Block Logging

When to Use

  • When investigating security incidents that require analyzing powershell script block logging
  • When building detection rules or threat hunting queries for this domain
  • When SOC analysts need structured procedures for this analysis type
  • When validating security monitoring coverage for related attack techniques

Prerequisites

  • Familiarity with security operations concepts and tools
  • Access to a test or lab environment for safe execution
  • Python 3.8+ with required dependencies installed
  • Appropriate authorization for any testing activities

Instructions

  1. Install dependencies: pip install python-evtx lxml
  2. Collect PowerShell Operational logs: Microsoft-Windows-PowerShell%4Operational.evtx
  3. Parse Event ID 4104 entries using python-evtx to extract ScriptBlockText, ScriptBlockId, and MessageNumber/MessageTotal for multi-part script reconstruction.
  4. Apply detection heuristics:
    • Base64-encoded commands (-EncodedCommand, FromBase64String)
    • Download cradles (DownloadString, DownloadFile, Invoke-WebRequest, Net.WebClient)
    • AMSI bypass patterns (AmsiUtils, amsiInitFailed)
    • Obfuscation indicators (high entropy, tick-mark insertion, string concatenation)
  5. Generate a report with reconstructed scripts, risk scores, and MITRE ATT&CK mappings.
python scripts/agent.py --evtx-file /path/to/PowerShell-Operational.evtx --output ps_analysis.json

Examples

Detect Encoded Command Execution

import base64
if "-encodedcommand" in script_text.lower():
    encoded = script_text.split()[-1]
    decoded = base64.b64decode(encoded).decode("utf-16-le")

Reconstruct Multi-Block Script

Scripts split across multiple 4104 events share a ScriptBlockId. Concatenate blocks ordered by MessageNumber to recover the full script.

الأسئلة الشائعة

ما هي «Script Block Logs»؟

هي سجلات مفصلة ينشئها Windows عندما يشغّل PowerShell الأوامر، وتساعد على فهم ما نُفّذ.

ما هي تقنيات «living-off-the-land»؟

هي أساليب يسيء فيها المهاجمون استخدام أدوات Windows المشروعة، مثل PowerShell، لتنفيذ الهجمات دون الحاجة إلى تثبيت برامج ضارة إضافية.

ما المقصود بـ«الإنتروبيا» هنا؟

هي مقياس لمدى عشوائية النص أو «تشويشه». النص ذو الإنتروبيا العالية قد يدل على أن الأمر مشفّر لإخفاء غرضه الحقيقي.

التفاصيل

الوصف الأصلي من المؤلف

Parse Windows PowerShell Script Block Logs (Event ID 4104) from EVTX files to detect obfuscated commands, encoded payloads, and living-off-the-land techniques. Uses python-evtx to extract and reconstruct multi-block scripts, applies entropy analysis and pattern matching for Base64-encoded commands, Invoke-Expression abuse, download cradles, and AMSI bypass attempts.

repo: mukul975/Anthropic-Cybersecurity-Skills

الشعبية

نجوم GitHub
35k
الترتيب
#7646
الترخيص
Apache-2.0
آخر تحديث
31‏/8‏/2026

هل هذه المهارة مفيدة؟

0

سجّل الدخول للتصويت.

التعليقات

  • …

المزيد من المهارات من هذا المستودع

مهارات مشابهة