Skip to content
KitploitKITPLOIT
工具博客
提交
工具博客
提交

黑客、渗透测试和网络安全工具,武装您的安全武器库!

Kitploit 是一个黑客、网络安全和渗透测试工具的目录。发现最新的项目更新,查找漏洞、分析系统、自动化测试并加强你的安全。

··订阅源·联系·隐私·© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
clawdguard — 🦞 Clawdbot/Moltbot 的安全加固补丁。自动检测并修复暴露的网关。 | Kitploit
工具/GitHubGitHub/fadidevv/clawdguard
防御工具漏洞扫描器配置审计网络安全身份验证错误配置
GitHubfadidevv/clawdguard

clawdguard

🦞 Clawdbot/Moltbot 的安全加固补丁。自动检测并修复暴露的网关。

查看仓库
216个月前尚未审核

最受欢迎

查看全部 →

发现我们社区最常用的工具。

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享

🦞 ClawdGuard

Crates.io Downloads GitHub stars GitHub forks GitHub issues License: MIT

针对 Clawdbot/Moltbot 安装实例的安全加固工具,可检测并修复暴露的网关。

ClawdGuard 修复安全问题的截图

检测并修复暴露的 Clawdbot/Moltbot 网关

问题 • 功能 • 快速开始 • Docker • 命令行 • 修复内容 • 开发


问题现状

目前有 900 多个 Clawdbot/Moltbot 实例暴露在互联网上(可在 Shodan 上看到,端口 18789),且没有任何身份验证。这使得任何人都可以:

问题并非 bug,而是配置不当。用户将 gateway.bind 改为 0.0.0.0 或使用 Docker 的 -p 18789:18789 且未设置合适的身份验证时,便会完全暴露。

ClawdGuard 可以解决这个问题。


功能特性

  • 自动检测 - 自动查找配置文件、服务及正在运行的网关
  • 风险分析 - 为您的配置打分(0-10),并给出详细分析
  • 一键修复 - 补丁配置、生成安全令牌、重启服务
  • 验证确认 - 确认修复生效(端口关闭、需要认证)
  • 安全可靠 - 在任何更改前创建带时间戳的备份
  • 跨平台 - macOS(launchd)和 Linux(systemd)
  • 优雅停止 - 随时按 Ctrl+C 安全取消
  • 详细模式 - 查看每项检查的详细日志
  • Docker 就绪 - 无需安装 Rust

快速开始

1. 选择安装方式

方式 A:从 crates.io 安装(推荐)

root@kitploit:~
cargo install clawdguard

# 运行
clawdguard

方式 B:从源码构建

root@kitploit:~
# 克隆仓库
git clone https://github.com/fadidevv/clawdguard.git
cd clawdguard

# 构建(首次约需 2 分钟)
cargo build --release

# 运行
./target/release/clawdguard

方式 C:使用 Docker(无需 Rust 环境)

root@kitploit:~
# 克隆仓库
git clone https://github.com/fadidevv/clawdguard.git
cd clawdguard

# 构建镜像(首次约需 3-5 分钟)
docker build --no-cache -t clawdguard .

# 运行(挂载您的配置目录)
docker run -v ~/.moltbot:/root/.moltbot clawdguard
# 或用于旧版 Clawdbot:
docker run -v ~/.clawdbot:/root/.clawdbot clawdguard

2. 运行

root@kitploit:~
clawdguard

就这么简单!ClawdGuard 将:

  1. 检测您的 Clawdbot/Moltbot 安装
  2. 分析配置中的安全风险
  3. 在做出更改前请求确认
  4. 使用安全设置修补配置
  5. 验证修复是否成功

3. 保存您的令牌

ClawdGuard 会生成一个安全令牌。请保存好它!

root@kitploit:~
╭────────────────────────────────────────────────────────────────────╮
│  ⚠️  重要提示:请保存您的新网关令牌!                               │
│                                                                    │
│    clwd_a8f2k9x3m1p7v4q2b6n8...                                    │
│                                                                    │
│  您将需要此令牌从控制界面或 CLI 进行连接。                          │
╰────────────────────────────────────────────────────────────────────╯

Docker 设置

针对未安装 Rust 用户的完整 Docker 文档。

构建与运行

root@kitploit:~
# 1. 克隆仓库
git clone https://github.com/fadidevv/clawdguard.git
cd clawdguard

