[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M798N4BDX96D7K1YGES36MY6":3,"skill-same:01M798N4BDX96D7K1YGES36MY6":51},{"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":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":30,"commitSha":31,"skillDirectory":32,"forksCount":33,"repositoryHtmlUrl":34,"repositoryHomepageUrl":6,"ownerHtmlUrl":35,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":36,"install":37,"resources":50},"01M798N4BDX96D7K1YGES36MY6","reverser-fileless-malware",null,"In-memory and fileless malware detection — AMSI bypass analysis, reflective DLL injection, CLR-hosted payloads, process hollowing, PowerShell cradle chains, WMI\u002FCOM persistence, and registry-resident payloads. Covers detection, memory forensics, and payload extraction.","7ShIkI3\u002FDecepticon-x-DarkTriad","7ShIkI3","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F78133376?v=4","01M797CTK5AHH2161YVG93NJ3B","Raphael Pascaud","01M797CTKRQS64R01J7E6TJSEM",3,"Apache-2.0","https:\u002F\u002Fgithub.com\u002F7ShIkI3\u002FDecepticon-x-DarkTriad\u002Fblob\u002Fmain\u002Fpackages\u002Fdecepticon\u002Fdecepticon\u002Fskills\u002Fstandard\u002Freverser\u002Ffileless-malware\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: reverser-fileless-malware\ndescription: \"In-memory and fileless malware detection — AMSI bypass analysis, reflective DLL injection, CLR-hosted payloads, process hollowing, PowerShell cradle chains, WMI\u002FCOM persistence, and registry-resident payloads. Covers detection, memory forensics, and payload extraction.\"\nallowed-tools: Bash Read Write\nmetadata:\n  when_to_use: \"fileless malware memory injection reflective dll process hollowing amsi bypass clr powershell cradle wmi persistence registry payload inmemory living-off-the-land lolbin\"\n  subdomain: reverser\n  tags: \"fileless, AMSI, reflective injection, process hollowing, memory forensics\"\n  mitre_attack: \"T1059.001, T1620, T1055, T1562.001\"\n---\n\n# Fileless Malware Analysis\n\nDetect, extract, and analyze malware that lives entirely in memory — no files on disk. Covers AMSI bypass techniques, reflective loading, process injection variants, and LOLBin abuse chains.\n\n## Quick Reference\n\n```bash\n# Scan for injected code in running processes\npe-sieve.exe \u002Fpid \u003CPID> \u002Fdir .\u002Fdump\u002F \u002Fshellc \u002Fiat 3\n\n# Scan ALL processes at once\nhollows_hunter.exe \u002Fdir .\u002Fhunt_results\u002F\n\n# Dump suspicious process memory\nprocdump.exe -ma \u003CPID> process.dmp\n\n# Search memory dump for PE headers\npython3 -c \"\nd=open('process.dmp','rb').read()\nimport re\nfor m in re.finditer(b'MZ',d):\n    off=m.start()\n    if d[off+0x3c:off+0x40] != b'\\x00'*4:\n        print(f'PE header at offset 0x{off:x}')\n\"\n\n# Extract PowerShell from event logs\nwevtutil qe Microsoft-Windows-PowerShell\u002FOperational \u002Ff:text \u002Fc:50\n```\n\n## MITRE ATT&CK Mapping\n\n| Technique | ID | How It Appears |\n|---|---|---|\n| PowerShell | T1059.001 | Encoded cradles, AMSI bypass, download-execute chains |\n| Reflective Code Loading | T1620 | Assembly.Load(byte[]), ReflectiveLoader in shellcode, Donut payloads |\n| Process Injection | T1055 | Classic injection, process hollowing (T1055.012), thread hijacking |\n| Impair Defenses: AMSI | T1562.001 | Patching AmsiScanBuffer, CLR hooking, registry disable |\n| WMI Event Subscription | T1546.003 | Fileless persistence via WMI consumers |\n| Signed Binary Proxy | T1218 | mshta, rundll32, regsvr32, msbuild LOLBin execution |\n\n## 1. Detect In-Memory Artifacts\n\nIdentify processes with injected or hollowed code regions.\n\n```bash\n# pe-sieve — scan single process for implants\npe-sieve.exe \u002Fpid \u003CPID> \u002Fshellc \u002Fthreads \u002Fiat 3 \u002Fdir .\u002Fpe_sieve_out\u002F\n# Output: report.json with findings per memory region\n\n# hollows_hunter — system-wide sweep\nhollows_hunter.exe \u002Fdir .\u002Fhh_out\u002F \u002Fshellc \u002Floop\n# Scans every process; reports: hollowed, implanted, unreachable\n\n# Process Hacker — manual inspection (GUI)\n# 1. Open Process Hacker → Properties on suspect process\n# 2. Memory tab → look for:\n#    - RWX regions (should be rare in legit processes)\n#    - Private regions with PE headers (MZ signature)\n#    - Mapped regions not backed by a file\n# 3. Threads tab → look for:\n#    - Threads with start address in unbacked memory\n#    - Threads in ntdll!RtlUserThreadStart pointing to RWX region\n\n# Volatility 3 — analyze memory image\nvol3 -f memory.raw windows.malfind\nvol3 -f memory.raw windows.vadinfo --pid \u003CPID>\nvol3 -f memory.raw windows.hollowfind\n```\n\n## 2. AMSI Bypass Analysis\n\nUnderstand and detect AMSI patching techniques.\n\n```bash\n# Common AMSI bypass: patching AmsiScanBuffer in amsi.dll\n# The bypass writes 0xC3 (RET) or specific bytes to the function prolog\n# Detection: compare amsi.dll in-memory vs on-disk\n\n# Check if AMSI is patched in a process\npython3 \u003C\u003C 'EOF'\nimport ctypes, ctypes.wintypes\n# Load amsi.dll and get AmsiScanBuffer address\namsi = ctypes.windll.LoadLibrary(\"amsi.dll\")\naddr = ctypes.windll.kernel32.GetProcAddress(amsi._handle, b\"AmsiScanBuffer\")\n# Read first bytes — should NOT be 0xC3 (ret) or 0x80 (cmp byte patched)\nbuf = (ctypes.c_byte * 8)()\nctypes.memmove(buf, addr, 8)\nfirst_bytes = bytes(buf)\nprint(f\"AmsiScanBuffer prolog: {first_bytes.hex()}\")\nif first_bytes[0] == 0xC3 or first_bytes[:3] == bytes([0x48, 0x31, 0xC0]):\n    print(\"[!] AMSI IS PATCHED — bypass active\")\nelse:\n    print(\"[+] AMSI appears intact\")\nEOF\n\n# ETW-based AMSI logging analysis\n# Check for disabled ETW providers (another bypass vector)\nlogman query providers | findstr \u002Fi \"amsi\\|antimalware\"\n\n# Scan PowerShell scriptblock logs for bypass patterns\n# Event Log: Microsoft-Windows-PowerShell\u002FOperational, Event ID 4104\nwevtutil qe \"Microsoft-Windows-PowerShell\u002FOperational\" \u002Fq:\"*[System[EventID=4104]]\" \u002Ff:text \u002Fc:100 > scriptblocks.txt\ngrep -iE \"AmsiScanBuffer|amsiInitFailed|AmsiUtils|Reflection\\.Assembly|VirtualProtect|Marshal\\.Copy\" scriptblocks.txt\n\n# Known AMSI bypass signatures to hunt\n# 1. Matt Graeber's reflection: [Ref].Assembly.GetType('System.Management.Automation.AmsiUtils')\n# 2. Direct patch: VirtualProtect + Marshal.Copy on AmsiScanBuffer\n# 3. amsiInitFailed field set to $true\n# 4. CLR hooking via profiler DLL\n# 5. Registry disable: HKCU\\Software\\Microsoft\\Windows Script\\Settings\\AmsiEnable=0\n```\n\n## 3. Reflective DLL Injection Analysis\n\nDetect and extract reflectively loaded DLLs.\n\n```bash\n# Reflective loaders don't use LoadLibrary — they parse PE headers manually\n# Key indicators:\n# - RWX memory region with PE header\n# - No corresponding file on disk\n# - Thread start address in unbacked memory\n\n# pe-sieve dump of reflective DLL\npe-sieve.exe \u002Fpid \u003CPID> \u002Fdir .\u002Fdump\u002F \u002Fimp 3 \u002Fshellc\n# Reconstructs import table from the dump\n\n# Manual extraction from process memory\npython3 \u003C\u003C 'EOF'\nimport ctypes\nfrom ctypes import wintypes\n\nPROCESS_VM_READ = 0x0010\nPROCESS_QUERY_INFORMATION = 0x0400\npid = \u003CPID>\n\nkernel32 = ctypes.windll.kernel32\nhandle = kernel32.OpenProcess(PROCESS_VM_READ | PROCESS_QUERY_INFORMATION, False, pid)\n\n# Walk memory regions looking for MZ headers in RWX pages\naddr = 0\nwhile addr \u003C 0x7FFFFFFFFFFF:\n    mbi = ctypes.create_string_buffer(48)\n    if kernel32.VirtualQueryEx(handle, addr, mbi, 48) == 0:\n        break\n    # Parse MEMORY_BASIC_INFORMATION\n    base = int.from_bytes(mbi[0:8], 'little')\n    size = int.from_bytes(mbi[24:32], 'little')\n    protect = int.from_bytes(mbi[32:36], 'little')\n    state = int.from_bytes(mbi[16:20], 'little')\n\n    # PAGE_EXECUTE_READWRITE = 0x40, MEM_COMMIT = 0x1000\n    if state == 0x1000 and protect == 0x40 and size > 0x1000:\n        buf = (ctypes.c_char * min(size, 0x200))()\n        read = ctypes.c_size_t()\n        kernel32.ReadProcessMemory(handle, base, buf, len(buf), ctypes.byref(read))\n        if buf.raw[:2] == b'MZ':\n            print(f\"[!] PE in RWX at 0x{base:x} size=0x{size:x}\")\n    addr = base + size\nkernel32.CloseHandle(handle)\nEOF\n\n# Volatility malfind — finds injected code regions\nvol3 -f memory.raw windows.malfind --pid \u003CPID> --dump --dump-dir .\u002Fmalfind_dumps\u002F\n```\n\n## 4. Process Hollowing Detection\n\n```bash\n# Detect hollowed processes: legitimate image path but injected code\n# Key sign: PEB ImageBaseAddress differs from on-disk PE base\n\n# Volatility hollow process detection\nvol3 -f memory.raw windows.hollowfind\n\n# Manual check with pe-sieve\npe-sieve.exe \u002Fpid \u003CPID> \u002Fhooks \u002Fiat 3 \u002Fdir .\u002Fhollow_check\u002F\n# Look for \"replaced\" status in report.json\n\n# Sysmon-based detection (Event ID 25 — process tampering)\nwevtutil qe \"Microsoft-Windows-Sysmon\u002FOperational\" \u002Fq:\"*[System[EventID=25]]\" \u002Ff:text \u002Fc:20\n\n# Common hollowing targets (watch these processes):\n# svchost.exe, explorer.exe, notepad.exe, dllhost.exe, RuntimeBroker.exe\n# If their in-memory image doesn't match disk → hollowed\n```\n\n## 5. PowerShell Cradle Chain Reconstruction\n\n```bash\n# Extract full PowerShell execution chain from logs\n# ScriptBlock Logging (Event ID 4104) captures decoded content\n\n# Export all scriptblock events\npowershell -c \"Get-WinEvent -LogName 'Microsoft-Windows-PowerShell\u002FOperational' | Where-Object {$_.Id -eq 4104} | Select-Object -Property TimeCreated,Message | Export-Csv scriptblocks.csv\"\n\n# Common fileless chain pattern:\n# Stage 0: mshta\u002Fwscript\u002Fshortcut → powershell -enc \u003Cbase64>\n# Stage 1: IEX(New-Object Net.WebClient).DownloadString('http:\u002F\u002F...')\n# Stage 2: Reflective load .NET assembly or shellcode via [System.Reflection.Assembly]::Load()\n# Stage 3: In-memory C2 beacon (Cobalt Strike, Sliver, etc.)\n\n# Decode base64 PowerShell\npython3 \u003C\u003C 'EOF'\nimport base64\nencoded = \"\u003CBASE64_FROM_CMDLINE>\"\ndecoded = base64.b64decode(encoded).decode('utf-16-le')\nprint(decoded)\n# Extract URLs\nimport re\nurls = re.findall(r'https?:\u002F\u002F[^\\s\\'\"]+', decoded)\nfor u in urls:\n    print(f\"  URL: {u}\")\nEOF\n\n# Reconstruct WMI persistence (fileless persistence mechanism)\nwmic \u002Fnamespace:\\\\root\\subscription path __EventFilter list full\nwmic \u002Fnamespace:\\\\root\\subscription path CommandLineEventConsumer list full\nwmic \u002Fnamespace:\\\\root\\subscription path __FilterToConsumerBinding list full\n```\n\n## 6. CLR-Hosted Payload Extraction\n\n```bash\n# .NET assemblies loaded via Assembly.Load(byte[]) leave CLR artifacts\n# Detect: ETW CLR events or inspect AppDomain loaded assemblies\n\n# List loaded assemblies in a process using ClrMD\npython3 \u003C\u003C 'EOF'\n# Use clrmd via pythonnet or dump with SOS\n# Alternative: use procdump + dotnet-dump\nimport subprocess\nsubprocess.run([\"procdump\", \"-ma\", str(\u003CPID>), \"clr_dump.dmp\"])\n# Then analyze with dotnet-dump\nsubprocess.run([\"dotnet-dump\", \"analyze\", \"clr_dump.dmp\"],\n               input=b\"clrmodules\\ndumpheap -stat -type System.Reflection.Assembly\\nexit\\n\")\nEOF\n\n# WinDbg + SOS approach for CLR inspection\n# .loadby sos clr\n# !DumpDomain           — lists all AppDomains and loaded assemblies\n# !DumpAssembly \u003Caddr>  — details of a specific assembly\n# !SaveModule \u003Caddr> recovered.dll  — save module to disk\n\n# ETW provider for CLR loading events\nlogman create trace clr_trace -p {E13C0D23-CCBC-4E12-931B-D9CC2EEE27E4} 0x8 -o clr_events.etl\n# Keywords 0x8 = LoaderKeyword — captures Assembly.Load events\n```\n\n## Tools & Resources\n\n| Tool | Purpose | Install |\n|---|---|---|\n| pe-sieve | Detect implants\u002Fhollowing in running processes | github.com\u002Fhasherezade\u002Fpe-sieve |\n| hollows_hunter | System-wide pe-sieve scan | github.com\u002Fhasherezade\u002Fhollows_hunter |\n| Process Hacker | Advanced process inspector (GUI) | processhacker.sourceforge.io |\n| Volatility 3 | Memory image forensics | github.com\u002Fvolatilityfoundation\u002Fvolatility3 |\n| Moneta | Detect in-memory malware artifacts | github.com\u002Fforrest-orr\u002Fmoneta |\n| Sysmon | Windows system activity logging | docs.microsoft.com\u002Fsysinternals\u002Fsysmon |\n| procdump | Process memory dumper | docs.microsoft.com\u002Fsysinternals\u002Fprocdump |\n| dotnet-dump | .NET managed dump analyzer | dotnet tool install -g dotnet-dump |\n| ETWExplorer | ETW provider browser | github.com\u002Fzodiacon\u002FEtwExplorer |\n\n## Detection Signatures\n\n| Indicator | Description | Detection |\n|---|---|---|\n| RWX memory region with MZ header | Reflectively loaded PE | pe-sieve \u002Fshellc; Volatility malfind |\n| `AmsiScanBuffer` patched prolog | AMSI bypass active | Compare in-memory vs on-disk amsi.dll |\n| PowerShell `-enc` with long base64 | Encoded PowerShell payload | Sysmon Event ID 1, CommandLine regex |\n| WMI event subscription | Fileless persistence | WMI query __EventFilter \u002F CommandLineEventConsumer |\n| Thread start in unbacked memory | Injected thread | Process Hacker threads tab; Moneta scan |\n| `csc.exe` \u002F `msbuild.exe` with no project | LOLBin code compilation | Sysmon: parent process analysis |\n| High scriptblock Event ID 4104 volume | PowerShell cradle chain | SIEM correlation on 4104 burst |\n\n## Error Handling & Edge Cases\n\n| Issue | Resolution |\n|---|---|\n| pe-sieve misses injected .NET | Use `\u002Fdotnet` flag; .NET assemblies need CLR-aware scanning |\n| Process terminates before dump | Use Sysmon + scriptblock logging for post-mortem; configure proactive ETW tracing |\n| AMSI patched before logging starts | Use kernel-mode ETW or driver-based monitoring (e.g., Microsoft Defender ATP kernel sensor) |\n| PowerShell constrained language mode | Attacker may bypass via `Add-Type` with inline C# or CMSTP\u002FMSBuild LOLBins |\n| Memory image too large for Volatility | Use `--pid` to scope analysis; increase system swap |\n| Anti-forensics: timestomped\u002Fcleared logs | Cross-reference with NTFS $MFT, Sysmon, and network logs |\n| Kernel-mode injection (driver-level) | Out of scope for user-mode tools — see reverser\u002Frootkit-analysis |\n\n## Decision Gate\n\n```\nIF suspicious process has RWX regions or pe-sieve\u002Fhollows_hunter hits:\n  → Dump process memory (procdump -ma)\n  → Extract implants with pe-sieve \u002Fimp 3\n  → Identify payload type (.NET → dnSpy; native → Ghidra)\n  → Trace injection chain (parent process, command line, scriptblocks)\nELSE IF PowerShell scriptblock logs show encoded\u002Fobfuscated content:\n  → Decode all stages\n  → Identify download URLs and in-memory payloads\n  → Check for AMSI bypass indicators\nELSE IF WMI persistence found:\n  → Extract consumer script\u002Fcommand\n  → Trace event filter trigger conditions\n  → Remove binding + consumer + filter\nELSE:\n  → Enable Sysmon + scriptblock logging + ETW\n  → Re-run detection after activity window\n```\n","# Fileless Malware Analysis\n\nDetect, extract, and analyze malware that lives entirely in memory — no files on disk. Covers AMSI bypass techniques, reflective loading, process injection variants, and LOLBin abuse chains.\n\n## Quick Reference\n\n```bash\n# Scan for injected code in running processes\npe-sieve.exe \u002Fpid \u003CPID> \u002Fdir .\u002Fdump\u002F \u002Fshellc \u002Fiat 3\n\n# Scan ALL processes at once\nhollows_hunter.exe \u002Fdir .\u002Fhunt_results\u002F\n\n# Dump suspicious process memory\nprocdump.exe -ma \u003CPID> process.dmp\n\n# Search memory dump for PE headers\npython3 -c \"\nd=open('process.dmp','rb').read()\nimport re\nfor m in re.finditer(b'MZ',d):\n    off=m.start()\n    if d[off+0x3c:off+0x40] != b'\\x00'*4:\n        print(f'PE header at offset 0x{off:x}')\n\"\n\n# Extract PowerShell from event logs\nwevtutil qe Microsoft-Windows-PowerShell\u002FOperational \u002Ff:text \u002Fc:50\n```\n\n## MITRE ATT&CK Mapping\n\n| Technique | ID | How It Appears |\n|---|---|---|\n| PowerShell | T1059.001 | Encoded cradles, AMSI bypass, download-execute chains |\n| Reflective Code Loading | T1620 | Assembly.Load(byte[]), ReflectiveLoader in shellcode, Donut payloads |\n| Process Injection | T1055 | Classic injection, process hollowing (T1055.012), thread hijacking |\n| Impair Defenses: AMSI | T1562.001 | Patching AmsiScanBuffer, CLR hooking, registry disable |\n| WMI Event Subscription | T1546.003 | Fileless persistence via WMI consumers |\n| Signed Binary Proxy | T1218 | mshta, rundll32, regsvr32, msbuild LOLBin execution |\n\n## 1. Detect In-Memory Artifacts\n\nIdentify processes with injected or hollowed code regions.\n\n```bash\n# pe-sieve — scan single process for implants\npe-sieve.exe \u002Fpid \u003CPID> \u002Fshellc \u002Fthreads \u002Fiat 3 \u002Fdir .\u002Fpe_sieve_out\u002F\n# Output: report.json with findings per memory region\n\n# hollows_hunter — system-wide sweep\nhollows_hunter.exe \u002Fdir .\u002Fhh_out\u002F \u002Fshellc \u002Floop\n# Scans every process; reports: hollowed, implanted, unreachable\n\n# Process Hacker — manual inspection (GUI)\n# 1. Open Process Hacker → Properties on suspect process\n# 2. Memory tab → look for:\n#    - RWX regions (should be rare in legit processes)\n#    - Private regions with PE headers (MZ signature)\n#    - Mapped regions not backed by a file\n# 3. Threads tab → look for:\n#    - Threads with start address in unbacked memory\n#    - Threads in ntdll!RtlUserThreadStart pointing to RWX region\n\n# Volatility 3 — analyze memory image\nvol3 -f memory.raw windows.malfind\nvol3 -f memory.raw windows.vadinfo --pid \u003CPID>\nvol3 -f memory.raw windows.hollowfind\n```\n\n## 2. AMSI Bypass Analysis\n\nUnderstand and detect AMSI patching techniques.\n\n```bash\n# Common AMSI bypass: patching AmsiScanBuffer in amsi.dll\n# The bypass writes 0xC3 (RET) or specific bytes to the function prolog\n# Detection: compare amsi.dll in-memory vs on-disk\n\n# Check if AMSI is patched in a process\npython3 \u003C\u003C 'EOF'\nimport ctypes, ctypes.wintypes\n# Load amsi.dll and get AmsiScanBuffer address\namsi = ctypes.windll.LoadLibrary(\"amsi.dll\")\naddr = ctypes.windll.kernel32.GetProcAddress(amsi._handle, b\"AmsiScanBuffer\")\n# Read first bytes — should NOT be 0xC3 (ret) or 0x80 (cmp byte patched)\nbuf = (ctypes.c_byte * 8)()\nctypes.memmove(buf, addr, 8)\nfirst_bytes = bytes(buf)\nprint(f\"AmsiScanBuffer prolog: {first_bytes.hex()}\")\nif first_bytes[0] == 0xC3 or first_bytes[:3] == bytes([0x48, 0x31, 0xC0]):\n    print(\"[!] AMSI IS PATCHED — bypass active\")\nelse:\n    print(\"[+] AMSI appears intact\")\nEOF\n\n# ETW-based AMSI logging analysis\n# Check for disabled ETW providers (another bypass vector)\nlogman query providers | findstr \u002Fi \"amsi\\|antimalware\"\n\n# Scan PowerShell scriptblock logs for bypass patterns\n# Event Log: Microsoft-Windows-PowerShell\u002FOperational, Event ID 4104\nwevtutil qe \"Microsoft-Windows-PowerShell\u002FOperational\" \u002Fq:\"*[System[EventID=4104]]\" \u002Ff:text \u002Fc:100 > scriptblocks.txt\ngrep -iE \"AmsiScanBuffer|amsiInitFailed|AmsiUtils|Reflection\\.Assembly|VirtualProtect|Marshal\\.Copy\" scriptblocks.txt\n\n# Known AMSI bypass signatures to hunt\n# 1. Matt Graeber's reflection: [Ref].Assembly.GetType('System.Management.Automation.AmsiUtils')\n# 2. Direct patch: VirtualProtect + Marshal.Copy on AmsiScanBuffer\n# 3. amsiInitFailed field set to $true\n# 4. CLR hooking via profiler DLL\n# 5. Registry disable: HKCU\\Software\\Microsoft\\Windows Script\\Settings\\AmsiEnable=0\n```\n\n## 3. Reflective DLL Injection Analysis\n\nDetect and extract reflectively loaded DLLs.\n\n```bash\n# Reflective loaders don't use LoadLibrary — they parse PE headers manually\n# Key indicators:\n# - RWX memory region with PE header\n# - No corresponding file on disk\n# - Thread start address in unbacked memory\n\n# pe-sieve dump of reflective DLL\npe-sieve.exe \u002Fpid \u003CPID> \u002Fdir .\u002Fdump\u002F \u002Fimp 3 \u002Fshellc\n# Reconstructs import table from the dump\n\n# Manual extraction from process memory\npython3 \u003C\u003C 'EOF'\nimport ctypes\nfrom ctypes import wintypes\n\nPROCESS_VM_READ = 0x0010\nPROCESS_QUERY_INFORMATION = 0x0400\npid = \u003CPID>\n\nkernel32 = ctypes.windll.kernel32\nhandle = kernel32.OpenProcess(PROCESS_VM_READ | PROCESS_QUERY_INFORMATION, False, pid)\n\n# Walk memory regions looking for MZ headers in RWX pages\naddr = 0\nwhile addr \u003C 0x7FFFFFFFFFFF:\n    mbi = ctypes.create_string_buffer(48)\n    if kernel32.VirtualQueryEx(handle, addr, mbi, 48) == 0:\n        break\n    # Parse MEMORY_BASIC_INFORMATION\n    base = int.from_bytes(mbi[0:8], 'little')\n    size = int.from_bytes(mbi[24:32], 'little')\n    protect = int.from_bytes(mbi[32:36], 'little')\n    state = int.from_bytes(mbi[16:20], 'little')\n\n    # PAGE_EXECUTE_READWRITE = 0x40, MEM_COMMIT = 0x1000\n    if state == 0x1000 and protect == 0x40 and size > 0x1000:\n        buf = (ctypes.c_char * min(size, 0x200))()\n        read = ctypes.c_size_t()\n        kernel32.ReadProcessMemory(handle, base, buf, len(buf), ctypes.byref(read))\n        if buf.raw[:2] == b'MZ':\n            print(f\"[!] PE in RWX at 0x{base:x} size=0x{size:x}\")\n    addr = base + size\nkernel32.CloseHandle(handle)\nEOF\n\n# Volatility malfind — finds injected code regions\nvol3 -f memory.raw windows.malfind --pid \u003CPID> --dump --dump-dir .\u002Fmalfind_dumps\u002F\n```\n\n## 4. Process Hollowing Detection\n\n```bash\n# Detect hollowed processes: legitimate image path but injected code\n# Key sign: PEB ImageBaseAddress differs from on-disk PE base\n\n# Volatility hollow process detection\nvol3 -f memory.raw windows.hollowfind\n\n# Manual check with pe-sieve\npe-sieve.exe \u002Fpid \u003CPID> \u002Fhooks \u002Fiat 3 \u002Fdir .\u002Fhollow_check\u002F\n# Look for \"replaced\" status in report.json\n\n# Sysmon-based detection (Event ID 25 — process tampering)\nwevtutil qe \"Microsoft-Windows-Sysmon\u002FOperational\" \u002Fq:\"*[System[EventID=25]]\" \u002Ff:text \u002Fc:20\n\n# Common hollowing targets (watch these processes):\n# svchost.exe, explorer.exe, notepad.exe, dllhost.exe, RuntimeBroker.exe\n# If their in-memory image doesn't match disk → hollowed\n```\n\n## 5. PowerShell Cradle Chain Reconstruction\n\n```bash\n# Extract full PowerShell execution chain from logs\n# ScriptBlock Logging (Event ID 4104) captures decoded content\n\n# Export all scriptblock events\npowershell -c \"Get-WinEvent -LogName 'Microsoft-Windows-PowerShell\u002FOperational' | Where-Object {$_.Id -eq 4104} | Select-Object -Property TimeCreated,Message | Export-Csv scriptblocks.csv\"\n\n# Common fileless chain pattern:\n# Stage 0: mshta\u002Fwscript\u002Fshortcut → powershell -enc \u003Cbase64>\n# Stage 1: IEX(New-Object Net.WebClient).DownloadString('http:\u002F\u002F...')\n# Stage 2: Reflective load .NET assembly or shellcode via [System.Reflection.Assembly]::Load()\n# Stage 3: In-memory C2 beacon (Cobalt Strike, Sliver, etc.)\n\n# Decode base64 PowerShell\npython3 \u003C\u003C 'EOF'\nimport base64\nencoded = \"\u003CBASE64_FROM_CMDLINE>\"\ndecoded = base64.b64decode(encoded).decode('utf-16-le')\nprint(decoded)\n# Extract URLs\nimport re\nurls = re.findall(r'https?:\u002F\u002F[^\\s\\'\"]+', decoded)\nfor u in urls:\n    print(f\"  URL: {u}\")\nEOF\n\n# Reconstruct WMI persistence (fileless persistence mechanism)\nwmic \u002Fnamespace:\\\\root\\subscription path __EventFilter list full\nwmic \u002Fnamespace:\\\\root\\subscription path CommandLineEventConsumer list full\nwmic \u002Fnamespace:\\\\root\\subscription path __FilterToConsumerBinding list full\n```\n\n## 6. CLR-Hosted Payload Extraction\n\n```bash\n# .NET assemblies loaded via Assembly.Load(byte[]) leave CLR artifacts\n# Detect: ETW CLR events or inspect AppDomain loaded assemblies\n\n# List loaded assemblies in a process using ClrMD\npython3 \u003C\u003C 'EOF'\n# Use clrmd via pythonnet or dump with SOS\n# Alternative: use procdump + dotnet-dump\nimport subprocess\nsubprocess.run([\"procdump\", \"-ma\", str(\u003CPID>), \"clr_dump.dmp\"])\n# Then analyze with dotnet-dump\nsubprocess.run([\"dotnet-dump\", \"analyze\", \"clr_dump.dmp\"],\n               input=b\"clrmodules\\ndumpheap -stat -type System.Reflection.Assembly\\nexit\\n\")\nEOF\n\n# WinDbg + SOS approach for CLR inspection\n# .loadby sos clr\n# !DumpDomain           — lists all AppDomains and loaded assemblies\n# !DumpAssembly \u003Caddr>  — details of a specific assembly\n# !SaveModule \u003Caddr> recovered.dll  — save module to disk\n\n# ETW provider for CLR loading events\nlogman create trace clr_trace -p {E13C0D23-CCBC-4E12-931B-D9CC2EEE27E4} 0x8 -o clr_events.etl\n# Keywords 0x8 = LoaderKeyword — captures Assembly.Load events\n```\n\n## Tools & Resources\n\n| Tool | Purpose | Install |\n|---|---|---|\n| pe-sieve | Detect implants\u002Fhollowing in running processes | github.com\u002Fhasherezade\u002Fpe-sieve |\n| hollows_hunter | System-wide pe-sieve scan | github.com\u002Fhasherezade\u002Fhollows_hunter |\n| Process Hacker | Advanced process inspector (GUI) | processhacker.sourceforge.io |\n| Volatility 3 | Memory image forensics | github.com\u002Fvolatilityfoundation\u002Fvolatility3 |\n| Moneta | Detect in-memory malware artifacts | github.com\u002Fforrest-orr\u002Fmoneta |\n| Sysmon | Windows system activity logging | docs.microsoft.com\u002Fsysinternals\u002Fsysmon |\n| procdump | Process memory dumper | docs.microsoft.com\u002Fsysinternals\u002Fprocdump |\n| dotnet-dump | .NET managed dump analyzer | dotnet tool install -g dotnet-dump |\n| ETWExplorer | ETW provider browser | github.com\u002Fzodiacon\u002FEtwExplorer |\n\n## Detection Signatures\n\n| Indicator | Description | Detection |\n|---|---|---|\n| RWX memory region with MZ header | Reflectively loaded PE | pe-sieve \u002Fshellc; Volatility malfind |\n| `AmsiScanBuffer` patched prolog | AMSI bypass active | Compare in-memory vs on-disk amsi.dll |\n| PowerShell `-enc` with long base64 | Encoded PowerShell payload | Sysmon Event ID 1, CommandLine regex |\n| WMI event subscription | Fileless persistence | WMI query __EventFilter \u002F CommandLineEventConsumer |\n| Thread start in unbacked memory | Injected thread | Process Hacker threads tab; Moneta scan |\n| `csc.exe` \u002F `msbuild.exe` with no project | LOLBin code compilation | Sysmon: parent process analysis |\n| High scriptblock Event ID 4104 volume | PowerShell cradle chain | SIEM correlation on 4104 burst |\n\n## Error Handling & Edge Cases\n\n| Issue | Resolution |\n|---|---|\n| pe-sieve misses injected .NET | Use `\u002Fdotnet` flag; .NET assemblies need CLR-aware scanning |\n| Process terminates before dump | Use Sysmon + scriptblock logging for post-mortem; configure proactive ETW tracing |\n| AMSI patched before logging starts | Use kernel-mode ETW or driver-based monitoring (e.g., Microsoft Defender ATP kernel sensor) |\n| PowerShell constrained language mode | Attacker may bypass via `Add-Type` with inline C# or CMSTP\u002FMSBuild LOLBins |\n| Memory image too large for Volatility | Use `--pid` to scope analysis; increase system swap |\n| Anti-forensics: timestomped\u002Fcleared logs | Cross-reference with NTFS $MFT, Sysmon, and network logs |\n| Kernel-mode injection (driver-level) | Out of scope for user-mode tools — see reverser\u002Frootkit-analysis |\n\n## Decision Gate\n\n```\nIF suspicious process has RWX regions or pe-sieve\u002Fhollows_hunter hits:\n  → Dump process memory (procdump -ma)\n  → Extract implants with pe-sieve \u002Fimp 3\n  → Identify payload type (.NET → dnSpy; native → Ghidra)\n  → Trace injection chain (parent process, command line, scriptblocks)\nELSE IF PowerShell scriptblock logs show encoded\u002Fobfuscated content:\n  → Decode all stages\n  → Identify download URLs and in-memory payloads\n  → Check for AMSI bypass indicators\nELSE IF WMI persistence found:\n  → Extract consumer script\u002Fcommand\n  → Trace event filter trigger conditions\n  → Remove binding + consumer + filter\nELSE:\n  → Enable Sysmon + scriptblock logging + ETW\n  → Re-run detection after activity window\n```\n",{"name":5,"metadata":24,"description":7,"allowed-tools":29},{"tags":25,"subdomain":26,"when_to_use":27,"mitre_attack":28},"fileless, AMSI, reflective injection, process hollowing, memory forensics","reverser","fileless malware memory injection reflective dll process hollowing amsi bypass clr powershell cradle wmi persistence registry payload inmemory living-off-the-land lolbin","T1059.001, T1620, T1055, T1562.001","Bash Read Write","main","42b918525fb79065e730da3da997bffb33fcd414","packages\u002Fdecepticon\u002Fdecepticon\u002Fskills\u002Fstandard\u002Freverser\u002Ffileless-malware",0,"https:\u002F\u002Fgithub.com\u002F7ShIkI3\u002FDecepticon-x-DarkTriad","https:\u002F\u002Fgithub.com\u002F7ShIkI3","2026-07-22 19:02:27",{"source":8,"skillName":5,"commands":38,"prompt":48,"zipAvailable":49},[39,42,45],{"tool":40,"command":41},"npx","npx skills add 7ShIkI3\u002FDecepticon-x-DarkTriad --skill reverser-fileless-malware",{"tool":43,"command":44},"bunx","bunx skills add 7ShIkI3\u002FDecepticon-x-DarkTriad --skill reverser-fileless-malware",{"tool":46,"command":47},"pnpm","pnpm dlx skills add 7ShIkI3\u002FDecepticon-x-DarkTriad --skill reverser-fileless-malware","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002F7ShIkI3\u002FDecepticon-x-DarkTriad\u002Fblob\u002Fmain\u002Fpackages\u002Fdecepticon\u002Fdecepticon\u002Fskills\u002Fstandard\u002Freverser\u002Ffileless-malware\u002FSKILL.md",true,[],[52,59,66,73,80,87],{"skillNo":53,"name":54,"nameZh":6,"description":55,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":56,"categories":57,"keywords":58,"publishedAt":19},"01M798TNHEBA4Y67TJJ7W0KBDD","wps-pixie-dust","WPS Pixie-Dust offline nonce attack (reaver -K \u002F pixiewps) and fallback online PIN brute (bully) to recover the AP's WPA PSK without capturing a handshake.","https:\u002F\u002Fgithub.com\u002F7ShIkI3\u002FDecepticon-x-DarkTriad\u002Fblob\u002Fmain\u002Fpackages\u002Fdecepticon\u002Fdecepticon\u002Fskills\u002Fstandard\u002Fwireless\u002Fwps-pixie-dust\u002FSKILL.md",[],[],{"skillNo":60,"name":61,"nameZh":6,"description":62,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":63,"categories":64,"keywords":65,"publishedAt":19},"01M798TH79VR8XM7AAMG0ZKSXX","wpa3-sae","WPA3-SAE transition-mode downgrade (DragonShift), SSID Confusion CVE-2023-52424, Dragonblood side-channels, and SAE captive-portal credential recovery against WPA3-Personal networks.","https:\u002F\u002Fgithub.com\u002F7ShIkI3\u002FDecepticon-x-DarkTriad\u002Fblob\u002Fmain\u002Fpackages\u002Fdecepticon\u002Fdecepticon\u002Fskills\u002Fstandard\u002Fwireless\u002Fwpa3-sae\u002FSKILL.md",[],[],{"skillNo":67,"name":68,"nameZh":6,"description":69,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":70,"categories":71,"keywords":72,"publishedAt":19},"01M798TD0E10ZHQN5X362M4HG9","wpa2-psk","WPA\u002FWPA2-PSK handshake capture via targeted deauth + PMKID (no deauth required) + offline hashcat cracking. The most common consumer\u002FSMB encryption mode in 2026.","https:\u002F\u002Fgithub.com\u002F7ShIkI3\u002FDecepticon-x-DarkTriad\u002Fblob\u002Fmain\u002Fpackages\u002Fdecepticon\u002Fdecepticon\u002Fskills\u002Fstandard\u002Fwireless\u002Fwpa2-psk\u002FSKILL.md",[],[],{"skillNo":74,"name":75,"nameZh":6,"description":76,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":77,"categories":78,"keywords":79,"publishedAt":19},"01M798T7HFR3NB9WJTK1FESVF9","wpa-enterprise-eap","WPA\u002FWPA2\u002FWPA3-Enterprise (802.1X\u002FEAP) rogue-RADIUS evil-twin for MSCHAPv2 capture, GTC downgrade, and PEAP relay. MSCHAPv2 capture equals a NetNTLM hash — the primary wireless on-ramp to Active Directory.","https:\u002F\u002Fgithub.com\u002F7ShIkI3\u002FDecepticon-x-DarkTriad\u002Fblob\u002Fmain\u002Fpackages\u002Fdecepticon\u002Fdecepticon\u002Fskills\u002Fstandard\u002Fwireless\u002Fwpa-enterprise-eap\u002FSKILL.md",[],[],{"skillNo":81,"name":82,"nameZh":6,"description":83,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":84,"categories":85,"keywords":86,"publishedAt":19},"01M798T38B4SV0T87VQK56KPHC","krack-fragattacks","KRACK key-reinstallation (CVE-2017-13077..13082) and FragAttacks fragmentation\u002Faggregation flaws (CVE-2020-24586..24588, CVE-2020-26139..26147) against legacy or embedded 802.11 supplicants with poor patch cadence.","https:\u002F\u002Fgithub.com\u002F7ShIkI3\u002FDecepticon-x-DarkTriad\u002Fblob\u002Fmain\u002Fpackages\u002Fdecepticon\u002Fdecepticon\u002Fskills\u002Fstandard\u002Fwireless\u002Fkrack-fragattacks\u002FSKILL.md",[],[],{"skillNo":88,"name":89,"nameZh":6,"description":90,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":91,"categories":92,"keywords":93,"publishedAt":19},"01M798SXTNF0RP1DXKQEWFVQ9H","evil-twin-karma","Evil-twin rogue AP with KARMA\u002FMana PNL-probe response, captive-portal credential capture, and post-association MITM for PSK\u002Fopen networks. Distinct from wpa-enterprise-eap which targets 802.1X.","https:\u002F\u002Fgithub.com\u002F7ShIkI3\u002FDecepticon-x-DarkTriad\u002Fblob\u002Fmain\u002Fpackages\u002Fdecepticon\u002Fdecepticon\u002Fskills\u002Fstandard\u002Fwireless\u002Fevil-twin-karma\u002FSKILL.md",[],[]]