umair-aziz025/pentest-audit-trail

GitHub: umair-aziz025/pentest-audit-trail

基于区块链的渗透测试审计平台,确保审计记录不可篡改。

Stars: 0 | Forks: 0

# 🔐 区块链渗透测试审计

用于渗透测试、安全评估和法医证据工作流程的不可变审计跟踪。

React TypeScript Node Express Ethereum IPFS MIT License

区块链渗透测试审计是一个开源安全评估平台,它使用区块链支持的完整性记录渗透测试活动、工件和验证事件。它结合了以网络为主题的 React 界面、Express API、PostgreSQL/Drizzle 数据建模、IPFS/Pinata 存储,以及以太坊智能合约审计跟踪。 ## ✨ 本项目功能 - 🔗 使用区块链可验证的时间戳记录安全评估事件。 - 📦 通过 IPFS/Pinata 工作流程存储支持性证据和工件。 - 🧾 导出审计数据以进行报告、合规性和交接工作流程。 - 🛡️ 跟踪安全活动、审计条目、区块链状态和 IPFS 存储健康。 - 🎛️ 提供一个现代网络安全仪表板,具有可配置的视觉主题。 - 🧪 支持本地 Hardhat 开发以及测试网部署流程。 - 🔐 将机密存储在环境变量中,而不是源代码中。 ## 🏗️ 架构概述 ``` ┌──────────────────────┐ ┌──────────────────────┐ ┌──────────────────────┐ │ React Frontend │◄────►│ Express Backend │◄────►│ PostgreSQL Database │ │ TypeScript + Vite │ │ Node.js API │ │ Drizzle ORM │ └──────────┬───────────┘ └──────────┬───────────┘ └──────────────────────┘ │ │ ▼ ▼ ┌──────────────────────┐ ┌──────────────────────┐ │ Wallet / Ethereum │ │ IPFS Storage │ │ ethers + wagmi │ │ Pinata / Gateway │ └──────────┬───────────┘ └──────────┬───────────┘ │ │ ▼ ▼ ┌──────────────────────┐ ┌──────────────────────┐ │ AuditTrail Contract │ │ Evidence Artifacts │ │ Solidity │ │ CIDs / Metadata │ └──────────────────────┘ └──────────────────────┘ ``` ## 🔄 应用流程 ``` Security Assessment │ ▼ Create Audit Entry │ ├── Upload evidence artifact ──► IPFS / Pinata ──► CID │ └── Submit audit metadata ─────► Ethereum Contract │ ▼ Immutable Audit Event │ ▼ Dashboard / Activity Logs / Exported Report ``` ## 🧩 核心模块 | 模块 | 目的 | | --- | --- | | 仪表板 | 显示区块链指标、最近的活动、健康指标和快速操作。 | | 审计条目 | 创建审计记录并将证据元数据链接到区块链/IPFS 状态。 | | IPFS 存储 | 通过 Pinata/IPFS 上传、列出、验证和检索工件 CID。 | | 区块链 | 连接钱包、读取合约状态、部署/合约和跟踪审计事件。 | | 活动监控器 | 展示安全活动时间线和可导出的操作日志。 | | 设置 | 管理本地 IPFS、网关、主题、刷新和环境辅助设置。 | ## 🗂️ 仓库结构 ``` blockchain-pentest-audit/ |-- README.md |-- SETUP.md |-- CONTRIBUTING.md |-- SECURITY.md |-- CODE_OF_CONDUCT.md |-- LICENSE.txt |-- env.example |-- .env.example |-- package.json |-- hardhat.config.cjs |-- drizzle.config.ts |-- client/ | |-- index.html | `-- src/ | |-- components/ # Dashboard widgets, wallet UI, shadcn/Radix UI | |-- contexts/ # Theme context | |-- contracts/ # Frontend contract bindings and deployment metadata | |-- hooks/ # Blockchain, mobile, toast, and utility hooks | |-- lib/ # Web3 config, query client, network utilities | |-- pages/ # Dashboard, audit creation, IPFS, settings, activity | `-- services/ # IPFS, blockchain explorer, activity logging |-- server/ | |-- contracts/ # Solidity smart contract | |-- services/ # Blockchain, IPFS, security service wrappers | |-- db.ts # Database connection | |-- routes.ts # Express API routes | `-- index.ts # Server entrypoint |-- shared/ | `-- schema.ts # Drizzle tables and shared types `-- scripts/ |-- deploy.js |-- deploy.ts |-- deploy-production.js `-- auto-deploy.js ``` ## 🧰 技术栈 | 层 | 工具 | | --- | --- | | 前端 | React 18、TypeScript、Vite、Tailwind CSS、Radix UI、TanStack Query | | 后端 | Node.js、Express、TypeScript、Multer、REST API | | 数据库 | PostgreSQL、Drizzle ORM、Drizzle Kit | | 区块链 | Solidity、Hardhat、ethers.js、wagmi、RainbowKit | | 存储 | IPFS、Pinata API、内容寻址 CID | | 安全 | 基于环境的机密、智能合约审计跟踪、可导出的证据日志 | ## ✅ 要求 - Node.js 18+ - npm - PostgreSQL 数据库 - 以太坊钱包,如 MetaMask - WalletConnect 项目 ID - Pinata 账户或兼容的 IPFS 网关 - 可选:Sepolia RPC 提供商用于测试网部署 ## 🚀 快速开始 ``` git clone https://github.com/umair-aziz025/blockchain-pentest-audit.git cd blockchain-pentest-audit npm install cp env.example .env ``` 将 `.env` 更新为您的本地值: ``` DATABASE_URL=postgresql://username:password@localhost:5432/audit_trail VITE_WALLETCONNECT_PROJECT_ID=your_walletconnect_project_id VITE_PINATA_API_KEY=your_pinata_api_key VITE_PINATA_SECRET_KEY=your_pinata_secret_key VITE_PINATA_JWT=your_pinata_jwt_token SESSION_SECRET=your_random_session_secret ``` 启动应用程序: ``` npm run dev ``` 有关数据库设置和部署详细信息,请参阅 [SETUP.md](SETUP.md). ## 🔐 机密处理 此存储库不应包含实时凭据。以下内容仅保留在本地 `.env` 文件或安全的部署机密存储中: - 钱包私钥 - Pinata API 密钥、密钥、JWT 和网关密钥 - 包含真实用户名/密码的数据库 URL - 生产应用程序使用的 WalletConnect 项目 ID - 如 Infura 或 Alchemy 的 RPC 提供商令牌 - 会话机密 跟踪的环境文件仅包含占位符。 ## 🧪 有用脚本 | 命令 | 目的 | | --- | --- | | `npm run dev` | 启动 Express/Vite 开发服务器。 | | `npm run build` | 构建前端和捆绑服务器输出。 | | `npm start` | 从 `dist/` 运行生产服务器。 | | `npm run check` | 运行 TypeScript 检查。 | | `npm run db:push` | 推送 Drizzle 架构更改。 | | `npm run blockchain:node` | 启动本地 Hardhat 区块链。 | | `npm run blockchain:compile` | 编译 Solidity 合约。 | | `npm run blockchain:deploy` | 将合约部署到本地 Hardhat 网络。 | ## 🛡️ 负责任的使用 本工具旨在用于授权的安全评估、内部审计工作流程、培训和研发。不要用它来记录、协调或支持未经授权的活动。始终遵守适用的法律、参与范围、客户参与规则和负责任的披露实践。 ## 🤝 贡献 欢迎贡献。在提交拉取请求之前,请阅读 [CONTRIBUTING.md](CONTRIBUTING.md) 和 [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md). ## 🚨 安全报告 如果您发现漏洞,请不要公开创建问题。请遵循 [SECURITY.md](SECURITY.md) 中的流程。 ## 📄 许可证 本项目采用 [MIT 许可证](LICENSE.txt). ## 👨‍💻 作者 由 [Umair Aziz](https://github.com/umair-aziz025) 开发和维护。
标签:DNS解析, Ethereum, Express, GNU通用公共许可证, IPFS, MITM代理, Node.js, React, Syscalls, TypeScript, 互联网扫描, 人工智能安全, 区块链技术, 可视化仪表盘, 合规性, 安全插件, 安全评估平台, 审计追踪, 开源项目, 智能合约, 本地开发, 测试网部署, 环境变量, 自动化攻击, 证据完整性