Mythril เป็นเครื่องมือวิเคราะห์ความปลอดภัยสำหรับ EVM bytecode มันตรวจพบช่องโหว่ด้านความปลอดภัยในสัญญาอัจฉริยะที่สร้างขึ้นสำหรับ Ethereum, Hedera, Quorum, Vechain, Rootstock, Tron และ blockchains ที่เข้ากันได้กับ EVM อื่น ๆ มันใช้การดำเนินการเชิงสัญลักษณ์การแก้ปัญหา SMT และการวิเคราะห์ Taint เพื่อตรวจจับช่องโหว่ด้านความปลอดภัยที่หลากหลาย
ไม่ว่าคุณต้องการมีส่วนร่วมต้องการการสนับสนุนหรือต้องการเรียนรู้สิ่งที่เราทำอาหารเพื่ออนาคตคุณสามารถชำระเงิน Dialigence-Mythx Channel ในเซิร์ฟเวอร์ Consensys Discord
รับด้วย Docker:
$ docker pull mythril/myth
ติดตั้งจาก PYPI (Python 3.7-3.10):
$ pip3 install mythril
ใช้ผ่าน hook ล่วงหน้า (แทนที่ $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>
>
นี่คือตัวอย่างของการเรียกใช้ mythril บนไฟล์ killbilly.sol
ซึ่งอยู่ในไดเรกทอรี solidity_examples
สำหรับ 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 พบได้ในเอกสาร
สำหรับการสนับสนุนหรือการอภิปรายทั่วไปโปรดชำระเงิน Dialigence-Mythx Channel ใน Consensys Discord Server ..
เอกสารของ Mythril มีอยู่ในโฟลเดอร์ docs
และเผยแพร่เพื่ออ่านเอกสาร มันขึ้นอยู่กับสฟิงซ์และสามารถสร้างได้โดยใช้ makefile ที่มีอยู่ในไดเรกทอรีย่อย:
cd docs
make html
สิ่งนี้จะสร้างไดเรกทอรีเอาต์พุต build
ที่มีเอาต์พุต HTML อีกวิธีหนึ่งคือเอกสาร PDF สามารถสร้างขึ้นด้วย make latexpdf
ตัวเลือกรูปแบบเอาต์พุตที่มีอยู่สามารถเห็นได้ด้วย make help
เยี่ยมชมรีจิสทรีการจำแนกประเภทช่องโหว่ของสมาร์ทสัญญาเพื่อค้นหาข้อมูลโดยละเอียดและคำแนะนำการแก้ไขสำหรับช่องโหว่ที่รายงาน