[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M73084DS673C63FMSSACZQAV":3,"skill-same:01M73084DS673C63FMSSACZQAV":89},{"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":49,"commitSha":50,"skillDirectory":51,"forksCount":52,"repositoryHtmlUrl":53,"repositoryHomepageUrl":54,"ownerHtmlUrl":55,"ownerBlogUrl":56,"ownerDescription":57,"updatedAt":58,"install":59,"resources":72},"01M73084DS673C63FMSSACZQAV","analyzing-linux-elf-malware",null,"Analyzes malicious Linux ELF (Executable and Linkable Format) binaries including botnets, cryptominers, ransomware, and rootkits targeting Linux servers, containers, and cloud infrastructure. Covers static analysis, dynamic tracing, and reverse engineering of x86_64 and ARM ELF samples. Activates for requests involving Linux malware analysis, ELF binary investigation, Linux server compromise assessment, or container malware analysis.","Horonomos-laps\u002FYana-AI","Horonomos-laps","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F355299122?v=4","01M76B3QPXE88ET2SQPDPVATZT"," Horonomos-laps","01M72ZQRJPCYPSSWT4D00VJR2A",13,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fyanacuti1121\u002FYana-AI\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fanalyzing-linux-elf-malware\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fanalyzing-linux-elf-malware\u002FSKILL.md",[],[],"2026-11-11 15:11:14",false,"---\nname: analyzing-linux-elf-malware\ndescription: 'Analyzes malicious Linux ELF (Executable and Linkable Format) binaries\n  including botnets, cryptominers, ransomware, and rootkits targeting Linux servers,\n  containers, and cloud infrastructure. Covers static analysis, dynamic tracing, and\n  reverse engineering of x86_64 and ARM ELF samples. Activates for requests involving\n  Linux malware analysis, ELF binary investigation, Linux server compromise assessment,\n  or container malware analysis.\n\n  '\ndomain: cybersecurity\nsubdomain: malware-analysis\ntags:\n- malware\n- Linux\n- ELF\n- reverse-engineering\n- server-malware\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- T1059.004\n- T1620\n- T1574.006\nsource: https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\nsource_commit: 04450304b12645cb2b974ab96d28c0664758a88d\nnote: \"Vendored verbatim from an external Apache-2.0 security-skill library, pinned by commit. Exceeds the internal 300-line skill guideline (agent-code-constraints.md) -- kept as-is because this is vendored reference material (forensics\u002Fthreat-intel procedure), not Yana AI-authored content, and trimming would damage technical accuracy.\"\n---\n\n# Analyzing Linux ELF Malware\n\n## When to Use\n\n- A Linux server or container has been compromised and suspicious ELF binaries are found\n- Analyzing Linux botnets (Mirai, Gafgyt, XorDDoS), cryptominers, or ransomware\n- Investigating malware targeting cloud infrastructure, Docker containers, or Kubernetes pods\n- Reverse engineering Linux rootkits and kernel modules\n- Analyzing cross-platform malware compiled for Linux x86_64, ARM, or MIPS architectures\n\n**Do not use** for Windows PE binary analysis; use PEStudio, Ghidra, or IDA for Windows malware.\n\n## Prerequisites\n\n- Ghidra or IDA with Linux ELF support for disassembly and decompilation\n- Linux analysis VM (Ubuntu 22.04 recommended) with development tools installed\n- strace, ltrace, and GDB for dynamic analysis and debugging\n- readelf, objdump, and nm from GNU binutils for static inspection\n- Radare2 for quick binary triage and scripted analysis\n- Docker for isolated container-based malware execution\n\n## Workflow\n\n### Step 1: Identify ELF Binary Properties\n\nExamine the ELF header and basic properties:\n\n```bash\n# File type identification\nfile suspect_binary\n\n# Detailed ELF header analysis\nreadelf -h suspect_binary\n\n# Section headers\nreadelf -S suspect_binary\n\n# Program headers (segments)\nreadelf -l suspect_binary\n\n# Symbol table (if not stripped)\nreadelf -s suspect_binary\nnm suspect_binary 2>\u002Fdev\u002Fnull\n\n# Dynamic linking information\nreadelf -d suspect_binary\nldd suspect_binary 2>\u002Fdev\u002Fnull  # Only on matching architecture!\n\n# Compute hashes\nmd5sum suspect_binary\nsha256sum suspect_binary\n\n# Check for packing\u002FUPX\nupx -t suspect_binary\n```\n\n```python\n# Python-based ELF analysis\nfrom elftools.elf.elffile import ELFFile\nimport hashlib\n\nwith open(\"suspect_binary\", \"rb\") as f:\n    data = f.read()\n    sha256 = hashlib.sha256(data).hexdigest()\n\nwith open(\"suspect_binary\", \"rb\") as f:\n    elf = ELFFile(f)\n\n    print(f\"SHA-256:      {sha256}\")\n    print(f\"Class:        {elf.elfclass}-bit\")\n    print(f\"Endian:       {elf.little_endian and 'Little' or 'Big'}\")\n    print(f\"Machine:      {elf.header.e_machine}\")\n    print(f\"Type:         {elf.header.e_type}\")\n    print(f\"Entry Point:  0x{elf.header.e_entry:X}\")\n\n    # Check if stripped\n    symtab = elf.get_section_by_name('.symtab')\n    print(f\"Stripped:     {'Yes' if symtab is None else 'No'}\")\n\n    # Section entropy analysis\n    import math\n    from collections import Counter\n    for section in elf.iter_sections():\n        data = section.data()\n        if len(data) > 0:\n            entropy = -sum((c\u002Flen(data)) * math.log2(c\u002Flen(data))\n                          for c in Counter(data).values() if c > 0)\n            if entropy > 7.0:\n                print(f\"  [!] High entropy section: {section.name} ({entropy:.2f})\")\n```\n\n### Step 2: Extract Strings and Indicators\n\nSearch for embedded IOCs and functionality clues:\n\n```bash\n# ASCII strings\nstrings suspect_binary > strings_output.txt\n\n# Search for network indicators\ngrep -iE \"(http|https|ftp):\u002F\u002F\" strings_output.txt\ngrep -iE \"([0-9]{1,3}\\.){3}[0-9]{1,3}\" strings_output.txt\ngrep -iE \"[a-zA-Z0-9.-]+\\.(com|net|org|io|ru|cn)\" strings_output.txt\n\n# Search for shell commands\ngrep -iE \"(bash|sh|wget|curl|chmod|\u002Ftmp\u002F|\u002Fdev\u002F)\" strings_output.txt\n\n# Search for crypto mining indicators\ngrep -iE \"(stratum|xmr|monero|pool\\.|mining)\" strings_output.txt\n\n# Search for SSH\u002Fcredential theft\ngrep -iE \"(ssh|authorized_keys|id_rsa|shadow|passwd)\" strings_output.txt\n\n# Search for persistence mechanisms\ngrep -iE \"(crontab|systemd|init\\.d|rc\\.local|ld\\.so\\.preload)\" strings_output.txt\n\n# FLOSS for obfuscated strings (if available)\nfloss suspect_binary\n```\n\n### Step 3: Analyze System Calls and Library Usage\n\nIdentify what system calls and libraries the malware uses:\n\n```bash\n# List imported functions (dynamically linked)\nreadelf -r suspect_binary | grep -E \"socket|connect|exec|fork|open|write|bind|listen\"\n\n# Trace system calls during execution (in isolated VM only)\nstrace -f -e trace=network,process,file -o strace_output.txt .\u002Fsuspect_binary\n\n# Trace library calls\nltrace -f -o ltrace_output.txt .\u002Fsuspect_binary\n\n# Key system calls to watch:\n# Network: socket, connect, bind, listen, accept, sendto, recvfrom\n# Process: fork, execve, clone, kill, ptrace\n# File:    open, read, write, unlink, rename, chmod\n# Persistence: inotify_add_watch (file monitoring)\n```\n\n### Step 4: Dynamic Analysis with GDB\n\nDebug the malware to observe runtime behavior:\n\n```bash\n# Start GDB with the binary\ngdb .\u002Fsuspect_binary\n\n# Set breakpoints on key functions\n(gdb) break main\n(gdb) break socket\n(gdb) break connect\n(gdb) break execve\n(gdb) break fork\n\n# Run and analyze\n(gdb) run\n(gdb) info registers    # View register state\n(gdb) x\u002F20s $rdi        # Examine string argument\n(gdb) bt                # Backtrace\n(gdb) continue\n\n# For stripped binaries, break on entry point\n(gdb) break *0x400580   # Entry point from readelf\n(gdb) run\n\n# Monitor network connections during execution\n# In another terminal:\nss -tlnp  # List listening sockets\nss -tnp   # List established connections\n```\n\n### Step 5: Reverse Engineer with Ghidra\n\nPerform deep code analysis on the ELF binary:\n\n```\nGhidra Analysis for Linux ELF:\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n1. Import: File -> Import -> Select ELF binary\n   - Ghidra auto-detects ELF format and architecture\n   - Accept default analysis options\n\n2. Key analysis targets:\n   - main() function (or entry point if stripped)\n   - Socket creation and connection functions\n   - Command dispatch logic (switch\u002Fcase on received data)\n   - Encryption\u002Fencoding routines\n   - Persistence installation code\n   - Self-propagation\u002Fscanning functions\n\n3. For Mirai-like botnets, look for:\n   - Credential list for brute-forcing (telnet\u002FSSH)\n   - Attack module selection (UDP flood, SYN flood, ACK flood)\n   - Scanner module (port scanning for vulnerable devices)\n   - Killer module (killing competing botnets)\n\n4. For cryptominers, look for:\n   - Mining pool connection (stratum protocol)\n   - Wallet address strings\n   - CPU\u002FGPU utilization functions\n   - Process hiding techniques\n```\n\n### Step 6: Analyze Linux-Specific Persistence\n\nCheck for persistence mechanisms:\n\n```bash\n# Check for LD_PRELOAD rootkit\nstrings suspect_binary | grep \"ld.so.preload\"\n# Malware writing to \u002Fetc\u002Fld.so.preload can hook all dynamic library calls\n\n# Check for crontab persistence\nstrings suspect_binary | grep -i \"cron\"\n\n# Check for systemd service creation\nstrings suspect_binary | grep -iE \"systemd|\\.service|systemctl\"\n\n# Check for init script creation\nstrings suspect_binary | grep -iE \"init\\.d|rc\\.local|update-rc\"\n\n# Check for SSH key injection\nstrings suspect_binary | grep -i \"authorized_keys\"\n\n# Check for kernel module (rootkit) loading\nstrings suspect_binary | grep -iE \"insmod|modprobe|init_module\"\n\n# Check for process hiding\nstrings suspect_binary | grep -iE \"proc|readdir|getdents\"\n```\n\n## Key Concepts\n\n| Term | Definition |\n|------|------------|\n| **ELF (Executable and Linkable Format)** | Standard binary format for Linux executables, shared libraries, and core dumps containing headers, sections, and segments |\n| **Stripped Binary** | ELF binary with debug symbols removed, making reverse engineering more difficult as function names are lost |\n| **LD_PRELOAD** | Linux environment variable specifying shared libraries to load before all others; abused by rootkits to intercept system library calls |\n| **strace** | Linux system call tracer that logs all system calls and signals made by a process, revealing file, network, and process operations |\n| **GOT\u002FPLT** | Global Offset Table and Procedure Linkage Table; ELF structures for dynamic linking that can be hijacked for function hooking |\n| **Statically Linked** | Binary compiled with all library code included; common in IoT malware to run on systems without matching shared libraries |\n| **Mirai** | Prolific Linux botnet targeting IoT devices via telnet brute-force; source code leaked, leading to many variants |\n\n## Tools & Systems\n\n- **Ghidra**: NSA reverse engineering tool with full ELF support for x86, x86_64, ARM, MIPS, and other Linux architectures\n- **Radare2**: Open-source reverse engineering framework with command-line interface for quick binary analysis and scripting\n- **strace**: Linux system call tracing tool for observing binary behavior including file, network, and process operations\n- **GDB**: GNU Debugger for setting breakpoints, examining memory, and stepping through Linux binary execution\n- **pyelftools**: Python library for parsing ELF files programmatically for automated analysis pipelines\n\n## Common Scenarios\n\n### Scenario: Analyzing a Cryptominer Found on a Compromised Linux Server\n\n**Context**: A cloud server shows 100% CPU usage. Investigation reveals an unknown binary running from \u002Ftmp with a suspicious name. The binary needs analysis to confirm it is a cryptominer and identify the attacker's wallet and pool.\n\n**Approach**:\n1. Copy the binary to an analysis VM and compute SHA-256 hash\n2. Run `file` and `readelf` to identify architecture and linking type\n3. Extract strings and search for mining pool addresses (stratum+tcp:\u002F\u002F) and wallet addresses\n4. Run with strace in a sandbox to observe network connections (mining pool connection)\n5. Import into Ghidra to identify the mining algorithm and configuration extraction\n6. Check for persistence mechanisms (crontab, systemd service, SSH keys)\n7. Document all IOCs including pool address, wallet, C2 for updates, and persistence artifacts\n\n**Pitfalls**:\n- Running `ldd` on malware outside a sandbox (ldd can execute code in the binary)\n- Not checking for ARM\u002FMIPS architecture before attempting x86_64 execution\n- Missing companion scripts (.sh files) that may handle persistence and cleanup\n- Ignoring the initial access vector (how the miner was deployed: SSH brute force, web exploit, container escape)\n\n## Output Format\n\n```\nLINUX ELF MALWARE ANALYSIS REPORT\n====================================\nFile:             \u002Ftmp\u002F.X11-unix\u002F.rsync\nSHA-256:          e3b0c44298fc1c149afbf4c8996fb924...\nType:             ELF 64-bit LSB executable, x86-64\nLinking:          Statically linked (all libraries embedded)\nStripped:         Yes\nSize:             2,847,232 bytes\nPacker:           UPX 3.96 (unpacked for analysis)\n\nCLASSIFICATION\nFamily:           XMRig Cryptominer (modified)\nVariant:          Custom build with C2 update mechanism\n\nFUNCTIONALITY\n[*] XMR (Monero) mining via RandomX algorithm\n[*] Stratum pool connection for work submission\n[*] C2 check-in for configuration updates\n[*] Process name masquerading (argv[0] = \"[kworker\u002F0:0]\")\n[*] Competitor process killing (kills other miners)\n[*] SSH key injection for re-access\n\nNETWORK INDICATORS\nMining Pool:      stratum+tcp:\u002F\u002Fpool.minexmr[.]com:4444\nC2 Server:        hxxp:\u002F\u002Fupdate.malicious[.]com\u002Fconfig\nWallet:           49jZ5Q3b...Monero_Wallet_Address...\n\nPERSISTENCE\n[1] Crontab entry: *\u002F5 * * * * \u002Ftmp\u002F.X11-unix\u002F.rsync\n[2] SSH key added to \u002Froot\u002F.ssh\u002Fauthorized_keys\n[3] Systemd service: \u002Fetc\u002Fsystemd\u002Fsystem\u002Frsync-daemon.service\n[4] Modified \u002Fetc\u002Fld.so.preload for process hiding\n\nPROCESS HIDING\nLD_PRELOAD:       \u002Fusr\u002Flib\u002F.libsystem.so\nHook:             readdir() to hide \u002Ftmp\u002F.X11-unix\u002F.rsync from ls\nHook:             fopen() to hide from \u002Fproc\u002F*\u002Fmaps reading\n```\n","# Analyzing Linux ELF Malware\n\n## When to Use\n\n- A Linux server or container has been compromised and suspicious ELF binaries are found\n- Analyzing Linux botnets (Mirai, Gafgyt, XorDDoS), cryptominers, or ransomware\n- Investigating malware targeting cloud infrastructure, Docker containers, or Kubernetes pods\n- Reverse engineering Linux rootkits and kernel modules\n- Analyzing cross-platform malware compiled for Linux x86_64, ARM, or MIPS architectures\n\n**Do not use** for Windows PE binary analysis; use PEStudio, Ghidra, or IDA for Windows malware.\n\n## Prerequisites\n\n- Ghidra or IDA with Linux ELF support for disassembly and decompilation\n- Linux analysis VM (Ubuntu 22.04 recommended) with development tools installed\n- strace, ltrace, and GDB for dynamic analysis and debugging\n- readelf, objdump, and nm from GNU binutils for static inspection\n- Radare2 for quick binary triage and scripted analysis\n- Docker for isolated container-based malware execution\n\n## Workflow\n\n### Step 1: Identify ELF Binary Properties\n\nExamine the ELF header and basic properties:\n\n```bash\n# File type identification\nfile suspect_binary\n\n# Detailed ELF header analysis\nreadelf -h suspect_binary\n\n# Section headers\nreadelf -S suspect_binary\n\n# Program headers (segments)\nreadelf -l suspect_binary\n\n# Symbol table (if not stripped)\nreadelf -s suspect_binary\nnm suspect_binary 2>\u002Fdev\u002Fnull\n\n# Dynamic linking information\nreadelf -d suspect_binary\nldd suspect_binary 2>\u002Fdev\u002Fnull  # Only on matching architecture!\n\n# Compute hashes\nmd5sum suspect_binary\nsha256sum suspect_binary\n\n# Check for packing\u002FUPX\nupx -t suspect_binary\n```\n\n```python\n# Python-based ELF analysis\nfrom elftools.elf.elffile import ELFFile\nimport hashlib\n\nwith open(\"suspect_binary\", \"rb\") as f:\n    data = f.read()\n    sha256 = hashlib.sha256(data).hexdigest()\n\nwith open(\"suspect_binary\", \"rb\") as f:\n    elf = ELFFile(f)\n\n    print(f\"SHA-256:      {sha256}\")\n    print(f\"Class:        {elf.elfclass}-bit\")\n    print(f\"Endian:       {elf.little_endian and 'Little' or 'Big'}\")\n    print(f\"Machine:      {elf.header.e_machine}\")\n    print(f\"Type:         {elf.header.e_type}\")\n    print(f\"Entry Point:  0x{elf.header.e_entry:X}\")\n\n    # Check if stripped\n    symtab = elf.get_section_by_name('.symtab')\n    print(f\"Stripped:     {'Yes' if symtab is None else 'No'}\")\n\n    # Section entropy analysis\n    import math\n    from collections import Counter\n    for section in elf.iter_sections():\n        data = section.data()\n        if len(data) > 0:\n            entropy = -sum((c\u002Flen(data)) * math.log2(c\u002Flen(data))\n                          for c in Counter(data).values() if c > 0)\n            if entropy > 7.0:\n                print(f\"  [!] High entropy section: {section.name} ({entropy:.2f})\")\n```\n\n### Step 2: Extract Strings and Indicators\n\nSearch for embedded IOCs and functionality clues:\n\n```bash\n# ASCII strings\nstrings suspect_binary > strings_output.txt\n\n# Search for network indicators\ngrep -iE \"(http|https|ftp):\u002F\u002F\" strings_output.txt\ngrep -iE \"([0-9]{1,3}\\.){3}[0-9]{1,3}\" strings_output.txt\ngrep -iE \"[a-zA-Z0-9.-]+\\.(com|net|org|io|ru|cn)\" strings_output.txt\n\n# Search for shell commands\ngrep -iE \"(bash|sh|wget|curl|chmod|\u002Ftmp\u002F|\u002Fdev\u002F)\" strings_output.txt\n\n# Search for crypto mining indicators\ngrep -iE \"(stratum|xmr|monero|pool\\.|mining)\" strings_output.txt\n\n# Search for SSH\u002Fcredential theft\ngrep -iE \"(ssh|authorized_keys|id_rsa|shadow|passwd)\" strings_output.txt\n\n# Search for persistence mechanisms\ngrep -iE \"(crontab|systemd|init\\.d|rc\\.local|ld\\.so\\.preload)\" strings_output.txt\n\n# FLOSS for obfuscated strings (if available)\nfloss suspect_binary\n```\n\n### Step 3: Analyze System Calls and Library Usage\n\nIdentify what system calls and libraries the malware uses:\n\n```bash\n# List imported functions (dynamically linked)\nreadelf -r suspect_binary | grep -E \"socket|connect|exec|fork|open|write|bind|listen\"\n\n# Trace system calls during execution (in isolated VM only)\nstrace -f -e trace=network,process,file -o strace_output.txt .\u002Fsuspect_binary\n\n# Trace library calls\nltrace -f -o ltrace_output.txt .\u002Fsuspect_binary\n\n# Key system calls to watch:\n# Network: socket, connect, bind, listen, accept, sendto, recvfrom\n# Process: fork, execve, clone, kill, ptrace\n# File:    open, read, write, unlink, rename, chmod\n# Persistence: inotify_add_watch (file monitoring)\n```\n\n### Step 4: Dynamic Analysis with GDB\n\nDebug the malware to observe runtime behavior:\n\n```bash\n# Start GDB with the binary\ngdb .\u002Fsuspect_binary\n\n# Set breakpoints on key functions\n(gdb) break main\n(gdb) break socket\n(gdb) break connect\n(gdb) break execve\n(gdb) break fork\n\n# Run and analyze\n(gdb) run\n(gdb) info registers    # View register state\n(gdb) x\u002F20s $rdi        # Examine string argument\n(gdb) bt                # Backtrace\n(gdb) continue\n\n# For stripped binaries, break on entry point\n(gdb) break *0x400580   # Entry point from readelf\n(gdb) run\n\n# Monitor network connections during execution\n# In another terminal:\nss -tlnp  # List listening sockets\nss -tnp   # List established connections\n```\n\n### Step 5: Reverse Engineer with Ghidra\n\nPerform deep code analysis on the ELF binary:\n\n```\nGhidra Analysis for Linux ELF:\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n1. Import: File -> Import -> Select ELF binary\n   - Ghidra auto-detects ELF format and architecture\n   - Accept default analysis options\n\n2. Key analysis targets:\n   - main() function (or entry point if stripped)\n   - Socket creation and connection functions\n   - Command dispatch logic (switch\u002Fcase on received data)\n   - Encryption\u002Fencoding routines\n   - Persistence installation code\n   - Self-propagation\u002Fscanning functions\n\n3. For Mirai-like botnets, look for:\n   - Credential list for brute-forcing (telnet\u002FSSH)\n   - Attack module selection (UDP flood, SYN flood, ACK flood)\n   - Scanner module (port scanning for vulnerable devices)\n   - Killer module (killing competing botnets)\n\n4. For cryptominers, look for:\n   - Mining pool connection (stratum protocol)\n   - Wallet address strings\n   - CPU\u002FGPU utilization functions\n   - Process hiding techniques\n```\n\n### Step 6: Analyze Linux-Specific Persistence\n\nCheck for persistence mechanisms:\n\n```bash\n# Check for LD_PRELOAD rootkit\nstrings suspect_binary | grep \"ld.so.preload\"\n# Malware writing to \u002Fetc\u002Fld.so.preload can hook all dynamic library calls\n\n# Check for crontab persistence\nstrings suspect_binary | grep -i \"cron\"\n\n# Check for systemd service creation\nstrings suspect_binary | grep -iE \"systemd|\\.service|systemctl\"\n\n# Check for init script creation\nstrings suspect_binary | grep -iE \"init\\.d|rc\\.local|update-rc\"\n\n# Check for SSH key injection\nstrings suspect_binary | grep -i \"authorized_keys\"\n\n# Check for kernel module (rootkit) loading\nstrings suspect_binary | grep -iE \"insmod|modprobe|init_module\"\n\n# Check for process hiding\nstrings suspect_binary | grep -iE \"proc|readdir|getdents\"\n```\n\n## Key Concepts\n\n| Term | Definition |\n|------|------------|\n| **ELF (Executable and Linkable Format)** | Standard binary format for Linux executables, shared libraries, and core dumps containing headers, sections, and segments |\n| **Stripped Binary** | ELF binary with debug symbols removed, making reverse engineering more difficult as function names are lost |\n| **LD_PRELOAD** | Linux environment variable specifying shared libraries to load before all others; abused by rootkits to intercept system library calls |\n| **strace** | Linux system call tracer that logs all system calls and signals made by a process, revealing file, network, and process operations |\n| **GOT\u002FPLT** | Global Offset Table and Procedure Linkage Table; ELF structures for dynamic linking that can be hijacked for function hooking |\n| **Statically Linked** | Binary compiled with all library code included; common in IoT malware to run on systems without matching shared libraries |\n| **Mirai** | Prolific Linux botnet targeting IoT devices via telnet brute-force; source code leaked, leading to many variants |\n\n## Tools & Systems\n\n- **Ghidra**: NSA reverse engineering tool with full ELF support for x86, x86_64, ARM, MIPS, and other Linux architectures\n- **Radare2**: Open-source reverse engineering framework with command-line interface for quick binary analysis and scripting\n- **strace**: Linux system call tracing tool for observing binary behavior including file, network, and process operations\n- **GDB**: GNU Debugger for setting breakpoints, examining memory, and stepping through Linux binary execution\n- **pyelftools**: Python library for parsing ELF files programmatically for automated analysis pipelines\n\n## Common Scenarios\n\n### Scenario: Analyzing a Cryptominer Found on a Compromised Linux Server\n\n**Context**: A cloud server shows 100% CPU usage. Investigation reveals an unknown binary running from \u002Ftmp with a suspicious name. The binary needs analysis to confirm it is a cryptominer and identify the attacker's wallet and pool.\n\n**Approach**:\n1. Copy the binary to an analysis VM and compute SHA-256 hash\n2. Run `file` and `readelf` to identify architecture and linking type\n3. Extract strings and search for mining pool addresses (stratum+tcp:\u002F\u002F) and wallet addresses\n4. Run with strace in a sandbox to observe network connections (mining pool connection)\n5. Import into Ghidra to identify the mining algorithm and configuration extraction\n6. Check for persistence mechanisms (crontab, systemd service, SSH keys)\n7. Document all IOCs including pool address, wallet, C2 for updates, and persistence artifacts\n\n**Pitfalls**:\n- Running `ldd` on malware outside a sandbox (ldd can execute code in the binary)\n- Not checking for ARM\u002FMIPS architecture before attempting x86_64 execution\n- Missing companion scripts (.sh files) that may handle persistence and cleanup\n- Ignoring the initial access vector (how the miner was deployed: SSH brute force, web exploit, container escape)\n\n## Output Format\n\n```\nLINUX ELF MALWARE ANALYSIS REPORT\n====================================\nFile:             \u002Ftmp\u002F.X11-unix\u002F.rsync\nSHA-256:          e3b0c44298fc1c149afbf4c8996fb924...\nType:             ELF 64-bit LSB executable, x86-64\nLinking:          Statically linked (all libraries embedded)\nStripped:         Yes\nSize:             2,847,232 bytes\nPacker:           UPX 3.96 (unpacked for analysis)\n\nCLASSIFICATION\nFamily:           XMRig Cryptominer (modified)\nVariant:          Custom build with C2 update mechanism\n\nFUNCTIONALITY\n[*] XMR (Monero) mining via RandomX algorithm\n[*] Stratum pool connection for work submission\n[*] C2 check-in for configuration updates\n[*] Process name masquerading (argv[0] = \"[kworker\u002F0:0]\")\n[*] Competitor process killing (kills other miners)\n[*] SSH key injection for re-access\n\nNETWORK INDICATORS\nMining Pool:      stratum+tcp:\u002F\u002Fpool.minexmr[.]com:4444\nC2 Server:        hxxp:\u002F\u002Fupdate.malicious[.]com\u002Fconfig\nWallet:           49jZ5Q3b...Monero_Wallet_Address...\n\nPERSISTENCE\n[1] Crontab entry: *\u002F5 * * * * \u002Ftmp\u002F.X11-unix\u002F.rsync\n[2] SSH key added to \u002Froot\u002F.ssh\u002Fauthorized_keys\n[3] Systemd service: \u002Fetc\u002Fsystemd\u002Fsystem\u002Frsync-daemon.service\n[4] Modified \u002Fetc\u002Fld.so.preload for process hiding\n\nPROCESS HIDING\nLD_PRELOAD:       \u002Fusr\u002Flib\u002F.libsystem.so\nHook:             readdir() to hide \u002Ftmp\u002F.X11-unix\u002F.rsync from ls\nHook:             fopen() to hide from \u002Fproc\u002F*\u002Fmaps reading\n```\n",{"name":5,"note":25,"tags":26,"author":32,"domain":33,"source":34,"license":15,"version":35,"nist_csf":36,"subdomain":41,"description":42,"mitre_attack":43,"source_commit":48},"Vendored verbatim from an external Apache-2.0 security-skill library, pinned by commit. Exceeds the internal 300-line skill guideline (agent-code-constraints.md) -- kept as-is because this is vendored reference material (forensics\u002Fthreat-intel procedure), not Yana AI-authored content, and trimming would damage technical accuracy.",[27,28,29,30,31],"malware","Linux","ELF","reverse-engineering","server-malware","mahipal","cybersecurity","https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills","1.0.0",[37,38,39,40],"DE.AE-02","RS.AN-03","ID.RA-01","DE.CM-01","malware-analysis","Analyzes malicious Linux ELF (Executable and Linkable Format) binaries including botnets, cryptominers, ransomware, and rootkits targeting Linux servers, containers, and cloud infrastructure. Covers static analysis, dynamic tracing, and reverse engineering of x86_64 and ARM ELF samples. Activates for requests involving Linux malware analysis, ELF binary investigation, Linux server compromise assessment, or container malware analysis.\n",[44,45,46,47],"T1027","T1059.004","T1620","T1574.006","04450304b12645cb2b974ab96d28c0664758a88d","main","481dcd7dd2e288b9d627a2bd017db70e64e6c6fa",".claude\u002Fskills\u002Fanalyzing-linux-elf-malware",2,"https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI","https:\u002F\u002Fyana.vutam.link\u002F","https:\u002F\u002Fgithub.com\u002FHoronomos-laps","https:\u002F\u002Fyana.vutam.link","An open-source governed runtime & execution environment for multi-agent AI systems.","2026-11-14 13:24:09",{"source":8,"skillName":5,"commands":60,"prompt":70,"zipAvailable":71},[61,64,67],{"tool":62,"command":63},"npx","npx skills add Horonomos-laps\u002FYana-AI --skill analyzing-linux-elf-malware",{"tool":65,"command":66},"bunx","bunx skills add Horonomos-laps\u002FYana-AI --skill analyzing-linux-elf-malware",{"tool":68,"command":69},"pnpm","pnpm dlx skills add Horonomos-laps\u002FYana-AI --skill analyzing-linux-elf-malware","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fanalyzing-linux-elf-malware\u002FSKILL.md",true,[73,77,83],{"path":74,"resourceType":74,"resourceTypeDesc":75,"sizeBytes":76,"sourceHtmlUrl":16},"LICENSE","许可证",11255,{"path":78,"resourceType":79,"resourceTypeDesc":80,"sizeBytes":81,"sourceHtmlUrl":82},"references\u002Fapi-reference.md","REFERENCE","参考文档",3126,"https:\u002F\u002Fgithub.com\u002Fyanacuti1121\u002FYana-AI\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fanalyzing-linux-elf-malware\u002Freferences\u002Fapi-reference.md",{"path":84,"resourceType":85,"resourceTypeDesc":86,"sizeBytes":87,"sourceHtmlUrl":88},"scripts\u002Fagent.py","SCRIPT","脚本",8794,"https:\u002F\u002Fgithub.com\u002Fyanacuti1121\u002FYana-AI\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fanalyzing-linux-elf-malware\u002Fscripts\u002Fagent.py",[90,98,105,113,121,129],{"skillNo":91,"name":92,"nameZh":6,"description":93,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":94,"licenseFileUrl":6,"sourceHtmlUrl":95,"categories":96,"keywords":97,"publishedAt":20},"01M735GKET5YVYKAY62W2P5YXB","openai--sentry--sentry","Use when the user asks to inspect Sentry issues or events, summarize recent production errors, or pull basic Sentry health data via the Sentry API; perform read-only queries with the bundled script and require `SENTRY_AUTH_TOKEN`.","MIT","https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fopenai--sentry--sentry\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},"01M73DCAP83T17HY7SMGK7MGFE","ito-basket-compare","Compare Itô prediction-market baskets against a user's knowledge base, portfolio notes, financial context, watchlist, or research thesis. Use for read-only basket comparison and gap analysis without investment advice or live trading.","https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI\u002Fblob\u002Fmain\u002Fcore\u002Fskills\u002Fito-basket-compare\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":109,"sourceHtmlUrl":110,"categories":111,"keywords":112,"publishedAt":20},"01M734CYEMZFDR3KH6SW0JP8TD","implementing-network-traffic-baselining","Build network traffic baselines from NetFlow\u002FIPFIX data using Python pandas for statistical analysis, z-score anomaly detection, and hourly\u002Fdaily traffic pattern profiling","https:\u002F\u002Fgithub.com\u002Fyanacuti1121\u002FYana-AI\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fimplementing-network-traffic-baselining\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fimplementing-network-traffic-baselining\u002FSKILL.md",[],[],{"skillNo":114,"name":115,"nameZh":6,"description":116,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":117,"sourceHtmlUrl":118,"categories":119,"keywords":120,"publishedAt":20},"01M73ASZ6NJRJM44Z2P84NGQ3Q","detecting-evasion-techniques-in-endpoint-logs","Detects defense evasion techniques used by adversaries in endpoint logs including log tampering, timestomping, process injection, and security tool disabling. Use when investigating suspicious endpoint behavior, building detection rules for evasion tactics, or conducting threat hunting for stealthy adversary activity. Activates for requests involving evasion detection, defense evasion analysis, log tampering detection, or MITRE ATT&CK TA0005.","https:\u002F\u002Fgithub.com\u002Fyanacuti1121\u002FYana-AI\u002Fblob\u002Fmain\u002Fcore\u002Fskills\u002Fdetecting-evasion-techniques-in-endpoint-logs\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI\u002Fblob\u002Fmain\u002Fcore\u002Fskills\u002Fdetecting-evasion-techniques-in-endpoint-logs\u002FSKILL.md",[],[],{"skillNo":122,"name":123,"nameZh":6,"description":124,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":125,"sourceHtmlUrl":126,"categories":127,"keywords":128,"publishedAt":20},"01M734AFNXD06Z78QRK0VKGT7Q","implementing-microsegmentation-with-guardicore","Implementing microsegmentation using Akamai Guardicore Segmentation to map application dependencies, create granular network policies, visualize east-west traffic flows, and enforce least-privilege communication between workloads across data centers and cloud.","https:\u002F\u002Fgithub.com\u002Fyanacuti1121\u002FYana-AI\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fimplementing-microsegmentation-with-guardicore\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fimplementing-microsegmentation-with-guardicore\u002FSKILL.md",[],[],{"skillNo":130,"name":131,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":132,"categories":133,"keywords":134,"publishedAt":20},"01M736TK27QMCXK0DVCH25SJN5","ramdisk-tmpfs-patterns","https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Framdisk-tmpfs-patterns\u002FSKILL.md",[],[]]