# 2. 构建镜像(首次约需 3-5 分钟)
docker build --no-cache -t clawdguard .

# 3. 运行扫描(挂载您的配置目录)
# 用于 Moltbot(较新版本):
docker run -v ~/.moltbot:/root/.moltbot clawdguard

# 用于 Clawdbot(旧版):
docker run -v ~/.clawdbot:/root/.clawdbot clawdguard

# 使用详细模式
docker run -v ~/.moltbot:/root/.moltbot clawdguard --verbose

# 仅扫描(不修复)
docker run -v ~/.moltbot:/root/.moltbot clawdguard --scan-only

# 自动模式(无交互提示)
docker run -v ~/.moltbot:/root/.moltbot clawdguard --auto

# 显示帮助
docker run clawdguard --help

Docker Compose

使用 docker-compose 简化语法:

root@kitploit:~
# 使用 docker-compose 运行
docker-compose run clawdguard

# 带详细模式
docker-compose run clawdguard --verbose

# 仅扫描
docker-compose run clawdguard --scan-only

# 自动模式
docker-compose run clawdguard --auto

Docker 命令参考

卷挂载

挂载点用途
~/.moltbot:/root/.moltbot您的 Moltbot 配置目录(较新版本)
~/.clawdbot:/root/.clawdbot您的 Clawdbot 配置目录(旧版)
./results:/app/results将结果保存到本地

Docker 小贴士

root@kitploit:~
# 创建别名以便使用(请使用您自己的配置目录)
alias clawdguard='docker run -v ~/.moltbot:/root/.moltbot clawdguard'
# 或用于旧版 Clawdbot:
alias clawdguard='docker run -v ~/.clawdbot:/root/.clawdbot clawdguard'

# 然后直接运行:
clawdguard
clawdguard --scan-only
clawdguard --verbose

CLI 参考

root@kitploit:~
clawdguard [选项]

选项:
    --scan-only         仅扫描问题,不应用修复
    --auto              自动应用所有修复,无需确认提示
    --backup-dir <目录>  备份文件的自定义目录
    --skip-firewall     跳过添加防火墙规则
    --skip-restart      跳过重启网关服务
    --token <令牌>      使用特定令牌而非生成
    -v, --verbose       显示详细输出
    --json              以 JSON 格式输出结果(适用于脚本)
    -h, --help          打印帮助
    -V, --version       打印版本

示例

root@kitploit:~
# 基本用法 - 扫描、修复、验证
clawdguard

# 仅扫描(不修复任何内容)
clawdguard --scan-only

# 自动修复所有内容(无提示)
clawdguard --auto

# 使用您自己的令牌
clawdguard --token "my-secure-token-here"

# 故障排除时使用详细输出
clawdguard --verbose

# 脚本中使用 JSON 输出
clawdguard --json

# 组合选项
clawdguard --auto --skip-firewall --verbose

# 自定义备份目录
clawdguard --backup-dir /tmp/backups

修复内容

风险评分

ClawdGuard 计算 0-10 分的风险评分:

分数等级含义
0-3🟢 低小问题或已安全
4-6🟡 中存在一些安全问题
7-10🔴 严重已暴露到互联网,立即修复

风险评分计算规则:

  • 暴露的绑定地址:+3 分
  • 缺失身份验证:+4 分
  • 外部端口可达:+2 分
  • mDNS 信息泄露:+1 分
  • 宽松的文件权限:+1 分

输出示例

普通模式

root@kitploit:~
  🦞 ClawdGuard
  Security hardening for Clawdbot/Moltbot
  v1.0.0

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

ℹ 随时可按 Ctrl+C 取消

[1/4] 🔍 检测安装...
      ✓ 配置文件: ~/.clawdbot/clawdbot.json
      ✓ 服务: bot.molt.gateway (运行中,PID 1234)
      ✓ 端口 18789 活跃

[2/4] ⚠️  分析安全风险...

╭──────────────────┬─────────────────────────┬──────────╮
│ 问题             │ 当前值                   │ 严重程度 │
├──────────────────┼─────────────────────────┼──────────┤
│ 网关绑定         │ 0.0.0.0                 │ 严重     │
│ 身份验证         │ none                    │ 严重     │
│ mDNS 广播        │ full                    │ 中等     │
╰──────────────────┴─────────────────────────┴──────────╯

      风险评分: 9/10 🔴 严重

      ⚠ 这将会修改您的配置文件以修复安全问题。
      ℹ 任何更改前都会创建备份。

      执行修复? [y/N]: y

