Giter Site home page Giter Site logo

ksmaheshkumar / gitrob Goto Github PK

View Code? Open in Web Editor NEW

This project forked from michenriksen/gitrob

0.0 0.0 0.0 743 KB

Reconnaissance tool for GitHub organizations

Home Page: http://michenriksen.com/blog/gitrob-putting-the-open-source-in-osint/

License: MIT License

Ruby 77.57% JavaScript 4.06% CSS 5.22% HTML 13.15%

gitrob's Introduction

Gitrob

Developers generally like to share their code, and many of them do so by open sourcing it on GitHub, a social code hosting and collaboration service. Many companies also use GitHub as a convenient place to host both private and public code repositories by creating GitHub organizations where employees can be joined.

Sometimes employees might publish things that should not be publicly available, things that contain sensitive information or things that could even lead to direct compromise of a system. This can happen by accident or because the employee does not know the sensitivity of the information.

Gitrob is a command line tool that can help organizations and security professionals find such sensitive information. The tool will iterate over all public organization and member repositories and match filenames against a range of patterns for files, that typically contain sensitive or dangerous information.

Read the blog post for more information and screenshots.

How it works

Looking for sensitive information in GitHub repositories is not a new thing, it has been known for a while that things such as private keys and credentials can be found with GitHub's search functionality, however Gitrob makes it easier to focus the effort on a specific organization.

The first thing the tool does is to collect all public repositories of the organization itself. It then goes on to collect all the organization members and their public repositories, in order to compile a list of repositories that might be related or have relevance to the organization.

When the list of repositories has been compiled, it proceeds to gather all the filenames in each repository and runs them through a series of observers that will flag the files, if they match any patterns of known sensitive files. This step might take a while if the organization is big or if the members have a lot of public repositories.

All of the members, repositories and files will be saved to a PostgreSQL database. When everything has been sifted through, it will start a Sinatra web server locally on the machine, which will serve a simple web application to present the collected data for analysis.

Installation

Gitrob is written in Ruby and requires at least version 1.9.3 or above, except for version 2.2.0 which is currently not compatible. If you are on an older version, it is very easy to install newer versions with RVM. If you are installing Gitrob on Kali, you are almost good to go, you just need to update Bundler with gem install bundler. It might also be necessary to install a PostgreSQL dependency with apt-get install postgresql-server-dev-9.1 and a Ruby dependency with apt-get install ruby1.9.1-dev in a terminal.

Gitrob is a Ruby gem, so installation is a simple gem install gitrob in a terminal. This will automatically install all the code dependencies as well.

A PostgreSQL database is also needed for Gitrob to store its data. Installing PostgreSQL is pretty straight forward; here is an installation guide for Mac OS X and one for Ubuntu/Debian based Linux. If you're installing Gitrob on Kali, you already have PostgreSQL installed, however you need to start the server with service postgresql start in a terminal.

When PostgreSQL is installed, it's time to create a user and a database for Gitrob. To do so, type the following commands in a terminal:

sudo su postgres # Not necessary on Mac OS X
createuser -s gitrob --pwprompt
createdb -O gitrob gitrob

The last thing we need is a GitHub access token in order to be able to talk to their API. The easiest way is to create a personal access token. If you plan on using Gitrob extensively or on a very big organization, it might be necessary to have multiple access tokens to prevent running into rate limiting, but they need to be from different user accounts.

When everything is ready, simply run gitrob --configure and you will be presented with a configuration wizard that asks you for database connection details and GitHub access tokens. All of this configuration can be changed by running the same command again. The configuration will be saved in ~/.gitrobrc - and yes, Gitrob is looking for this file too so watch out.

When everything is set up, you can start analyzing organizations by running gitrob -o <orgname> in a terminal. To see options, use gitrob --help.

Contributing

Gitrob should be considered Beta and there is probably a good amount of bugs. Bug reports and suggestions for improvements are welcome!

Another way to help out is to contribute new patterns for sensitive files. If you know of any sensitive files that are not already identified, please submit them in a pull request. I am especially interested in sensitive web framework files and configuration files. Have a look at the patterns.json file to see what is already looked for.

How to make a pull request:

  1. Fork it ( https://github.com/michenriksen/gitrob/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

gitrob's People

Contributors

stefanscherer avatar merenon avatar karbassi avatar ghyde 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.