मुख्य सामग्री पर जाएँ
Skillpedia
एनालिसिस और स्प्रेडशीट35k · #7646

analyzing-powershell-script-block-logging

यह क्या करती है

यह टूल PowerShell logs का विश्लेषण करके संदिग्ध या छिपाए गए कमांड खोजता है। यह उन तकनीकों को ढूंढता है जिनसे हैकर Windows पर खतरनाक कोड चलाते हैं।

कब इस्तेमाल करें

  • ✓किसी सुरक्षा घटना की जांच करते समय।
  • ✓खतरनाक गतिविधि पकड़ने के लिए अलर्ट बनाते समय।
  • ✓यह देखने के लिए कि सुरक्षा सिस्टम ज्ञात हमले पकड़ पा रहा है या नहीं।

Skill का लिंक

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

इसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।

कैसे इस्तेमाल करें

सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।

पेस्ट करने के लिए तैयार मैसेज

इस skill से मेरी मदद करो: https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/analyzing-powershell-script-block-logging/SKILL.md इस लिंक की SKILL.md फ़ाइल पढ़ो और मेरे काम में उसके निर्देशों का पालन करो।
क्या आप चाहते हैं कि आपका AI ऐसी skills खुद ढूँढे?मुफ़्त Skillpedia MCP इंस्टॉल करें: बस एक लाइन, और हर काम से पहले यह 15,000+ skills में खोजता है।1 मिनट में इंस्टॉल करें →

AI से क्या माँगें: उदाहरण

“इस PowerShell log फ़ाइल का विश्लेषण करो और बताओ कि इसमें कुछ संदिग्ध है या नहीं।”

हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।

यह कैसे काम करती है

टूल PowerShell logs पढ़ता है, टुकड़ों में बंटे स्क्रिप्ट हिस्सों को जोड़ता है, और आम हमले के पैटर्न खोजता है, जैसे encoded कमांड या सुरक्षा बंद करने की कोशिश।

तकनीकी सामग्री (मूल 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, का गलत इस्तेमाल करके हमला करते हैं, बिना कोई अलग खतरनाक सॉफ़्टवेयर इंस्टॉल किए।

इस संदर्भ में 'entropy' क्या है?

यह मापता है कि कोई टेक्स्ट कितना रैंडम या 'उलझा हुआ' दिखता है। ज़्यादा entropy वाला टेक्स्ट इशारा कर सकता है कि कमांड को इसलिए encode किया गया है ताकि उसका असली मकसद छिप जाए।

जानकारी

लेखक का मूल विवरण

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

क्या यह skill काम की है?

0

लॉग इन करें वोट करने के लिए।

कमेंट

  • …

इस repository की और skills

मिलती-जुलती skills