No project description provided
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.6.
git 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 | |
| ens | Do Ethereum Name Service queries (supported on the mainnet only) | |
| toName | Transform an address to the ENS name | |
| toAddress | Transform an ENS name to the Ethereum public address | |
| info | Get details about an ENS name | |
| version | Print Versions (If connected to a node it will print the host version too) |
Acknowledgement
- Interactive shell: python-nubia
- Web3.py
TODO:
- Able to connect to ws / http / https / IPC
- 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
legions-0.8.0.tar.gz
(15.8 kB
view details)
File details
Details for the file legions-0.8.0.tar.gz.
File metadata
- Download URL: legions-0.8.0.tar.gz
- Upload date:
- Size: 15.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.8.0 tqdm/4.45.0 CPython/3.8.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
66a22de2362f2205c78bddcf1456254b98b3f6d34818a8507c58997c235fa755
|
|
| MD5 |
1b017a4a26d85b0d7a14e4c2341b07c2
|
|
| BLAKE2b-256 |
fa101437c2a7acdf668d1b09d57c862fdc6fdf5205fe7af291334a2affa9c07d
|