Commit-Stream : OSINT Tool For Finding Github Repositories

Commit-Stream drinks commit logs from the Github event firehose exposing the author details (name and email address) associated with Github repositories in real time.

OSINT / Recon uses for Redteamers / Bug bounty hunters:

  • Uncover repositories which employees of a target company is commiting code (filter by email domain)
  • Identify repositories belonging to an individual (filter by author name)
  • Chain with other tools such as trufflehog to extract secrets in uncovered repositories.

Installation

  • Binaries

Compiled 64-bit executable files for Windows, Mac and Linux are available here

  • Go get

If you would prefer to build yourself (and Go is setup correctly):

go get -u github.com/x1sec/commit-stream

  • Building from source

go get && go build

Usage

Usage:
commit-stream [OPTIONS]

Options:
-e, –email Match email addresses field (specify multiple with comma). Omit to match all.
-n, –name Match author name field (specify multiple with comma). Omit to match all.
-t, –token Github token (if not specified, will use environment variable ‘CSTREAM_TOKEN’)
-a –all-commits Search through previous commit history (default: false)
-i –ignore-priv Ignore noreply.github.com private email addresses (default: false)

It requires a Github personal access token to be used. You can generate a token navigating in Github [Settings / Developer Settings / Personal Access Tokens] then selecting ‘Generate new token’. Nothing here needs to be selected, just enter the name of the token and click generate.

Once the token has been created, the recommended method is to set it via an environment variable CSTREAM_TOKEN:

export CSTREAM_TOKEN=xxxxxxxxxx

Alternatively, the --token switch maybe used when invoking the program, e.g:

./commit-stream –token xxxxxxxxxx

When running commit-stream with no options, it will immediately dump author details and the associated repositories in CSV format to the terminal. Filtering options are available.

To filter by email domain:

./commit-stream –email ‘@company.com’

To filter by author name:

./commit-stream –name ‘John Smith’

Multiple keywords can be specified with a , character. e.g.

./commit-stream –email ‘@telsa.com,@ford.com’

It is possible to search upto 20 previous commits for the filter keywords by specifying --all-commits. This may increase the likelihood of a positive matches.

Email addresses that have been set to private (@users.noreply.github.com) can be ommited by specifying --ignore-priv. This is useful to reduce the volume of data collected if running the tool for an extended period of time.

Note

Github provides the ability to prevent email addresses from being exposed. In the Github settings select Keep my email addresses private and Block command line pushes that expose my email under the Email options.

As only one token is used this software does not breach any terms of use with Github. That said, use at your own risk. The author does not hold any responsibility for it’s usage.

Credit: @Darkport’s ssshgit

R K

Recent Posts

Configure a Static IP Address on Ubuntu 18.04: Netplan Guide

Setting a static IP address on your server is a smart move. It ensures your…

31 minutes ago

Install Xrdp on Ubuntu 18.04: Remote Desktop Setup Guide

Xrdp is an open-source implementation of the Microsoft Remote Desktop Protocol (RDP). It lets you access…

53 minutes ago

Add and Delete Users on Ubuntu 18.04: A Practical Guide

Managing user accounts is one of the most basic system administration tasks on any Linux…

58 minutes ago

Install Wine on Ubuntu 18.04: Run Windows Apps on Linux

Wine (short for "Wine Is Not an Emulator") is a compatibility layer that lets you run…

1 hour ago

Install KVM on Ubuntu 18.04: Setup, Network, and Create VMs

KVM (Kernel-based Virtual Machine) is an open-source virtualization technology built into the Linux kernel. It lets…

1 hour ago

Upgrade to Ubuntu 20.04 LTS: Prepare, Update, and Confirm

Ubuntu 20.04 LTS (code name Focal Fossa) was released on April 23, 2020. It is a…

1 day ago