關于SherlockChain
SherlockChain是一款功能強大的智能合約安全分析框架,該工具整合了Slither工具(一款針對智能合約的安全工具)的功能,并引入了高級人工智能模型,旨在輔助廣大研究人員針對Solidity、Vyper和Plutus智能合約執行安全分析。
核心功能
1、全面的漏洞檢測:SherlockChain的檢測器可以識別各種不同類型的漏洞,包括重入漏洞和無保護升級等高危安全問題;
2、AI驅動的安全分析:集成的人工智能模型提高了漏洞檢測的精準度,為開發人員提供了高價值的安全實踐建議;
3、無縫集成:SherlockChain支持與流行的開發框架(如Hardhat、Foundry和Brownie)無縫集成,使其易于融入現有的工作流程;
4、直觀的分析報告:SherlockChain可以生成包含有清晰解釋和代碼段的詳細報告,能夠幫助開發人員快速理解和解決已發現的安全問題;
5、自定義分析:框架提供了靈活的API,允許用戶編寫自定義分析和檢測器,并根據實際需求對SherlockChain進行自定義開發;
6、持續性監控:我們可以將SherlockChain集成到自己的CI/CD管道中,為智能合約代碼庫提供持續監控和警報服務;
AI驅動功能
1、智能漏洞優先級確認:人工智能模型分析檢測到的漏洞上下文和潛在影響,為開發人員提供一個需要解決的問題優先級列表;
2、自動修復建議:人工智能組件會提供漏洞修復和代碼修改方案,以解決已識別的漏洞,加快修復過程;
3、主動安全審計:SherlockChain的人工智能模型會持續監控目標代碼庫,主動識別新出現的威脅并提供預警信號;
4、自然語言交互:用戶可以使用自然語言與SherlockChain進行交互,從而查詢工具、請求特定分析并收到詳細響應;
工具安裝
由于該工具基于Python 3開發,因此我們首先需要在本地設備上安裝并配置好最新版本的Python 3環境。
接下來,廣大研究人員可以直接使用下列命令將該項目源碼克隆至本地:
git clone https://github.com/0xQuantumCoder/SherlockChain.git
然后切換到項目目錄中,執行安裝腳本即可:
cd SherlockChainpip install .
工具使用
1、漏洞檢測:--detect和--exclude-detectors選項允許用戶指定要執行的漏洞檢測器,包括內置的和AI驅動的檢測器;
2、分析報告:--report-format、--report-output和各種--report-*選項可以控制分析報告的形式,支持以不同格式生成報告,例如JSON、Markdown和SARIF等;
3、過濾器:--filter-*選項可以對報告的問題根據嚴重性、影響程度、可信度和其他標準進行過濾;
4、AI集成:--ai-*選項允許用戶配置和控制SherlockChain的AI功能,例如優先考慮高影響漏洞、啟用特定的人工智能檢測器和管理人工智能模型配置等;
5、與開發框架的集成:--truffle和--truffle-build-directory選項允許我們將SherlockChain集成到Truffle之類的流行開發框架中;
6、雜項:提供了用于編譯智能合約、枚舉檢測器和自定義分析過程的附加選項;
下列命令可以查看工具的幫助選項:
sherlockchain --help
執行上述命令后,即可查看到SherlockChain框架可提供的全部參數選項以及對應的描述信息:
usage: sherlockchain [-h] [--version] [--solc-remaps SOLC_REMAPS] [--solc-settings SOLC_SETTINGS][--solc-version SOLC_VERSION] [--truffle] [--truffle-build-directory TRUFFLE_BUILD_DIRECTORY][--truffle-config-file TRUFFLE_CONFIG_FILE] [--compile] [--list-detectors][--list-detectors-info] [--detect DETECTORS] [--exclude-detectors EXCLUDE_DETECTORS][--print-issues] [--json] [--markdown] [--sarif] [--text] [--zip] [--output OUTPUT][--filter-paths FILTER_PATHS] [--filter-paths-exclude FILTER_PATHS_EXCLUDE][--filter-contracts FILTER_CONTRACTS] [--filter-contracts-exclude FILTER_CONTRACTS_EXCLUDE][--filter-severity FILTER_SEVERITY] [--filter-impact FILTER_IMPACT][--filter-confidence FILTER_CONFIDENCE] [--filter-check-suicidal][--filter-check-upgradeable] [--filter-check-erc20] [--filter-check-erc721][--filter-check-reentrancy] [--filter-check-gas-optimization] [--filter-check-code-quality][--filter-check-best-practices] [--filter-check-ai-detectors] [--filter-check-all][--filter-check-none] [--check-all] [--check-suicidal] [--check-upgradeable][--check-erc20] [--check-erc721] [--check-reentrancy] [--check-gas-optimization][--check-code-quality] [--check-best-practices] [--check-ai-detectors] [--check-none][--check-all-detectors] [--check-all-severity] [--check-all-impact] [--check-all-confidence][--check-all-categories] [--check-all-filters] [--check-all-options] [--check-all][--check-none] [--report-format {json,markdown,sarif,text,zip}] [--report-output OUTPUT][--report-severity REPORT_SEVERITY] [--report-impact REPORT_IMPACT][--report-confidence REPORT_CONFIDENCE] [--report-check-suicidal][--report-check-upgradeable] [--report-check-erc20] [--report-check-erc721][--report-check-reentrancy] [--report-check-gas-optimization] [--report-check-code-quality][--report-check-best-practices] [--report-check-ai-detectors] [--report-check-all][--report-check-none] [--report-all] [--report-suicidal] [--report-upgradeable][--report-erc20] [--report-erc721] [--report-reentrancy] [--report-gas-optimization][--report-code-quality] [--report-best-practices] [--report-ai-detectors] [--report-none][--report-all-detectors] [--report-all-severity] [--report-all-impact][--report-all-confidence] [--report-all-categories] [--report-all-filters][--report-all-options] [--report-all] [--report-none] [--ai-enabled] [--ai-disabled][--ai-priority-high] [--ai-priority-medium] [--ai-priority-low] [--ai-priority-all][--ai-priority-none] [--ai-confidence-high] [--ai-confidence-medium] [--ai-confidence-low][--ai-confidence-all] [--ai-confidence-none] [--ai-detectors-all] [--ai-detectors-none][--ai-detectors-specific AI_DETECTORS_SPECIFIC] [--ai-detectors-exclude AI_DETECTORS_EXCLUDE][--ai-models-path AI_MODELS_PATH] [--ai-models-update] [--ai-models-download][--ai-models-list] [--ai-models-info] [--ai-models-version] [--ai-models-check][--ai-models-upgrade] [--ai-models-remove] [--ai-models-clean] [--ai-models-reset][--ai-models-backup] [--ai-models-restore] [--ai-models-export] [--ai-models-import][--ai-models-config AI_MODELS_CONFIG] [--ai-models-config-update] [--ai-models-config-reset][--ai-models-config-export] [--ai-models-config-import] [--ai-models-config-list][--ai-models-config-info] [--ai-models-config-version] [--ai-models-config-check][--ai-models-config-upgrade] [--ai-models-config-remove] [--ai-models-config-clean][--ai-models-config-reset] [--ai-models-config-backup] [--ai-models-config-restore][--ai-models-config-export] [--ai-models-config-import] [--ai-models-config-path AI_MODELS_CONFIG_PATH][--ai-models-config-file AI_MODELS_CONFIG_FILE] [--ai-models-config-url AI_MODELS_CONFIG_URL][--ai-models-config-name AI_MODELS_CONFIG_NAME] [--ai-models-config-description AI_MODELS_CONFIG_DESCRIPTION][--ai-models-config-version-major AI_MODELS_CONFIG_VERSION_MAJOR][--ai-models-config-version-minor AI_MODELS_CONFIG_VERSION_MINOR][--ai-models-config-version-patch AI_MODELS_CONFIG_VERSION_PATCH][--ai-models-config-author AI_MODELS_CONFIG_AUTHOR][--ai-models-config-license AI_MODELS_CONFIG_LICENSE][--ai-models-config-url-documentation AI_MODELS_CONFIG_URL_DOCUMENTATION][--ai-models-config-url-source AI_MODELS_CONFIG_URL_SOURCE][--ai-models-config-url-issues AI_MODELS_CONFIG_URL_ISSUES][--ai-models-config-url-changelog AI_MODELS_CONFIG_URL_CHANGELOG][--ai-models-config-url-support AI_MODELS_CONFIG_URL_SUPPORT][--ai-models-config-url-website AI_MODELS_CONFIG_URL_WEBSITE][--ai-models-config-url-logo AI_MODELS_CONFIG_URL_LOGO][--ai-models-config-url-icon AI_MODELS_CONFIG_URL_ICON][--ai-models-config-url-banner AI_MODELS_CONFIG_URL_BANNER][--ai-models-config-url-screenshot AI_MODELS_CONFIG_URL_SCREENSHOT][--ai-models-config-url-video AI_MODELS_CONFIG_URL_VIDEO][--ai-models-config-url-demo AI_MODELS_CONFIG_URL_DEMO][--ai-models-config-url-documentation-api AI_MODELS_CONFIG_URL_DOCUMENTATION_API][--ai-models-config-url-documentation-user AI_MODELS_CONFIG_URL_DOCUMENTATION_USER][--ai-models-config-url-documentation-developer AI_MODELS_CONFIG_URL_DOCUMENTATION_DEVELOPER][--ai-models-config-url-documentation-faq AI_MODELS_CONFIG_URL_DOCUMENTATION_FAQ][--ai-models-config-url-documentation-tutorial AI_MODELS_CONFIG_URL_DOCUMENTATION_TUTORIAL][--ai-models-config-url-documentation-guide AI_MODELS_CONFIG_URL_DOCUMENTATION_GUIDE][--ai-models-config-url-documentation-whitepaper AI_MODELS_CONFIG_URL_DOCUMENTATION_WHITEPAPER][--ai-models-config-url-documentation-roadmap AI_MODELS_CONFIG_URL_DOCUMENTATION_ROADMAP][--ai-models-config-url-documentation-blog AI_MODELS_CONFIG_URL_DOCUMENTATION_BLOG][--ai-models-config-url-documentation-community AI_MODELS_CONFIG_URL_DOCUMENTATION_COMMUNITY]
許可證協議
本項目的開發與發布遵循AGPL-3.0開源許可協議。
項目地址
SherlockChain:【GitHub傳送門】