analyzing-persistence-mechanisms-in-linux
它能做什么
这个工具会查找攻击者可能用来在 Linux 电脑上“留后门”的方法,即使电脑重启之后,他们仍然能够再次进入。它会检查那些让程序在后台自动运行的文件和设置。
适用场景
- ✓当你怀疑有黑客入侵了你的 Linux 电脑时。
- ✓当你想查找攻击者可能留下的隐藏访问入口时。
- ✓当你想弄清楚攻击者是如何一直保持对系统的访问权限时。
技能链接
https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/analyzing-persistence-mechanisms-in-linux/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“帮我检查一下我的 Linux 系统里有没有隐藏的访问入口。”
每周 5 个新技能,1 分钟读完。
工作原理
工具会检查恶意程序常见的隐藏位置,这些程序可能借此自动启动。它还会查看系统日志,记录这些改动发生的时间,并整理成一条时间线。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
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
- Scan Crontab Entries — Enumerate all user crontabs, /etc/cron.d/, /etc/cron.daily/, and anacron jobs for suspicious commands
- Audit Systemd Units — Check /etc/systemd/system/ and ~/.config/systemd/user/ for non-package-managed service and timer units
- Detect LD_PRELOAD Hijacking — Check /etc/ld.so.preload and LD_PRELOAD environment variable for injected shared libraries
- Inspect Shell Profiles — Scan .bashrc, .bash_profile, .profile, /etc/profile.d/ for injected commands or reverse shells
- Check SSH Authorized Keys — Audit all authorized_keys files for unauthorized public keys with command restrictions
- Correlate Auditd Logs — Search auditd logs for file modification events on persistence paths to build an installation timeline
- 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
常见问题
什么是“持久化机制”(persistence mechanisms)?
这是攻击者用来确保即使系统重启,或者你试图清除它们之后,仍然能重新进入系统的方法。
我需要是 Linux 专家才能使用这个工具吗?
不需要。即使你不是程序员,也可以使用它,大部分分析工作都由工具自动完成。
什么是 auditd?
它是一个 Linux 服务,用来记录系统上发生的事情,比如哪些文件被修改了。工具借助它的记录,就能知道隐藏的访问入口是什么时候被安装的。
详情
作者的原始描述
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.
热度
- GitHub 星标
- 35k
- 排名
- #7644
- 许可证
- Apache-2.0
- 更新时间
- 2026/8/31
评论
- …
同一仓库的更多技能
abusing-dpapi-for-credential-access
35k为你的 AI 智能体提供针对特定任务的现成指令,让它完成得更好、更快。
abusing-shadow-credentials-for-privesc
35k教你的 AI 智能体写出清晰、结构良好的文本。
achieving-cmmc-level-2-compliance
35k帮助你的智能体搭建符合 CMMC Level 2 合规要求的环境。它会落实安全要求,并管理必要的文档。
acquiring-disk-image-with-dd-and-dcfldd
35k帮助你的智能体创建硬盘的精确副本。这能确保调查过程中信息不丢失、不被篡改。