[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7B66Z950PK3440HW231S8D4":3,"skill-same:01M7B66Z950PK3440HW231S8D4":88},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":15,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":52,"commitSha":53,"skillDirectory":54,"forksCount":13,"repositoryHtmlUrl":55,"repositoryHomepageUrl":6,"ownerHtmlUrl":56,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":57,"install":58,"resources":71},"01M7B66Z950PK3440HW231S8D4","detecting-process-injection-techniques",null,"Detects and analyzes process injection techniques used by malware including classic DLL injection, process hollowing, APC injection, thread hijacking, and reflective loading. Uses memory forensics, API monitoring, and behavioral analysis to identify injection artifacts. Activates for requests involving process injection detection, code injection analysis, hollowed process investigation, or in-memory threat detection.","vikasvardhanv\u002Fjerry_skills","vikasvardhanv","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F99010657?v=4","01M7B2B0VN78W7529RQX5BR6DZ","01M7B2B0WDNTXJHRK3QNPNWRP6",0,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fcurated_premium_skills\u002FAnthropic-Cybersecurity-Skills\u002Fskills\u002Fdetecting-process-injection-techniques\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fcurated_premium_skills\u002FAnthropic-Cybersecurity-Skills\u002Fskills\u002Fdetecting-process-injection-techniques\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: detecting-process-injection-techniques\ndescription: 'Detects and analyzes process injection techniques used by malware including\n  classic DLL injection, process hollowing, APC injection, thread hijacking, and reflective\n  loading. Uses memory forensics, API monitoring, and behavioral analysis to identify\n  injection artifacts. Activates for requests involving process injection detection,\n  code injection analysis, hollowed process investigation, or in-memory threat detection.\n\n  '\ndomain: cybersecurity\nsubdomain: malware-analysis\ntags:\n- malware\n- process-injection\n- detection\n- memory-forensics\n- defense-evasion\nversion: 1.0.0\nauthor: mahipal\nlicense: Apache-2.0\nd3fend_techniques:\n- Executable Denylisting\n- Execution Isolation\n- File Metadata Consistency Validation\n- Content Format Conversion\n- File Content Analysis\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- T1070\n---\n\n# Detecting Process Injection Techniques\n\n## When to Use\n\n- EDR alerts on suspicious API call sequences (VirtualAllocEx + WriteProcessMemory + CreateRemoteThread)\n- A legitimate process (explorer.exe, svchost.exe) exhibits unexpected network connections or file operations\n- Memory forensics reveals executable code in memory regions that should not contain it\n- Investigating living-off-the-land attacks where malware hides inside trusted processes\n- Building detection logic for specific injection techniques in EDR or SIEM rules\n\n**Do not use** for standard DLL loading analysis; injection implies unauthorized code placement in a process without that process's cooperation.\n\n## Prerequisites\n\n- Volatility 3 for memory forensics analysis of injection artifacts\n- Sysmon configured with Event IDs 8 (CreateRemoteThread) and 10 (ProcessAccess)\n- API Monitor or x64dbg for observing injection API calls in real-time\n- Process Hacker or Process Explorer for inspecting process memory regions\n- Understanding of Windows memory management (VirtualAlloc, VAD, page protections)\n- Isolated analysis environment for safe malware execution and monitoring\n\n## Workflow\n\n### Step 1: Identify Injection via Memory Forensics\n\nUse Volatility to detect injected code in process memory:\n\n```bash\n# malfind: Primary injection detection plugin\nvol3 -f memory.dmp windows.malfind\n\n# malfind detects:\n# - Memory regions with PAGE_EXECUTE_READWRITE (RWX) protection\n# - PE headers (MZ signature) in non-image VAD entries\n# - Executable memory not backed by a file on disk\n\n# Filter by specific process\nvol3 -f memory.dmp windows.malfind --pid 852\n\n# Dump injected memory regions for analysis\nvol3 -f memory.dmp windows.malfind --dump\n\n# Check VAD (Virtual Address Descriptor) tree for anomalies\nvol3 -f memory.dmp windows.vadinfo --pid 852\n\n# Detect hollowed processes (mapped image doesn't match disk)\nvol3 -f memory.dmp windows.hollowfind\n```\n\n### Step 2: Classify the Injection Technique\n\nIdentify which injection method was used based on artifacts:\n\n```\nProcess Injection Techniques and Detection Artifacts:\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n\n1. Classic DLL Injection\n   APIs: OpenProcess -> VirtualAllocEx -> WriteProcessMemory -> CreateRemoteThread\n   Artifact: Loaded DLL in target process not present in known-good baseline\n   Detection: New DLL in dlllist not matching disk hash, CreateRemoteThread event\n\n2. Process Hollowing (RunPE)\n   APIs: CreateProcess(SUSPENDED) -> NtUnmapViewOfSection -> VirtualAllocEx ->\n         WriteProcessMemory -> SetThreadContext -> ResumeThread\n   Artifact: Process image in memory doesn't match file on disk\n   Detection: hollowfind plugin, mismatched PE headers vs disk file\n\n3. APC Injection\n   APIs: OpenProcess -> VirtualAllocEx -> WriteProcessMemory -> QueueUserAPC\n   Artifact: Alertable thread has queued APC pointing to injected code\n   Detection: Thread start addresses outside known modules\n\n4. Thread Hijacking\n   APIs: OpenProcess -> VirtualAllocEx -> WriteProcessMemory ->\n         SuspendThread -> GetThreadContext -> SetThreadContext -> ResumeThread\n   Artifact: Thread instruction pointer changed to injected code\n   Detection: Thread context modification, EIP\u002FRIP outside module boundaries\n\n5. Reflective DLL Injection\n   APIs: VirtualAllocEx -> WriteProcessMemory -> CreateRemoteThread (to reflective loader)\n   Artifact: DLL loaded in memory but NOT in loaded module list\n   Detection: malfind (PE in non-image memory), module not in ldrmodules\n\n6. Process Doppelganging\n   APIs: NtCreateTransaction -> NtCreateFile(transacted) -> NtWriteFile ->\n         NtCreateSection -> NtRollbackTransaction -> NtCreateProcessEx\n   Artifact: Process created from transacted file that was rolled back\n   Detection: Process with no corresponding file on disk\n\n7. AtomBombing\n   APIs: GlobalAddAtom -> NtQueueApcThread (with GlobalGetAtomName)\n   Artifact: Code stored in global atom table, APC triggers copy to target\n   Detection: Unusual atom table entries, APC injection indicators\n```\n\n### Step 3: Detect Injection via Sysmon Events\n\nAnalyze Sysmon and Windows Event Log data:\n\n```bash\n# Sysmon Event ID 8: CreateRemoteThread\n# Detect when one process creates a thread in another\nwevtutil qe \"Microsoft-Windows-Sysmon\u002FOperational\" \\\n  \u002Fq:\"*[System[EventID=8]]\" \u002Ff:text \u002Fc:20\n\n# Sysmon Event ID 10: ProcessAccess\n# Detect suspicious access rights to other processes\n# DesiredAccess containing PROCESS_VM_WRITE (0x0020) + PROCESS_CREATE_THREAD (0x0002)\nwevtutil qe \"Microsoft-Windows-Sysmon\u002FOperational\" \\\n  \u002Fq:\"*[System[EventID=10]]\" \u002Ff:text \u002Fc:20\n\n# Sysmon Event ID 1: Process Creation\n# Detect process hollowing via suspicious parent-child relationships\nwevtutil qe \"Microsoft-Windows-Sysmon\u002FOperational\" \\\n  \u002Fq:\"*[System[EventID=1]]\" \u002Ff:text \u002Fc:20\n```\n\n```python\n# Parse Sysmon events for injection indicators\nimport xml.etree.ElementTree as ET\nimport subprocess\n\n# Query CreateRemoteThread events\nresult = subprocess.run(\n    [\"wevtutil\", \"qe\", \"Microsoft-Windows-Sysmon\u002FOperational\",\n     \"\u002Fq:*[System[EventID=8]]\", \"\u002Ff:xml\", \"\u002Fc:100\"],\n    capture_output=True, text=True\n)\n\nsuspicious_injections = []\nfor event_xml in result.stdout.split(\"\u003C\u002FEvent>\"):\n    if not event_xml.strip():\n        continue\n    try:\n        root = ET.fromstring(event_xml + \"\u003C\u002FEvent>\")\n        ns = {\"e\": \"http:\u002F\u002Fschemas.microsoft.com\u002Fwin\u002F2004\u002F08\u002Fevents\u002Fevent\"}\n        data = {}\n        for d in root.findall(\".\u002F\u002Fe:EventData\u002Fe:Data\", ns):\n            data[d.get(\"Name\")] = d.text\n\n        source = data.get(\"SourceImage\", \"\")\n        target = data.get(\"TargetImage\", \"\")\n\n        # Flag injections from unusual sources into system processes\n        system_procs = [\"svchost.exe\", \"explorer.exe\", \"lsass.exe\", \"winlogon.exe\"]\n        if any(p in target.lower() for p in system_procs):\n            if not any(p in source.lower() for p in [\"csrss.exe\", \"services.exe\", \"lsass.exe\"]):\n                print(f\"[!] Suspicious injection: {source} -> {target}\")\n                suspicious_injections.append(data)\n    except:\n        pass\n```\n\n### Step 4: Analyze Injected Code\n\nExamine the injected payload to understand its purpose:\n\n```bash\n# Dump injected code from Volatility malfind\nvol3 -f memory.dmp windows.malfind --pid 852 --dump\n\n# Analyze the dumped region\nfile malfind.*.dmp\n\n# If it contains a PE (MZ header), analyze as a standalone executable\npython3 \u003C\u003C 'PYEOF'\nimport pefile\n\n# Attempt to parse as PE\ntry:\n    pe = pefile.PE(\"malfind.852.0x400000.dmp\")\n    print(\"Injected PE detected!\")\n    print(f\"  Architecture: {'x64' if pe.FILE_HEADER.Machine == 0x8664 else 'x86'}\")\n    print(f\"  Imports:\")\n    if hasattr(pe, 'DIRECTORY_ENTRY_IMPORT'):\n        for entry in pe.DIRECTORY_ENTRY_IMPORT:\n            print(f\"    {entry.dll.decode()}: {len(entry.imports)} functions\")\nexcept:\n    print(\"Not a valid PE - likely shellcode\")\n    # Analyze as shellcode\n    with open(\"malfind.852.0x400000.dmp\", \"rb\") as f:\n        shellcode = f.read()\n    print(f\"  Size: {len(shellcode)} bytes\")\n    print(f\"  First bytes: {shellcode[:32].hex()}\")\nPYEOF\n\n# Disassemble shellcode\npython3 -c \"\nfrom capstone import Cs, CS_ARCH_X86, CS_MODE_64\nwith open('malfind.852.0x400000.dmp', 'rb') as f:\n    code = f.read()[:256]\nmd = Cs(CS_ARCH_X86, CS_MODE_64)\nfor insn in md.disasm(code, 0x400000):\n    print(f'  0x{insn.address:X}: {insn.mnemonic} {insn.op_str}')\n\"\n\n# Scan with YARA for known payloads\nvol3 -f memory.dmp yarascan.YaraScan --pid 852 --yara-file malware_rules.yar\n```\n\n### Step 5: Map to MITRE ATT&CK\n\nClassify detected techniques in the ATT&CK framework:\n\n```\nMITRE ATT&CK Process Injection Sub-Techniques (T1055):\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\nT1055.001  Dynamic-link Library Injection\nT1055.002  Portable Executable Injection\nT1055.003  Thread Execution Hijacking\nT1055.004  Asynchronous Procedure Call (APC)\nT1055.005  Thread Local Storage\nT1055.008  Ptrace System Calls (Linux)\nT1055.009  Proc Memory (\u002Fproc\u002Fpid\u002Fmem - Linux)\nT1055.011  Extra Window Memory Injection\nT1055.012  Process Hollowing\nT1055.013  Process Doppelganging\nT1055.014  VDSO Hijacking (Linux)\nT1055.015  ListPlanting\n```\n\n### Step 6: Create Detection Signatures\n\nBuild detection rules for the identified technique:\n\n```yaml\n# Sigma rule for CreateRemoteThread injection\ntitle: Suspicious CreateRemoteThread into System Process\nlogsource:\n    product: windows\n    service: sysmon\ndetection:\n    selection:\n        EventID: 8\n        TargetImage|endswith:\n            - '\\svchost.exe'\n            - '\\explorer.exe'\n            - '\\lsass.exe'\n    filter:\n        SourceImage|endswith:\n            - '\\csrss.exe'\n            - '\\services.exe'\n            - '\\svchost.exe'\n    condition: selection and not filter\nlevel: high\n```\n\n## Key Concepts\n\n| Term | Definition |\n|------|------------|\n| **Process Injection** | Technique of executing code within the address space of another process, typically to evade detection and inherit the target's trust level |\n| **Process Hollowing** | Creating a legitimate process in suspended state, unmapping its memory, writing malicious code, and resuming execution to masquerade as the legitimate process |\n| **Reflective DLL Injection** | Loading a DLL into a process's memory without using the Windows loader, so the DLL does not appear in the loaded module list |\n| **APC Injection** | Queuing an Asynchronous Procedure Call to a thread in the target process, causing it to execute injected code when the thread enters an alertable state |\n| **VAD (Virtual Address Descriptor)** | Windows kernel structure describing memory regions in a process; anomalous VAD entries (RWX permissions, non-image PE) indicate injection |\n| **CreateRemoteThread** | Windows API creating a thread in another process; the primary mechanism for classic DLL injection and many other injection techniques |\n| **PAGE_EXECUTE_READWRITE** | Memory protection allowing read, write, and execute; rarely used by legitimate applications, common indicator of injected code |\n\n## Tools & Systems\n\n- **Volatility (malfind)**: Memory forensics plugin detecting injected code through VAD analysis and PE header scanning in non-image memory regions\n- **Sysmon**: System Monitor providing detailed Windows event logging including CreateRemoteThread (EID 8) and ProcessAccess (EID 10)\n- **Process Hacker**: Advanced process management tool showing detailed memory regions, thread stacks, and injected modules\n- **API Monitor**: Windows tool for monitoring and logging API calls made by processes, useful for observing injection sequences in real-time\n- **pe-sieve**: Tool scanning running processes for signs of code injection, hooking, and hollowing\n\n## Common Scenarios\n\n### Scenario: Investigating a Hollowed svchost.exe Process\n\n**Context**: EDR alerts on svchost.exe making HTTPS connections to an external IP. Svchost.exe should only communicate with Microsoft services. Memory analysis is needed to confirm process hollowing.\n\n**Approach**:\n1. Capture memory dump of the suspicious svchost.exe process\n2. Run Volatility `malfind` to detect injected PE in the process memory\n3. Compare the in-memory image base with the on-disk svchost.exe file hash\n4. Check the process parent (should be services.exe) and creation parameters\n5. Dump the hollowed executable from memory and analyze with Ghidra\n6. Run `netscan` to confirm the network connections from the hollowed process\n7. Scan dumped code with YARA for malware family identification\n\n**Pitfalls**:\n- Assuming all svchost.exe instances are identical (each loads different service DLLs)\n- Not checking the parent process (hollowed processes often have wrong parents)\n- Relying only on process name matching (attackers specifically target svchost.exe because multiple instances are expected)\n- Missing the injection source process that may have already terminated\n\n## Output Format\n\n```\nPROCESS INJECTION ANALYSIS REPORT\n====================================\nDump File:        memory.dmp\nAnalysis Tool:    Volatility 3.2 + Sysmon\n\nINJECTION DETECTED\nTarget Process:   svchost.exe (PID: 852)\nSource Process:    malware.exe (PID: 2184) [terminated]\nTechnique:        Process Hollowing (T1055.012)\n\nEVIDENCE\nmalfind Results:\n  PID 852 (svchost.exe):\n    Address: 0x00400000\n    Size:    184,320 bytes\n    Protection: PAGE_EXECUTE_READWRITE\n    Header: MZ (PE32 executable)\n    NOT backed by disk file\n\nProcess Verification:\n  Expected Image: C:\\Windows\\System32\\svchost.exe (SHA-256: aaa...)\n  In-Memory Image: Unknown PE (SHA-256: bbb...)\n  Result: MISMATCH - HOLLOWED PROCESS\n\nSysmon Events:\n  [4688] malware.exe (PID 2184) created svchost.exe (PID 852) SUSPENDED\n  [10]   malware.exe accessed svchost.exe with PROCESS_VM_WRITE\n  [8]    malware.exe created remote thread in svchost.exe\n\nINJECTED PAYLOAD ANALYSIS\nSHA-256:          bbb123def456...\nYARA Match:       CobaltStrike_Beacon_x64\nType:             Cobalt Strike Beacon (HTTP)\nC2:               hxxps:\u002F\u002F185.220.101[.]42\u002Fupdates\n\nMITRE ATT&CK\nT1055.012  Process Hollowing\nT1071.001  Web Protocols (HTTPS C2)\nT1036.005  Match Legitimate Name (svchost.exe)\n```\n","# Detecting Process Injection Techniques\n\n## When to Use\n\n- EDR alerts on suspicious API call sequences (VirtualAllocEx + WriteProcessMemory + CreateRemoteThread)\n- A legitimate process (explorer.exe, svchost.exe) exhibits unexpected network connections or file operations\n- Memory forensics reveals executable code in memory regions that should not contain it\n- Investigating living-off-the-land attacks where malware hides inside trusted processes\n- Building detection logic for specific injection techniques in EDR or SIEM rules\n\n**Do not use** for standard DLL loading analysis; injection implies unauthorized code placement in a process without that process's cooperation.\n\n## Prerequisites\n\n- Volatility 3 for memory forensics analysis of injection artifacts\n- Sysmon configured with Event IDs 8 (CreateRemoteThread) and 10 (ProcessAccess)\n- API Monitor or x64dbg for observing injection API calls in real-time\n- Process Hacker or Process Explorer for inspecting process memory regions\n- Understanding of Windows memory management (VirtualAlloc, VAD, page protections)\n- Isolated analysis environment for safe malware execution and monitoring\n\n## Workflow\n\n### Step 1: Identify Injection via Memory Forensics\n\nUse Volatility to detect injected code in process memory:\n\n```bash\n# malfind: Primary injection detection plugin\nvol3 -f memory.dmp windows.malfind\n\n# malfind detects:\n# - Memory regions with PAGE_EXECUTE_READWRITE (RWX) protection\n# - PE headers (MZ signature) in non-image VAD entries\n# - Executable memory not backed by a file on disk\n\n# Filter by specific process\nvol3 -f memory.dmp windows.malfind --pid 852\n\n# Dump injected memory regions for analysis\nvol3 -f memory.dmp windows.malfind --dump\n\n# Check VAD (Virtual Address Descriptor) tree for anomalies\nvol3 -f memory.dmp windows.vadinfo --pid 852\n\n# Detect hollowed processes (mapped image doesn't match disk)\nvol3 -f memory.dmp windows.hollowfind\n```\n\n### Step 2: Classify the Injection Technique\n\nIdentify which injection method was used based on artifacts:\n\n```\nProcess Injection Techniques and Detection Artifacts:\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n\n1. Classic DLL Injection\n   APIs: OpenProcess -> VirtualAllocEx -> WriteProcessMemory -> CreateRemoteThread\n   Artifact: Loaded DLL in target process not present in known-good baseline\n   Detection: New DLL in dlllist not matching disk hash, CreateRemoteThread event\n\n2. Process Hollowing (RunPE)\n   APIs: CreateProcess(SUSPENDED) -> NtUnmapViewOfSection -> VirtualAllocEx ->\n         WriteProcessMemory -> SetThreadContext -> ResumeThread\n   Artifact: Process image in memory doesn't match file on disk\n   Detection: hollowfind plugin, mismatched PE headers vs disk file\n\n3. APC Injection\n   APIs: OpenProcess -> VirtualAllocEx -> WriteProcessMemory -> QueueUserAPC\n   Artifact: Alertable thread has queued APC pointing to injected code\n   Detection: Thread start addresses outside known modules\n\n4. Thread Hijacking\n   APIs: OpenProcess -> VirtualAllocEx -> WriteProcessMemory ->\n         SuspendThread -> GetThreadContext -> SetThreadContext -> ResumeThread\n   Artifact: Thread instruction pointer changed to injected code\n   Detection: Thread context modification, EIP\u002FRIP outside module boundaries\n\n5. Reflective DLL Injection\n   APIs: VirtualAllocEx -> WriteProcessMemory -> CreateRemoteThread (to reflective loader)\n   Artifact: DLL loaded in memory but NOT in loaded module list\n   Detection: malfind (PE in non-image memory), module not in ldrmodules\n\n6. Process Doppelganging\n   APIs: NtCreateTransaction -> NtCreateFile(transacted) -> NtWriteFile ->\n         NtCreateSection -> NtRollbackTransaction -> NtCreateProcessEx\n   Artifact: Process created from transacted file that was rolled back\n   Detection: Process with no corresponding file on disk\n\n7. AtomBombing\n   APIs: GlobalAddAtom -> NtQueueApcThread (with GlobalGetAtomName)\n   Artifact: Code stored in global atom table, APC triggers copy to target\n   Detection: Unusual atom table entries, APC injection indicators\n```\n\n### Step 3: Detect Injection via Sysmon Events\n\nAnalyze Sysmon and Windows Event Log data:\n\n```bash\n# Sysmon Event ID 8: CreateRemoteThread\n# Detect when one process creates a thread in another\nwevtutil qe \"Microsoft-Windows-Sysmon\u002FOperational\" \\\n  \u002Fq:\"*[System[EventID=8]]\" \u002Ff:text \u002Fc:20\n\n# Sysmon Event ID 10: ProcessAccess\n# Detect suspicious access rights to other processes\n# DesiredAccess containing PROCESS_VM_WRITE (0x0020) + PROCESS_CREATE_THREAD (0x0002)\nwevtutil qe \"Microsoft-Windows-Sysmon\u002FOperational\" \\\n  \u002Fq:\"*[System[EventID=10]]\" \u002Ff:text \u002Fc:20\n\n# Sysmon Event ID 1: Process Creation\n# Detect process hollowing via suspicious parent-child relationships\nwevtutil qe \"Microsoft-Windows-Sysmon\u002FOperational\" \\\n  \u002Fq:\"*[System[EventID=1]]\" \u002Ff:text \u002Fc:20\n```\n\n```python\n# Parse Sysmon events for injection indicators\nimport xml.etree.ElementTree as ET\nimport subprocess\n\n# Query CreateRemoteThread events\nresult = subprocess.run(\n    [\"wevtutil\", \"qe\", \"Microsoft-Windows-Sysmon\u002FOperational\",\n     \"\u002Fq:*[System[EventID=8]]\", \"\u002Ff:xml\", \"\u002Fc:100\"],\n    capture_output=True, text=True\n)\n\nsuspicious_injections = []\nfor event_xml in result.stdout.split(\"\u003C\u002FEvent>\"):\n    if not event_xml.strip():\n        continue\n    try:\n        root = ET.fromstring(event_xml + \"\u003C\u002FEvent>\")\n        ns = {\"e\": \"http:\u002F\u002Fschemas.microsoft.com\u002Fwin\u002F2004\u002F08\u002Fevents\u002Fevent\"}\n        data = {}\n        for d in root.findall(\".\u002F\u002Fe:EventData\u002Fe:Data\", ns):\n            data[d.get(\"Name\")] = d.text\n\n        source = data.get(\"SourceImage\", \"\")\n        target = data.get(\"TargetImage\", \"\")\n\n        # Flag injections from unusual sources into system processes\n        system_procs = [\"svchost.exe\", \"explorer.exe\", \"lsass.exe\", \"winlogon.exe\"]\n        if any(p in target.lower() for p in system_procs):\n            if not any(p in source.lower() for p in [\"csrss.exe\", \"services.exe\", \"lsass.exe\"]):\n                print(f\"[!] Suspicious injection: {source} -> {target}\")\n                suspicious_injections.append(data)\n    except:\n        pass\n```\n\n### Step 4: Analyze Injected Code\n\nExamine the injected payload to understand its purpose:\n\n```bash\n# Dump injected code from Volatility malfind\nvol3 -f memory.dmp windows.malfind --pid 852 --dump\n\n# Analyze the dumped region\nfile malfind.*.dmp\n\n# If it contains a PE (MZ header), analyze as a standalone executable\npython3 \u003C\u003C 'PYEOF'\nimport pefile\n\n# Attempt to parse as PE\ntry:\n    pe = pefile.PE(\"malfind.852.0x400000.dmp\")\n    print(\"Injected PE detected!\")\n    print(f\"  Architecture: {'x64' if pe.FILE_HEADER.Machine == 0x8664 else 'x86'}\")\n    print(f\"  Imports:\")\n    if hasattr(pe, 'DIRECTORY_ENTRY_IMPORT'):\n        for entry in pe.DIRECTORY_ENTRY_IMPORT:\n            print(f\"    {entry.dll.decode()}: {len(entry.imports)} functions\")\nexcept:\n    print(\"Not a valid PE - likely shellcode\")\n    # Analyze as shellcode\n    with open(\"malfind.852.0x400000.dmp\", \"rb\") as f:\n        shellcode = f.read()\n    print(f\"  Size: {len(shellcode)} bytes\")\n    print(f\"  First bytes: {shellcode[:32].hex()}\")\nPYEOF\n\n# Disassemble shellcode\npython3 -c \"\nfrom capstone import Cs, CS_ARCH_X86, CS_MODE_64\nwith open('malfind.852.0x400000.dmp', 'rb') as f:\n    code = f.read()[:256]\nmd = Cs(CS_ARCH_X86, CS_MODE_64)\nfor insn in md.disasm(code, 0x400000):\n    print(f'  0x{insn.address:X}: {insn.mnemonic} {insn.op_str}')\n\"\n\n# Scan with YARA for known payloads\nvol3 -f memory.dmp yarascan.YaraScan --pid 852 --yara-file malware_rules.yar\n```\n\n### Step 5: Map to MITRE ATT&CK\n\nClassify detected techniques in the ATT&CK framework:\n\n```\nMITRE ATT&CK Process Injection Sub-Techniques (T1055):\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\nT1055.001  Dynamic-link Library Injection\nT1055.002  Portable Executable Injection\nT1055.003  Thread Execution Hijacking\nT1055.004  Asynchronous Procedure Call (APC)\nT1055.005  Thread Local Storage\nT1055.008  Ptrace System Calls (Linux)\nT1055.009  Proc Memory (\u002Fproc\u002Fpid\u002Fmem - Linux)\nT1055.011  Extra Window Memory Injection\nT1055.012  Process Hollowing\nT1055.013  Process Doppelganging\nT1055.014  VDSO Hijacking (Linux)\nT1055.015  ListPlanting\n```\n\n### Step 6: Create Detection Signatures\n\nBuild detection rules for the identified technique:\n\n```yaml\n# Sigma rule for CreateRemoteThread injection\ntitle: Suspicious CreateRemoteThread into System Process\nlogsource:\n    product: windows\n    service: sysmon\ndetection:\n    selection:\n        EventID: 8\n        TargetImage|endswith:\n            - '\\svchost.exe'\n            - '\\explorer.exe'\n            - '\\lsass.exe'\n    filter:\n        SourceImage|endswith:\n            - '\\csrss.exe'\n            - '\\services.exe'\n            - '\\svchost.exe'\n    condition: selection and not filter\nlevel: high\n```\n\n## Key Concepts\n\n| Term | Definition |\n|------|------------|\n| **Process Injection** | Technique of executing code within the address space of another process, typically to evade detection and inherit the target's trust level |\n| **Process Hollowing** | Creating a legitimate process in suspended state, unmapping its memory, writing malicious code, and resuming execution to masquerade as the legitimate process |\n| **Reflective DLL Injection** | Loading a DLL into a process's memory without using the Windows loader, so the DLL does not appear in the loaded module list |\n| **APC Injection** | Queuing an Asynchronous Procedure Call to a thread in the target process, causing it to execute injected code when the thread enters an alertable state |\n| **VAD (Virtual Address Descriptor)** | Windows kernel structure describing memory regions in a process; anomalous VAD entries (RWX permissions, non-image PE) indicate injection |\n| **CreateRemoteThread** | Windows API creating a thread in another process; the primary mechanism for classic DLL injection and many other injection techniques |\n| **PAGE_EXECUTE_READWRITE** | Memory protection allowing read, write, and execute; rarely used by legitimate applications, common indicator of injected code |\n\n## Tools & Systems\n\n- **Volatility (malfind)**: Memory forensics plugin detecting injected code through VAD analysis and PE header scanning in non-image memory regions\n- **Sysmon**: System Monitor providing detailed Windows event logging including CreateRemoteThread (EID 8) and ProcessAccess (EID 10)\n- **Process Hacker**: Advanced process management tool showing detailed memory regions, thread stacks, and injected modules\n- **API Monitor**: Windows tool for monitoring and logging API calls made by processes, useful for observing injection sequences in real-time\n- **pe-sieve**: Tool scanning running processes for signs of code injection, hooking, and hollowing\n\n## Common Scenarios\n\n### Scenario: Investigating a Hollowed svchost.exe Process\n\n**Context**: EDR alerts on svchost.exe making HTTPS connections to an external IP. Svchost.exe should only communicate with Microsoft services. Memory analysis is needed to confirm process hollowing.\n\n**Approach**:\n1. Capture memory dump of the suspicious svchost.exe process\n2. Run Volatility `malfind` to detect injected PE in the process memory\n3. Compare the in-memory image base with the on-disk svchost.exe file hash\n4. Check the process parent (should be services.exe) and creation parameters\n5. Dump the hollowed executable from memory and analyze with Ghidra\n6. Run `netscan` to confirm the network connections from the hollowed process\n7. Scan dumped code with YARA for malware family identification\n\n**Pitfalls**:\n- Assuming all svchost.exe instances are identical (each loads different service DLLs)\n- Not checking the parent process (hollowed processes often have wrong parents)\n- Relying only on process name matching (attackers specifically target svchost.exe because multiple instances are expected)\n- Missing the injection source process that may have already terminated\n\n## Output Format\n\n```\nPROCESS INJECTION ANALYSIS REPORT\n====================================\nDump File:        memory.dmp\nAnalysis Tool:    Volatility 3.2 + Sysmon\n\nINJECTION DETECTED\nTarget Process:   svchost.exe (PID: 852)\nSource Process:    malware.exe (PID: 2184) [terminated]\nTechnique:        Process Hollowing (T1055.012)\n\nEVIDENCE\nmalfind Results:\n  PID 852 (svchost.exe):\n    Address: 0x00400000\n    Size:    184,320 bytes\n    Protection: PAGE_EXECUTE_READWRITE\n    Header: MZ (PE32 executable)\n    NOT backed by disk file\n\nProcess Verification:\n  Expected Image: C:\\Windows\\System32\\svchost.exe (SHA-256: aaa...)\n  In-Memory Image: Unknown PE (SHA-256: bbb...)\n  Result: MISMATCH - HOLLOWED PROCESS\n\nSysmon Events:\n  [4688] malware.exe (PID 2184) created svchost.exe (PID 852) SUSPENDED\n  [10]   malware.exe accessed svchost.exe with PROCESS_VM_WRITE\n  [8]    malware.exe created remote thread in svchost.exe\n\nINJECTED PAYLOAD ANALYSIS\nSHA-256:          bbb123def456...\nYARA Match:       CobaltStrike_Beacon_x64\nType:             Cobalt Strike Beacon (HTTP)\nC2:               hxxps:\u002F\u002F185.220.101[.]42\u002Fupdates\n\nMITRE ATT&CK\nT1055.012  Process Hollowing\nT1071.001  Web Protocols (HTTPS C2)\nT1036.005  Match Legitimate Name (svchost.exe)\n```\n",{"name":5,"tags":24,"author":30,"domain":31,"license":14,"version":32,"nist_csf":33,"subdomain":38,"description":39,"mitre_attack":40,"d3fend_techniques":46},[25,26,27,28,29],"malware","process-injection","detection","memory-forensics","defense-evasion","mahipal","cybersecurity","1.0.0",[34,35,36,37],"DE.AE-02","RS.AN-03","ID.RA-01","DE.CM-01","malware-analysis","Detects and analyzes process injection techniques used by malware including classic DLL injection, process hollowing, APC injection, thread hijacking, and reflective loading. Uses memory forensics, API monitoring, and behavioral analysis to identify injection artifacts. Activates for requests involving process injection detection, code injection analysis, hollowed process investigation, or in-memory threat detection.\n",[41,42,43,44,45],"T1027","T1055","T1140","T1497","T1070",[47,48,49,50,51],"Executable Denylisting","Execution Isolation","File Metadata Consistency Validation","Content Format Conversion","File Content Analysis","main","1eb986d0b0ecc180291597e08eb5a58288843536","skills\u002Fcurated_premium_skills\u002FAnthropic-Cybersecurity-Skills\u002Fskills\u002Fdetecting-process-injection-techniques","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv","2026-08-25 13:16:33",{"source":8,"skillName":5,"commands":59,"prompt":69,"zipAvailable":70},[60,63,66],{"tool":61,"command":62},"npx","npx skills add vikasvardhanv\u002Fjerry_skills --skill detecting-process-injection-techniques",{"tool":64,"command":65},"bunx","bunx skills add vikasvardhanv\u002Fjerry_skills --skill detecting-process-injection-techniques",{"tool":67,"command":68},"pnpm","pnpm dlx skills add vikasvardhanv\u002Fjerry_skills --skill detecting-process-injection-techniques","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fcurated_premium_skills\u002FAnthropic-Cybersecurity-Skills\u002Fskills\u002Fdetecting-process-injection-techniques\u002FSKILL.md",true,[72,76,82],{"path":73,"resourceType":73,"resourceTypeDesc":74,"sizeBytes":75,"sourceHtmlUrl":15},"LICENSE","许可证",11255,{"path":77,"resourceType":78,"resourceTypeDesc":79,"sizeBytes":80,"sourceHtmlUrl":81},"references\u002Fapi-reference.md","REFERENCE","参考文档",2648,"https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fcurated_premium_skills\u002FAnthropic-Cybersecurity-Skills\u002Fskills\u002Fdetecting-process-injection-techniques\u002Freferences\u002Fapi-reference.md",{"path":83,"resourceType":84,"resourceTypeDesc":85,"sizeBytes":86,"sourceHtmlUrl":87},"scripts\u002Fagent.py","SCRIPT","脚本",9240,"https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fcurated_premium_skills\u002FAnthropic-Cybersecurity-Skills\u002Fskills\u002Fdetecting-process-injection-techniques\u002Fscripts\u002Fagent.py",[89,97,104,111,118,125],{"skillNo":90,"name":91,"nameZh":6,"description":92,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":93,"licenseFileUrl":6,"sourceHtmlUrl":94,"categories":95,"keywords":96,"publishedAt":19},"01M7BESR1CJ3H5SP9XM8KYJZ9W","syllabus","Generates a curated supplementary reading list from any course syllabus using Consensus academic search. Grill-me intake (syllabus input format + course audience + year range) plus a grouping forcing-options checkpoint before any search runs — so the reading list matches the course's level and recency need. Parses the syllabus to extract topics and learning outcomes, searches Consensus for recent peer-reviewed papers per topic, and produces a professionally formatted .docx with clickable Consensus links, plain-language summaries calibrated to audience level, and Bloom-higher-order discussion questions tied to course learning goals. Use when the user uploads a syllabus, course outline, or curriculum document and wants supplementary readings (e.g., 'create a reading list from this syllabus', 'find recent papers for my course') — even casual mentions with a syllabus attached should trigger this skill.","MIT","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fresearch\u002Fsyllabus\u002Fskills\u002Fsyllabus\u002FSKILL.md",[],[],{"skillNo":98,"name":99,"nameZh":6,"description":100,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":93,"licenseFileUrl":6,"sourceHtmlUrl":101,"categories":102,"keywords":103,"publishedAt":19},"01M7BES1YA6R97W7QPMFFM1PED","pulse","Multi-source recency research skill that takes the pulse of any topic across Reddit, Hacker News, the open web, and optionally X\u002FTwitter within a configurable recent window (default 30 days). Forcing intake clarifies topic specificity, angle (trend\u002Fsentiment\u002Fproblems\u002Fopportunities\u002Fcomparison), time window, and platform scope before searching. Returns a synthesized briefing with citations, engagement metrics, and cross-platform pattern analysis. Use when the user requests multi-source recency intelligence on a topic (e.g., 'pulse on [topic]', 'what's happening with [topic]', 'what are people saying about [topic]', 'current conversation about [topic]', 'take the pulse of [topic]', 'trending: [topic]', 'find me info on [topic]'), and for competitor research, trend discovery, tool comparisons, and audience sentiment analysis.","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fresearch\u002Fpulse\u002Fskills\u002Fpulse\u002FSKILL.md",[],[],{"skillNo":105,"name":106,"nameZh":6,"description":107,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":93,"licenseFileUrl":6,"sourceHtmlUrl":108,"categories":109,"keywords":110,"publishedAt":19},"01M7BERNHYGY035AR00VRT03KE","patent","Patent prior-art and landscape intelligence skill — not generic patent help. Commits to one of five sub-use-cases via forcing intake (novelty search \u002F freedom-to-operate \u002F competitive landscape \u002F acquisition diligence \u002F litigation prior-art) before any search runs. Searches Google Patents, Espacenet, USPTO, and optionally Lens.org for citation-graph signals. Output is an editable Word document (.docx) with verdict, ranked closest art (claim-text extracted), CPC-class-aware landscape, family-resolved hits, geographic coverage, FTO flags where applicable, strategy recommendations, and full audit log. Use when the user asks for patent searching or analysis (e.g., 'prior art search for [invention]', 'freedom to operate analysis for [product]'). Produces search signal, not legal advice — always recommends consulting a patent attorney before filing or licensing decisions. Trademark, copyright, and trade-secret questions are out of scope.","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fresearch\u002Fpatent\u002Fskills\u002Fpatent\u002FSKILL.md",[],[],{"skillNo":112,"name":113,"nameZh":6,"description":114,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":93,"licenseFileUrl":6,"sourceHtmlUrl":115,"categories":116,"keywords":117,"publishedAt":19},"01M7BERCK1EAKTWW7R436WAR0J","notebooklm","Browser automation skill for controlling Google's NotebookLM. Use when the user wants anything done in NotebookLM (e.g., 'open NotebookLM', 'check my [name] notebook', 'ask my notebook about X', 'add [source] to NotebookLM', 'generate a Video Overview from my notebook', 'use NotebookLM Studio'). Handles reading and querying notebooks, adding sources (URLs, text, files, YouTube links, synthesized content), generating Studio outputs (Audio\u002FVideo Overviews, Mind Maps, Reports incl. Briefing Doc\u002FStudy Guide\u002FFAQ, Flashcards, Quiz, slide decks, infographics — discover the exact set from the live Studio panel; the UI evolves fast), and creating new notebooks. Requires browser automation environment — fails gracefully when unavailable.","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fresearch\u002Fnotebooklm\u002Fskills\u002Fnotebooklm\u002FSKILL.md",[],[],{"skillNo":119,"name":120,"nameZh":6,"description":121,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":93,"licenseFileUrl":6,"sourceHtmlUrl":122,"categories":123,"keywords":124,"publishedAt":19},"01M7BEQZAZAQRTXFJRY7RHV3TY","litreview","Academic literature orientation skill that searches papers via free keyless APIs (PubMed E-utilities + OpenAlex) by default — with the Consensus MCP as an optional enhancement lane when connected — builds a strategic search plan using PICO (default) or SPIDER \u002F Decomposition \u002F hybrid as fallbacks, and synthesizes findings into a formatted Word (.docx) research guide. Grill-me intake (research question specificity + framework hint + tentative depth) before the recon search; a second forcing checkpoint after Phase 2 confirms framework + sub-areas + depth before searches consume budget. Configurable depth (5\u002F10\u002F20 queries) controls coverage vs. speed. Output is a 'launching pad' — an orientation guide that lets a researcher dive in confidently, not a finished review. Use when the user starts literature-oriented research (e.g., 'litreview on [topic]', 'literature review on [topic]', 'I'm starting a literature review on X', 'I'm writing a paper on X', 'help me research X', 'I'm doing research on X', 'can you help me research X'). Do NOT use for single one-off paper searches wanting a quick list — that's a plain PubMed\u002FOpenAlex (or Consensus) query.","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fresearch\u002Flitreview\u002Fskills\u002Flitreview\u002FSKILL.md",[],[],{"skillNo":126,"name":127,"nameZh":6,"description":128,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":93,"licenseFileUrl":6,"sourceHtmlUrl":129,"categories":130,"keywords":131,"publishedAt":19},"01M7BEQKJ45K31QK5VRAQSVJCJ","grants","NIH grant research skill for clinical researchers. Grill-me intake (research idea + career stage + preliminary data + environment + submission posture + known institute targets) locks down the funding strategy before any search runs. Runs a 5-facet Consensus positioning analysis (with draft Significance\u002FInnovation language), maps the research to the right NIH institutes and study sections via RePORTER, finds NOSIs and funded overlap, and produces an editable Word document (.docx) with budget\u002Fscope-aware mechanism recommendations, submission timelines, and a mandatory program officer recommendation. Use when the user asks about research funding or makes any grant-related request (e.g., 'grants for [topic]', 'find grants for my research idea', 'what grants match my research', 'help me find NIH funding', 'grant opportunities for my research'). NIH-only scope — non-NIH funders (PCORI, DOD CDMRP, VA, foundations) are out of scope and flagged at intake.","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fresearch\u002Fgrants\u002Fskills\u002Fgrants\u002FSKILL.md",[],[]]