返回顶部
l

litellm-attack-detectorLiteLLM攻击检测器

Detect the LiteLLM supply chain attack (v1.82.7/1.82.8). Scans for compromised packages, malicious .pth files, backdoor persistence, suspicious network connections, and Kubernetes IoCs. No dependencies, read-only, safe to run.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
124
下载量
免费
免费
1
收藏
概述
安装方式
版本历史

litellm-attack-detector

LiteLLM 供应链攻击检测器

检测 LiteLLM 供应链攻击(v1.82.7 / v1.82.8,TeamPCP)的入侵指标。纯只读脚本,不修改任何文件,不发送任何数据,安全可靠。

参考:https://github.com/BerriAI/litellm/issues/24512

原始脚本:https://gist.github.com/sorrycc/30a765b9a82d0d8958e756b251828a19#file-check-litellm-sh(作者 @sorrycc,已适配错误修复:set -euo pipefail → set -u)

概述

2026 年 3 月,LiteLLM PyPI 包的 1.82.7 和 1.82.8 版本被植入恶意代码(供应链攻击)。攻击者通过 .pth 文件持久化后门,窃取环境变量中的凭据,并在 Kubernetes 环境中部署特权 Pod。

本技能提供一键检测脚本,覆盖 7 个检测维度:

#检测项说明
1版本检测检查 pip/pip3/uv 中是否安装了受影响版本
2
.pth 文件扫描 | 搜索 site-packages 和缓存目录中的恶意 litellm_init.pth |
| 3 | 后门持久化 | 检查 ~/.config/sysmon/、sysmon.service、/tmp/.pg_state 等已知后门路径 |
| 4 | 网络连接 | 检查是否有到 litellm.cloud / checkmarx.zone 的活跃连接 |
| 5 | DNS 解析 | 确认恶意域名的 DNS 可达性 |
| 6 | Kubernetes | 检查 kube-system 中的可疑 Pod 和特权容器 |
| 7 | 依赖链 | 检查哪些包间接依赖了 litellm |

使用时机

当用户的请求涉及以下场景时触发此技能:

  • - 检测 LiteLLM 供应链攻击:检查一下有没有中招
  • 安全扫描:扫描一下 litellm 是否被篡改
  • 事件响应:litellm 后门检测
  • 关键词触发:litellm attack、litellm 1.82.7、litellm 1.82.8、TeamPCP、supply chain、供应链攻击

使用方法

运行检测脚本

bash
bash {{SKILL_DIR}}/scripts/detect.sh

脚本无需任何参数,无需 root 权限,自动检测当前环境。

输出说明

脚本使用彩色输出标识检测结果:

  • - 🟢 [+] 绿色 — 该项安全
  • 🔴 [!] 红色 — 发现入侵指标(IoC)
  • 🟡 [*] 黄色 — 信息提示

输出示例(安全环境)

============================================
LiteLLM 供应链攻击检测器
目标:litellm 1.82.7 / 1.82.8(TeamPCP)
============================================

[*] 检查已安装的 litellm 版本...
[+] litellm 未通过 pip 安装
[*] 在 Python site-packages 中搜索 litellm_init.pth...
[+] 未发现 litellm_init.pth
[*] 检查持久化后门痕迹...
[+] 未发现持久化后门痕迹
[*] 检查可疑网络连接...
[+] 未发现到已知 C2 域名的可疑连接
[*] 检查 DNS 解析...
[*] 检查 Kubernetes 环境...
[*] 未找到 kubectl,跳过 Kubernetes 检查
[*] 检查 litellm 是否为传递依赖...

============================================
安全 — 未发现入侵指标。
============================================

输出示例(受感染环境)

============================================
警报 — 检测到入侵指标!

建议操作:
1. 卸载 litellm 并手动删除 litellm_init.pth
2. 移除后门:~/.config/sysmon/ 和 sysmon.service
3. 清除缓存:pip cache purge / rm -rf ~/.cache/uv
4. 轮换所有凭据:
- SSH 密钥
- AWS / GCP / Azure 凭据
- Kubernetes 配置和服务账号令牌
- .env 文件中的所有 API 密钥
- 数据库密码
- Git 凭据
- CI/CD 密钥
5. 审计云 IAM 日志,检查未授权访问
6. 如果在 K8s 中:删除 node-setup-* Pod,审计密钥
============================================

退出码

  • - 0 — 未发现入侵指标
  • 1 — 发现入侵指标,需要立即处理

边界情况

  • - 无 pip/pip3:自动跳过版本检测,继续其他检查项
  • 无 python3:.pth 文件搜索会使用备用路径(~/.cache/pip、~/.cache/uv 等)
  • 无 kubectl:自动跳过 Kubernetes 检查
  • 无 lsof/ss:跳过网络连接检测
  • 虚拟环境:自动检测 $VIRTUAL_ENV 路径
  • macOS / Linux 均支持:脚本兼容两个平台
  • 只读操作:整个脚本不修改任何文件、不安装任何东西、不向外发送任何数据

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 litellm-attack-detector-1776025921 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 litellm-attack-detector-1776025921 技能

通过命令行安装

skillhub install litellm-attack-detector-1776025921

下载

⬇ 下载 litellm-attack-detector v1.0.0(免费)

文件大小: 5.69 KB | 发布时间: 2026-4-13 10:52

v1.0.0 最新 2026-4-13 10:52
Initial release: Detects compromise from the LiteLLM supply chain attack (v1.82.7/1.82.8) in a safe, read-only manner.

- Scans for malicious packages, .pth files, persistence mechanisms, suspicious network connections, and Kubernetes compromise Indicators (IoCs).
- No dependencies required, safe to run (does not modify files or send data).
- Provides color-coded output and actionable remediation guidance if compromise is detected.
- Handles edge cases: missing pip/python, alternative cache locations, absence of kubectl or lsof, macOS/Linux compatibility.
- Usage details and detection steps included for both security teams and general users.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部