analyzing-linux-persistence

analyzing-linux-persistence is a skill for Claude Code, Codex from trilwu/secskills. It costs 97 tokens per session (4,183 once invoked), scanned E, original, MIT.

A guide to finding ways an attacker keeps access to a Linux computer. Persistence includes startup services, scheduled tasks, login scripts, SSH settings, and other automatic launch points.

In plain words
What is it for?
Use it during investigations of compromised Linux hosts, disk images, unauthorized services, rogue scheduled jobs, kernel modules, and other attacker changes.
Why use it?
Linux persistence can be hidden in many different system locations, so checking only one or two places can miss a backdoor. A systematic sweep helps determine whether cleanup was complete.

Skill for Claude CodeCodex

Part of the secskills-defense plugin — 22 skills shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/trilwu/secskills/analyzing-linux-persistence
Any agent
npx skills add trilwu/secskills --skill analyzing-linux-persistence
Clone the repo
git clone --depth 1 https://github.com/trilwu/secskills

Made for: Claude Code, Codex.

Or install secskills-defense, the plugin that ships this one along with the rest of its 22 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for analyzing-linux-persistence

README.md
[![agentmods](https://agentmods.dev/badge/skills/trilwu/secskills/analyzing-linux-persistence.svg)](https://agentmods.dev/skills/trilwu/secskills/analyzing-linux-persistence)
Your own site
<a href="https://agentmods.dev/skills/trilwu/secskills/analyzing-linux-persistence"><img src="https://agentmods.dev/badge/skills/trilwu/secskills/analyzing-linux-persistence.svg" alt="Measured on agentmods" height="20"></a>
Per session 97 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,183 The whole file, excluding the scripts and references it only reads on demand.
Security scan E 3 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00097 $0.04183
Opus 5 $0.00048 $0.02091
Sonnet 5 $0.00019 $0.00837
Haiku 4.5 $0.00010 $0.00418

Measured 5d ago against content hash 82724e3e28fd, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade E, and why

analyzing-linux-persistence scanned grade E with 3 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Reaches for credential fileshighPrivilege escalation

SSH keys, cloud credentials, git-credentials, .npmrc, /etc/shadow: reading these is how a config file becomes a credential leak.

/root/.ssh/authorized_keys /home/*/.ssh/authorized_keys 2>/dev/null

Downloads and executes remote codehighSupply chain

curl | sh runs whatever the server returns today, which is not necessarily what it returned when this was reviewed.

running `curl | bash` will not trigger a signature.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

running `curl | bash` will not trigger a signature.
secskills-defense/skills/analyzing-linux-persistence/SKILL.md · 397 lines

How it starts

The opening of the file, as written. The whole thing — 397 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Analyzing Linux Persistence

Linux persistence mechanisms are spread across dozens of locations that no single tool checks comprehensively. The attacker needs only one you miss. The work is a systematic sweep of every initialization path the kernel and userspace honor, in a sequence that catches the common before the exotic.

When to Use

  • Investigating a compromised Linux host to find how the attacker kept access
  • Forensic analysis of a Linux disk image or live system
  • Looking for backdoors, unauthorized services, or rogue scheduled tasks
  • Determining the full scope of attacker modifications during IR
  • Validating that eradication removed every persistence mechanism

When NOT to Use

  • Running a full incident response -- use responding-to-incidents
  • Establishing persistence offensively -- use establishing-persistence
  • Actively escalating privileges -- use escalating-linux-privileges
  • The host is Windows -- use investigating-windows-endpoints
  • You have an acquired disk image, not a live host -- use analyzing-disk-images
  • Analyzing a recovered malware sample -- use analyzing-malware

Systemd Units

Systemd is the most common persistence vector on modern Linux. Check every search path, not just /etc/systemd/system.

Search paths (evaluated in priority order):

/etc/systemd/system/          # admin-installed, highest priority
/run/systemd/system/          # runtime units, survive until reboot
/usr/lib/systemd/system/      # package-installed defaults
/usr/local/lib/systemd/system/
~/.config/systemd/user/       # per-user units (no root needed)

Enumeration:

# All enabled units -- compare against a known-good baseline
systemctl list-unit-files --state=enabled --type=service
systemctl list-unit-files --state=enabled --type=timer

# Recently modified service files
find /etc/systemd /run/systemd /usr/lib/systemd ~/.config/systemd \
  -name '*.service' -o -name '*.timer' -o -name '*.socket' \
  2>/dev/null | xargs ls -lt | head -30

# Show the full contents of a suspect unit
systemctl cat suspicious.service

# Check for drop-in overrides that modify legitimate units
find /etc/systemd/system/*.d /run/systemd/system/*.d \
  -name '*.conf' 2>/dev/null

# Masked units -- attacker may mask a security service
systemctl list-unit-files --state=masked

# Systemd generators -- scripts that dynamically create units at boot.
# Four directories, in ascending precedence. Checking only the first two
# misses generators dropped in the others.
ls -la /etc/systemd/system-generators/
ls -la /run/systemd/system-generators/         # tmpfs: runtime-injected
ls -la /usr/local/lib/systemd/system-generators/
ls -la /usr/lib/systemd/system-generators/

Read the full file on GitHub · 397 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 397 lines · 97 tokens per session scan E 82724e3e28fd

Subscribe to this mod's changes

analyzing-linux-persistence is a skill published in the GitHub repository trilwu/secskills (134 stars, last pushed today), licensed MIT. It adds 97 tokens to every session and 4,183 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it E with 3 findings (reaches for credential files, downloads and executes remote code, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

claude-md-improver

Audit and improve CLAUDE.md files in repositories. Use when user asks to check, audit, update, improve, or fix CLAUDE.md files. Scans for all CLAUDE.md files, evaluates quality against templates, outputs quality report, then makes targeted updates. Also use when the user mentions "CLAUDE.md maintenance" or "project…

anthropics/claude-plugins-official · 82 tokens

agent-platform-rag-engine-management

Manage and query Agent Platform RAG Engine Corpora and retrieve grounded contexts using the Google GenAI SDK. Use when listing RAG corpora or files, inspecting a corpus, retrieving contexts, or generating content grounded in a RAG corpus. Do not use for standard database queries (use SQL/Spanner skills), Google…

google/skills · 85 tokens

gke-reliability

Improves GKE workload reliability, using PDBs, health probes, and topology spread constraints. Use when configuring GKE workload reliability, setting up PDBs, or configuring GKE health probes (liveness, readiness, startup). Don't use for disaster recovery setup or full cluster backups (use gke-backup-dr instead).

google/skills · 73 tokens

gke-workload-security

Audits, configures, and hardens workload-level security controls for Google Kubernetes Engine (GKE) applications and namespaces. Covers running cluster security audits (auditcluster.sh), configuring Workload Identity Federation (impersonation, KSA/GSA binding, and pod setup), enforcing Network Policies (default-deny…

google/skills · 181 tokens

agent-platform-model-registry

Agent Platform Model Registry Management. Use when you need to upload, list, describe, update, or delete machine learning models (and their versions) in the Agent Platform Model Registry. Don't use for model training, model deployment to endpoints, or managing non-Agent Platform models.

google/skills · 60 tokens

google-cloud-solution-agentic-analytics-spark-knowledge-catalog

Discovers requirements and generates guidance to design and deploy a governed, secure agentic-analytics solution for data that's distributed across Google Cloud, other cloud providers, or on-premises. Data that's outside Google Cloud (such as data from Databricks, Snowflake, Salesforce, SAP, or Oracle systems) is…

google/skills · 138 tokens