metagon / ithildin Goto Github PK
View Code? Open in Web Editor NEWSemantic analyzer of EVM bytecode based on Mythril
License: MIT License
Semantic analyzer of EVM bytecode based on Mythril
License: MIT License
Mythril has to be executed at least once, and solc has to be installed in order for the ~/.mythril
directory to be present, which is required by SQLite when opening the signatures database at ~/.mythril/signatures.db
.
~/.mythril
./ithil
with an arbitrary contractEither introduce a setup script that creates the folder, or create a pull request at the mythril repository with the fix at signatures.py
constructor (line 120).
When ithil and myth analyze the same contract, myth takes considerably less time to complete compared to ithil. This might have something to do with the plug-ins that mythril loads in SymExecWrapper.
This pattern detection strategy needs to be improved to avoid lots of false positives. Due to the nature of the pattern it is often hard to discern between hash lock and accessing data structures, s.a. mappings, where the input gets hashed to get the key. Furthermore this strategy needs to be able to detect hash lock instances where the hash is stored in a storage variable by itself, i.e. not in a mapping.
A docker image would be the easiest way to install Ithildin on any operating system.
The installation instructions are almost perfect. On my Ubuntu 18.04 distributions, two more things were necessary for successful installation:
pip3 install wheel
(could maybe go into requirements.txt
, see e.g. stackexchange)sudo apt install libleveldb-dev
(required for compiling plyvel/_plyvel.cpp
during the installation process)The laser plugin CallDepthLimit throws an exception that is not being handled in _execute_pre_hook
.
Ithildin v0.2.2
Analyze the contract at address 0x5c367c1b2603ed166c62cec0e4d47e9d5dc1c073
while having all strategies disabled except of Ownership
and allow for a higher timeout, e.g. --timeout 120
.
[INFO ] 2021-02-19 19:48:01,093 - ithildin.tools.benchmark Analyzing contract 54597/127010 at address 0x5c367c1b2603ed166c62cec0e4d47e9d5dc1c073
[INFO ] 2021-02-19 19:48:01,095 - ithildin.analysis.symbolic Running symbolic execution in existing mode...
Laser plugin with name coverage was already loaded, skipping...
Laser plugin with name mutation-pruner was already loaded, skipping...
Laser plugin with name call-depth-limit was already loaded, skipping...
Laser plugin with name instruction-profiler was already loaded, skipping...
Laser plugin with name dependency-pruner was already loaded, skipping...
[INFO ] 2021-02-19 19:48:07,057 - ithildin.analysis.base Analysis strategy Ownership got a hit in function fallback
[INFO ] 2021-02-19 19:48:09,948 - ithildin.analysis.base Analysis strategy Ownership got a hit in function blockHashAddendsInexpansible(uint256)
[INFO ] 2021-02-19 19:48:11,140 - ithildin.analysis.base Analysis strategy Ownership got a hit in function _function_0x0ec2e821
[INFO ] 2021-02-19 19:48:19,585 - ithildin.analysis.base Analysis strategy Ownership got a hit in function transfer(address,address,address,uint256)
[INFO ] 2021-02-19 19:48:30,973 - ithildin.analysis.base Analysis strategy Ownership got a hit in function _function_0x28342ecf
Traceback (most recent call last):
File "/home/philippos/.local/bin/ithil", line 8, in <module>
sys.exit(main())
File "/home/philippos/.local/lib/python3.8/site-packages/ithildin/__main__.py", line 5, in main
cli.main()
File "/home/philippos/.local/lib/python3.8/site-packages/ithildin/interfaces/cli.py", line 140, in main
benchmark(args)
File "/home/philippos/.local/lib/python3.8/site-packages/ithildin/tools/benchmark.py", line 282, in benchmark
new_benchmark(args)
File "/home/philippos/.local/lib/python3.8/site-packages/ithildin/tools/benchmark.py", line 246, in new_benchmark
analysis_report = LaserWrapper().execute(contract_loader=contract_loader, timeout=args.timeout, max_depth=args.max_depth)
File "/home/philippos/.local/lib/python3.8/site-packages/ithildin/analysis/symbolic.py", line 86, in execute
laser.sym_exec(creation_code=creation_code,
File "/home/philippos/.local/lib/python3.8/site-packages/mythril/laser/ethereum/svm.py", line 155, in sym_exec
self._execute_transactions(symbol_factory.BitVecVal(target_address, 256))
File "/home/philippos/.local/lib/python3.8/site-packages/mythril/laser/ethereum/svm.py", line 216, in _execute_transactions
execute_message_call(self, address)
File "/home/philippos/.local/lib/python3.8/site-packages/mythril/laser/ethereum/transaction/symbolic.py", line 108, in execute_message_call
laser_evm.exec()
File "/home/philippos/.local/lib/python3.8/site-packages/mythril/laser/ethereum/svm.py", line 253, in exec
new_states, op_code = self.execute_state(global_state)
File "/home/philippos/.local/lib/python3.8/site-packages/mythril/laser/ethereum/svm.py", line 335, in execute_state
self._execute_pre_hook(op_code, global_state)
File "/home/philippos/.local/lib/python3.8/site-packages/mythril/laser/ethereum/svm.py", line 654, in _execute_pre_hook
hook(global_state)
File "/home/philippos/.local/lib/python3.8/site-packages/mythril/laser/plugin/plugins/call_depth_limiter.py", line 30, in sstore_mutator_hook
raise PluginSkipWorldState
mythril.laser.plugin.signals.PluginSkipWorldState
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.