wxmini-security-audit
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesewxmini-security-audit
wxmini-security-audit
Skill by ara.so — Security Skills collection.
Automated security auditing framework for WeChat mini-programs using Claude Code Agent Teams. Orchestrates 7 specialized agents to perform comprehensive static analysis covering sensitive information leakage, API endpoint extraction, cryptographic analysis, and vulnerability detection across seven security dimensions.
由ara.so开发的Skill — 安全技能合集。
基于Claude Code Agent Teams的微信小程序自动化安全审计框架。编排7个专业Agent执行全面静态分析,覆盖敏感信息泄露、API端点提取、加密分析、漏洞检测等七大安全维度。
What It Does
功能介绍
- Multi-Agent Orchestration: Coordinates 7 specialized agents (decompiler, secret scanner, endpoint miner, crypto analyzer, vulnerability analyzer, custom analyzer, reporter)
- Dual-Layer Architecture: Python regex scripts ensure 100% rule coverage, LLM agents provide intelligent analysis with context awareness
- Parallel Phase 2 Execution: Runs 4 analysis agents simultaneously to minimize audit time
- User Intent Parsing: Automatically triggers deep custom analysis when specific endpoints/parameters are mentioned
- Pure Static Analysis: Zero network requests, no attack code generation, fully local processing
- Comprehensive Reporting: Generates both summary reports and detailed documentation with structured data exports
- 多Agent编排:协调7个专业Agent(反编译Agent、密钥扫描Agent、端点挖掘Agent、加密分析Agent、漏洞分析Agent、自定义分析Agent、报告生成Agent)
- 双层架构:Python正则脚本确保100%规则覆盖,LLM Agent提供具备上下文感知能力的智能分析
- 并行第二阶段执行:同时运行4个分析Agent以最小化审计耗时
- 用户意图解析:当提及特定端点/参数时自动触发深度自定义分析
- 纯静态分析:零网络请求,不生成攻击代码,全程本地处理
- 全面报告生成:生成汇总报告和结构化数据导出的详细文档
Architecture
架构设计
The framework operates in sequential phases:
- Phase 0: User intent parsing (extracts target path, creates output directory, parses requirements)
- Phase 1: Decompilation (unveilr.exe processes wxapkg files, generates file inventory)
- Phase 1.5: Script pre-scanning (Python regex extracts raw endpoints and secrets)
- Phase 2: Parallel analysis (4 agents run simultaneously: SecretScanner, EndpointMiner, CryptoAnalyzer, VulnAnalyzer)
- Phase 2.5: Custom analysis (triggered only when user specifies particular endpoints/parameters)
- Phase 3: Report generation (aggregates findings into structured reports)
框架按以下阶段顺序运行:
- 阶段0:用户意图解析(提取目标路径、创建输出目录、解析需求)
- 阶段1:反编译(unveilr.exe处理wxapkg文件,生成文件清单)
- 阶段1.5:脚本预扫描(Python正则提取原始端点和密钥)
- 阶段2:并行分析(4个Agent同时运行:SecretScanner、EndpointMiner、CryptoAnalyzer、VulnAnalyzer)
- 阶段2.5:自定义分析(仅当用户指定特定端点/参数时触发)
- 阶段3:报告生成(将分析结果汇总为结构化报告)
Installation
安装步骤
Prerequisites
前置要求
- Claude Code CLI environment with Agent Teams/Skill support
- Python 3.x (standard library only, no external dependencies)
- Windows platform (current version requires unveilr.exe)
- unveilr.exe binary (WeChat mini-program decompiler)
- 支持Agent Teams/Skill的Claude Code CLI环境
- Python 3.x(仅需标准库,无外部依赖)
- Windows平台(当前版本依赖unveilr.exe)
- unveilr.exe二进制文件(微信小程序反编译工具)
Setup
配置流程
Clone the repository into your Claude Code Skills directory:
bash
git clone https://github.com/sssmmmwww/wxmini-security-audit.git
cd wxmini-security-auditwxmini-security-audit/
├── SKILL.md
├── agents/
│ ├── agent-01-decompiler.md
│ ├── agent-02-secret-scanner.md
│ ├── agent-03-endpoint-miner.md
│ ├── agent-04-crypto-analyzer.md
│ ├── agent-05-vuln-analyzer.md
│ ├── agent-06-reporter.md
│ └── agent-07-custom-analyzer.md
└── tools/
├── unveilr.exe # Place here
└── scripts/
├── endpoint_extractor.py
└── secret_scanner.py将仓库克隆到你的Claude Code Skills目录:
bash
git clone https://github.com/sssmmmwww/wxmini-security-audit.git
cd wxmini-security-auditwxmini-security-audit/
├── SKILL.md
├── agents/
│ ├── agent-01-decompiler.md
│ ├── agent-02-secret-scanner.md
│ ├── agent-03-endpoint-miner.md
│ ├── agent-04-crypto-analyzer.md
│ ├── agent-05-vuln-analyzer.md
│ ├── agent-06-reporter.md
│ └── agent-07-custom-analyzer.md
└── tools/
├── unveilr.exe # 放置于此
└── scripts/
├── endpoint_extractor.py
└── secret_scanner.pyUsage
使用方法
Basic Audit
基础审计
Trigger the audit by providing a mini-program directory path:
Audit this WeChat mini program D:\wechat\miniapp\wxapkg_filesAnalyze this mini program for security issues C:\miniprogram\target提供小程序目录路径触发审计:
Audit this WeChat mini program D:\wechat\miniapp\wxapkg_filesAnalyze this mini program for security issues C:\miniprogram\targetFocused Analysis
聚焦分析
Specify particular concerns to trigger Phase 2.5 custom analysis:
Audit this mini program D:\wxapp, focus on the /api/user/login endpointScan D:\wxapp for vulnerabilities, particularly payment security and privilege escalation指定关注内容以触发阶段2.5的自定义分析:
Audit this mini program D:\wxapp, focus on the /api/user/login endpointScan D:\wxapp for vulnerabilities, particularly payment security and privilege escalationWith External Tool Integration
集成外部工具
Provide context from intercepting proxies:
Analyze this mini program D:\wxapp, Burp Suite captured the /api/pay endpoint with a tamperable amount parameter提供拦截代理的上下文信息:
Analyze this mini program D:\wxapp, Burp Suite captured the /api/pay endpoint with a tamperable amount parameterOutput Structure
输出结构
After completion, find results in :
wxaudit-output/wxaudit-output/
├── security_report.md # Primary findings, risk assessment, remediation
├── api_endpoints_full.md # Complete endpoint inventory
├── secrets_full.md # All sensitive findings including false positives
├── findings.json # Structured summary data
├── domains.txt # Extracted domain list
├── endpoints_fuzz.txt # Fuzzing-ready endpoint list
├── file_inventory.json # Decompiled file asset manifest
├── raw_endpoints.json # Regex extraction raw results
├── raw_secrets.json # Secret scanner raw results
├── secrets_report.json # Intelligent secret analysis
├── api_endpoints.json # Intelligent API analysis
├── crypto_analysis.json # Cryptographic assessment
├── vuln_analysis.json # Vulnerability findings
└── custom_analysis.json # Custom requirement analysis (conditional)完成后,结果将保存在目录中:
wxaudit-output/wxaudit-output/
├── security_report.md # 核心发现、风险评估、修复建议
├── api_endpoints_full.md # 完整端点清单
├── secrets_full.md # 所有敏感信息发现(含误报)
├── findings.json # 结构化汇总数据
├── domains.txt # 提取的域名列表
├── endpoints_fuzz.txt # 可用于模糊测试的端点列表
├── file_inventory.json # 反编译文件资产清单
├── raw_endpoints.json # 正则提取原始结果
├── raw_secrets.json # 密钥扫描原始结果
├── secrets_report.json # 智能密钥分析结果
├── api_endpoints.json # 智能API分析结果
├── crypto_analysis.json # 加密评估结果
├── vuln_analysis.json # 漏洞发现结果
└── custom_analysis.json # 自定义需求分析结果(按需生成)Python Script Layer
Python脚本层
Endpoint Extraction Script
端点提取脚本
Located at , this script provides 100% rule coverage for API endpoint detection:
tools/scripts/endpoint_extractor.pypython
import re
import json
import os
def extract_endpoints(source_dir):
"""
Extract API endpoints from decompiled mini-program files.
Returns: List of dicts with {pattern, file, line, context}
"""
endpoints = []
patterns = [
r'https?://[^\s\'"]+', # Full URLs
r'wx\.request\s*\(\s*\{[^}]+url\s*:\s*[\'"]([^\'"]+)',
r'url\s*:\s*[\'"]([^\'"]+)[\'"]', # Generic URL assignments
r'/api/[a-zA-Z0-9/_-]+', # API path fragments
r'baseURL\s*:\s*[\'"]([^\'"]+)[\'"]', # Base URL configs
]
for root, dirs, files in os.walk(source_dir):
for file in files:
if not file.endswith(('.js', '.json')):
continue
filepath = os.path.join(root, file)
try:
with open(filepath, 'r', encoding='utf-8', errors='ignore') as f:
for line_num, line in enumerate(f, 1):
for pattern in patterns:
for match in re.finditer(pattern, line):
endpoints.append({
'pattern': pattern,
'value': match.group(0),
'file': filepath,
'line': line_num,
'context': line.strip()
})
except Exception as e:
continue
return endpoints
if __name__ == '__main__':
import sys
source_dir = sys.argv[1]
output_file = sys.argv[2]
results = extract_endpoints(source_dir)
with open(output_file, 'w', encoding='utf-8') as f:
json.dump(results, f, indent=2, ensure_ascii=False)位于,该脚本为API端点检测提供100%规则覆盖:
tools/scripts/endpoint_extractor.pypython
import re
import json
import os
def extract_endpoints(source_dir):
"""
Extract API endpoints from decompiled mini-program files.
Returns: List of dicts with {pattern, file, line, context}
"""
endpoints = []
patterns = [
r'https?://[^\s\'"]+', # Full URLs
r'wx\.request\s*\(\s*\{[^}]+url\s*:\s*[\'"]([^\'"]+)',
r'url\s*:\s*[\'"]([^\'"]+)[\'"]', # Generic URL assignments
r'/api/[a-zA-Z0-9/_-]+', # API path fragments
r'baseURL\s*:\s*[\'"]([^\'"]+)[\'"]', # Base URL configs
]
for root, dirs, files in os.walk(source_dir):
for file in files:
if not file.endswith(('.js', '.json')):
continue
filepath = os.path.join(root, file)
try:
with open(filepath, 'r', encoding='utf-8', errors='ignore') as f:
for line_num, line in enumerate(f, 1):
for pattern in patterns:
for match in re.finditer(pattern, line):
endpoints.append({
'pattern': pattern,
'value': match.group(0),
'file': filepath,
'line': line_num,
'context': line.strip()
})
except Exception as e:
continue
return endpoints
if __name__ == '__main__':
import sys
source_dir = sys.argv[1]
output_file = sys.argv[2]
results = extract_endpoints(source_dir)
with open(output_file, 'w', encoding='utf-8') as f:
json.dump(results, f, indent=2, ensure_ascii=False)Secret Scanner Script
密钥扫描脚本
Located at :
tools/scripts/secret_scanner.pypython
import re
import json
import os
SECRET_PATTERNS = {
'api_key': r'(?i)(api[_-]?key|apikey|key)\s*[:=]\s*[\'"]([a-zA-Z0-9_\-]{16,})[\'"]',
'access_token': r'(?i)(access[_-]?token|accesstoken)\s*[:=]\s*[\'"]([a-zA-Z0-9_\-\.]{20,})[\'"]',
'secret': r'(?i)(secret|app[_-]?secret)\s*[:=]\s*[\'"]([a-zA-Z0-9_\-]{16,})[\'"]',
'password': r'(?i)(password|passwd|pwd)\s*[:=]\s*[\'"](.{6,})[\'"]',
'private_key': r'-----BEGIN\s+(?:RSA\s+)?PRIVATE\s+KEY-----',
'ip_internal': r'\b(?:10|172\.(?:1[6-9]|2[0-9]|3[01])|192\.168)\.\d{1,3}\.\d{1,3}\b',
'phone': r'(?<![0-9])(1[3-9]\d{9})(?![0-9])',
'id_card': r'[1-6]\d{5}(?:19|20)\d{2}(?:0[1-9]|1[0-2])(?:0[1-9]|[12]\d|3[01])\d{3}[\dXx]',
'email': r'\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,}\b',
'debug_flag': r'(?i)(debug|test|dev)[_-]?(mode|flag|env)\s*[:=]\s*(true|1|yes)',
}
def scan_secrets(source_dir):
"""
Scan for sensitive information in source files.
Returns: List of findings with {type, value, file, line, context}
"""
findings = []
for root, dirs, files in os.walk(source_dir):
for file in files:
if not file.endswith(('.js', '.json', '.xml')):
continue
filepath = os.path.join(root, file)
try:
with open(filepath, 'r', encoding='utf-8', errors='ignore') as f:
for line_num, line in enumerate(f, 1):
for secret_type, pattern in SECRET_PATTERNS.items():
for match in re.finditer(pattern, line):
findings.append({
'type': secret_type,
'value': match.group(0),
'file': filepath,
'line': line_num,
'context': line.strip(),
'severity': classify_severity(secret_type)
})
except Exception as e:
continue
return findings
def classify_severity(secret_type):
"""Assign severity based on secret type."""
critical = ['private_key', 'secret', 'api_key']
high = ['access_token', 'password']
medium = ['ip_internal', 'debug_flag']
if secret_type in critical:
return 'CRITICAL'
elif secret_type in high:
return 'HIGH'
elif secret_type in medium:
return 'MEDIUM'
return 'LOW'
if __name__ == '__main__':
import sys
source_dir = sys.argv[1]
output_file = sys.argv[2]
results = scan_secrets(source_dir)
with open(output_file, 'w', encoding='utf-8') as f:
json.dump(results, f, indent=2, ensure_ascii=False)位于:
tools/scripts/secret_scanner.pypython
import re
import json
import os
SECRET_PATTERNS = {
'api_key': r'(?i)(api[_-]?key|apikey|key)\s*[:=]\s*[\'"]([a-zA-Z0-9_\-]{16,})[\'"]',
'access_token': r'(?i)(access[_-]?token|accesstoken)\s*[:=]\s*[\'"]([a-zA-Z0-9_\-\.]{20,})[\'"]',
'secret': r'(?i)(secret|app[_-]?secret)\s*[:=]\s*[\'"]([a-zA-Z0-9_\-]{16,})[\'"]',
'password': r'(?i)(password|passwd|pwd)\s*[:=]\s*[\'"](.{6,})[\'"]',
'private_key': r'-----BEGIN\s+(?:RSA\s+)?PRIVATE\s+KEY-----',
'ip_internal': r'\b(?:10|172\.(?:1[6-9]|2[0-9]|3[01])|192\.168)\.\d{1,3}\.\d{1,3}\b',
'phone': r'(?<![0-9])(1[3-9]\d{9})(?![0-9])',
'id_card': r'[1-6]\d{5}(?:19|20)\d{2}(?:0[1-9]|1[0-2])(?:0[1-9]|[12]\d|3[01])\d{3}[\dXx]',
'email': r'\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,}\b',
'debug_flag': r'(?i)(debug|test|dev)[_-]?(mode|flag|env)\s*[:=]\s*(true|1|yes)',
}
def scan_secrets(source_dir):
"""
Scan for sensitive information in source files.
Returns: List of findings with {type, value, file, line, context}
"""
findings = []
for root, dirs, files in os.walk(source_dir):
for file in files:
if not file.endswith(('.js', '.json', '.xml')):
continue
filepath = os.path.join(root, file)
try:
with open(filepath, 'r', encoding='utf-8', errors='ignore') as f:
for line_num, line in enumerate(f, 1):
for secret_type, pattern in SECRET_PATTERNS.items():
for match in re.finditer(pattern, line):
findings.append({
'type': secret_type,
'value': match.group(0),
'file': filepath,
'line': line_num,
'context': line.strip(),
'severity': classify_severity(secret_type)
})
except Exception as e:
continue
return findings
def classify_severity(secret_type):
"""Assign severity based on secret type."""
critical = ['private_key', 'secret', 'api_key']
high = ['access_token', 'password']
medium = ['ip_internal', 'debug_flag']
if secret_type in critical:
return 'CRITICAL'
elif secret_type in high:
return 'HIGH'
elif secret_type in medium:
return 'MEDIUM'
return 'LOW'
if __name__ == '__main__':
import sys
source_dir = sys.argv[1]
output_file = sys.argv[2]
results = scan_secrets(source_dir)
with open(output_file, 'w', encoding='utf-8') as f:
json.dump(results, f, indent=2, ensure_ascii=False)Agent Configuration
Agent配置
Agent 02: SecretScanner
Agent 02: SecretScanner
Receives from the script layer and performs intelligent filtering:
raw_secrets.jsonmarkdown
undefined接收脚本层的并执行智能过滤:
raw_secrets.jsonmarkdown
undefinedRole
Role
You are a security analyst specializing in sensitive information leakage detection.
You are a security analyst specializing in sensitive information leakage detection.
Input
Input
- file_inventory.json (file asset manifest)
- raw_secrets.json (script extraction results)
- file_inventory.json (file asset manifest)
- raw_secrets.json (script extraction results)
Task
Task
- Load raw_secrets.json
- Filter false positives:
- Placeholder values (e.g., "YOUR_API_KEY", "example.com")
- Comments and documentation
- Test/demo code markers
- Classify real findings by severity
- Generate contextual risk assessment
- Load raw_secrets.json
- Filter false positives:
- Placeholder values (e.g., "YOUR_API_KEY", "example.com")
- Comments and documentation
- Test/demo code markers
- Classify real findings by severity
- Generate contextual risk assessment
Output Format
Output Format
secrets_report.json:
{
"valid_findings": [
{
"type": "api_key",
"value": "[REDACTED]",
"file": "pages/user/login.js",
"line": 42,
"severity": "CRITICAL",
"reasoning": "Hardcoded API key in production login flow",
"recommendation": "Move to secure backend configuration"
}
],
"false_positives": [...],
"summary": {
"total_raw": 156,
"valid": 23,
"critical": 3,
"high": 8,
"medium": 12
}
}
undefinedsecrets_report.json:
{
"valid_findings": [
{
"type": "api_key",
"value": "[REDACTED]",
"file": "pages/user/login.js",
"line": 42,
"severity": "CRITICAL",
"reasoning": "Hardcoded API key in production login flow",
"recommendation": "Move to secure backend configuration"
}
],
"false_positives": [...],
"summary": {
"total_raw": 156,
"valid": 23,
"critical": 3,
"high": 8,
"medium": 12
}
}
undefinedAgent 03: EndpointMiner
Agent 03: EndpointMiner
Correlates endpoint fragments with BaseURL configurations:
markdown
undefined关联端点片段与BaseURL配置:
markdown
undefinedRole
Role
API endpoint extraction and intelligent correlation specialist.
API endpoint extraction and intelligent correlation specialist.
Input
Input
- file_inventory.json
- raw_endpoints.json (script results)
- file_inventory.json
- raw_endpoints.json (script results)
Task
Task
- Group endpoints by BaseURL
- Reconstruct complete API URLs from fragments
- Identify request methods from wx.request contexts
- Map endpoints to source files
- Flag suspicious patterns (internal IPs, non-HTTPS, hardcoded credentials in URLs)
- Group endpoints by BaseURL
- Reconstruct complete API URLs from fragments
- Identify request methods from wx.request contexts
- Map endpoints to source files
- Flag suspicious patterns (internal IPs, non-HTTPS, hardcoded credentials in URLs)
Output Format
Output Format
api_endpoints.json:
{
"domains": ["https://api.example.com", "https://backend.example.com"],
"endpoints": [
{
"method": "POST",
"url": "https://api.example.com/api/user/login",
"base": "https://api.example.com",
"path": "/api/user/login",
"source_file": "utils/request.js",
"line": 15,
"params": ["username", "password"],
"security_notes": ["Uses HTTPS", "No credential exposure"]
}
]
}
undefinedapi_endpoints.json:
{
"domains": ["https://api.example.com", "https://backend.example.com"],
"endpoints": [
{
"method": "POST",
"url": "https://api.example.com/api/user/login",
"base": "https://api.example.com",
"path": "/api/user/login",
"source_file": "utils/request.js",
"line": 15,
"params": ["username", "password"],
"security_notes": ["Uses HTTPS", "No credential exposure"]
}
]
}
undefinedAgent 05: VulnAnalyzer
Agent 05: VulnAnalyzer
Performs vulnerability analysis across seven dimensions:
markdown
undefined从七大维度执行漏洞分析:
markdown
undefinedVulnerability Analysis Dimensions
Vulnerability Analysis Dimensions
-
Authentication & Authorization
- Token storage in localStorage
- Session management flaws
- Missing authentication checks
-
Data Security
- Sensitive data in logs
- Unencrypted storage
- PII exposure
-
Injection Vulnerabilities
- SQL injection vectors
- XSS potential
- Command injection
-
Privilege Escalation
- Role-based access control bypasses
- User ID manipulation risks
-
Payment Security
- Amount tampering potential
- Order verification gaps
-
Information Leakage
- Error messages exposing internals
- Debug mode in production
- Version disclosure
-
Configuration Security
- Insecure default settings
- Missing security headers
- Weak encryption algorithms
-
Authentication & Authorization
- Token storage in localStorage
- Session management flaws
- Missing authentication checks
-
Data Security
- Sensitive data in logs
- Unencrypted storage
- PII exposure
-
Injection Vulnerabilities
- SQL injection vectors
- XSS potential
- Command injection
-
Privilege Escalation
- Role-based access control bypasses
- User ID manipulation risks
-
Payment Security
- Amount tampering potential
- Order verification gaps
-
Information Leakage
- Error messages exposing internals
- Debug mode in production
- Version disclosure
-
Configuration Security
- Insecure default settings
- Missing security headers
- Weak encryption algorithms
Output Format
Output Format
vuln_analysis.json with findings categorized by dimension and severity.
undefinedvuln_analysis.json with findings categorized by dimension and severity.
undefinedCommon Patterns
常见使用模式
Pattern 1: Basic Directory Audit
模式1:基础目录审计
User: Audit this WeChat mini program D:\projects\wxapp
Agent: [Executes full 6-phase pipeline]
Output: wxaudit-output/ with 14 files用户: Audit this WeChat mini program D:\projects\wxapp
Agent: [执行完整的6阶段流程]
输出: wxaudit-output/目录下包含14个文件Pattern 2: Targeted Endpoint Analysis
模式2:目标端点分析
User: Analyze D:\wxapp, focus on /api/payment/submit
Agent: [Triggers Phase 2.5 CustomAnalyzer]
Output: Includes custom_analysis.json with deep dive on payment endpoint用户: Analyze D:\wxapp, focus on /api/payment/submit
Agent: [触发阶段2.5的CustomAnalyzer]
输出: 包含针对支付端点深度分析的custom_analysis.jsonPattern 3: Integration with Burp Suite
模式3:集成Burp Suite
User: Audit D:\wxapp, Burp found /api/user/profile returns other users' data when changing uid parameter
Agent: [Correlates with extracted endpoints, flags in vuln_analysis.json under "Privilege Escalation"]用户: Audit D:\wxapp, Burp found /api/user/profile returns other users' data when changing uid parameter
Agent: [关联提取的端点,在vuln_analysis.json的"Privilege Escalation"维度下标记]Troubleshooting
故障排除
Issue: "unveilr.exe not found"
问题:"unveilr.exe not found"
Solution: Download unveilr.exe and place in directory:
tools/bash
undefined解决方案: 下载unveilr.exe并放置在目录下:
tools/bash
undefinedVerify placement
验证放置位置
ls tools/unveilr.exe
ls tools/unveilr.exe
Should show: tools/unveilr.exe
应显示: tools/unveilr.exe
undefinedundefinedIssue: "No endpoints found in raw_endpoints.json"
问题:"No endpoints found in raw_endpoints.json"
Cause: Source directory contains only compiled wxapkg files, not decompiled JS.
Solution: Ensure Phase 1 (agent-01-decompiler) completes successfully. Check for .js files:
file_inventory.jsonbash
cat wxaudit-output/file_inventory.json | grep ".js"原因: 源目录仅包含编译后的wxapkg文件,未包含反编译后的JS文件。
解决方案: 确保阶段1(agent-01-decompiler)执行成功。检查中是否存在.js文件:
file_inventory.jsonbash
cat wxaudit-output/file_inventory.json | grep ".js"Issue: "High false positive rate in secrets_full.md"
问题:"secrets_full.md中误报率高"
Expected: The dual-layer architecture intentionally preserves all script findings. Agent-02 filters these in .
secrets_report.jsonCheck: Review for filtered valid findings:
secrets_report.jsonbash
cat wxaudit-output/secrets_report.json | jq '.summary'预期情况: 双层架构会保留所有脚本发现的结果,Agent-02会在中过滤这些结果。
secrets_report.json检查: 查看中的过滤后有效发现:
secrets_report.jsonbash
cat wxaudit-output/secrets_report.json | jq '.summary'Issue: "Custom analysis not triggered"
问题:"自定义分析未触发"
Cause: User prompt did not specify particular endpoints/parameters.
Solution: Explicitly mention target areas:
Analyze D:\wxapp, investigate the /api/order/create endpoint and its amount parameter原因: 用户提示未指定特定端点/参数。
解决方案: 明确提及目标分析区域:
Analyze D:\wxapp, investigate the /api/order/create endpoint and its amount parameterIssue: "Script execution errors in Phase 1.5"
问题:"阶段1.5中脚本执行错误"
Debug: Check Python script output directly:
bash
python tools/scripts/endpoint_extractor.py D:\decompiled_output wxaudit-output/raw_endpoints.json
python tools/scripts/secret_scanner.py D:\decompiled_output wxaudit-output/raw_secrets.json调试: 直接检查Python脚本输出:
bash
python tools/scripts/endpoint_extractor.py D:\decompiled_output wxaudit-output/raw_endpoints.json
python tools/scripts/secret_scanner.py D:\decompiled_output wxaudit-output/raw_secrets.jsonSecurity Constraints
安全约束
This framework adheres to strict ethical boundaries:
- No Network Activity: All analysis is local; no validation of extracted secrets/tokens
- No Attack Code: Does not generate PoC exploits or automated attack scripts
- Minimal Permissions: Read-only access to source directory, write-only to output directory
- Data Privacy: No telemetry, no external uploads, all processing remains local
本框架严格遵守伦理边界:
- 无网络活动:所有分析均在本地进行;不验证提取的密钥/令牌
- 无攻击代码:不生成PoC利用程序或自动化攻击脚本
- 最小权限:仅对源目录具有只读权限,对输出目录具有只写权限
- 数据隐私:无遥测数据,无外部上传,所有处理均保留在本地
Environment Variables
环境变量
No environment variables required. All configuration is embedded in agent prompt files under .
agents/To customize agent behavior, edit the respective files:
.mdbash
undefined无需环境变量。所有配置均嵌入在目录下的Agent提示文件中。
agents/如需自定义Agent行为,编辑对应的文件:
.mdbash
undefinedExample: Adjust SecretScanner sensitivity
示例:调整SecretScanner的敏感度
vim agents/agent-02-secret-scanner.md
vim agents/agent-02-secret-scanner.md
Modify the false positive filtering rules section
修改误报过滤规则部分
undefinedundefinedAdvanced Usage
高级用法
Custom Vulnerability Rules
自定义漏洞规则
Extend with project-specific patterns:
agent-05-vuln-analyzer.mdmarkdown
undefined在中扩展项目特定规则:
agent-05-vuln-analyzer.mdmarkdown
undefinedCustom Rules (add to agent-05-vuln-analyzer.md)
Custom Rules (add to agent-05-vuln-analyzer.md)
- Business Logic Flaws
- Check for discount code stacking vulnerabilities
- Verify coupon expiration enforcement
- Validate inventory deduction timing
undefined- Business Logic Flaws
- Check for discount code stacking vulnerabilities
- Verify coupon expiration enforcement
- Validate inventory deduction timing
undefinedIntegration with CI/CD
集成CI/CD
Run as part of security pipeline:
bash
undefined作为安全流水线的一部分运行:
bash
undefinedExample GitLab CI job
示例GitLab CI任务
security_audit:
script:
- claude-code execute-skill wxmini-security-audit "Audit ./decompiled_app"
- cat wxaudit-output/findings.json | jq '.summary.critical' | grep -q '^0$' || exit 1
undefinedsecurity_audit:
script:
- claude-code execute-skill wxmini-security-audit "Audit ./decompiled_app"
- cat wxaudit-output/findings.json | jq '.summary.critical' | grep -q '^0$' || exit 1
undefinedBulk Analysis
批量分析
Process multiple mini-programs:
bash
for dir in ./mini-programs/*/; do
claude-code execute-skill wxmini-security-audit "Audit $dir"
mv wxaudit-output "results/$(basename $dir)-audit"
done处理多个小程序:
bash
for dir in ./mini-programs/*/; do
claude-code execute-skill wxmini-security-audit "Audit $dir"
mv wxaudit-output "results/$(basename $dir)-audit"
done