meltedinhex/analyst-ai-pack / skills/hunting-persistence-on-linux
hunting-persistence-on-linux
FlaggedHunts for Linux persistence by inspecting cron, systemd units, shell rc files, SSH authorized_keys, and common autostart locations for attacker-added entries. Activates for requests to hunt Linux persistence, audit cron/systemd for backdoors, or find unauthorized autostart and authorized_keys entries.
| File | Kind | Size |
|---|---|---|
| LICENSE | other | 340 B |
| SKILL.md | skill md | 2.7 KB |
| references/api-reference.md | markdown | 1.2 KB |
| scripts/analyst.py | script | 2.8 KB |
references/api-reference.md
View on GitHub# API Reference: Hunting Persistence on Linux
## Overview
`scripts/analyst.py` recursively scans collected Linux persistence artifacts and flags suspicious
lines (download-exec, reverse shells, suspicious paths) plus `authorized_keys` additions, grouped
by mechanism inferred from the file path. It reads files statically and executes nothing.
## Dependencies
| Package | Version | Purpose |
|---------|---------|---------|
| (stdlib) | — | regex, JSON, pathlib |
## Core functions
### `scan(root)`
Returns findings (file, mechanism, line, match), a per-mechanism count, and the total.
## Mechanisms
cron, systemd (`.service`/`.timer`), rc/profile, ssh_keys (`authorized_keys`), autostart/init.d.
## Patterns
`curl|wget ... | sh`, `base64 -d | bash`, `nc -e`, `/dev/tcp/`, `bash -i`, python socket one-liners,
and `/tmp`/`/dev/shm` execution paths.
## Usage
```bash
python scripts/analyst.py scan /path/to/collected
```
## Sources
- MITRE ATT&CK T1543.002 Systemd Service; T1053.003 Cron; T1098.004 SSH Authorized Keys — https://attack.mitre.org/
- Reverse-shell / download-exec one-liner patterns from public Linux IR practice
- Linux persistence locations (cron, systemd, rc files, autostart) from distribution documentation
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |