Maddyrampant/wp-sentinel-panel

GitHub: Maddyrampant/wp-sentinel-panel

一款自托管的 WordPress 主题与插件安全分析器,通过 170+ 项安全检查和主题情报模块帮助用户离线检测恶意代码、后门与安全漏洞。

Stars: 1 | Forks: 0

# 🛡️ WP-SENTINEL ### WordPress 主题与插件安全分析器 **170+ 项安全检查 · 主题情报 · 实时分析 · 双语 (EN/FA)** ![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg) ![Node.js](https://img.shields.io/badge/Node.js-20+-green.svg) ![TypeScript](https://img.shields.io/badge/TypeScript-5.5-blue.svg) ![React](https://img.shields.io/badge/React-18-61DAFB.svg) ![Version](https://img.shields.io/badge/version-1.1.0-orange.svg)
## 概述 WP-SENTINEL 是一个自托管的 WordPress 主题和插件安全分析平台。它通过现代的 Web 面板,扫描混淆代码、后门、恶意软件、盗版主题特征、外部域名连接以及 170+ 种已知安全模式。 **专为需要快速、离线和可靠的 WordPress 代码审计的安全研究人员、WordPress 开发者和托管服务提供商而构建。** ## 功能 ### 核心扫描引擎 - **170+ 项安全检查**,涵盖 6 个类别 - **混淆检测** — base64、hex、ROT13、gzinflate、编码字符串 - **外部访问监控** — HTTP 请求、cURL、file_get_contents、fopen - **安全规则引擎** — 30 条内置规则,带置信度评分 - **自定义规则** — YAML 导入/导出、多模式匹配、路径定向 - **风险评分** — 带上下文修饰符的加权评分 ### 主题情报模块 - **盗版主题检测** — 关键词分析(nulled、cracked、warez、license bypass) - **恶意软件与后门扫描** — eval+base64、system/exec、file_put_contents、preg_replace /e - **外部域名提取** — 识别所有出站连接,并检测可疑的 TLD - **Base64 payload 解码** — 安全解码并提取隐藏的 URL - **单主题风险评分** — 汇总严重性及其详细分析 ### Web 面板 - **React + Tailwind CSS** 深色主题仪表盘 - **实时扫描结果**,支持标签式分类视图 - **按文件分组和按检查分组** 的结果视图 - **“为什么被标记?”** 上下文面板,提供 ±3 行代码上下文 - **威胁类型过滤** (webshell、backdoor、injection、redirect、secrets) - **扫描历史**,带有趋势分析图表 - **比较扫描** — 对比两次扫描结果的差异 - **通过 PDFKit 生成 PDF 报告** - **全面的双语支持** — 英语与波斯语,支持 RTL 布局 ## 快速开始 ### 前置条件 - [Node.js](https://nodejs.org/) v20+ (推荐使用 LTS 版本) - npm v10+ ### 安装 ``` git clone https://github.com/Maddyrampant/wp-sentinel-panel.git cd wp-sentinel-panel # 安装 server 依赖 cd server && npm install # 安装 client 依赖 cd ../client && npm install ``` ### 构建与运行 ``` # 构建 server cd server && npm run build # 构建 client cd ../client && npm run build # 启动 server cd ../server && npm start ``` 面板现已在 **http://localhost:3001** 运行 ### 开发模式 ``` # Terminal 1 — Server (hot reload) cd server && npm run dev # Terminal 2 — Client (Vite dev server) cd client && npm run dev ``` Vite 开发服务器会将 `/api` 请求代理到 `http://localhost:3001`。 ## 项目结构 ``` wp-sentinel-panel/ ├── server/ # Express + TypeScript backend │ ├── src/ │ │ ├── index.ts # Express app entry │ │ ├── types.ts # TypeScript interfaces │ │ ├── db/ │ │ │ └── database.ts # SQLite (better-sqlite3) │ │ ├── scanner/ │ │ │ ├── engine.ts # 170+ check engine │ │ │ ├── theme-intel.ts # Theme Intelligence module │ │ │ ├── pdf-report.ts # PDF report generation │ │ │ └── zip-handler.ts # ZIP upload/extraction │ │ ├── rules/ │ │ │ ├── rule-loader.ts # YAML rule parser │ │ │ ├── scorer.ts # Risk scoring engine │ │ │ ├── domain-allowlist.ts # Safe domain registry │ │ │ └── wp-compromise-rules.yaml # 30 built-in rules │ │ └── routes/ │ │ ├── scan.ts # Scan API routes │ │ ├── rules.ts # Custom rules CRUD │ │ └── theme-intel.ts # Theme scan API │ ├── data/ # SQLite database (gitignored) │ └── tsconfig.json │ ├── client/ # React + Vite + Tailwind frontend │ ├── src/ │ │ ├── App.tsx # Routes │ │ ├── api/client.ts # Axios API client │ │ ├── components/ │ │ │ ├── Layout.tsx # Responsive layout │ │ │ └── Sidebar.tsx # Navigation + language switcher │ │ ├── pages/ │ │ │ ├── Dashboard.tsx # Overview + trend charts │ │ │ ├── NewScan.tsx # Upload / path scan │ │ │ ├── ScanResult.tsx # Tabbed results with context │ │ │ ├── ThemeIntel.tsx # Theme Intelligence page │ │ │ ├── History.tsx # Scan history │ │ │ ├── Compare.tsx # Diff two scans │ │ │ └── CustomRules.tsx # Rule management │ │ ├── i18n/ │ │ │ ├── en.ts # English translations │ │ │ ├── fa.ts # Farsi translations │ │ │ ├── checks.ts # 200+ check translations │ │ │ └── index.tsx # i18n context provider │ │ └── types/ │ │ └── index.ts # Client-side types │ ├── dist/ # Built client (served by Express) │ └── vite.config.ts │ └── .gitignore ``` ## API Endpoints | Method | Endpoint | Description | |--------|----------|-------------| | `POST` | `/api/scan` | 按路径扫描目录 | | `POST` | `/api/upload` | 上传 ZIP 并扫描 | | `GET` | `/api/scan/:id` | 获取扫描结果 | | `GET` | `/api/history` | 列出扫描历史 | | `GET` | `/api/stats` | 仪表盘统计数据 | | `GET` | `/api/trend` | 图表的趋势数据 | | `POST` | `/api/compare` | 比较两次扫描 | | `GET` | `/api/report/:id/:format` | 下载 PDF/JSON/CSV 报告 | | `GET` | `/api/rules` | 列出所有自定义规则 | | `POST` | `/api/rules` | 创建/更新规则 | | `DELETE` | `/api/rules/:id` | 删除规则 | | `GET` | `/api/rules/builtin` | 列出内置规则 | | `POST` | `/api/rules/import` | 从 YAML 导入规则 | | `GET` | `/api/rules/export` | 将规则导出为 YAML | | `POST` | `/api/theme-scan` | 扫描主题目录 | | `GET` | `/api/theme-scan/history` | 主题扫描历史 | | `GET` | `/api/theme-scan/:id` | 获取主题扫描结果 | | `DELETE` | `/api/theme-scan/:id` | 删除主题扫描 | ## 安全检查 | Category | Checks | Description | |----------|--------|-------------| | 混淆 (Obfuscation) | 20 | Base64、hex、ROT13、gzinflate、eval、编码字符串 | | 外部访问 (External Access) | 16 | HTTP 请求、cURL、fopen、远程包含 | | 安全 (Security) | 85+ | SQL injection、XSS、文件上传、身份验证绕过、权限提升 | | 代码模式 (Code Patterns) | 13 | 危险函数、动态执行、断言滥用 | | 文件分析 (File Analysis) | 15+ | 文件权限、可疑名称、隐藏文件 | | WordPress | 18 | 核心文件修改、数据库凭证暴露、插件/主题漏洞 | ## 内置规则 在启动时通过 YAML 加载的 8 个类别中的 30 条规则: - **后门 (Backdoor)** — 远程代码执行、文件上传后门 - **混淆 (Obfuscation)** — eval+base64、hex 解码、ROT13 - **Webshell** — 命令 shell、反向 shell、文件管理器 - **WordPress** — wp-config 暴露、xmlrpc 滥用、用户枚举 - **持久化 (Persistence)** — cron 作业、计划任务、启动钩子 - **重定向 (Redirect)** — header 重定向、meta refresh、JS 重定向 - **敏感信息 (Secrets)** — 硬编码凭证、API keys、tokens - **完整性 (Integrity)** — 核心文件修改、校验和不匹配 ## 主题情报 用于 WordPress 主题安全分析的专用模块: ``` POST /api/theme-scan { "themesPath": "/var/www/html/wp-content/themes", "themeName": "flavor" // optional: scan single theme } ``` 返回每个主题的: - 风险评分 (0–100) 及其严重程度 - 带有可疑 TLD 检测的外部域名 - 盗版/破解主题特征 - 恶意软件与后门模式匹配 - Base64 解码后的 payload 及提取的 URL - 来自 style.css 的主题元数据 ## 国际化 提供带有 RTL 布局的全面双语支持: | Language | Status | |----------|--------| | 英语 | ✅ 完成 | | فارسی (波斯语) | ✅ 完成 — 完整的 RTL 支持 | 从侧边栏切换语言。布局会自动针对 RTL 方向进行调整。 ## 技术栈 | Layer | Technology | |-------|-----------| | Runtime | Node.js 20+ | | 语言 | TypeScript 5.5 | | 后端 | Express 4 | | 数据库 | SQLite (better-sqlite3) | | 前端 | React 18 | | 样式 | Tailwind CSS 3 | | 构建 | Vite 6 | | PDF | PDFKit | | 图表 | Chart.js | | HTTP | Axios | | 规则 | js-yaml | ## 配置 | Env Variable | Default | Description | |-------------|---------|-------------| | `PORT` | `3001` | 服务器端口 | ## 许可证 该项目基于 **MIT License** 授权。 ``` MIT License Copyright (c) 2026 WP-SENTINEL Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ```
**专为 WordPress 安全社区用心打造** [报告问题](https://github.com/Maddyrampant/wp-sentinel-panel/issues) · [请求功能](https://github.com/Maddyrampant/wp-sentinel-panel/issues)
标签:DNS 反向解析, GNU通用公共许可证, MITM代理, Node.js, React, Syscalls, WordPress, 云安全监控, 网络信息收集, 自动化攻击, 静态分析