mythril
v0.24.8
MyThril是EVM字節碼的安全分析工具。它檢測到為以太坊,Hedera,Foorum,Vechain,rootstock,Tron和其他與EVM兼容的區塊鏈製造的智能合約中的安全漏洞。它使用符號執行,SMT解決和污點分析來檢測各種安全漏洞。
無論您是想貢獻,需要支持還是想學習我們將來的烹飪方法,都可以在共享Consensys Discord Server中籤出勤奮的Mythx頻道。
與Docker一起得到:
$ docker pull mythril/myth
來自PYPI(Python 3.7-3.10)的安裝:
$ pip3 install mythril
通過預加入掛鉤(將$GIT_TAG
替換為真實標籤)使用它:
- repo : https://github.com/Consensys/mythril
rev : $GIT_TAG
hooks :
- id : mythril
此外,set args: [disassemble]
或args: [read-storage]
使用與analyze
不同的命令。
有關更多詳細說明,請參見文檔。
跑步:
$ myth analyze <solidity-file>
或者:
$ myth analyze -a <contract-address>
指定使用-t <number>
探索的最大交易數量。您還可以使用--execution-timeout <seconds>
設置超時。
這是在file killbilly.sol
上3
solidity_examples
的示例
> 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的說明。
有關支持或一般討論,請查看共識不和諧服務器中的勤奮 - mythx頻道。
MyThril的文檔包含在docs
文件夾中,並發布以閱讀文檔。它基於獅身人面像,可以使用子目錄中包含的makefile構建:
cd docs
make html
這將創建一個包含HTML輸出的build
輸出目錄。另外,可以使用make latexpdf
構建PDF文檔。可用的輸出格式選項可以在make help
看到。
請訪問智能合同漏洞分類註冊表,以查找有關報告的漏洞的詳細信息和補救指南。