jthack/litellm-vuln-detector
GitHub: jthack/litellm-vuln-detector
针对 LiteLLM 1.82.7/1.82.8 PyPI 供应链攻击的入侵指标检测与凭据泄露评估工具
Stars: 2 | Forks: 0
# litellm 供应链攻击检测器
2026年3月24日,恶意版本的 litellm (1.82.7 和 1.82.8) 被发布到 PyPI,绕过了正常的 GitHub 发布流程。被篡改的软件包会将凭据(SSH 密钥、AWS/GCP/Azure 凭证、.env 文件、k8s 配置、Shell 历史记录等)窃取到攻击者的基础设施,并安装持久化后门。
**完整分析:** [https://futuresearch.ai/blog/litellm-pypi-supply-chain-attack/](https://futuresearch.ai/blog/litellm-pypi-supply-chain-attack/)
## 快速开始
需要 [ripgrep](https://github.com/BurntSushi/ripgrep) (`rg`)。
```
curl -sL https://raw.githubusercontent.com/jthack/litellm-vuln-detector/main/detect.sh | bash
```
或者克隆并运行:
```
git clone https://github.com/jthack/litellm-vuln-detector.git
cd litellm-vuln-detector
./detect.sh
```
## 检查内容
| 检查项 | 描述 |
|-------|-------------|
| **已安装版本** | 通过 pip, uv, conda 检测 litellm 1.82.7/1.82.8,并扫描磁盘上所有的 virtualenvs/pyenv/site-packages |
| **恶意 .pth 文件** | 在 site-packages、uv 缓存、virtualenvs 中搜索 `litellm_init.pth` |
| **持久化后门** | 检查 `~/.config/sysmon/sysmon.py` 和 systemd 用户服务 |
| **窃取域名** | 扫描 Shell 历史记录和日志中的 `models.litellm.cloud` |
| **网络连接** | 检查是否有连接到攻击者基础设施的活动连接 |
| **可疑进程** | 检测正在运行的 `sysmon.py` 或 `litellm_init` 进程 |
| **Kubernetes** | 查找 kube-system 中恶意的 `node-setup-*` Pods(如果 kubectl 可用) |
| **凭据暴露** | 列出本地可能已被窃取的现有凭据 |
## 退出代码
- `0` — 未发现入侵指标
- `>0` — 检测到的 IOC 数量
## 如果您已被入侵
1. `pip uninstall litellm`
2. `rm -rf ~/.config/sysmon/ ~/.config/systemd/user/sysmon.service`
3. `pkill -f sysmon.py`
4. **轮换所有凭据** — SSH 密钥、AWS/GCP/Azure Token、API 密钥、数据库密码
5. 审计 Kubernetes 集群中 `kube-system` 里的 `node-setup-*` Pods
6. 检查云访问日志中是否有未授权活动
标签:Chrome Headless, DevSecOps, DNS 解析, IOC扫描, IP 地址批量处理, Kubernetes安全, LiteLLM, PyPI漏洞, Python包管理, Ripgrep, Shell脚本, StruQ, 上游代理, 供应链攻击检测, 信标检测, 凭据窃取, 后门检测, 妥协指标, 子域名突变, 库, 应急响应, 应用安全, 文档安全, 环境安全