Code Monkey home page Code Monkey logo

legions's Introduction

get in touch with Consensys Diligence
[ 🌐 📩 ]

Legions

License: MIT CircleCI Code style: black PyPI

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

demo

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

TODO:

  • Able to connect to ws / http / https / IPC
  • Fix Verbose Status bar (It does not change from OFF)
  • Print Accounts in getnodeinfo in 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.json depending on the execution path might not be found. fix it.
  • inline TODOs (tons)

legions's People

Contributors

cleanunicorn avatar shayanb avatar jeamick avatar

Stargazers

ĒRDNA avatar

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.