Raptorはブロックチェーンエコシステム(コントラクト、プロトコルなど)を監査するためのフレームワークです。
Raptorは、スマートコントラクトやブロックチェーンプロトコルのセキュリティ脆弱性を特定するための構造化されたアプローチとツールを提供します。このフレームワークは、監査人が発見事項を一貫して文書化し、複数の監査プラットフォーム向けのレポートを生成するのに役立ちます。
# Install latest stable version (recommended)
curl -sSL https://raw.githubusercontent.com/calvin-kimani/raptor/main/install.sh | bash
# Install specific version
curl -sSL https://raw.githubusercontent.com/calvin-kimani/raptor/main/install.sh | bash -s -- v0.1.0
curl -sSL https://raw.githubusercontent.com/calvin-kimani/raptor/main/install.sh | bash -s -- 0.1.0
# Latest stable
git clone https://github.com/calvin-kimani/raptor.git /tmp/raptor-install
bash /tmp/raptor-install/install.sh
rm -rf /tmp/raptor-install
# Specific version
git clone https://github.com/calvin-kimani/raptor.git /tmp/raptor-install
bash /tmp/raptor-install/install.sh v0.1.5
rm -rf /tmp/raptor-install
その後、シェルを再起動するか、以下を実行します:
source ~/.bashrc # or ~/.zshrc for zsh
インストールの確認:
raptor --version
# Update to latest stable version
raptor update
# Update to specific version
raptor update v0.2.5
raptor update 0.2.5
# Upgrade to latest major version
raptor upgrade
# Upgrade to specific major version
raptor upgrade v1.0.0
# Downgrade to previous version
raptor downgrade v0.1.0
# List all available versions
raptor version --list
# Show current version
raptor version --current
raptor --version
raptor/
├── bin/ # CLI executables and modules
│ ├── raptor # Main Raptor CLI executable
│ └── cli/ # CLI module code
│ ├── __init__.py # Version info
│ ├── config.py # Configuration management
│ ├── finding.py # Finding management
│ ├── git.py # Git repository management
│ ├── init.py # Project initialization
│ ├── plugin_lock.py # Plugin lock file management
│ ├── plugin_manager.py # Plugin discovery and installation
│ ├── raptor.py # Main CLI logic
│ ├── report.py # Report generation
│ ├── update.py # Version management
│ └── version_utils.py # Version parsing and comparison
├── scripts/ # Custom user scripts directory
├── schemas/ # Report templates and finding schemas
│ ├── reports/
│ │ ├── sherlock-report.yml # Sherlock format template
│ │ ├── code4rena-report.yml # Code4rena format template
│ │ └── codehawks-report.yml # CodeHawks format template
│ └── findings/
│ └── finding-schema.json # JSON schema for findings
├── CONFIGURATION.md # Configuration guide
├── CONTRIBUTING.md # Contribution guidelines
├── install.sh # Installation script
├── raptor.toml # Framework configuration
└── README.md # This file
Raptorは複数の監査プラットフォーム向けのレポート生成をサポートしています:
各プラットフォームには固有のフォーマット要件があります。Raptorは発見事項を構造化JSON形式で保存し、各プラットフォームに適したMarkdown形式に変換します。
テンプレートの場所:
~/.raptor/schemas/reports/<project>/audits/reports/.templates/raptor.tomlで設定可能カスタムレポート形式の追加についてはCONFIGURATION.mdを参照してください。
Raptorは監査プロジェクトを管理するためのコマンドラインインターフェースを提供します:
# Initialize a new audit project
raptor init my-audit
# Force overwrite existing directory
raptor init my-audit --force
# Clone repositories during init (shallow by default)
raptor init --git-url https://github.com/user/repo.git
# Clone multiple repos with full commit history
raptor init --git-url URL1 URL2 --commit
# Add repositories to existing project (shallow by default)
raptor git add https://github.com/user/repo.git
# Add multiple repos with full history
raptor git add URL1 URL2 --commit
# List all repositories in src/
raptor git list
# Update all repositories
raptor git update
# Update specific repositories
raptor git update repo1 repo2
# Remove repositories
raptor git remove repo-name
# Create a new finding (stored as JSON)
raptor finding --new "Attacker will drain funds from stakers" --severity HIGH
# Create finding and immediately generate reports
raptor finding --new "Reentrancy in withdraw" --severity CRITICAL --report sherlock code4rena
# Generate reports for all findings (default: sherlock format)
raptor report
# Generate reports in specific formats
raptor report --format sherlock code4rena codehawks
# Generate report for specific finding
raptor report --format sherlock --finding HIGH-reentrancy-attack
主な機能:
--git-urlでリポジトリをクローンするか、raptor gitコマンドで管理します--depth 1でクローンされ、高速ダウンロードを実現Raptorは、自動依存関係管理とマルチバージョンサポートを備えた拡張可能なプラグインアーキテクチャをサポートしています。
# List all available plugins
raptor plugins list
raptor plugins -l
# Install plugin to project (.plugins/)
raptor plugins install solidity-parser
# Install plugin globally (~/.raptor/bin/cli/plugins/)
raptor plugins install solidity-parser --global
raptor plugins -i solidity-parser -g
# Install multiple plugins
raptor plugins install parser-plugin graph-plugin
# Force reinstall
raptor plugins install solidity-parser --force
raptor plugins -i solidity-parser -f
# Check plugin status
raptor plugins status solidity-parser
Raptorでは、同じプラグインの複数バージョンを並行してインストールできます:
# First installation (becomes active version)
raptor plugins install solidity-parser
# Installs to: .plugins/solidity-parser/1.0.0/
# Install different version (previous remains active)
raptor plugins install solidity-parser
# Installs to: .plugins/solidity-parser/1.1.0/
# List shows all versions
raptor plugins list
# Output:
# solidity-parser [Project] v1.0.0 (2 versions)
# Versions: v1.0.0*, v1.1.0
# Switch active version
raptor plugins switch solidity-parser 1.1.0
# Output: ✓ Switched 'solidity-parser' from v1.0.0 to v1.1.0
インストールされたプラグインは.plugins.lockで追跡され、以下の情報を記録します:
プラグインをraptor.tomlに追加します:
[plugins.my-plugin]
url = "https://raw.githubusercontent.com/user/repo/main/plugin/install.py"
version = ">=1.0.0" # Optional version constraint
description = "My custom plugin"
# Or use local path
[plugins.local-plugin]
url = "/path/to/plugin"
# or relative path
url = "../my-plugins/analyzer"
バージョン制約:
"1.0.0" または "@1.0.0" - 正確なバージョン">=1.0.0" - 最小バージョン">1.0.0" - より大きいバージョン"<=2.0.0" - 最大バージョン"<2.0.0" - より小さいバージョンraptor init my-auditで新しい監査プロジェクトを初期化するraptor git add https://github.com/user/repo.gitでターゲットコントラクトリポジトリをクローンするraptor finding --new "Title" --severity HIGHで発見事項を文書化するraptor report --format sherlock code4renaでプラットフォーム固有のレポートを生成する詳細な設定ガイドについてはCONFIGURATION.mdを参照してください。
貢献ガイドContributing Guideをお読みください。
すべてのやり取りにおいて、敬意と専門性を持って行動してください。私たちは皆、プロジェクトを共に学び、改善するためにここにいます。
お客様の選択により、Apache License Version 2.0またはMIT Licenseのいずれかの下でライセンス供与されます。
明示的に別段の表明がない限り、Apache-2.0ライセンスで定義される、あなたがこれらのクレートに含めるために意図的に提出した一切のコントリビューションは、上記の通りデュアルライセンスされ、追加の条項や条件は適用されません。
このフレームワークは、教育目的および許可を得たセキュリティテスト専用です。セキュリティ監査を実施する前に、必ず適切な許可を得てください。