GithubHelp home page GithubHelp logo

lefterisjp / memoryjolter Goto Github PK

View Code? Open in Web Editor NEW
7.0 3.0 2.0 10 KB

A tool to help recover passwords for ethereum keyfiles

License: BSD 3-Clause "New" or "Revised" License

Python 100.00%
ethereum password password-cracker password-recovery

memoryjolter's Introduction

Memory Jolter

Memory jolter is a python script with the intention to help people who have forgotten their ethereum keyfile password but still vaguely remember possible combination of words that the password may have had. The script works by trying all possible combinations of all possible permutations of the words depending on some rules. The permutation rules are hardcoded but can be easily adjusted by tweaking the appropriate function.

The hardcoded permutation rules are for capilatization and 1337 speak, which is a common practise for many people who are trying to make passwords they can remember but also want to introduce special characters.

Installation

You will need python 2.7. This script does not work with python 3 due to dependency on pyethapp for unlocking the account.

Create a virtualenv for memory jolter and then install the requirements by doing pip install -r requirements.txt.

Usage

Run the script with python main.py [ARGS].

The possible arguments and what they do are explained below.

Key File

With --keyfile pathtokeyfile you need to provide the path to the keyfile whose password you are trying to find.

Input File

With --input-file pathtoinputfile you need to provide the path to the file which contains the words and wordlists that will act as input and whose permutations and combinations will be used to find the password.

The input file needs to be in JSON format and contain a JSON list. Each element of the list needs to contain either a string or a list of strings. For each string in the list we will compute all possible permutations. For each wordlist we will not compute permutations but take all possible combinations of the words in the wordlist.

As an example look at the following json file:

["cat", ["12", "$#"]]

This will produce the following possibilities:

["c@T12", "CaT$#", "C4T$#", "caT12", "C@t12", "C@t$#", "C4t$#", "cAT$#", "cAt$#", "CaT12", "c@T$#", "CAT12", "C4t12", "c4t$#", "CAt$#", "c4T$#", "cAt12", "C@T12", "Cat12", "c4T12", "c@t12", "CAT$#", "caT$#", "cAT12", "Cat$#", "cat$#", "C@T$#", "CAt12", "cat12", "C4T12", "c@t$#", "c4t12"]

all of which will be tried against the provided keyfile

Respect Word Order

This option is on by default. And it can be turned off by providing --no-respect-word-order. Respecting word order means that the possible combinations will be computed respecting the order of the elements given in the provided input list.

By providing --no-respect-word-order for the example input file given above we would get the following password possibilities, essentially doubling them:

["caT$#", "c@T12", "CaT$#", "C4T$#", "caT12", "$#C4t", "12C4t", "$#c@t", "$#CaT", "12C@t", "12CaT", "C@t12", "C@T$#", "12CAt", "$#c@T", "c@T$#", "C4t$#", "cAT$#", "cAt$#", "12c@t", "CaT12", "$#cAT", "$#C4T", "12C4T", "C@t$#", "$#caT", "12C@T", "12caT", "12Cat", "$#Cat", "c4T12", "cAt12", "c4t$#", "CAt$#", "c4T$#", "CAT12", "$#CAT", "$#c4T", "12c4T", "$#C@T", "12cAT", "C@T12", "Cat12", "12cAt", "C4t12", "$#CAt", "c@t12", "CAT$#", "$#cat", "12c@T", "cAT12", "Cat$#", "cat$#", "$#cAt", "12c4t", "$#C@t", "12cat", "CAt12", "12CAT", "$#c4t", "cat12", "C4T12", "c@t$#", "c4t12"]

Threads

The number of threads to use. By default this is a single thread.

If you provide a number bigger than 1 here then the possible search space for the password is divided by that number and a work chunk is sent to each thread. Each thread then works on its own chunk in parallel greatly increasing the speed of the search.

Saving tried passwords

In case you need to quit the program or it crashes we regularly write all the tried combinations in a local file called tried.json. When the program restarts then the tried.json is read and all already attempted passwords are subtracted from the search space.

This way you can resume your search at a future time if it takes too long.

Other commands

The script contains some other miscellaneous commands that may or may not come in handy.

Combining Tried Files

If you have run the script in different computers and have created 2 different tried.json files then this command enables you to combine them into 1 file to be provided back to the script.

It works by doing:

python main.py combine_tried_files FILE1 FILE2 ...

and the result is saved into combinedtried.json

Checking the number of tried passwords

You can inspect a tried file by using this comand:

python main.py check_tried_length FILE

By Default FILE is tried.json. This will return how many passwords have already been attempted. As the program continuously writes on this file, you can query this while the program runs to inspect progress.

Compact the number of tried passwords

Even though the script should not write duplicated entries into the tried.json file it can happen due to some logic error. This command allows you to compact it and delete any and all duplicate entries.

python main.py make_tried_unique_list FILE

By default FILE is tried.json.

Attempt a password manually

By using this command you can attempt to unlock the keyfile by providing a password manually.

python main.py --keyfile PATHTOKEYFILE PASSWORDGOESHERE

Be careful here because the attempted password will be saved in your shell's history!

memoryjolter's People

Contributors

lefterisjp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

reddmist whoerau

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.