用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/killvxk/cybersecurity-skills-zh --skill analyzing-supply-chain-malware-artifacts命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | analyzing-supply-chain-malware-artifacts |
| description | 调查供应链攻击工件,包括被木马化的软件更新、被攻陷的构建流水线和侧载的依赖项,以识别入侵向量和攻陷范围。 |
| domain | cybersecurity |
| subdomain | malware-analysis |
| tags | ["supply-chain","malware-analysis","trojanized-software","solarwinds","3cx","dependency-confusion","software-integrity"] |
| version | 1.0 |
| author | mahipal |
| license | Apache-2.0 |
供应链攻击通过破坏合法软件分发渠道,借助受信任的更新机制投递恶意软件。典型案例包括 SolarWinds SUNBURST(2020 年,影响 18,000 多个客户)、3CX SmoothOperator(2023 年,一起源自 Trading Technologies 的级联供应链攻击)以及大量 npm/PyPI 包投毒活动。分析工作涉及:将木马化二进制文件与合法版本进行比对、识别构建工件中的注入代码、检查代码签名异常,以及追踪从初始攻陷到载荷投递的感染链。截至 2025 年,供应链攻击占所有违规事件的 30%,较前几年增加了 100%。
pefile、ssdeep、hashlib#!/usr/bin/env python3
"""比对木马化二进制文件与合法版本。"""
import hashlib
import pefile
import sys
import json
def compare_pe_files(legitimate_path, suspect_path):
"""比对合法版本与可疑版本之间的 PE 文件结构。"""
legit_pe = pefile.PE(legitimate_path)
suspect_pe = pefile.PE(suspect_path)
report = {"differences": [], "suspicious_sections": [], "import_changes": []}
# 比对节
legit_sections = {s.Name.rstrip(b'\x00').decode(): {
"size": s.SizeOfRawData,
"entropy": s.get_entropy(),
"characteristics": s.Characteristics,
} for s in legit_pe.sections}
suspect_sections = {s.Name.rstrip(b'\x00').decode(): {
"size": s.SizeOfRawData,
"entropy": s.get_entropy(),
"characteristics": s.Characteristics,
} for s in suspect_pe.sections}
# 查找新增或已修改的节
for name, props in suspect_sections.items():
if name not in legit_sections:
report["suspicious_sections"].append({
"name": name, "reason": "合法版本中不存在的新节",
"size": props["size"], "entropy": round(props["entropy"], 2),
})
elif (props[] - legit_sections[name][]) > :
report[].append({
: name, : ,
: legit_sections[name][],
: props[],
})
legit_imports = ()
(legit_pe, ):
entry legit_pe.DIRECTORY_ENTRY_IMPORT:
imp entry.imports:
imp.name:
legit_imports.add()
suspect_imports = ()
(suspect_pe, ):
entry suspect_pe.DIRECTORY_ENTRY_IMPORT:
imp entry.imports:
imp.name:
suspect_imports.add()
new_imports = suspect_imports - legit_imports
new_imports:
report[] = (new_imports)
report[] = (legit_pe.OPTIONAL_HEADER.DATA_DIRECTORY[].Size)
report[] = (suspect_pe.OPTIONAL_HEADER.DATA_DIRECTORY[].Size)
report
():
hashes = {}
(filepath, ) f:
data = f.read()
algo [, , ]:
h = hashlib.new(algo)
h.update(data)
hashes[algo] = h.hexdigest()
hashes
__name__ == :
(sys.argv) < :
()
sys.exit()
report = compare_pe_files(sys.argv[], sys.argv[])
(json.dumps(report, indent=, ensure_ascii=))