[3/4] 🔧 应用修复...
      ✓ 备份: ~/.clawdbot/clawdbot.json.backup.20260128_143022
      ✓ 设置 gateway.bind = "loopback" (原值: "0.0.0.0")
      ✓ 设置 gateway.auth.mode = "token" (原值: "none")
      ✓ 设置 gateway.auth.token = <已生成>
      ✓ 修复文件权限 (600)

      已生成令牌: clwd_a8f2k9x3m1p7v4q2b6n8...

[4/4] ✅ 验证修复...
      ✓ 网关服务已重启
      ✓ 端口 18789 已无法从外部访问
      ✓ 网关在 localhost 上正常响应
      ✓ 现在需要身份验证

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

╭────────────────────────────────────────────────────────────────────╮
│                                                                    │
│  🎉 成功!您的 Clawdbot/Moltbot 现已安全。                         │
│                                                                    │
╰────────────────────────────────────────────────────────────────────╯

JSON 输出

root@kitploit:~
clawdguard --json
root@kitploit:~
{"status": "fixed", "token": "clwd_a8f2k9x3m1p7v4q2b6n8...", "backup": "~/.clawdbot/clawdbot.json.backup.20260128_143022"}

优雅停止(Ctrl+C)

扫描过程中,随时按 Ctrl+C 安全停止。

root@kitploit:~
[2/4] ⚠️  分析安全风险...
^C
⚠ 已中断!正在退出...

在您确认之前不会进行任何更改,因此随时中断都是安全的。


运行之后

更新您的环境变量

root@kitploit:~
# 添加到您的 shell 配置文件 (~/.bashrc, ~/.zshrc 等)
export CLAWDBOT_GATEWAY_TOKEN="clwd_your_token_here"

远程访问(安全方法)

如果需要远程访问,请使用以下安全方法之一:

方法命令
Tailscale(推荐)tailscale serve --bg 18789
SSH 隧道ssh -L 18789:localhost:18789 your-server
Cloudflare Tunnelcloudflared tunnel --url http://localhost:18789

切勿将 gateway.bind 改回 0.0.0.0 或直接暴露端口。


故障排除

"未找到 Clawdbot/Moltbot 安装"

请确保:

  • 已安装 Clawdbot 或 Moltbot
  • 至少运行过一次(会创建 ~/.moltbot/ 或 ~/.clawdbot/ 目录)
  • 配置文件存在于 ~/.moltbot/moltbot.json 或 ~/.clawdbot/clawdbot.json

"无法重启服务"

请尝试手动重启:

root@kitploit:~
clawdbot gateway restart
# 或
moltbot gateway restart

令牌不工作

  1. 保存完整的令牌(包括 clwd_ 前缀)
  2. 添加到环境变量或控制界面设置
  3. 重启网关

Docker:权限拒绝

请确保您的配置目录可读:

root@kitploit:~
# 用于 Moltbot(较新版本)
chmod 755 ~/.moltbot
chmod 644 ~/.moltbot/moltbot.json

# 用于 Clawdbot(旧版)
chmod 755 ~/.clawdbot
chmod 644 ~/.clawdbot/clawdbot.json

平台支持

平台状态服务管理器
macOS✅ 完整支持launchd
Linux✅ 完整支持systemd(用户)
Windows⚠️ WSL2在 WSL2 内运行

工作原理

root@kitploit:~
┌─────────────────────────────────────────────────────────────────┐
│                       ClawdGuard v1.0                          │
├─────────────────────────────────────────────────────────────────┤
│                                                                 │
│  ┌──────────┐   ┌──────────┐   ┌──────────┐   ┌──────────┐     │
│  │ 检测     │ → │ 分析     │ → │ 修补     │ → │ 验证     │     │
│  └──────────┘   └──────────┘   └──────────┘   └──────────┘     │
│       │              │              │              │            │
│       ▼              ▼              ▼              ▼            │
│  查找配置文件   检查风险       修复配置      确认安全         │
│  查找服务       评估危险       生成令牌      测试端口         │
│  查找进程       列出问题       修复权限      重启服务         │
│                                                                 │
└─────────────────────────────────────────────────────────────────┘

