Skip to content

meltedinhex/analyst-ai-pack / skills/hunting-persistence-on-linux

hunting-persistence-on-linux

Flagged

Hunts 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.

FileKindSize
LICENSEother340 B
SKILL.mdskill md2.7 KB
references/api-reference.mdmarkdown1.2 KB
scripts/analyst.pyscript2.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
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: 471kUpdated Claude CodeCodexVerifiedInstall
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: 471kUpdated Claude CodeCodexVerifiedInstall
rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics.Stars: 471kUpdated Claude CodeCodexVerifiedInstall
ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first.Stars: 194kUpdated Claude CodeCodexVerifiedInstall