[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6AG30PDJMKYYNDAHHB9WJ2D":3,"skill-same:01M6AG30PDJMKYYNDAHHB9WJ2D":119},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":8,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":18,"categories":19,"keywords":30,"publishedAt":51,"linkOnly":52,"markdownContent":53,"markdownBody":54,"frontMatter":55,"refName":70,"commitSha":71,"skillDirectory":72,"forksCount":73,"repositoryHtmlUrl":74,"repositoryHomepageUrl":75,"ownerHtmlUrl":76,"ownerBlogUrl":77,"ownerDescription":78,"updatedAt":79,"install":80,"resources":93},"01M6AG30PDJMKYYNDAHHB9WJ2D","performing-static-malware-analysis-with-pe-studio","PEStudio 恶意软件静态分析","Performs static analysis of Windows PE malware samples using PEStudio to examine file headers, imports, strings, and resources without executing the binary, identifying packing, anti-analysis tricks, and malicious imports. Use for pre-execution triage of a suspicious Windows executable before sandbox detonation.","使用 PEStudio 对 Windows PE 恶意软件样本进行静态分析，检查文件头、导入表、字符串和资源，无需执行二进制文件，从而识别加壳、反分析技巧和恶意导入。用于可疑 Windows 可执行文件在进入沙箱引爆前的执行前分诊。","mukul975\u002FAnthropic-Cybersecurity-Skills","mukul975","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F42860185?v=4","01M6ADEQR8T5M4EEG6C67BQCWF","Mahipal","01M6ADJPMYWG1E5GM1FWBE3128",36146,"Apache-2.0",null,"https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fperforming-static-malware-analysis-with-pe-studio\u002FSKILL.md",[20,25],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BR4MYFKGCC4WCWVJ50KJ2C","安全工程师","PROFESSION","适用职业",{"categoryNo":26,"categoryName":27,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BSJ8FPTACYEEYRWQRNFXKY","安全检测工程","SCENARIO","使用场景",[31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50],"performing static malware analysis with pe studio","analysis","malware","malware analysis","static-analysis","PEStudio","PE-analysis","execution","packing","malware-analysis","reverse-engineering","malicious","engineering","file","windows","triage","cybersecurity","static analysis","sandbox","suspicious","2026-11-10 10:12:30",false,"---\nname: performing-static-malware-analysis-with-pe-studio\ndescription: >-\n  Performs static analysis of Windows PE malware samples using PEStudio to\n  examine file headers, imports, strings, and resources without executing\n  the binary, identifying packing, anti-analysis tricks, and malicious\n  imports. Use for pre-execution triage of a suspicious Windows executable\n  before sandbox detonation.\ndomain: cybersecurity\nsubdomain: malware-analysis\ntags:\n- malware\n- static-analysis\n- PE-analysis\n- PEStudio\n- reverse-engineering\nversion: 1.0.0\nauthor: mahipal\nlicense: Apache-2.0\nnist_csf:\n- DE.AE-02\n- RS.AN-03\n- ID.RA-01\n- DE.CM-01\nmitre_attack:\n- T1027\n- T1055\n- T1140\n- T1497\n- T0816\n---\n\n# Performing Static Malware Analysis with PEStudio\n\n## When to Use\n\n- A suspicious Windows executable has been collected and needs initial triage before sandbox execution\n- You need to identify imports, strings, and resources that reveal malware functionality without running the sample\n- Determining whether a PE file is packed, obfuscated, or contains anti-analysis techniques\n- Extracting indicators of compromise (hashes, URLs, IPs, registry keys) embedded in a binary\n- Classifying a sample's capabilities based on its import table and section characteristics\n\n**Do not use** for dynamic behavioral analysis requiring execution; use a sandbox (Cuckoo, ANY.RUN) for runtime behavior observation.\n\n## Prerequisites\n\n- PEStudio (free edition from https:\u002F\u002Fwww.winitor.com\u002F) installed on an isolated analysis workstation\n- Python 3.8+ with `pefile` library for scripted PE analysis (`pip install pefile`)\n- CFF Explorer or PE-bear as supplementary PE analysis tools\n- Access to VirusTotal API for hash lookups and community intelligence\n- Isolated analysis VM with no network connectivity to production systems\n- FLOSS (FireEye Labs Obfuscated String Solver) for extracting obfuscated strings\n\n## Workflow\n\n### Step 1: Compute File Hashes and Verify Sample Integrity\n\nGenerate cryptographic hashes for identification and intelligence lookup:\n\n```bash\n# Generate MD5, SHA-1, and SHA-256 hashes\nmd5sum suspect.exe\nsha1sum suspect.exe\nsha256sum suspect.exe\n\n# Check hash against VirusTotal\ncurl -s -X GET \"https:\u002F\u002Fwww.virustotal.com\u002Fapi\u002Fv3\u002Ffiles\u002F$(sha256sum suspect.exe | cut -d' ' -f1)\" \\\n  -H \"x-apikey: $VT_API_KEY\" | jq '.data.attributes.last_analysis_stats'\n\n# Get file type with magic bytes verification\nfile suspect.exe\n```\n\n### Step 2: Examine PE Headers and Section Table\n\nOpen the sample in PEStudio and inspect structural properties:\n\n```\nPEStudio Analysis Points:\n━━━━━━━━━━━━━━━━━━━━━━━━━\nFile Header:       Compilation timestamp, target architecture (x86\u002Fx64)\nOptional Header:   Entry point address, image base, subsystem (GUI\u002Fconsole)\nSection Table:     Section names, virtual\u002Fraw sizes, entropy values\n                   High entropy (>7.0) in .text\u002F.rsrc suggests packing\nSignatures:        Authenticode signature presence and validity\n```\n\n**Scripted PE Header Analysis with pefile:**\n```python\nimport pefile\nimport hashlib\nimport math\n\npe = pefile.PE(\"suspect.exe\")\n\n# Compilation timestamp\nimport datetime\ntimestamp = pe.FILE_HEADER.TimeDateStamp\ncompile_time = datetime.datetime.utcfromtimestamp(timestamp)\nprint(f\"Compile Time: {compile_time} UTC\")\n\n# Section analysis with entropy calculation\nfor section in pe.sections:\n    name = section.Name.decode().rstrip('\\x00')\n    entropy = section.get_entropy()\n    raw_size = section.SizeOfRawData\n    virtual_size = section.Misc_VirtualSize\n    ratio = virtual_size \u002F raw_size if raw_size > 0 else 0\n    print(f\"Section: {name:8s} Entropy: {entropy:.2f} Raw: {raw_size:>10} Virtual: {virtual_size:>10} Ratio: {ratio:.2f}\")\n    if entropy > 7.0:\n        print(f\"  [!] HIGH ENTROPY - likely packed or encrypted\")\n    if ratio > 10:\n        print(f\"  [!] HIGH V\u002FR RATIO - unpacking stub likely present\")\n```\n\n### Step 3: Analyze Import Address Table (IAT)\n\nIdentify suspicious API imports that indicate malware capabilities:\n\n```python\n# Extract and categorize imports\nsuspicious_imports = {\n    \"Process Injection\": [\"VirtualAllocEx\", \"WriteProcessMemory\", \"CreateRemoteThread\", \"NtCreateThreadEx\"],\n    \"Keylogging\": [\"GetAsyncKeyState\", \"SetWindowsHookExA\", \"GetKeyState\"],\n    \"Persistence\": [\"RegSetValueExA\", \"CreateServiceA\", \"SchTasksCreate\"],\n    \"Evasion\": [\"IsDebuggerPresent\", \"CheckRemoteDebuggerPresent\", \"NtQueryInformationProcess\"],\n    \"Network\": [\"InternetOpenA\", \"HttpSendRequestA\", \"URLDownloadToFileA\", \"WSAStartup\"],\n    \"File Operations\": [\"CreateFileA\", \"WriteFile\", \"DeleteFileA\", \"MoveFileA\"],\n    \"Crypto\": [\"CryptEncrypt\", \"CryptDecrypt\", \"CryptAcquireContextA\"],\n}\n\nfor entry in pe.DIRECTORY_ENTRY_IMPORT:\n    dll_name = entry.dll.decode()\n    for imp in entry.imports:\n        if imp.name:\n            func_name = imp.name.decode()\n            for category, funcs in suspicious_imports.items():\n                if func_name in funcs:\n                    print(f\"[!] {category}: {dll_name} -> {func_name}\")\n```\n\n### Step 4: Extract and Analyze Strings\n\nUse FLOSS for obfuscated strings and standard strings extraction:\n\n```bash\n# Standard strings extraction (ASCII and Unicode)\nstrings -a suspect.exe > strings_ascii.txt\nstrings -el suspect.exe > strings_unicode.txt\n\n# FLOSS for decoded\u002Fdeobfuscated strings\nfloss suspect.exe --output-json floss_output.json\n\n# Search for network indicators in strings\ngrep -iE \"(http|https|ftp):\u002F\u002F\" strings_ascii.txt\ngrep -iE \"([0-9]{1,3}\\.){3}[0-9]{1,3}\" strings_ascii.txt\ngrep -iE \"[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}\" strings_ascii.txt\n\n# Search for registry keys\ngrep -i \"HKLM\\\\|HKCU\\\\|SOFTWARE\\\\|CurrentVersion\\\\Run\" strings_ascii.txt\n\n# Search for file paths and extensions\ngrep -iE \"\\.(exe|dll|bat|ps1|vbs|tmp)\" strings_ascii.txt\n```\n\n### Step 5: Inspect Resources and Embedded Data\n\nExamine the PE resource section for embedded payloads or configuration:\n\n```python\n# Extract resources from PE file\nif hasattr(pe, 'DIRECTORY_ENTRY_RESOURCE'):\n    for resource_type in pe.DIRECTORY_ENTRY_RESOURCE.entries:\n        if hasattr(resource_type, 'directory'):\n            for resource_id in resource_type.directory.entries:\n                if hasattr(resource_id, 'directory'):\n                    for resource_lang in resource_id.directory.entries:\n                        data = pe.get_data(resource_lang.data.struct.OffsetToData,\n                                          resource_lang.data.struct.Size)\n                        entropy = calculate_entropy(data)\n                        print(f\"Resource Type: {resource_type.id} Size: {len(data)} Entropy: {entropy:.2f}\")\n                        if entropy > 7.0:\n                            print(f\"  [!] High entropy resource - possible embedded payload\")\n                        # Check for PE signature in resource (embedded executable)\n                        if data[:2] == b'MZ':\n                            print(f\"  [!] Embedded PE detected in resource\")\n                            with open(f\"extracted_resource_{resource_type.id}.bin\", \"wb\") as f:\n                                f.write(data)\n```\n\n### Step 6: Check for Packing and Protection\n\nDetermine if the binary is packed or protected:\n\n```bash\n# Detect packer with Detect It Easy (DIE)\ndiec suspect.exe\n\n# Check with PEiD signatures (command-line version)\npython3 -c \"\nimport pefile\npe = pefile.PE('suspect.exe')\n# Check for common packer section names\npacker_sections = {'.upx0': 'UPX', '.aspack': 'ASPack', '.adata': 'ASPack',\n                   '.nsp0': 'NsPack', '.vmprotect': 'VMProtect', '.themida': 'Themida'}\nfor section in pe.sections:\n    name = section.Name.decode().rstrip('\\x00').lower()\n    if name in packer_sections:\n        print(f'[!] Packer detected: {packer_sections[name]} (section: {name})')\n\n# Check import table size (very few imports suggest packing)\nimport_count = sum(len(entry.imports) for entry in pe.DIRECTORY_ENTRY_IMPORT)\nif import_count \u003C 10:\n    print(f'[!] Only {import_count} imports - likely packed')\n\"\n```\n\n### Step 7: Generate Static Analysis Report\n\nCompile all findings into a structured triage report:\n\n```\nDocument the following for each analyzed sample:\n- File identification (hashes, file type, size, compile timestamp)\n- Packing\u002Fprotection status and identified packer\n- Suspicious imports categorized by capability\n- Network indicators extracted from strings (IPs, domains, URLs)\n- Embedded resources and their characteristics\n- Overall threat assessment and recommended next steps (sandbox execution, YARA rule creation)\n```\n\n## Key Concepts\n\n| Term | Definition |\n|------|------------|\n| **PE (Portable Executable)** | The file format for Windows executables (.exe, .dll, .sys) containing headers, sections, imports, and resources that define how the OS loads the binary |\n| **Import Address Table (IAT)** | PE structure listing external DLL functions the executable calls at runtime; reveals program capabilities and intent |\n| **Section Entropy** | Statistical measure of randomness in a PE section; values above 7.0 (out of 8.0) indicate compression, encryption, or packing |\n| **FLOSS** | FireEye Labs Obfuscated String Solver; automatically extracts and decodes obfuscated strings that standard `strings` misses |\n| **Packing** | Compression or encryption of a PE file's code section to hinder static analysis; requires runtime unpacking stub to execute |\n| **PE Resources** | Data section within a PE file that can contain icons, dialogs, version info, or attacker-embedded payloads and configuration data |\n| **Compilation Timestamp** | Timestamp in the PE header indicating when the binary was compiled; can be forged but often reveals development timeline |\n\n## Tools & Systems\n\n- **PEStudio**: Free Windows tool for static analysis of PE files providing indicators, imports, strings, and resource inspection in a single interface\n- **pefile (Python)**: Python library for parsing and analyzing PE file structures programmatically for automated analysis pipelines\n- **FLOSS**: FireEye tool that extracts obfuscated strings from malware using static analysis techniques including stack string decoding\n- **Detect It Easy (DIE)**: Packer and compiler detection tool that identifies protectors, compilers, and linkers used to build PE files\n- **CFF Explorer**: Advanced PE editor and viewer for detailed inspection of PE headers, sections, imports, and resource directories\n\n## Common Scenarios\n\n### Scenario: Triaging a Suspicious Email Attachment\n\n**Context**: SOC receives an alert on a suspicious executable attached to a phishing email. The file needs rapid triage to determine if it is malicious before committing sandbox resources.\n\n**Approach**:\n1. Compute SHA-256 hash and query VirusTotal for existing detections and community comments\n2. Open in PEStudio and check the indicators tab for red\u002Fyellow flagged items\n3. Verify compile timestamp (future dates or dates from 1970 indicate timestamp manipulation)\n4. Check imports for VirtualAllocEx, CreateRemoteThread (injection), URLDownloadToFileA (downloader)\n5. Extract strings and search for C2 URLs, IP addresses, and file paths\n6. Check resources for embedded PE files or high-entropy data blobs\n7. Assess packing status; if packed, note the packer and plan for unpacking before deeper analysis\n\n**Pitfalls**:\n- Trusting the PE compile timestamp without corroborating evidence (timestamps are trivially forged)\n- Concluding a file is benign because it has few suspicious imports (packed malware hides real imports)\n- Missing Unicode strings by only running ASCII string extraction\n- Not checking overlay data appended after the last PE section (common hiding spot for configuration data)\n\n## Output Format\n\n```\nSTATIC MALWARE ANALYSIS REPORT\n=================================\nSample:           suspect.exe\nMD5:              d41d8cd98f00b204e9800998ecf8427e\nSHA-256:          e3b0c44298fc1c149afbf4c8996fb924...\nFile Size:        245,760 bytes\nFile Type:        PE32 executable (GUI) Intel 80386\nCompile Time:     2025-09-14 08:23:15 UTC\n\nPACKING STATUS\nPacker Detected:  None (native binary)\nSection Entropy:  .text=6.42 .rdata=4.89 .data=3.21 .rsrc=7.81\nNote:             .rsrc section entropy elevated - check resources\n\nSUSPICIOUS IMPORTS\n[INJECTION]       kernel32.dll -> VirtualAllocEx\n[INJECTION]       kernel32.dll -> WriteProcessMemory\n[INJECTION]       kernel32.dll -> CreateRemoteThread\n[EVASION]         kernel32.dll -> IsDebuggerPresent\n[NETWORK]         wininet.dll  -> InternetOpenA\n[NETWORK]         wininet.dll  -> HttpSendRequestA\n[PERSISTENCE]     advapi32.dll -> RegSetValueExA\n\nEXTRACTED INDICATORS\nURLs:             hxxps:\u002F\u002Fupdate.malicious[.]com\u002Fgate.php\nIPs:              185.220.101[.]42, 91.215.85[.]17\nRegistry Keys:    HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Run\\svchost\nFile Paths:       C:\\Users\\Public\\svchost.exe\n\nEMBEDDED RESOURCES\nResource 101:     Size=98304 Entropy=7.89 [!] Embedded PE detected\nResource 102:     Size=4096  Entropy=2.14 (configuration XML)\n\nASSESSMENT\nThreat Level:     HIGH\nClassification:   Dropper with process injection capabilities\nRecommended:      Execute in sandbox, extract embedded PE for separate analysis\n```\n","# Performing Static Malware Analysis with PEStudio\n\n## When to Use\n\n- A suspicious Windows executable has been collected and needs initial triage before sandbox execution\n- You need to identify imports, strings, and resources that reveal malware functionality without running the sample\n- Determining whether a PE file is packed, obfuscated, or contains anti-analysis techniques\n- Extracting indicators of compromise (hashes, URLs, IPs, registry keys) embedded in a binary\n- Classifying a sample's capabilities based on its import table and section characteristics\n\n**Do not use** for dynamic behavioral analysis requiring execution; use a sandbox (Cuckoo, ANY.RUN) for runtime behavior observation.\n\n## Prerequisites\n\n- PEStudio (free edition from https:\u002F\u002Fwww.winitor.com\u002F) installed on an isolated analysis workstation\n- Python 3.8+ with `pefile` library for scripted PE analysis (`pip install pefile`)\n- CFF Explorer or PE-bear as supplementary PE analysis tools\n- Access to VirusTotal API for hash lookups and community intelligence\n- Isolated analysis VM with no network connectivity to production systems\n- FLOSS (FireEye Labs Obfuscated String Solver) for extracting obfuscated strings\n\n## Workflow\n\n### Step 1: Compute File Hashes and Verify Sample Integrity\n\nGenerate cryptographic hashes for identification and intelligence lookup:\n\n```bash\n# Generate MD5, SHA-1, and SHA-256 hashes\nmd5sum suspect.exe\nsha1sum suspect.exe\nsha256sum suspect.exe\n\n# Check hash against VirusTotal\ncurl -s -X GET \"https:\u002F\u002Fwww.virustotal.com\u002Fapi\u002Fv3\u002Ffiles\u002F$(sha256sum suspect.exe | cut -d' ' -f1)\" \\\n  -H \"x-apikey: $VT_API_KEY\" | jq '.data.attributes.last_analysis_stats'\n\n# Get file type with magic bytes verification\nfile suspect.exe\n```\n\n### Step 2: Examine PE Headers and Section Table\n\nOpen the sample in PEStudio and inspect structural properties:\n\n```\nPEStudio Analysis Points:\n━━━━━━━━━━━━━━━━━━━━━━━━━\nFile Header:       Compilation timestamp, target architecture (x86\u002Fx64)\nOptional Header:   Entry point address, image base, subsystem (GUI\u002Fconsole)\nSection Table:     Section names, virtual\u002Fraw sizes, entropy values\n                   High entropy (>7.0) in .text\u002F.rsrc suggests packing\nSignatures:        Authenticode signature presence and validity\n```\n\n**Scripted PE Header Analysis with pefile:**\n```python\nimport pefile\nimport hashlib\nimport math\n\npe = pefile.PE(\"suspect.exe\")\n\n# Compilation timestamp\nimport datetime\ntimestamp = pe.FILE_HEADER.TimeDateStamp\ncompile_time = datetime.datetime.utcfromtimestamp(timestamp)\nprint(f\"Compile Time: {compile_time} UTC\")\n\n# Section analysis with entropy calculation\nfor section in pe.sections:\n    name = section.Name.decode().rstrip('\\x00')\n    entropy = section.get_entropy()\n    raw_size = section.SizeOfRawData\n    virtual_size = section.Misc_VirtualSize\n    ratio = virtual_size \u002F raw_size if raw_size > 0 else 0\n    print(f\"Section: {name:8s} Entropy: {entropy:.2f} Raw: {raw_size:>10} Virtual: {virtual_size:>10} Ratio: {ratio:.2f}\")\n    if entropy > 7.0:\n        print(f\"  [!] HIGH ENTROPY - likely packed or encrypted\")\n    if ratio > 10:\n        print(f\"  [!] HIGH V\u002FR RATIO - unpacking stub likely present\")\n```\n\n### Step 3: Analyze Import Address Table (IAT)\n\nIdentify suspicious API imports that indicate malware capabilities:\n\n```python\n# Extract and categorize imports\nsuspicious_imports = {\n    \"Process Injection\": [\"VirtualAllocEx\", \"WriteProcessMemory\", \"CreateRemoteThread\", \"NtCreateThreadEx\"],\n    \"Keylogging\": [\"GetAsyncKeyState\", \"SetWindowsHookExA\", \"GetKeyState\"],\n    \"Persistence\": [\"RegSetValueExA\", \"CreateServiceA\", \"SchTasksCreate\"],\n    \"Evasion\": [\"IsDebuggerPresent\", \"CheckRemoteDebuggerPresent\", \"NtQueryInformationProcess\"],\n    \"Network\": [\"InternetOpenA\", \"HttpSendRequestA\", \"URLDownloadToFileA\", \"WSAStartup\"],\n    \"File Operations\": [\"CreateFileA\", \"WriteFile\", \"DeleteFileA\", \"MoveFileA\"],\n    \"Crypto\": [\"CryptEncrypt\", \"CryptDecrypt\", \"CryptAcquireContextA\"],\n}\n\nfor entry in pe.DIRECTORY_ENTRY_IMPORT:\n    dll_name = entry.dll.decode()\n    for imp in entry.imports:\n        if imp.name:\n            func_name = imp.name.decode()\n            for category, funcs in suspicious_imports.items():\n                if func_name in funcs:\n                    print(f\"[!] {category}: {dll_name} -> {func_name}\")\n```\n\n### Step 4: Extract and Analyze Strings\n\nUse FLOSS for obfuscated strings and standard strings extraction:\n\n```bash\n# Standard strings extraction (ASCII and Unicode)\nstrings -a suspect.exe > strings_ascii.txt\nstrings -el suspect.exe > strings_unicode.txt\n\n# FLOSS for decoded\u002Fdeobfuscated strings\nfloss suspect.exe --output-json floss_output.json\n\n# Search for network indicators in strings\ngrep -iE \"(http|https|ftp):\u002F\u002F\" strings_ascii.txt\ngrep -iE \"([0-9]{1,3}\\.){3}[0-9]{1,3}\" strings_ascii.txt\ngrep -iE \"[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}\" strings_ascii.txt\n\n# Search for registry keys\ngrep -i \"HKLM\\\\|HKCU\\\\|SOFTWARE\\\\|CurrentVersion\\\\Run\" strings_ascii.txt\n\n# Search for file paths and extensions\ngrep -iE \"\\.(exe|dll|bat|ps1|vbs|tmp)\" strings_ascii.txt\n```\n\n### Step 5: Inspect Resources and Embedded Data\n\nExamine the PE resource section for embedded payloads or configuration:\n\n```python\n# Extract resources from PE file\nif hasattr(pe, 'DIRECTORY_ENTRY_RESOURCE'):\n    for resource_type in pe.DIRECTORY_ENTRY_RESOURCE.entries:\n        if hasattr(resource_type, 'directory'):\n            for resource_id in resource_type.directory.entries:\n                if hasattr(resource_id, 'directory'):\n                    for resource_lang in resource_id.directory.entries:\n                        data = pe.get_data(resource_lang.data.struct.OffsetToData,\n                                          resource_lang.data.struct.Size)\n                        entropy = calculate_entropy(data)\n                        print(f\"Resource Type: {resource_type.id} Size: {len(data)} Entropy: {entropy:.2f}\")\n                        if entropy > 7.0:\n                            print(f\"  [!] High entropy resource - possible embedded payload\")\n                        # Check for PE signature in resource (embedded executable)\n                        if data[:2] == b'MZ':\n                            print(f\"  [!] Embedded PE detected in resource\")\n                            with open(f\"extracted_resource_{resource_type.id}.bin\", \"wb\") as f:\n                                f.write(data)\n```\n\n### Step 6: Check for Packing and Protection\n\nDetermine if the binary is packed or protected:\n\n```bash\n# Detect packer with Detect It Easy (DIE)\ndiec suspect.exe\n\n# Check with PEiD signatures (command-line version)\npython3 -c \"\nimport pefile\npe = pefile.PE('suspect.exe')\n# Check for common packer section names\npacker_sections = {'.upx0': 'UPX', '.aspack': 'ASPack', '.adata': 'ASPack',\n                   '.nsp0': 'NsPack', '.vmprotect': 'VMProtect', '.themida': 'Themida'}\nfor section in pe.sections:\n    name = section.Name.decode().rstrip('\\x00').lower()\n    if name in packer_sections:\n        print(f'[!] Packer detected: {packer_sections[name]} (section: {name})')\n\n# Check import table size (very few imports suggest packing)\nimport_count = sum(len(entry.imports) for entry in pe.DIRECTORY_ENTRY_IMPORT)\nif import_count \u003C 10:\n    print(f'[!] Only {import_count} imports - likely packed')\n\"\n```\n\n### Step 7: Generate Static Analysis Report\n\nCompile all findings into a structured triage report:\n\n```\nDocument the following for each analyzed sample:\n- File identification (hashes, file type, size, compile timestamp)\n- Packing\u002Fprotection status and identified packer\n- Suspicious imports categorized by capability\n- Network indicators extracted from strings (IPs, domains, URLs)\n- Embedded resources and their characteristics\n- Overall threat assessment and recommended next steps (sandbox execution, YARA rule creation)\n```\n\n## Key Concepts\n\n| Term | Definition |\n|------|------------|\n| **PE (Portable Executable)** | The file format for Windows executables (.exe, .dll, .sys) containing headers, sections, imports, and resources that define how the OS loads the binary |\n| **Import Address Table (IAT)** | PE structure listing external DLL functions the executable calls at runtime; reveals program capabilities and intent |\n| **Section Entropy** | Statistical measure of randomness in a PE section; values above 7.0 (out of 8.0) indicate compression, encryption, or packing |\n| **FLOSS** | FireEye Labs Obfuscated String Solver; automatically extracts and decodes obfuscated strings that standard `strings` misses |\n| **Packing** | Compression or encryption of a PE file's code section to hinder static analysis; requires runtime unpacking stub to execute |\n| **PE Resources** | Data section within a PE file that can contain icons, dialogs, version info, or attacker-embedded payloads and configuration data |\n| **Compilation Timestamp** | Timestamp in the PE header indicating when the binary was compiled; can be forged but often reveals development timeline |\n\n## Tools & Systems\n\n- **PEStudio**: Free Windows tool for static analysis of PE files providing indicators, imports, strings, and resource inspection in a single interface\n- **pefile (Python)**: Python library for parsing and analyzing PE file structures programmatically for automated analysis pipelines\n- **FLOSS**: FireEye tool that extracts obfuscated strings from malware using static analysis techniques including stack string decoding\n- **Detect It Easy (DIE)**: Packer and compiler detection tool that identifies protectors, compilers, and linkers used to build PE files\n- **CFF Explorer**: Advanced PE editor and viewer for detailed inspection of PE headers, sections, imports, and resource directories\n\n## Common Scenarios\n\n### Scenario: Triaging a Suspicious Email Attachment\n\n**Context**: SOC receives an alert on a suspicious executable attached to a phishing email. The file needs rapid triage to determine if it is malicious before committing sandbox resources.\n\n**Approach**:\n1. Compute SHA-256 hash and query VirusTotal for existing detections and community comments\n2. Open in PEStudio and check the indicators tab for red\u002Fyellow flagged items\n3. Verify compile timestamp (future dates or dates from 1970 indicate timestamp manipulation)\n4. Check imports for VirtualAllocEx, CreateRemoteThread (injection), URLDownloadToFileA (downloader)\n5. Extract strings and search for C2 URLs, IP addresses, and file paths\n6. Check resources for embedded PE files or high-entropy data blobs\n7. Assess packing status; if packed, note the packer and plan for unpacking before deeper analysis\n\n**Pitfalls**:\n- Trusting the PE compile timestamp without corroborating evidence (timestamps are trivially forged)\n- Concluding a file is benign because it has few suspicious imports (packed malware hides real imports)\n- Missing Unicode strings by only running ASCII string extraction\n- Not checking overlay data appended after the last PE section (common hiding spot for configuration data)\n\n## Output Format\n\n```\nSTATIC MALWARE ANALYSIS REPORT\n=================================\nSample:           suspect.exe\nMD5:              d41d8cd98f00b204e9800998ecf8427e\nSHA-256:          e3b0c44298fc1c149afbf4c8996fb924...\nFile Size:        245,760 bytes\nFile Type:        PE32 executable (GUI) Intel 80386\nCompile Time:     2025-09-14 08:23:15 UTC\n\nPACKING STATUS\nPacker Detected:  None (native binary)\nSection Entropy:  .text=6.42 .rdata=4.89 .data=3.21 .rsrc=7.81\nNote:             .rsrc section entropy elevated - check resources\n\nSUSPICIOUS IMPORTS\n[INJECTION]       kernel32.dll -> VirtualAllocEx\n[INJECTION]       kernel32.dll -> WriteProcessMemory\n[INJECTION]       kernel32.dll -> CreateRemoteThread\n[EVASION]         kernel32.dll -> IsDebuggerPresent\n[NETWORK]         wininet.dll  -> InternetOpenA\n[NETWORK]         wininet.dll  -> HttpSendRequestA\n[PERSISTENCE]     advapi32.dll -> RegSetValueExA\n\nEXTRACTED INDICATORS\nURLs:             hxxps:\u002F\u002Fupdate.malicious[.]com\u002Fgate.php\nIPs:              185.220.101[.]42, 91.215.85[.]17\nRegistry Keys:    HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Run\\svchost\nFile Paths:       C:\\Users\\Public\\svchost.exe\n\nEMBEDDED RESOURCES\nResource 101:     Size=98304 Entropy=7.89 [!] Embedded PE detected\nResource 102:     Size=4096  Entropy=2.14 (configuration XML)\n\nASSESSMENT\nThreat Level:     HIGH\nClassification:   Dropper with process injection capabilities\nRecommended:      Execute in sandbox, extract embedded PE for separate analysis\n```\n",{"name":5,"tags":56,"author":57,"domain":47,"license":16,"version":58,"nist_csf":59,"subdomain":40,"description":7,"mitre_attack":64},[33,35,37,36,41],"mahipal","1.0.0",[60,61,62,63],"DE.AE-02","RS.AN-03","ID.RA-01","DE.CM-01",[65,66,67,68,69],"T1027","T1055","T1140","T1497","T0816","main","54a798831d2266a3ca61ce68a7acb80b81160d57","skills\u002Fperforming-static-malware-analysis-with-pe-studio",4425,"https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills","https:\u002F\u002Fmahipal.engineer\u002FAnthropic-Cybersecurity-Skills\u002F","https:\u002F\u002Fgithub.com\u002Fmukul975","Mahipal.engineer","🔐 Cybersecurity | 💻 Dev | 📷 Street Photographer\r\n🎓 MSc | 📚 Research & AI Security","2026-08-31 12:32:44",{"source":9,"skillName":5,"commands":81,"prompt":91,"zipAvailable":92},[82,85,88],{"tool":83,"command":84},"npx","npx skills add mukul975\u002FAnthropic-Cybersecurity-Skills --skill performing-static-malware-analysis-with-pe-studio",{"tool":86,"command":87},"bunx","bunx skills add mukul975\u002FAnthropic-Cybersecurity-Skills --skill performing-static-malware-analysis-with-pe-studio",{"tool":89,"command":90},"pnpm","pnpm dlx skills add mukul975\u002FAnthropic-Cybersecurity-Skills --skill performing-static-malware-analysis-with-pe-studio","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fperforming-static-malware-analysis-with-pe-studio\u002FSKILL.md",true,[94,99,105,109,113],{"path":95,"resourceType":95,"resourceTypeDesc":96,"sizeBytes":97,"sourceHtmlUrl":98},"LICENSE","许可证",11255,"https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fperforming-static-malware-analysis-with-pe-studio\u002FLICENSE",{"path":100,"resourceType":101,"resourceTypeDesc":102,"sizeBytes":103,"sourceHtmlUrl":104},"references\u002Fapi-reference.md","REFERENCE","参考文档",2176,"https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fperforming-static-malware-analysis-with-pe-studio\u002Freferences\u002Fapi-reference.md",{"path":106,"resourceType":101,"resourceTypeDesc":102,"sizeBytes":107,"sourceHtmlUrl":108},"references\u002Fargocd-setup.md",2894,"https:\u002F\u002Fgithub.com\u002Fdavila7\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fworkflow-automation\u002Fgitops-workflow\u002Freferences\u002Fargocd-setup.md",{"path":110,"resourceType":101,"resourceTypeDesc":102,"sizeBytes":111,"sourceHtmlUrl":112},"references\u002Fsync-policies.md",2767,"https:\u002F\u002Fgithub.com\u002Fdavila7\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fworkflow-automation\u002Fgitops-workflow\u002Freferences\u002Fsync-policies.md",{"path":114,"resourceType":115,"resourceTypeDesc":116,"sizeBytes":117,"sourceHtmlUrl":118},"scripts\u002Fagent.py","SCRIPT","脚本",7978,"https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fperforming-static-malware-analysis-with-pe-studio\u002Fscripts\u002Fagent.py",[120,152,181,213,243,275],{"skillNo":121,"name":122,"nameZh":123,"description":124,"descriptionZh":125,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":126,"categories":127,"keywords":132,"publishedAt":51},"01M6AGDM3HJXTKXX15ZZ0ZVCJ3","verifying-build-provenance-with-slsa-sigstore","SLSA 构建来源验证","Verifies artifact signatures and SLSA provenance using Sigstore's cosign (verify, verify-attestation, verify-blob-attestation) and slsa-verifier (verify-artifact), enforcing keyless OIDC builder identity and source repo against SLSA Build levels. Use in CI\u002FCD before deploying artifacts, when consuming third-party attestations, establishing a SLSA Build L3 pipeline, or confirming provenance during incident response or admission control.","使用 Sigstore 的 cosign（verify、verify-attestation、verify-blob-attestation）和 slsa-verifier（verify-artifact）验证工件签名和 SLSA 来源（provenance），强制校验 keyless OIDC 构建者身份和源仓库是否符合 SLSA Build 级别。适用于 CI\u002FCD 中部署工件前、消费第三方证明时、建立 SLSA Build L3 管道，或在事件响应或准入控制期间确认来源的场景。","https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fverifying-build-provenance-with-slsa-sigstore\u002FSKILL.md",[128,129],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":130,"categoryName":131,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8C32Q37WAMK06SGMFC02VFP","软件供应链安全",[133,134,135,136,137,47,138,139,140,141,142,143,144,145,146,147,148,149,150,151],"sigstore","provenance","slsa","verifying build provenance with slsa sigstore","security","incident response","identity","pr","code","artifacts","ci","supply-chain","pipeline","supply-chain-security","t1195","attestation","code-signing","cosign","keyless",{"skillNo":153,"name":154,"nameZh":155,"description":156,"descriptionZh":157,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":158,"categories":159,"keywords":164,"publishedAt":51},"01M6AGDGBPWYVZ2F11GFKJ4HZ9","validating-tpm-measured-boot-attestation","TPM 测量启动验证","Verifies TPM 2.0 measured-boot integrity and remote attestation with tpm2-tools -- reading PCRs (tpm2_pcrread), replaying the boot event log, generating and checking signed quotes (tpm2_quote\u002Ftpm2_checkquote), and sealing secrets to a PCR policy. Use to confirm a system booted trusted firmware\u002Fkernel for Zero Trust device posture, detect boot-chain tampering via PCR drift, or build a golden-value baseline for fleet attestation.","使用 tpm2-tools 验证 TPM 2.0 测量启动（measured boot）的完整性和远程证明：读取 PCR（tpm2_pcrread）、重放启动事件日志、生成并检查签名报价（tpm2_quote\u002Ftpm2_checkquote），以及将机密封印（seal）到 PCR 策略。适用于确认系统已启动可信固件\u002F内核以实现零信任（Zero Trust）设备状态、通过 PCR 漂移检测启动链篡改，或构建黄金值基线用于机群（fleet）证明。","https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fvalidating-tpm-measured-boot-attestation\u002FSKILL.md",[160,161],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":162,"categoryName":163,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8C89JJEXGGRGHS6XVXDA46K","终端安全加固",[165,148,166,167,137,168,47,140,169,170,171,172,173,174,175,176,177,178,179,180],"boot","TPM","validating tpm measured boot attestation","policy","verification","ZeRO","firmware","Tools","measured-boot","PCR","integrity","secrets","remote-attestation","tpm2-tools","integrity-verification","trusted-computing",{"skillNo":182,"name":183,"nameZh":184,"description":185,"descriptionZh":186,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":187,"categories":188,"keywords":195,"publishedAt":51},"01M6AGDCW0Y4FXZ3362GT1941M","validating-backup-integrity-for-recovery","备份完整性验证","Validates backup integrity through cryptographic hash verification, automated restore testing, corruption detection, and recoverability checks to confirm backups are reliable for disaster recovery and ransomware response. Use before relying on backups for recovery, when building post-backup validation pipelines, auditing backup infrastructure for compliance, or checking immutable\u002Fair-gapped backups for silent corruption or tampering.","通过加密哈希验证、自动化恢复测试、损坏检测和可恢复性检查来验证备份完整性，确认备份对于灾难恢复和勒索软件响应是可靠的。适用于在依赖备份进行恢复之前、构建备份后验证管道、审计备份基础设施以满足合规要求，或检查不可变\u002Fair-gapped（气隙）备份是否存在静默损坏或篡改的场景。","https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fvalidating-backup-integrity-for-recovery\u002FSKILL.md",[189,192],{"categoryNo":190,"categoryName":191,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BQGD4WETX0HM3SM9QKQ15B","SRE 工程师",{"categoryNo":193,"categoryName":194,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BSSTY86MWS6W5GDQWB1ADQ","备份与灾难恢复",[175,196,197,198,199,47,200,201,169,202,203,204,205,206,207,208,209,210,211,212],"backup","recovery","validating backup integrity for recovery","testing","infrastructure","validation","compliance","hash-verification","incident-response","ransomware","cryptocurrency","detection","t1078","t1490","immutable","disaster-recovery","restore-testing",{"skillNo":214,"name":215,"nameZh":216,"description":217,"descriptionZh":218,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":219,"categories":220,"keywords":225,"publishedAt":51},"01M6AGD9GBG2KZ336AE763J3WH","triaging-windows-with-kape","KAPE Windows 取证收集","Runs KAPE (Kroll Artifact Parser and Extractor) to collect targeted forensic artifacts (registry hives, $MFT, event logs, prefetch, browser data) via Targets and parse them with Modules wrapping Eric Zimmerman's EZ Tools (PECmd, MFTECmd, RECmd). Use during early incident containment\u002Ftriage when full disk imaging is impractical but a defensible, parseable Windows artifact set is needed quickly, including at-scale remote collection.","运行 KAPE（Kroll Artifact Parser and Extractor），通过 Targets 收集目标取证工件（注册表配置单元、$MFT、事件日志、prefetch、浏览器数据），并使用封装 Eric Zimmerman 的 EZ Tools（PECmd、MFTECmd、RECmd）的 Modules 进行解析。适用于事件遏制\u002F分诊早期阶段——此时完整磁盘镜像不切实际，但需要快速获得可采信、可解析的 Windows 工件集，包括大规模远程收集。","https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ftriaging-windows-with-kape\u002FSKILL.md",[221,222],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":223,"categoryName":224,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8C9JZH3GWXPJ6CQG5P7J48Y","数字取证与电子证据分析",[45,226,227,47,228,229,230,231,232,233,234,235,236,237,238,239,172,240,241,242],"kape","triaging windows with kape","registry","browser","logs","windows-forensics","dfir","mft","mftecmd","data","prefetch","eric-zimmerman","digital-forensics","SET","collection","pecmd","artifact-collection",{"skillNo":244,"name":245,"nameZh":246,"description":247,"descriptionZh":248,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":249,"categories":250,"keywords":255,"publishedAt":51},"01M6AGD5PW5J4EVZM958WD74ZQ","triaging-vulnerabilities-with-ssvc-framework","SSVC 漏洞优先级分诊","Triages and prioritizes vulnerabilities with CISA's Stakeholder-Specific Vulnerability Categorization (SSVC) decision tree, weighing exploitation status (via the CISA KEV catalog and FIRST EPSS API), technical impact, automatability, and mission prevalence to output Track\u002FTrack*\u002FAttend\u002FAct decisions. Use when prioritizing vulnerability scan results (OpenVAS, Nessus, Qualys) for remediation planning beyond raw CVSS scores.","使用 CISA 的 Stakeholder-Specific Vulnerability Categorization（SSVC，利益相关方特定漏洞分类）决策树对漏洞进行分诊和优先级排序，权衡利用状态（通过 CISA KEV 目录和 FIRST EPSS API）、技术影响、自动化程度和任务普遍性，输出 Track\u002FTrack*\u002FAttend\u002FAct 决策。适用于对漏洞扫描结果（OpenVAS、Nessus、Qualys）进行优先级排序以制定修复计划，而不局限于原始 CVSS 分数的场景。","https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ftriaging-vulnerabilities-with-ssvc-framework\u002FSKILL.md",[251,254],{"categoryNo":252,"categoryName":253,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BQV98CYQ7TEW2D1MRQ00TE","安全公告与漏洞管理",{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},[256,257,258,47,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274],"vulnerabilities","framework","triaging vulnerabilities with ssvc framework","status","planning","CISA","vulnerability-management","risk-management","nessus","qualys","openvas","cvss","remediation","risk","vulnerability","api","prioritization","ssvc","decision-tree",{"skillNo":276,"name":277,"nameZh":278,"description":279,"descriptionZh":280,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":281,"categories":282,"keywords":287,"publishedAt":51},"01M6AGD24TTQQM4CXG69E3B9TJ","triaging-security-incident","安全事件初步分诊","Performs initial triage of security incidents using the NIST SP 800-61r3 and SANS PICERL frameworks, classifying incident type, assigning priority by business impact, and routing to the appropriate response team. Use when a SIEM\u002FEDR alert needs human classification, concurrent alerts must be prioritized, or a user report or threat-intel IOC match requires initial incident categorization.","使用 NIST SP 800-61r3 和 SANS PICERL 框架对安全事件进行初步分诊，分类事件类型、按业务影响分配优先级，并路由到相应的响应团队。适用于 SIEM\u002FEDR 告警需要人工分类、并发告警必须确定优先级，或用户报告或威胁情报 IOC 匹配需要初步事件分类的场景。","https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ftriaging-security-incident\u002FSKILL.md",[283,284],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":285,"categoryName":286,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BTHYSJPJ500X64JJ5CH06D","安全事件响应与威胁狩猎",[137,288,47,289,44,290,291,292,293,294,295,208,38,209,32,296,297,298,299,300],"triaging security incident","siem","ioc","soc","NIST-800-61","NIST","severity","edr","classification","severity-classification","incident-triage","SANS-PICERL","SOC-operations"]