Identify Github accounts associated with email addresses
Important : email2github requires python >=3.8.
Your personal repository on github will need two elements :
- An authentication token :
This tool uses the Github API. Please create a personal access token by following this documentation. The scope of the token must include "repo" and "delete_repo", as the tool will create and delete fake private repositories.
Important : the token is asked at the first start and then saved as a json file inside a tmp directory in the repo. If you need to remove the token from the cache, simply edit or delete this file.
- a ssh public key :
Generate a ssh key on your machine :
ssh-keygen -f github -C github
Here the key will be named github and the domain will also be github. But feel free to change these values.
Export the public key to your github account.
# Clone the repo
$ git clone https://github.com/h51un6/email2github.git
# Change the working directory
$ cd email2github
# Create and activate a virtual environment (optional step)
$ python3 -m venv venv
$ . venv/bin/activate
# Install the requirements
$ pip install -r requirements.txt
$ python email2github search --help
Usage: python -m email2github search [OPTIONS] EMAILS
Search email addresses on Github
This command try to resolve email addresses to Github accounts with various
techniques, from the most simple to the most intrusive.
Email addresses could be set from a file or from a comma-separated list.
Options:
-o, --output PATH Save the results as CSV in a file
-q, --quiet Suppress helping messages
--help Show this message and exit.
Description | Command |
---|---|
Search a single email | python email2github search EMAIL |
Search from a file | python email2github search FILEPATH |
Search a list of emails | python email2github search EMAIL1,EMAIL2 |
Technique | Description | Scope |
---|---|---|
Search in emails | Use the Github's users search endpoint to search account by email | Public email |
Create fake commits | Create fake commits with arbitrary email. GitHub automatically resolves the emails to a GitHub accounts associated with them. | Public, private, primary and secondary email |
Thanks to the antnks' enumerate Github users POC.