项目结构

root@kitploit:~
clawdguard/
├── Cargo.toml           # 依赖项
├── Dockerfile           # Docker 构建
├── docker-compose.yml   # Docker Compose
├── .dockerignore
├── README.md
├── LICENSE
├── .gitignore
├── assets/
│   └── screenshot.png   # README 截图
├── src/
│   ├── main.rs          # CLI 入口
│   ├── lib.rs           # 库根模块
│   ├── detect/          # 安装检测
│   │   ├── mod.rs
│   │   ├── config.rs    # 配置文件检测
│   │   ├── process.rs   # 进程检测
│   │   └── service.rs   # 服务检测 (launchd/systemd)
│   ├── analyze/         # 安全分析
│   │   ├── mod.rs
│   │   ├── config_risk.rs
│   │   ├── network.rs   # 端口暴露检测
│   │   └── permissions.rs
│   ├── patch/           # 配置修补
│   │   ├── mod.rs
│   │   ├── config.rs
│   │   ├── firewall.rs
│   │   └── token.rs     # 安全令牌生成
│   ├── verify/          # 修复验证
│   │   ├── mod.rs
│   │   ├── port_check.rs
│   │   └── service.rs
│   └── output/
│       ├── mod.rs
│       └── printer.rs   # 彩色 CLI 输出
└── tests/
    └── integration.rs

开发

前置要求

方式 A:原生(Rust)

  • Rust 1.70+(curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh)

方式 B:Docker

  • Docker 20.10+

构建

原生:

root@kitploit:~
# 克隆仓库
git clone https://github.com/fadidevv/clawdguard.git
cd clawdguard

# 构建调试版(编译更快)
cargo build

# 构建发布版(优化)
cargo build --release

Docker:

root@kitploit:~
# 克隆仓库
git clone https://github.com/fadidevv/clawdguard.git
cd clawdguard

# 构建镜像
docker build --no-cache -t clawdguard .

运行测试

root@kitploit:~
# 运行所有测试
cargo test

# 带输出运行
cargo test -- --nocapture

代码质量

root@kitploit:~
# 格式化代码
cargo fmt

# 运行 linter
cargo clippy

# 检查而不构建
cargo check

贡献

欢迎贡献!请按以下步骤操作:

  1. Fork 本仓库
  2. 创建特性分支(git checkout -b feature/improvement)
  3. 进行您的更改
  4. 运行测试(cargo test)
  5. 运行 linter(cargo clippy)
  6. 格式化代码(cargo fmt)
  7. 提交更改(git commit -m '添加改进')
  8. 推送到分支(git push origin feature/improvement)
  9. 创建 Pull Request

贡献思路:

  • 添加对更多服务管理器的支持
  • 改进检测启发式算法
  • 添加回滚功能
  • 文档改进
  • Bug 修复

免责声明

本工具仅用于安全目的。

  • 仅在您拥有或已获授权修改的系统上运行
  • 关闭终端前,请务必确认令牌已保存
  • 通过尝试从其他设备连接来验证修复是否生效

作者不对滥用本工具承担任何责任。


许可证

MIT 许可证 - 请参见 LICENSE 文件了解详情。


保持安全!🦞🔐

下载工具
风险
影响
获取 API 密钥窃取 OpenAI、Anthropic 等凭据
执行命令在您的机器上运行任意 shell 命令
控制浏览器接管您的浏览会话
读取邮件访问 Gmail、日历、联系人
读取聊天记录查看您的所有聊天历史
劫持机器人以您的名义发送消息
命令描述
docker build --no-cache -t clawdguard .构建镜像
docker run clawdguard --help显示帮助
docker run -v ... clawdguard运行扫描
docker run -v ... clawdguard --scan-only仅扫描
docker run -v ... clawdguard --auto自动修复
docker run -v ... clawdguard --verbose详细模式
docker-compose run clawdguard使用 compose 运行
设置项修复前(不安全)修复后(安全)
gateway.bind"0.0.0.0" / "lan" / "all""loopback"
gateway.auth.mode"none" / 缺失"token"
gateway.auth.token缺失已生成安全令牌
discovery.mdns.mode"full""minimal"
文件权限644 / 755600