analyzing-persistence-mechanisms-in-linux — Claude Code skill
Scans Linux hosts for persistence in cron, systemd, LD_PRELOAD, and shell profiles, correlating findings with auditd logs.
npx skills add mukul975/Anthropic-Cybersecurity-Skills --skill analyzing-persistence-mechanisms-in-linux -a claude-codeWhat analyzing-persistence-mechanisms-in-linux does
This skill audits Linux environments during incident response and threat hunting. It inspects user crontabs, /etc/cron.d/, systemd services and timers in /etc/systemd/system/, shared library injections in /etc/ld.so.preload, shell profiles like .bashrc, and unauthorized keys in authorized_keys.
Events correlate against auditd logs to reconstruct an installation timeline. The final result delivers a JSON report scored by risk, mapped to MITRE ATT&CK techniques (T1053, T1543, T1574, T1546), along with remediation commands for every discovered artifact.
Without root or sudo access, inspecting restricted system paths and other users' crontabs will fail. Prerequisites include Python 3.8+ using standard modules and auditd configured with file watch rules on target persistence locations.
What it helps with
- audit user and system crontabs for unauthorized scheduled tasks
- detect unmanaged systemd service and timer units
- identify shared library injections via /etc/ld.so.preload
- reconstruct persistence timeline from auditd file modification logs
- generate remediation commands and MITRE ATT&CK technique mappings
Example prompts for the agent
- Scan this Linux host for persistence mechanisms and correlate with auditd.
- Check crontab, systemd units, and LD_PRELOAD for suspicious entries.
- Generate a persistence analysis report with MITRE ATT&CK mappings and remediation steps.
How to install analyzing-persistence-mechanisms-in-linux
1Skills CLI (Vercel)
npx skills add mukul975/Anthropic-Cybersecurity-Skills --skill analyzing-persistence-mechanisms-in-linux -a claude-code2Manually: put the files in place
~/.claude/skills/analyzing-persistence-mechanisms-in-linux/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/analyzing-persistence-mechanisms-in-linux/
1Skills CLI (Vercel)
npx skills add mukul975/Anthropic-Cybersecurity-Skills --skill analyzing-persistence-mechanisms-in-linux -a codex2Manually: put the files in place
.agents/skills/analyzing-persistence-mechanisms-in-linux/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add mukul975/Anthropic-Cybersecurity-Skills --skill analyzing-persistence-mechanisms-in-linux -a cursor2Manually: put the files in place
.cursor/skills/analyzing-persistence-mechanisms-in-linux/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install mukul975/Anthropic-Cybersecurity-Skills analyzing-persistence-mechanisms-in-linux2Manually: put the files in place
.github/skills/analyzing-persistence-mechanisms-in-linux/SKILL.md1Skills CLI (Vercel)
npx skills add mukul975/Anthropic-Cybersecurity-Skills --skill analyzing-persistence-mechanisms-in-linux -a gemini-cli2Platform CLI
gemini skills install https://github.com/mukul975/Anthropic-Cybersecurity-Skills --path skills/analyzing-persistence-mechanisms-in-linuxManually: put the files in place
.devin/skills/analyzing-persistence-mechanisms-in-linux/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add mukul975/Anthropic-Cybersecurity-Skills --skill analyzing-persistence-mechanisms-in-linux -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about analyzing-persistence-mechanisms-in-linux
How to install analyzing-persistence-mechanisms-in-linux in Claude Code?
Run npx skills add mukul975/Anthropic-Cybersecurity-Skills --skill analyzing-persistence-mechanisms-in-linux -a claude-code in your terminal.
What does analyzing-persistence-mechanisms-in-linux do?
It inspects persistence vectors on Linux hosts, including cron jobs, systemd units, preload injection, and SSH keys, mapping findings into a timeline using auditd logs.
What are the prerequisites for this skill?
You need root or sudo privileges, Python 3.8+ with standard libraries, and auditd configured with watch rules on critical persistence paths.
Source text
SKILL.md · Apache-2.0
--- name: analyzing-persistence-mechanisms-in-linux description: Scan Linux systems for persistence mechanisms including crontab/systemd entries, LD_PRELOAD injection, shell profile modifications (.bashrc, .profile), and SSH authorized_keys backdoors, then correlate findings with auditd logs into an installation timeline. Use during incident response or threat hunting to detect or confirm how an adversary maintained access to a compromised Linux host. domain: cybersecurity subdomain: threat-hunting tags: - linux-persistence - crontab - systemd - ld-preload - auditd - threat-hunting - incident-response mitre_attack: - T1053.003 - T1543.002 - T1574.006 - T1546.004 - T1098.004 version: '1.0' author: mahipal license: Apache-2.0 d3fend_techniques: - Executable Denylisting - Execution Isolation - File Metadata Consistency Validation - Process Termination - Content Format Conversion nist_csf: - DE.CM-01 - DE.AE-02 - DE.AE-07 - ID.RA-05 --- # Analyzing Persistence Mechanisms in Linux ## Overview Adversaries establish persistence on Linux systems through crontab jobs, systemd service/timer units, LD_PRELOAD library injection, shell profile modifications (.bashrc, .profile), SSH authorized_keys backdoors, and init script manipulation. This skill scans for all known persistence vectors, checks file timestamps and integrity, and correlates findings with auditd logs to build a timeline of persistence installation. ## When to Use - When investigating security incidents that require analyzing persistence mechanisms in linux - When building detection rules or threat hunting queries for this domain - When SOC analysts need structured procedures for this analysis type - When validating security monitoring coverage for related attack techniques ## Prerequisites - Root or sudo access on target Linux system (or forensic image) - auditd configured with file watch rules on persistence paths - Python 3.8+ with standard library (os, subprocess, json) - Optional: OSSEC/Wazuh agent for file integrity monitoring alerts ## Steps 1. **Scan Crontab Entries** — Enumerate all user crontabs, /etc/cron.d/, /etc/cron.daily/, and anacron jobs for suspicious commands 2. **Audit Systemd Units** — Check /etc/systemd/system/ and ~/.config/systemd/user/ for non-package-managed service and timer units 3. **Detect LD_PRELOAD Hijacking** — Check /etc/ld.so.preload and LD_PRELOAD environment variable for injected shared libraries 4. **Inspect Shell Profiles** — Scan .bashrc, .bash_profile, .profile, /etc/profile.d/ for injected commands or reverse shells 5. **Check SSH Authorized Keys** — Audit all authorized_keys files for unauthorized public keys with command restrictions 6. **Correlate Auditd Logs** — Search auditd logs for file modification events on persistence paths to build an installation timeline 7. **Generate Persistence Report** — Produce a risk-scored report of all discovered persistence mechanisms ## Expected Output - JSON report of all persistence mechanisms found with risk scores - Timeline of persistence installation from auditd correlation - MITRE ATT&CK technique mapping (T1053, T1543, T1574, T1546) - Remediation commands for each detected persistence mechanism
© mahipal · Apache-2.0 · mukul975/Anthropic-Cybersecurity-Skills