Handy toolkit for (security) researchers poking around Ethereum nodes and contracts, now with a slick command-line interface, with auto complete commands and history.
Project description
Legions
Ethereum Node Security Toolkit
Handy toolkit for (security) researchers poking around Ethereum nodes and contracts, now with a slick command-line interface, with auto complete commands and history.
Other functionalities:
- Conversions (toWei, fromWei, keccak, etc)
- Query for balance, code, storage of smart contracts, ecrecover
- etc
This package is extremely beta
Installation
Require Python 3.7.0.
clone https://github.com/shayanb/Legions
cd Legions
pip install .
or
pip install legions
Usage
If installed locally:
python legions/main.py
or if installed globally:
legions
Functions
| Command | [Subcommand] | Description |
|---|---|---|
| sethost | Setup the Web3 connection (RPC, IPC, HTTP) (default to infura mainnet) | |
| getnodeinfo | Information about the connected node (run setnode before this) |
|
| conversions | Conversions possible to do with Web3 | |
| fromWei | Converts the input to ether (to currency default to ether) |
|
| toWei | Converts the input to Wei (from currency default to ether) |
|
| keccak | keccak hash of the input | |
| toBytes | Converts the input to hex representation of its Bytes | |
| toChecksumAddress | Converts the input to Checksum Address | |
| toHex | Converts the input text to Hex | |
| fromWei | Converts the input to ether (or specified currency) | |
| query | Query Blockchain (Storage, balance, etc) | |
| balance | Get Balance of an account | |
| block | Get block details by block number | |
| code | Get code of the smart contract at address | |
| ecrecover | Get address associated with the signature (ecrecover) BUGGY |
|
| storage | Read the storage of a contract (count default = 10) |
|
| command | Manual RPC method with args | |
| investigate | Investigate further in the node (e.g. check if accounts are unlocked, etc) | |
| accounts | Investigate accounts (e.g. check if accounts are unlocked, etc) | |
| admin | Investigate accounts (e.g. functionalities under the admin_ namespace) | |
| sign | Investigate signature functionalities | |
| version | Print Versions (If connected to a node it will print the host version too) |
Acknowledgement
- Interactive shell: python-nubia
- Web3.py
TODO:
- Fix
VerboseStatus bar (It does not change fromOFF) - Print Accounts in
getnodeinfoin a pretty format (One per line) - A way to reinitiate w3 (web3) by setting it to new host (right now it works for sethost but getnodeinfo still uses the first initiated w3)
- add way more functionalities
chains.jsondepending on the execution path might not be found. fix it.- inline TODOs (tons)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file legions-0.5.2.tar.gz.
File metadata
- Download URL: legions-0.5.2.tar.gz
- Upload date:
- Size: 10.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.7.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7ba8569abc98e58c55af944ae98871236f3f5422338545948cc85a275a683d3d
|
|
| MD5 |
ea68a15792d9ae2cbbc4e94a51564787
|
|
| BLAKE2b-256 |
c836e49057f8d781d1115d952e6926140318c51072aeaa39460cff84d9926d08
|
File details
Details for the file legions-0.5.2-py3-none-any.whl.
File metadata
- Download URL: legions-0.5.2-py3-none-any.whl
- Upload date:
- Size: 11.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.7.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3f3f359a453dc6a16cad38d336e0a148747289dc9e5be2f27c75eb2f5e0f06e0
|
|
| MD5 |
c9eb07aa3110da7b9b2fd74c9680fc5d
|
|
| BLAKE2b-256 |
595fcccda55588044e56b9a6bcec49e938240f490b21be63156727490f7dd802
|