Mythrilは、EVM Bytecodeのセキュリティ分析ツールです。 Ethereum、Hedera、Quorum、Vechain、Vechain、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
さらに、 args: [disassemble]
またはargs: [read-storage]
analyze
とは異なるコマンドを使用します。
より詳細な指示については、ドキュメントを参照してください。
走る:
$ myth analyze <solidity-file>
または:
$ myth analyze -a <contract-address>
-t <number>
で探索するトランザクションの最大数を指定します。また、 --execution-timeout <seconds>
でタイムアウトを設定することもできます。
3
トランザクションのsolidity_examples
ディレクトリにあるファイルkillbilly.sol
でmythrilを実行する例は次のとおりです。
> 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を使用するための指示は、ドキュメントに記載されています。
サポートまたは一般的な議論については、Consensys Discord ServerのSildigence-Mythxチャンネルをチェックアウトしてください。
Mythrilのドキュメントはdocs
フォルダーに含まれており、ドキュメントを読むために公開されています。スフィンクスに基づいており、サブディレクトリに含まれるメイクファイルを使用して構築できます。
cd docs
make html
これにより、HTML出力を含むbuild
出力ディレクトリが作成されます。または、PDFドキュメントは、 make latexpdf
を使用して構築できます。使用可能な出力形式のオプションはmake help
を使用して見ることができます。
スマートコントラクトの脆弱性分類レジストリにアクセスして、報告された脆弱性の詳細な情報と修復ガイダンスを見つけてください。