ConsenSysDiligence/mythril
GitHub: ConsenSysDiligence/mythril
基于符号执行的 EVM 字节码安全分析工具,用于检测以太坊等区块链智能合约中的安全漏洞。
Stars: 4206 | Forks: 807
# Mythril
```
或者:
```
$ myth analyze -a
```
使用 `-t ` 指定要探索的最大交易数。您也可以使用 `--execution-timeout ` 设置超时时间。
以下是在 `solidity_examples` 目录下的 `killbilly.sol` 文件上运行 Mythril 并探索 `3` 个交易的示例:
```
> myth a killbilly.sol -t 3
==== Unprotected Selfdestruct ====
SWC ID: 106
Severity: High
Contract: KillBilly
Function name: commencekilling()
PC address: 354
Estimated Gas Usage: 974 - 1399
Any sender can cause the contract to self-destruct.
Any sender can trigger execution of the SELFDESTRUCT instruction to destroy this contract account and withdraw its balance to an arbitrary address. Review the transaction trace generated for this issue and make sure that appropriate security controls are in place to prevent unrestricted access.
--------------------
In file: killbilly.sol:22
selfdestruct(msg.sender)
--------------------
Initial State:
Account: [CREATOR], balance: 0x2, nonce:0, storage:{}
Account: [ATTACKER], balance: 0x1001, nonce:0, storage:{}
Transaction Sequence:
Caller: [CREATOR], calldata: , decoded_data: , value: 0x0
Caller: [ATTACKER], function: killerize(address), txdata: 0x9fa299cc000000000000000000000000deadbeefdeadbeefdeadbeefdeadbeefdeadbeef, decoded_data: ('0xdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef',), value: 0x0
Caller: [ATTACKER], function: activatekillability(), txdata: 0x84057065, value: 0x0
Caller: [ATTACKER], function: commencekilling(), txdata: 0x7c11da20, value: 0x0
```
使用 Mythril 的说明可以在 [文档](https://mythril-classic.readthedocs.io/en/develop/) 中找到。
如需支持或进行一般性讨论,请访问 [ConsenSys Discord server](https://discord.gg/consensys) 中的 [diligence-mythx channel](https://discord.com/channels/697535391594446898/712829485350649886)。
## 构建文档
Mythril 的文档包含在 `docs` 文件夹中,并发布在 [Read the Docs](https://mythril-classic.readthedocs.io/en/develop/) 上。它基于 Sphinx,可以使用子目录中包含的 Makefile 进行构建:
```
cd docs
make html
```
这将创建一个包含 HTML 输出的 `build` 输出目录。或者,可以使用 `make latexpdf` 构建 PDF 文档。可用的输出格式选项可以通过 `make help` 查看。
## 漏洞修复
请访问 [Smart Contract Vulnerability Classification Registry](https://swcregistry.io/) 查找有关报告漏洞的详细信息和修复指南。
标签:Docker, EVM字节码, Findomain, Mythril, Python, Solidity, 云安全监控, 代码分析, 以太坊, 凭证管理, 加密货币, 区块链安全, 安全防御评估, 形式化验证, 无后门, 智能合约审计, 符号执行, 请求拦截, 逆向工具, 静态分析