arraya20/pharos-security-suite
GitHub: arraya20/pharos-security-suite
专为 Pharos Network 打造的模块化安全工具包,覆盖 AI Agent 技能审查、智能合约字节码检测和链上地址风险分析等场景。
Stars: 0 | Forks: 0
# Pharos Security Suite
**专为 Pharos Network 生态打造的模块化安全工具包。**
包含四个独立模块,全面覆盖 Pharos Pacific 主网上 AI agent、智能合约及链上地址的安全防护面。
```
pharos-security-suite/
├── skill-inspector/ → Scan AI agent skills for prompt injection & Web3 risks
├── contract-inspector/ → ABI-free bytecode introspection & risk scoring
├── address-intelligence/ → Address profiling, classification & risk scoring
└── trust-layer/ → Cryptographic attestation for audit results (planned)
```
## 模块
### 1. Skill Inspector `v1.0` — Python
- 零 runtime 依赖 — 可在纯净的 Python 3.10+ 上运行
- 扫描 SKILL.md、脚本、配置和 Solidity 合约
- 多行污点追踪:private-key 源 → 网络/文件/shell sink
- 通过 OSV.dev 进行实时 CVE 查询,并支持离线降级
- 输出格式:terminal、JSON、Markdown、SARIF
```
cd skill-inspector && pip install -e .
pharos-skill-inspector scan ./some-skill/
pharos-skill-inspector scan https://github.com/owner/some-skill
```
**[完整文档 →](skill-inspector/README.md)**
### 2. Contract Inspector `v1.1` — Node.js
- 无需 ABI:适用于任何已部署的合约,即使是未验证的合约
- Proxy 检测:EIP-1167、EIP-1967、UUPS、OZ legacy
- 标准指纹识别:ERC-20/721/1155、Ownable、AccessControl、Pausable
- 特权函数标记:mint、pause、upgradeTo、DELEGATECALL、SELFDESTRUCT
- 确定性风险评分(低/中/高)
- CLI + HTTP API,便于 agent 集成
```
cd contract-inspector && npm install
node inspect.js 0x000000000022D473030F116dDEE9F6B43aC78BA3 --network mainnet
```
**[完整文档 →](contract-inspector/README.md)**
### 3. Address Intelligence `v1.0` — Node.js
- 纯 RPC 模式,即使在区块浏览器 API 宕机时也能正常工作
- 分类:New/Casual/Active/Whale/Bot/MEV/Dormant (EOA) 或 Token/DEX/Protocol (合约)
- 风险等级:LOW → MODERATE → ELEVATED → HIGH → CRITICAL
- 优雅降级:当浏览器不可用时,提供部分置信度 + 不确定性惩罚
- 根据官方 Pharos token 注册表验证 token 持有量
```
cd address-intelligence && npm install
node scripts/inspect.mjs 0x126cC4E8f6c24fdBe65e07AA8CaDB6dB1ec655e2 --network mainnet
```
**[完整文档 →](address-intelligence/README.md)**
### 4. Agent Trust Layer `计划中`
计划功能:
- 签名审计证明 (SHA-256 hash + Ed25519 signature)
- Pharos 上的链上证明注册表
- 跨模块组合(skill 扫描 + contract 扫描 → 统一信任评分)
- 供消费端 agent 使用的验证 SDK
## 架构
```
┌─────────────────────────────────────────────────────┐
│ Pharos Mainnet RPC │
└──────────┬──────────────────────┬────────────────────┘
│ │
┌──────▼──────┐ ┌──────▼──────┐
│ Contract │ │ Address │
│ Inspector │ │ Intelligence│
│ (bytecode) │ │ (history) │
└──────┬──────┘ └──────┬──────┘
│ │
└──────────┬───────────┘
│
┌───────▼───────┐
│ Trust Layer │
│ (attestation) │
└───────┬───────┘
│
┌─────────────────▼─────────────────┐
│ Skill Inspector │
│ (agent skill pre-screening) │
└───────────────────────────────────┘
↓ All modules feed into unified security reports
↓ Attestations are signed & optionally posted on-chain
```
## 快速开始
```
git clone https://github.com/arraya20/pharos-security-suite.git
cd pharos-security-suite
# Module 1: Skill Inspector
cd skill-inspector && python3 -m venv .venv && source .venv/bin/activate
pip install -e . && pharos-skill-inspector scan ./examples/
# Module 2: Contract Inspector
cd ../contract-inspector && npm install
node inspect.js 0xcfC8330f4BCAB529c625D12781b1C19466A9Fc8B --network mainnet
# Module 3: Address Intelligence
cd ../address-intelligence && npm install
node scripts/inspect.mjs 0x126cC4E8f6c24fdBe65e07AA8CaDB6dB1ec655e2 --network mainnet
```
## 设计原则
- **模块化** — 每个工具都是独立的,可单独使用或组合使用这四个工具
- **零/最小依赖** — 减少供应链攻击面
- **主网优先** — 专为 Pharos Pacific 主网打造,而不仅是 testnet 演示
- **确定性** — 无 LLM 幻觉,采用固定规则进行模式匹配
- **Agent 原生** — 设计为可组合的 skill,适用于自主 AI agent
## Pharos 生态
专为 [Pharos Network](https://pharos.xyz) 打造 — 这是一个兼容 EVM 的 L1,通过 [Anvita Flow](https://docs.pharos.xyz) 提供原生的 AI agent 基础设施。
| 资源 | 链接 |
|----------|------|
| Pharos Pacific 主网 | Chain ID `1672` |
| Pharos 文档 | [docs.pharos.xyz](https://docs.pharos.xyz) |
| Pharos 浏览器 | [pharosscan.xyz](https://pharosscan.xyz) |
| Pharos Agent Kit | [GitHub](https://github.com/aspect-build/pharos-agent-kit) |
## 作者
**Namri** ([@namri_20](https://x.com/namri_20))
- Pharos Skill Builder Campaign 获胜者
- 活跃的 Pharos 主网贡献者
## 许可证
MIT — 详情请参阅各模块的独立许可证。
标签:AI代理安全, DNS 反向解析, IP 地址批量处理, MITM代理, Web3安全, XSS注入, 区块链安全, 威胁情报, 开发者工具, 智能合约审计, 逆向工具, 错误基检测, 静态代码分析