memory-forensics – skill Bảo mật cho agent AI
Kỹ thuật toàn diện để thu thập, phân tích và trích xuất artifact từ bản dump bộ nhớ phục vụ ứng phó sự cố và phân tích mã độc.
Cài skill memory-forensics bằng một lệnh
Chọn công cụ bạn đang dùng, copy lệnh và dán vào terminal. Skill sẽ nằm trong thư mục skills của công cụ đó và sẵn sàng dùng ở phiên làm việc tiếp theo.
Claude Code
mkdir -p ~/.claude/skills && curl -fsSL https://skill.dn1nguoi.com/z/memory-forensics-a6d51.tgz | tar xz -C ~/.claude/skills
Gọi trong Claude Code: /memory-forensics – rồi mô tả công việc bạn muốn làm.
Codex
mkdir -p ~/.codex/skills && curl -fsSL https://skill.dn1nguoi.com/z/memory-forensics-a6d51.tgz | tar xz -C ~/.codex/skills
Gọi trong Codex: $memory-forensics – rồi mô tả công việc bạn muốn làm.
Hermes Agent
mkdir -p ~/.hermes/skills && curl -fsSL https://skill.dn1nguoi.com/z/memory-forensics-a6d51.tgz | tar xz -C ~/.hermes/skills
Gọi trong Hermes Agent: /memory-forensics – rồi mô tả công việc bạn muốn làm.
DeepSeek
mkdir -p ~/.deepcode/skills && curl -fsSL https://skill.dn1nguoi.com/z/memory-forensics-a6d51.tgz | tar xz -C ~/.deepcode/skills
Gọi trong DeepSeek: /memory-forensics – rồi mô tả công việc bạn muốn làm.
Nội dung SKILL.md
Nội dung SKILL.md gốc bằng tiếng Anh.
Memory Forensics
Comprehensive techniques for acquiring, analyzing, and extracting artifacts from memory dumps for incident response and malware analysis.
Use this skill when
- Working on memory forensics tasks or workflows
- Needing guidance, best practices, or checklists for memory forensics
Do not use this skill when
- The task is unrelated to memory forensics
- You need a different domain or tool outside this scope
Instructions
- Clarify goals, constraints, and required inputs.
- Apply relevant best practices and validate outcomes.
- Provide actionable steps and verification.
Memory Acquisition
Confirm authorization for the exact host/VM and sensitive-memory acquisition before collection. Dumps can contain passwords, private keys and personal records: store encrypted/restricted, hash originals, record tool/version/time and chain of custody, and analyze copies offline. Do not upload dumps or credential outputs to external services without explicit disclosure authority. Credential-extraction plugins are a separate sensitive step, not routine triage.
Acquisition can pause/crash or perturb a live system. Use a trusted OS-compatible tool, verify output capacity and document completeness; /dev/mem is often restricted and /proc/kcore is a sparse virtual view, not a portable substitute for a validated physical capture. Legacy macOS tools may not support the target hardware/OS. No capture command here is universally safe.
Live Acquisition Tools
Windows
# WinPmem (Recommended)
winpmem_mini_x64.exe memory.raw
# DumpIt
DumpIt.exe
# Belkasoft RAM Capturer
# GUI-based, outputs raw format
# Magnet RAM Capture
# GUI-based, outputs raw formatLinux
# LiME (Linux Memory Extractor)
sudo insmod lime.ko "path=/tmp/memory.lime format=lime"
# /dev/mem (limited, requires permissions)
sudo dd if=/dev/mem of=memory.raw bs=1M
# /proc/kcore (ELF format)
sudo cp /proc/kcore memory.elfmacOS
# osxpmem
sudo ./osxpmem -o memory.raw
# MacQuisition (commercial)Virtual Machine Memory
# VMware: .vmem file is raw memory
cp vm.vmem memory.raw
# VirtualBox: Use debug console
vboxmanage debugvm "VMName" dumpvmcore --filename memory.elf
# QEMU
virsh dump <domain> memory.raw --memory-only
# Hyper-V
# Checkpoint contains memory stateVolatility 3 Framework
Verify available plugins and their options using the installed version's help. Some names below are legacy/version-specific; do not assume every Volatility 2 plugin or dump flag exists in Volatility 3. Structure snippets are conceptual and OS-build-dependent. YARA matches, process-list differences and executable memory are leads requiring correlation, not standalone proof of malware.
Installation and Setup
# Install Volatility 3
pip install volatility3
# Install symbol tables (Windows)
# Download from https://downloads.volatilityfoundation.org/volatility3/symbols/
# Basic usage
vol -f memory.raw <plugin>
# With symbol path
vol -f memory.raw -s /path/to/symbols windows.pslistEssential Plugins
Process Analysis
# List processes
vol -f memory.raw windows.pslist
# Process tree (parent-child relationships)
vol -f memory.raw windows.pstree
# Hidden process detection
vol -f memory.raw windows.psscan
# Process memory dumps
vol -f memory.raw windows.memmap --pid <PID> --dump
# Process environment variables
vol -f memory.raw windows.envars --pid <PID>
# Command line arguments
vol -f memory.raw windows.cmdlineNetwork Analysis
# Network connections
vol -f memory.raw windows.netscan
# Network connection state
vol -f memory.raw windows.netstatDLL and Module Analysis
# Loaded DLLs per process
vol -f memory.raw windows.dlllist --pid <PID>
# Find hidden/injected DLLs
vol -f memory.raw windows.ldrmodules
# Kernel modules
vol -f memory.raw windows.modules
# Module dumps
vol -f memory.raw windows.moddump --pid <PID>Memory Injection Detection
# Detect code injection
vol -f memory.raw windows.malfind
# VAD (Virtual Address Descriptor) analysis
vol -f memory.raw windows.vadinfo --pid <PID>
# Dump suspicious memory regions
vol -f memory.raw windows.vadyarascan --yara-rules rules.yarRegistry Analysis
# List registry hives
vol -f memory.raw windows.registry.hivelist
# Print registry key
vol -f memory.raw windows.registry.printkey --key "Software\Microsoft\Windows\CurrentVersion\Run"
# Dump registry hive
vol -f memory.raw windows.registry.hivescan --dumpFile System Artifacts
# Scan for file objects
vol -f memory.raw windows.filescan
# Dump files from memory
vol -f memory.raw windows.dumpfiles --pid <PID>
# MFT analysis
vol -f memory.raw windows.mftscanLinux Analysis
# Process listing
vol -f memory.raw linux.pslist
# Process tree
vol -f memory.raw linux.pstree
# Bash history
vol -f memory.raw linux.bash
# Network connections
vol -f memory.raw linux.sockstat
# Loaded kernel modules
vol -f memory.raw linux.lsmod
# Mount points
vol -f memory.raw linux.mount
# Environment variables
vol -f memory.raw linux.envarsmacOS Analysis
# Process listing
vol -f memory.raw mac.pslist
# Process tree
vol -f memory.raw mac.pstree
# Network connections
vol -f memory.raw mac.netstat
# Kernel extensions
vol -f memory.raw mac.lsmodAnalysis Workflows
Malware Analysis Workflow
# 1. Initial process survey
vol -f memory.raw windows.pstree > processes.txt
vol -f memory.raw windows.pslist > pslist.txt
# 2. Network connections
vol -f memory.raw windows.netscan > network.txt
# 3. Detect injection
vol -f memory.raw windows.malfind > malfind.txt
# 4. Analyze suspicious processes
vol -f memory.raw windows.dlllist --pid <PID>
vol -f memory.raw windows.handles --pid <PID>
# 5. Dump suspicious executables
vol -f memory.raw windows.pslist --pid <PID> --dump
# 6. Extract strings from dumps
strings -a pid.<PID>.exe > strings.txt
# 7. YARA scanning
vol -f memory.raw windows.yarascan --yara-rules malware.yarIncident Response Workflow
# 1. Timeline of events
vol -f memory.raw windows.timeliner > timeline.csv
# 2. User activity
vol -f memory.raw windows.cmdline
vol -f memory.raw windows.consoles
# 3. Persistence mechanisms
vol -f memory.raw windows.registry.printkey \
--key "Software\Microsoft\Windows\CurrentVersion\Run"
# 4. Services
vol -f memory.raw windows.svcscan
# 5. Scheduled tasks
vol -f memory.raw windows.scheduled_tasks
# 6. Recent files
vol -f memory.raw windows.filescan | grep -i "recent"Data Structures
Windows Process Structures
// EPROCESS (Executive Process)
typedef struct _EPROCESS {
KPROCESS Pcb; // Kernel process block
EX_PUSH_LOCK ProcessLock;
LARGE_INTEGER CreateTime;
LARGE_INTEGER ExitTime;
// ...
LIST_ENTRY ActiveProcessLinks; // Doubly-linked list
ULONG_PTR UniqueProcessId; // PID
// ...
PEB* Peb; // Process Environment Block
// ...
} EPROCESS;
// PEB (Process Environment Block)
typedef struct _PEB {
BOOLEAN InheritedAddressSpace;
BOOLEAN ReadImageFileExecOptions;
BOOLEAN BeingDebugged; // Anti-debug check
// ...
PVOID ImageBaseAddress; // Base address of executable
PPEB_LDR_DATA Ldr; // Loader data (DLL list)
PRTL_USER_PROCESS_PARAMETERS ProcessParameters;
// ...
} PEB;VAD (Virtual Address Descriptor)
typedef struct _MMVAD {
MMVAD_SHORT Core;
union {
ULONG LongFlags;
MMVAD_FLAGS VadFlags;
} u;
// ...
PVOID FirstPrototypePte;
PVOID LastContiguousPte;
// ...
PFILE_OBJECT FileObject;
} MMVAD;
// Memory protection flags
#define PAGE_EXECUTE 0x10
#define PAGE_EXECUTE_READ 0x20
#define PAGE_EXECUTE_READWRITE 0x40
#define PAGE_EXECUTE_WRITECOPY 0x80Detection Patterns
Process Injection Indicators
# Malfind indicators
# - PAGE_EXECUTE_READWRITE protection (suspicious)
# - MZ header in non-image VAD region
# - Shellcode patterns at allocation start
# Common injection techniques
# 1. Classic DLL Injection
# - VirtualAllocEx + WriteProcessMemory + CreateRemoteThread
# 2. Process Hollowing
# - CreateProcess (SUSPENDED) + NtUnmapViewOfSection + WriteProcessMemory
# 3. APC Injection
# - QueueUserAPC targeting alertable threads
# 4. Thread Execution Hijacking
# - SuspendThread + SetThreadContext + ResumeThreadRootkit Detection
# Compare process lists
vol -f memory.raw windows.pslist > pslist.txt
vol -f memory.raw windows.psscan > psscan.txt
diff pslist.txt psscan.txt # Hidden processes
# Check for DKOM (Direct Kernel Object Manipulation)
vol -f memory.raw windows.callbacks
# Detect hooked functions
vol -f memory.raw windows.ssdt # System Service Descriptor Table
# Driver analysis
vol -f memo… (nội dung đầy đủ có trong gói tải về)
Skill liên quan
- metasploit-framework – ⚠️ CHỈ DÙNG CHO MỤC ĐÍCH ĐƯỢC ỦY QUYỀN > Skill này chỉ dành cho mục đích giáo dục hoặc…
- mid-engagement-ir-detection – Phương pháp phát hiện bản vá SOC của khách hàng, hoạt động của kẻ tấn công và thay đổi…
- mobile-reverse – Dịch ngược và kiểm thử bảo mật ứng dụng Android/iOS được ủy quyền: phân tích APK/IPA…
- mobile-security-coder – Chuyên gia lập trình di động an toàn, chuyên kiểm tra đầu vào, bảo mật WebView và các…
- model-supply-chain-security – Bảo mật chuỗi cung ứng mô hình AI với ký artifact, chứng thực nguồn gốc (provenance…
- network-engineer – Kỹ sư mạng chuyên gia, chuyên về mạng đám mây hiện đại, kiến trúc bảo mật và tối ưu hiệu…
- odoo-security-rules – Chuyên gia kiểm soát truy cập Odoo: ir.model.access.csv, record rules (ir.rule), nhóm…
- offensive-osint – Bộ công cụ vận hành cho trinh sát OSINT bên ngoài trong red-team và bug bounty có ủy…