optik-tools


Nameoptik-tools JSON
Version 0.0.2 PyPI version JSON
download
home_page
SummarySymbolic execution toolkit for Ethereum smart-contracts
upload_time2022-12-05 08:17:09
maintainer
docs_urlNone
authorTrail of Bits
requires_python>=3.7
license
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Optik

**Optik** is a set of symbolic execution tools that assist smart contract fuzzers, letting them run in a _hybrid_ mode. Optik couples [Echidna](https://github.com/crytic/echidna), our smart contract fuzzer, with the [Maat](https://github.com/trailofbits/maat) symbolic executor that replays the fuzzing corpus and extends it with new inputs that increase coverage.

#### Current limitations

Optik is a work in progress and should not be used for real audits yet. Current limitations include:

- Symbolic `KECCAK` hashes are not supported
- `CREATE2`, `CALLCODE`, and `DELEGATECALL` are not yet supported
- Gas is not taken into account
- Some echidna options are not yet supported (see `hybrid-echidna -h`)

## Hybrid Echidna

<p align="center" >
<img width="80%" src=".resources/hybrid_echidna.png"/> <br>
</p>

Optik allows to run the [Echidna](https://github.com/crytic/echidna) smart-contract 
fuzzer in _hybrid_ mode. It basically couples Echidna with the [Maat](https://github.com/trailofbits/maat) symbolic executor that replays the Echidna corpus and extends it with new inputs that increase coverage. 

`hybrid-echidna` starts with several <i>incremental seeding</i> steps, where it seeds the corpus with short transactions sequences obtained by [Slither](https://github.com/crytic/slither)'s dataflow analysis, and uses symbolic execution more intensely to solve new inputs. The sequence length is incremented at each seeding step. Once it reaches a certain length threshold, `hybrid-echidna` falls back into its normal mode, starts to limit the number of symbolic inputs to solve, and stops using dataflow analysis for seeding the corpus.

### Usage

Hybrid echidna can be used seamlessly in place of regular Echidna by replacing `echidna-test` with `hybrid-echidna` in your Echidna command line. 
For example: 

```
hybrid-echidna MyContract.sol  --test-mode assertion --corpus-dir /tmp/test --contract MyContract
```

Additionnal options are available in hybrid mode to control `hybrid-echidna`'s behaviour:

- `--max-iters`: maximum number of fuzzing iterations to perform (one iteration is one Echidna campaign + one symbolic executor run on the corpus)

- `--solver-timeout`: maximum time in milliseconds to spend solving each possible new input

- `--incremental-threshold`: number of initial incremental seeding steps to perform

- `--no-incremental`: skip initial incremental seeding

- `--cov-mode`: type of coverage to increase when solving new inputs. Most coverage modes are implemented for experimental purposes. Unless you are developing/hacking on Optik, we recommend to keep the default mode

Debugging, logging and terminal display:

- `--debug`: add debugging information to the log output

- `--logs`: write logs to a given file (or `stdout`)

- `--no-display`: disable the graphical terminal display

## Installation

For a quick installation, run:

```console
python3 -m pip install optik-tools
```

To keep up with the latest features and fixes, install Optik from its `master` branch:

```console
git clone https://github.com/crytic/optik && cd optik
python3 -m pip install .
```

You can also run it from Docker:

```console
git clone https://github.com/crytic/optik && cd optik
docker build -t crytic/optik .
docker run -it --rm --mount type=bind,source="$(pwd)",target=/workdir crytic/optik
# This runs the Docker container, mounting the local directory into /workdir
```

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "optik-tools",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "",
    "author": "Trail of Bits",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/89/d0/4388de6881c6107ea8b1b5d7f04b55caabd1c360366a59cfd99e20475b43/optik-tools-0.0.2.tar.gz",
    "platform": null,
    "description": "# Optik\n\n**Optik** is a set of symbolic execution tools that assist smart contract fuzzers, letting them run in a _hybrid_ mode. Optik couples [Echidna](https://github.com/crytic/echidna), our smart contract fuzzer, with the [Maat](https://github.com/trailofbits/maat) symbolic executor that replays the fuzzing corpus and extends it with new inputs that increase coverage.\n\n#### Current limitations\n\nOptik is a work in progress and should not be used for real audits yet. Current limitations include:\n\n- Symbolic `KECCAK` hashes are not supported\n- `CREATE2`, `CALLCODE`, and `DELEGATECALL` are not yet supported\n- Gas is not taken into account\n- Some echidna options are not yet supported (see `hybrid-echidna -h`)\n\n## Hybrid Echidna\n\n<p align=\"center\" >\n<img width=\"80%\" src=\".resources/hybrid_echidna.png\"/> <br>\n</p>\n\nOptik allows to run the [Echidna](https://github.com/crytic/echidna) smart-contract \nfuzzer in _hybrid_ mode. It basically couples Echidna with the [Maat](https://github.com/trailofbits/maat) symbolic executor that replays the Echidna corpus and extends it with new inputs that increase coverage. \n\n`hybrid-echidna` starts with several <i>incremental seeding</i> steps, where it seeds the corpus with short transactions sequences obtained by [Slither](https://github.com/crytic/slither)'s dataflow analysis, and uses symbolic execution more intensely to solve new inputs. The sequence length is incremented at each seeding step. Once it reaches a certain length threshold, `hybrid-echidna` falls back into its normal mode, starts to limit the number of symbolic inputs to solve, and stops using dataflow analysis for seeding the corpus.\n\n### Usage\n\nHybrid echidna can be used seamlessly in place of regular Echidna by replacing `echidna-test` with `hybrid-echidna` in your Echidna command line. \nFor example: \n\n```\nhybrid-echidna MyContract.sol  --test-mode assertion --corpus-dir /tmp/test --contract MyContract\n```\n\nAdditionnal options are available in hybrid mode to control `hybrid-echidna`'s behaviour:\n\n- `--max-iters`: maximum number of fuzzing iterations to perform (one iteration is one Echidna campaign + one symbolic executor run on the corpus)\n\n- `--solver-timeout`: maximum time in milliseconds to spend solving each possible new input\n\n- `--incremental-threshold`: number of initial incremental seeding steps to perform\n\n- `--no-incremental`: skip initial incremental seeding\n\n- `--cov-mode`: type of coverage to increase when solving new inputs. Most coverage modes are implemented for experimental purposes. Unless you are developing/hacking on Optik, we recommend to keep the default mode\n\nDebugging, logging and terminal display:\n\n- `--debug`: add debugging information to the log output\n\n- `--logs`: write logs to a given file (or `stdout`)\n\n- `--no-display`: disable the graphical terminal display\n\n## Installation\n\nFor a quick installation, run:\n\n```console\npython3 -m pip install optik-tools\n```\n\nTo keep up with the latest features and fixes, install Optik from its `master` branch:\n\n```console\ngit clone https://github.com/crytic/optik && cd optik\npython3 -m pip install .\n```\n\nYou can also run it from Docker:\n\n```console\ngit clone https://github.com/crytic/optik && cd optik\ndocker build -t crytic/optik .\ndocker run -it --rm --mount type=bind,source=\"$(pwd)\",target=/workdir crytic/optik\n# This runs the Docker container, mounting the local directory into /workdir\n```\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Symbolic execution toolkit for Ethereum smart-contracts",
    "version": "0.0.2",
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "a793a41f840279e79c5a6508a4bd460d",
                "sha256": "c245bfdfb4bb7c3f16a19e4b4e4c33ebeafbe5858f67f9c708e96c9c73d08a72"
            },
            "downloads": -1,
            "filename": "optik_tools-0.0.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "a793a41f840279e79c5a6508a4bd460d",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 60900,
            "upload_time": "2022-12-05T08:17:08",
            "upload_time_iso_8601": "2022-12-05T08:17:08.777413Z",
            "url": "https://files.pythonhosted.org/packages/88/44/82354cf7cac740f51d018b5b478e94063dfb6058c824e0c447e33a7e501f/optik_tools-0.0.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "9bc511ef6cfb4f8296e0aed283a4b208",
                "sha256": "eda23d4b0d0c591d7e665ca9385f00ba6be70c1fba0a0d7c9531421cbfad065f"
            },
            "downloads": -1,
            "filename": "optik-tools-0.0.2.tar.gz",
            "has_sig": false,
            "md5_digest": "9bc511ef6cfb4f8296e0aed283a4b208",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 54247,
            "upload_time": "2022-12-05T08:17:09",
            "upload_time_iso_8601": "2022-12-05T08:17:09.999746Z",
            "url": "https://files.pythonhosted.org/packages/89/d0/4388de6881c6107ea8b1b5d7f04b55caabd1c360366a59cfd99e20475b43/optik-tools-0.0.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2022-12-05 08:17:09",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "lcname": "optik-tools"
}
        
Elapsed time: 0.02488s