smartbugs/smartbugs

GitHub: smartbugs/smartbugs

一个可扩展的以太坊智能合约安全分析框架,通过统一的 Docker 化接口集成 25 种检测工具,支持对 Solidity 源码和字节码进行并行弱点分析并输出标准化结果。

Stars: 674 | Forks: 159

**@工具作者** 请考虑自行以最佳设置集成您的工具,而不是等待第三方来完成。欢迎提交 pull request,如需支持请联系我们! **@用户** 请注意,除了像 Mythril、Oyente+、Semgrep、Slither 和 Solhint 这样积极维护的工具外,SmartBugs 还提供了一些已停止维护的学术研究原型,这些原型可能与当前的 Solidity 和 EVM 版本不兼容。 # SmartBugs:一个用于分析以太坊智能合约的框架 Smartbugs 发布 Smartbugs 许可证 加密货币捐赠按钮 分析工具 SmartBugs 是一个可扩展的平台,提供了一个统一的工具接口, 用于分析区块链程序的弱点及其他属性, 详情请参阅这篇论文 ``` Monika di Angelo, Thomas Durieux, João F. Ferreira, Gernot Salzer: "SmartBugs 2.0: An Execution Framework for Weakness Detection in Ethereum Smart Contracts", in Proc. 38th IEEE/ACM International Conference on Automated Software Engineering (ASE), pages 2102-2105, IEEE Computer Society, 2023. ``` ## 功能特性 - *支持 25 种工具,3 种模式* 用于分析 Solidity 源 代码、部署字节码和运行时代码。 - *分析器的模块化集成。* 添加 新工具只需要一个封装该工具的 Docker 镜像以及 配置文件中的几行代码。要以标准化 格式输出结果,只需添加一个小型的 Python 脚本。 - *并行、随机、可重启的任务执行,* 以便在 执行批量分析时实现资源的最佳利用。如果 执行中断,可以通过再次使用相同参数 运行 SmartBugs 来恢复。 - *标准化的输出格式。* 脚本会解析并规范化 工具的输出,以便对 不同工具的结果进行自动化分析。 - *自动下载与待分析合约匹配的 Solidity 编译器,* 并 将其注入到 Docker 镜像中。 - *以 SARIF 格式输出结果,* 以便集成到 Github 工作流中。 - *平台独立性:* SmartBugs 已在 Linux、MacOS 和 Windows 上进行了测试。 ## 支持的工具 | | 版本 | Solidity | 字节码 | 运行时代码 | | :--- | :--- | :---: | :---: | :--: | | [CCC (CPG Contract Checker)](https://github.com/Fraunhofer-AISEC/cpg-contract-checker) | #c531ae3 (IMC-24) | :heavy_check_mark: | | | | [ConFuzzius](https://github.com/christoftorres/ConFuzzius) | #4315fb7 v0.0.1 | :heavy_check_mark: | | | | [Conkas](https://github.com/smartbugs/conkas) | #4e0f256 | :heavy_check_mark: | | :heavy_check_mark: | | [Ethainter](https://zenodo.org/record/3760403) | | | | :heavy_check_mark: | | [eThor](https://secpriv.wien/ethor) | 2023 [2] | | | :heavy_check_mark: | | [HoneyBadger](https://github.com/christoftorres/HoneyBadger) | #ff30c9a | :heavy_check_mark: | | :heavy_check_mark: | | [MadMax](https://github.com/nevillegrech/MadMax) | #6e9a6e9 | | | :heavy_check_mark: | | [Maian](https://github.com/smartbugs/MAIAN) | #4bab09a | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | [Mando](https://github.com/stephan-klein/ge-sc-machine) | v0.1 | :heavy_check_mark: | | | | [Mando HGT](https://github.com/stephan-klein/ge-sc-machine/tree/hgt) | v0.1-hgt | :heavy_check_mark: | | | | [Manticore](https://github.com/trailofbits/manticore) [3] | 0.3.7 | :heavy_check_mark: | | | | [Mythril](https://github.com/ConsenSys/mythril) | 0.24.8 [2] | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | [Osiris](https://github.com/christoftorres/Osiris) | #d1ecc37 | :heavy_check_mark: | | :heavy_check_mark: | | [Oyente+](https://github.com/smartbugs/oyente_plus) [1] | #060ca34 | :heavy_check_mark: | | :heavy_check_mark: | | [Pakala](https://github.com/palkeo/pakala) | #c84ef38 v1.1.10 | | | :heavy_check_mark: | | [Securify](https://github.com/eth-sri/securify) | | :heavy_check_mark: | | :heavy_check_mark: | | [Securify2](https://github.com/eth-sri/securify2) | | :heavy_check_mark: | | | | [Semgrep](https://github.com/Decurity/semgrep-smart-contracts)/[Decurity](https://github.com/Decurity/semgrep-smart-contracts) | 1.131.0/1.2.1 [2] | :heavy_check_mark: | | | | [sFuzz](https://github.com/duytai/sFuzz) | #48934c0 (2019-03-01) | :heavy_check_mark: | | | | [Slither](https://github.com/crytic/slither) | 0.11.3 [2] | :heavy_check_mark: | | | | [Smartcheck](https://github.com/smartdec/smartcheck) | | :heavy_check_mark: | | | | [Solhint](https://github.com/protofire/solhint) | 6.0.0 [2] | :heavy_check_mark: | | | | [teEther](https://github.com/nescio007/teether) | #04adf56 | | | :heavy_check_mark: | | [Vandal](https://github.com/usyd-blockchain/vandal) | #d2b0043 | | | :heavy_check_mark: | | [VulHunter](https://github.com/stephan-klein/VulHunter) | v0.1 | :heavy_check_mark: | :heavy_check_mark: | | **注:** **[1]** `oyente+` 是目前不再维护的 [Oyente](https://github.com/smartbugs/oyente) 工具的更新版本,在 SmartBugs 中以 `oyente` 的形式提供。Oyente 仅限于过时的 EVM 版本 (大致对应于 Solidity 0.4.x),因为它无法处理 其发布后引入的 EVM 操作。Oyente+ 在 Oyente 的基础上扩展了此类 操作,但没有添加用于检测更多弱点的检测器。 Oyente+ 处于持续维护中,并且支持近期的 EVM 版本。 **[2]** 提供旧版本,请参阅 [tools](tools/) 文件夹。 **[3]** 此工具可能未经过适当配置,因此可能无法产生有用的结果。欢迎提交修复。 ## 安装说明 SmartBugs 已在 Linux、MacOS 和 Windows 上进行了测试。它依赖于 Docker 和 Python。详情请参阅[安装说明](doc/installation.md)。 ## 使用方法 SmartBugs 为所有工具提供了统一的命令行界面。两项 实用程序允许用户在分析完成后的任何时间重新解析分析结果, 并将数据提取为适合数据库的形式。 作为示例,以下命令使用所有可用工具分析 `samples` 文件夹中的合约, 并将解析后的输出写入 `results.csv`。 ``` ./smartbugs -t all -f samples/* --timeout 600 ./reparse results ./results2csv -p results > results.csv ``` 详情请参阅[使用说明](doc/usage.md)和 [SmartBugs wiki](https://github.com/smartbugs/smartbugs/wiki)。 ## 智能合约数据集 如果您正在寻找输入数据,请参阅我们关于[可用数据集的信息](doc/datasets.md)。这些数据集中的合约 数量从 10 到 250,000 不等。 ## 学术界:如何引用 如果您使用了 SmartBugs 或上述任一数据集,您可能需要 引用您的来源。详情请参阅[出版物列表](doc/academia.md)。 ## 支持与捐赠 您可以通过捐赠来表达您对本项目的赞赏并支持未来的开发。 **🙌 ETH 捐赠:** `0xA4FBA2908162646197aca90b84B095BE4D16Ae53` 🙌 ## 许可证 本[许可证](LICENSE)适用于仓库中的所有文件, 但 `samples` 文件夹中的智能合约除外。 那里的文件获取自 [Etherscan](http://etherscan.io) 并保留其原始许可证。
标签:CISA项目, Docker, EVM字节码, Mythril, Oyente, Semgrep, Slither, Solidity, Web3安全, WordPress安全扫描, 云安全监控, 代码分析, 代码安全扫描, 以太坊, 凭证管理, 加密货币安全, 区块链安全, 学术研究, 安全防御评估, 工具集成, 弱点检测, 数据管道, 智能合约, 智能合约审计, 漏洞分析, 统一接口, 网络安全, 自动化分析, 请求拦截, 跨站脚本, 路径探测, 软件工程, 逆向工具, 隐私保护, 静态分析