跳到正文
Skillpedia
分析与电子表格35k · #7644

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。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/analyzing-persistence-mechanisms-in-linux/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 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

  1. Scan Crontab Entries — Enumerate all user crontabs, /etc/cron.d/, /etc/cron.daily/, and anacron jobs for suspicious commands
  2. Audit Systemd Units — Check /etc/systemd/system/ and ~/.config/systemd/user/ for non-package-managed service and timer units
  3. Detect LD_PRELOAD Hijacking — Check /etc/ld.so.preload and LD_PRELOAD environment variable for injected shared libraries
  4. Inspect Shell Profiles — Scan .bashrc, .bash_profile, .profile, /etc/profile.d/ for injected commands or reverse shells
  5. Check SSH Authorized Keys — Audit all authorized_keys files for unauthorized public keys with command restrictions
  6. Correlate Auditd Logs — Search auditd logs for file modification events on persistence paths to build an installation timeline
  7. 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.

repo: mukul975/Anthropic-Cybersecurity-Skills

热度

GitHub 星标
35k
排名
#7644
许可证
Apache-2.0
更新时间
2026/8/31

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能