GithubHelp home page GithubHelp logo

metagon / ithildin Goto Github PK

View Code? Open in Web Editor NEW
8.0 5.0 2.0 176 KB

Semantic analyzer of EVM bytecode based on Mythril

License: MIT License

Python 95.83% HTML 4.17%
smart-contracts ethereum mythril symbolic-execution evm-bytecode taint-analysis

ithildin's People

Contributors

metagon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

ithildin's Issues

SQLite fails when ~/.mythril directory is absent

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.

How to reproduce:

  1. Delete ~/.mythril
  2. Execute ./ithil with an arbitrary contract

How to fix:

Either 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).

Performance optimizations needed

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.

HashLock returns lots of false positives

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.

Installation instructions: wheel, leveldb-dev

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)

Unhandled Exception PluginSkipWorldState

The laser plugin CallDepthLimit throws an exception that is not being handled in _execute_pre_hook.

Affected Version

Ithildin v0.2.2

How to reproduce

Analyze the contract at address 0x5c367c1b2603ed166c62cec0e4d47e9d5dc1c073 while having all strategies disabled except of Ownership and allow for a higher timeout, e.g. --timeout 120.

Log

[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 

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.