# MSBot
**Repository Path**: samwulqy/msbot
## Basic Information
- **Project Name**: MSBot
- **Description**: MSBot是一个机器人验证服务,集成了鼠标操作,js挑战,真实ip获取等
- **Primary Language**: PHP
- **License**: AGPL-3.0
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2025-08-24
- **Last Updated**: 2025-08-24
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# MSBot 人机验证系统
> 一个开源、易部署、高准确率的真人检测引擎
> 作者:SamWu
> 联系邮箱:samwulqy@gmail.com / wujiayi@miaostars.com
> 项目仓库:https://gitee.com/SamWuLQY/MSBot
---
## 目录
- [项目简介](#项目简介)
- [功能特性](#功能特性)
- [快速开始](#快速开始)
- [商业化方案(VUID)](#商业化方案vuid)
- [API 文档](#api文档)
- [示例代码](#示例代码)
- [许可协议](#许可协议)
---
## 项目简介
MSBot 是一套类似 Cloudflare Turnstile 的轻量级人机验证解决方案。通过多维行为分析,精确区分真人用户与自动化程序,可无缝嵌入任何 Web 站点,并支持私有化或 SaaS 部署。
---
## 功能特性
| 维度 | 检测内容 | 说明 |
|---|---|---|
| 网络层 | 真实 IP 识别 | 穿透 CDN/代理,还原客户端真实地址 |
| 鉴权层 | VUID & API Key | 轻量级凭证体系,可按域名隔离 |
| 行为层 | 鼠标轨迹 | 轨迹平滑度、速度、停顿模式 |
| 代码层 | JS 挑战 | 浏览器指纹、WebGL、Canvas、字体列表 |
| 环境层 | 插件数量 | 检测浏览器插件/扩展安装数量 |
| 流量层 | 流量真实性 | 请求频率、Referer 链、时序一致性 |
---
## 快速开始
### 1. 开通服务
```bash
curl -X POST https://yourdomain.com/api/manage/activate \
-H "Content-Type: application/json" \
-d '{
"domain": "example.com",
"monthly_max_requests": 10000,
"contact_email": "admin@example.com"
}'
```
返回示例:
```json
{
"success": true,
"vuid": "3a4b5c6d-7e8f-9g10-h11i-12j13k14l15m",
"api_key": "ak_xxxxxxxx",
"secret_key": "sk_xxxxxxxx",
"expires_at": "2024-12-31T23:59:59Z"
}
```
2. 前端接入(仅需两行)
```html
```
3. 后端二次校验(PHP 示例)
```php
$resp = file_get_contents('https://yourdomain.com/api/manage/verify_token', false, stream_context_create([
'http' => [
'method' => 'POST',
'header' => [
'Content-Type: application/json',
'X-API-Key: ak_xxxxxxxx',
'X-Secret-Key: sk_xxxxxxxx'
],
'content' => json_encode([
'vuid' => $_POST['vuid'],
'domain'=> $_SERVER['HTTP_HOST'],
'token' => $_POST['token']
])
]
]));
$result = json_decode($resp, true);
if ($result['success'] && $result['valid']) {
// 真人,放行
}
```
---
商业化方案(VUID)
- VUID 即 Website Unique Identifier,一个域名对应唯一 VUID。
- 接入方只需引入 `msbot.js`,并把 `VUID` + `API Key` 写进 HTML,即可完成部署。
- 支持按量计费、套餐包、白名单等多种商业模式。
---
许可协议
AGPL3.0 License © 2025 SamWu
```