[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7AADGJKADGW4PS6NHXRTWZX":3,"skill-same:01M7AADGJKADGW4PS6NHXRTWZX":83},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":16,"sourceHtmlUrl":17,"categories":18,"keywords":19,"publishedAt":20,"linkOnly":21,"markdownContent":22,"markdownBody":23,"frontMatter":24,"refName":46,"commitSha":47,"skillDirectory":48,"forksCount":14,"repositoryHtmlUrl":49,"repositoryHomepageUrl":6,"ownerHtmlUrl":50,"ownerBlogUrl":6,"ownerDescription":51,"updatedAt":52,"install":53,"resources":66},"01M7AADGJKADGW4PS6NHXRTWZX","performing-static-malware-analysis-with-pe-studio",null,"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.","NeelakshSaxena\u002FVayu","NeelakshSaxena","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F87892838?v=4","01M7A3B9YFS6F6N9DD1787DT86","Neelaksh Saxena","01M7A3B9ZKBT09MNMPX2XN69BY",0,"Apache-2.0","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fperforming-static-malware-analysis-with-pe-studio\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fperforming-static-malware-analysis-with-pe-studio\u002FSKILL.md",[],[],"2026-11-15 14:19:17",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":25,"author":31,"domain":32,"license":15,"version":33,"nist_csf":34,"subdomain":39,"description":7,"mitre_attack":40},[26,27,28,29,30],"malware","static-analysis","PE-analysis","PEStudio","reverse-engineering","mahipal","cybersecurity","1.0.0",[35,36,37,38],"DE.AE-02","RS.AN-03","ID.RA-01","DE.CM-01","malware-analysis",[41,42,43,44,45],"T1027","T1055","T1140","T1497","T0816","main","7540bbccf0c1ded6156a467b02c95b61ad62413f",".agents\u002Fskills\u002Fperforming-static-malware-analysis-with-pe-studio","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena","Currently exploring the intersection of tech","2026-09-11 03:02:31",{"source":8,"skillName":5,"commands":54,"prompt":64,"zipAvailable":65},[55,58,61],{"tool":56,"command":57},"npx","npx skills add NeelakshSaxena\u002FVayu --skill performing-static-malware-analysis-with-pe-studio",{"tool":59,"command":60},"bunx","bunx skills add NeelakshSaxena\u002FVayu --skill performing-static-malware-analysis-with-pe-studio",{"tool":62,"command":63},"pnpm","pnpm dlx skills add NeelakshSaxena\u002FVayu --skill performing-static-malware-analysis-with-pe-studio","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fperforming-static-malware-analysis-with-pe-studio\u002FSKILL.md",true,[67,71,77],{"path":68,"resourceType":68,"resourceTypeDesc":69,"sizeBytes":70,"sourceHtmlUrl":16},"LICENSE","许可证",11255,{"path":72,"resourceType":73,"resourceTypeDesc":74,"sizeBytes":75,"sourceHtmlUrl":76},"references\u002Fapi-reference.md","REFERENCE","参考文档",2176,"https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fperforming-static-malware-analysis-with-pe-studio\u002Freferences\u002Fapi-reference.md",{"path":78,"resourceType":79,"resourceTypeDesc":80,"sizeBytes":81,"sourceHtmlUrl":82},"scripts\u002Fagent.py","SCRIPT","脚本",7978,"https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fperforming-static-malware-analysis-with-pe-studio\u002Fscripts\u002Fagent.py",[84,91,98,105,112,119],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":20},"01M7ACCCVNCFKMA9X6D15X6G98","runpodctl","Runpod CLI for managing GPU\u002FCPU workloads from the terminal — pods, serverless endpoints, templates, network volumes, Hub deploys, models, SSH, and file transfer (send\u002Freceive). Use for terminal\u002FCI\u002Fscripting, Hub browse\u002Fdeploy, SSH setup, `doctor`, or when the Runpod MCP tools are not connected. For structured tool calls in an MCP-enabled session, prefer runpod-mcp.","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Frunpodctl\u002FSKILL.md",[],[],{"skillNo":92,"name":93,"nameZh":6,"description":94,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":95,"categories":96,"keywords":97,"publishedAt":20},"01M7ACC63SRHEA5KMCHSMZK2TC","runpod","Start here for any Runpod task — running GPU\u002FCPU pods, deploying serverless endpoints, templates, network volumes, building images, or understanding how Runpod works. Routes to the right skill (runpod-mcp, runpodctl, flash, companion-clis, runpod-usage, runpod-templates, runpod-migrate) and indexes two dozen live-verified end-to-end examples (golden paths) — use it when the lane is unclear, and for any multi-step or provisioning task even when it is not.","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Frunpod\u002FSKILL.md",[],[],{"skillNo":99,"name":100,"nameZh":6,"description":101,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":102,"categories":103,"keywords":104,"publishedAt":20},"01M7ACC0Q1C89N9BZBV91CTQTF","runpod-usage","How Runpod works and how to work it — pods vs serverless, GPU\u002FVRAM selection, storage, building a container, networking, plus the agentic pod development loop (provision → ssh-exec → set up → poll readiness) and on-pod install hygiene (uv\u002Fapt). Use to answer \"how does X work\", \"which GPU\", \"how do I build a container\", or \"how do I stand up a workload on a pod\". Guidance, not a tool — execute with runpodctl, runpod-mcp, or flash.","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Frunpod-usage\u002FSKILL.md",[],[],{"skillNo":106,"name":107,"nameZh":6,"description":108,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":109,"categories":110,"keywords":111,"publishedAt":20},"01M7ACBRPE345GF5GM5B8P8RRC","runpod-templates","Runpod's official prebuilt pod templates (ComfyUI, PyTorch, and others): what each image ships, which ports and paths it uses, how to pick one, how to pin a version, and what is missing on first boot. Use when a task says \"run \u003CX> on a pod\" and an official template already covers it, instead of building an image — and when a user needs help with or wants to fix something about a Runpod template they are already running (won't boot, can't reach the UI, missing models, wrong CUDA line, broken ComfyUI workflow metadata on imported workflows): start here and route onward. Deploy with runpodctl or runpod-mcp; end-to-end walkthroughs live in the runpod router's golden paths.","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Frunpod-templates\u002FSKILL.md",[],[],{"skillNo":113,"name":114,"nameZh":6,"description":115,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":116,"categories":117,"keywords":118,"publishedAt":20},"01M7ACBJATHKVX1TWES2F44GY8","runpod-migrate","Migrate a codebase from the Runpod GraphQL API or REST v1 to REST v2 — inventory which parts use which API version, rewrite the call sites, flag breaking changes, and verify. Use when someone asks to move to v2, asks what v2 would change, or asks which Runpod API their code is on. For managing infrastructure rather than migrating code, use runpod-mcp or runpodctl.","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Frunpod-migrate\u002FSKILL.md",[],[],{"skillNo":120,"name":121,"nameZh":6,"description":122,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":123,"categories":124,"keywords":125,"publishedAt":20},"01M7ACBC7GHVH6T9YEAPCG2AP8","runpod-mcp","Manage Runpod infrastructure — pods, serverless endpoints, jobs, templates, network volumes, container-registry auth, GPU\u002FCPU catalog, and billing — via the Runpod MCP server's structured tool calls. Use when the Runpod MCP tools (create-pod, list-endpoints, …) are connected in this session, or to connect them (hosted OAuth or local npx). Prefer this over runpodctl for plain infra CRUD when MCP is available; use runpodctl for the terminal, file transfer, or SSH setup.","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Frunpod-mcp\u002FSKILL.md",[],[]]