Skip to content
This repository was archived by the owner on Jan 13, 2023. It is now read-only.

Commit d2c4339

Browse files
author
Michael Henriksen
committed
Genesis.
0 parents  commit d2c4339

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+4255
-0
lines changed

.github/ISSUE_TEMPLATE.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
Hey there and thank you for using the issue tracker!
2+
3+
## Checklist before filing an issue:
4+
5+
- [ ] Is this something you can **debug and fix**? Send a pull request! Bug fixes and documentation fixes are welcome.
6+
- [ ] Have a usage question? Ask your question on [StackOverflow](http://stackoverflow.com), [StackExchange Security](https://security.stackexchange.com) or similar platform.
7+
- [ ] Have an idea for a feature? Make sure that it hasn't been suggested before and describe your idea in detail.
8+
9+
## None of the above? create a bug report
10+
11+
Make sure to add **all the information needed to understand the bug** so that someone can help. If information is missing, the issue will be labeled with 'Needs more information' and closed until there is enough information.
12+
13+
## Expected Behavior
14+
15+
16+
## Actual Behavior
17+
18+
19+
## Steps to Reproduce the Problem
20+
21+
1.
22+
2.
23+
3.
24+
25+
## Specifications
26+
27+
- Gitrob version:
28+
- Operating system:
29+
- Go version:

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
**IMPORTANT: Please do not create a Pull Request without creating an issue first.**
2+
3+
*Any change needs to be discussed before proceeding. Failure to do so may result in the rejection of the pull request.*
4+
5+
Please provide enough information so that others can review your pull request:
6+
7+
<!-- You can skip this if you're fixing a typo or similar tiny fix. -->
8+
9+
Explain the **details** for making this change. What existing problem does the pull request solve?
10+
11+
<!-- Example: When "Adding a function to do X", explain why it is necessary to have a way to do X. -->
12+
13+
**Closing issues**
14+
15+
Put `closes #XXXX` in your comment to auto-close the issue that your PR fixes (if such).

.gitignore

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
# Binaries for programs and plugins
2+
*.exe
3+
*.exe~
4+
*.dll
5+
*.so
6+
*.dylib
7+
gitrob
8+
gitrob.exe
9+
10+
build
11+
12+
# Test binary, build with `go test -c`
13+
*.test
14+
15+
# Output of the go coverage tool, specifically when used with LiteIDE
16+
*.out
17+
18+
# Dropbox settings and caches
19+
.dropbox
20+
.dropbox.attr
21+
.dropbox.cache
22+
23+
# temporary files which can be created if a process still has a handle open of a deleted file
24+
.fuse_hidden*
25+
26+
# KDE directory preferences
27+
.directory
28+
29+
# Linux trash folder which might appear on any partition or disk
30+
.Trash-*
31+
32+
# .nfs files are created when an open file is removed but is still being accessed
33+
.nfs*
34+
35+
36+
# TextMate
37+
*.tmproj
38+
*.tmproject
39+
tmtags
40+
41+
# Swap
42+
[._]*.s[a-v][a-z]
43+
[._]*.sw[a-p]
44+
[._]s[a-v][a-z]
45+
[._]sw[a-p]
46+
47+
# Session
48+
Session.vim
49+
50+
# Temporary
51+
.netrwhist
52+
*~
53+
# Auto-generated tag files
54+
tags
55+
56+
# General
57+
.DS_Store
58+
.AppleDouble
59+
.LSOverride
60+
61+
# Icon must end with two \r
62+
Icon
63+
64+
65+
# Thumbnails
66+
._*
67+
68+
# Files that might appear in the root of a volume
69+
.DocumentRevisions-V100
70+
.fseventsd
71+
.Spotlight-V100
72+
.TemporaryItems
73+
.Trashes
74+
.VolumeIcon.icns
75+
.com.apple.timemachine.donotpresent
76+
77+
# Directories potentially created on remote AFP share
78+
.AppleDB
79+
.AppleDesktop
80+
Network Trash Folder
81+
Temporary Items
82+
.apdisk

CHANGELOG.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
2+
# Changelog
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
6+
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
7+
8+
## [Unreleased]
9+
10+
## 2.0.0-beta - 2018-06-08
11+
### Added
12+
- Total rewrite of Gitrob in [Golang](https://golang.org/)
13+
- Find interesting files in history down to a default (and configurable) depth of 500 commits
14+
- Hexdump view for binary files
15+
- Saving and loading of session files for easy sharing
16+
17+
### Removed
18+
- All the stupid Rubygems with native extensions
19+
- PostgreSQL dependency
20+
- Messy assessment comparison feature
21+
- User overview
22+
- Repository overview
23+
24+
[Unreleased]: https://github.com/michenriksen/gitrob/compare/v2.0.0-beta...HEAD

LICENSE.txt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2018 Michael Henriksen
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in
13+
all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
THE SOFTWARE.

README.md

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# Gitrob: Putting the Open Source in OSINT
2+
3+
Gitrob is a tool to help find potentially sensitive files pushed to public repositories on Github. Gitrob will clone repositories belonging to a user or organization down to a configurable depth and iterate through the commit history and flag files that match signatures for potentially sensitive files. The findings will be presented through a web interface for easy browsing and analysis.
4+
5+
## Usage
6+
7+
gitrob [options] target [target2] ... [targetN]
8+
9+
### Options
10+
11+
```
12+
-bind-address string
13+
Address to bind web server to (default "127.0.0.1")
14+
-commit-depth int
15+
Number of repository commits to process (default 500)
16+
-debug
17+
Print debugging information
18+
-github-access-token string
19+
GitHub access token to use for API requests
20+
-load string
21+
Load session file
22+
-no-expand-orgs
23+
Don't add members to targets when processing organizations
24+
-port int
25+
Port to run web server on (default 9393)
26+
-save string
27+
Save session to file
28+
-silent
29+
Suppress all output except for errors
30+
-threads int
31+
Number of concurrent threads (default number of logical CPUs)
32+
```
33+
34+
### Saving session to a file
35+
36+
By default, gitrob will store its state for an assessment in memory. This means that the results of an assessment is lost when Gitrob is closed. You can save the session to a file by using the `-save` option:
37+
38+
gitrob -save ~/gitrob-session.json acmecorp
39+
40+
Gitrob will save all the gathered information to the specified file path as a special JSON document. The file can be loaded again for browsing at another point in time, shared with other analysts or parsed for custom integrations with other tools and systems.
41+
42+
### Loading session from a file
43+
44+
A session stored in a file can be loaded with the `-load` option:
45+
46+
gitrob -load ~/gitrob-session.json
47+
48+
Gitrob will start its web interface and serve the results for analysis.
49+
50+
## Installation
51+
52+
A [precompiled version is available](https://github.com/michenriksen/gitrob/releases) for each release, alternatively you can use the latest version of the source code from this repository in order to build your own binary.
53+
54+
Make sure you have a correctly configured **Go >= 1.8** environment and that `$GOPATH/bin` is in your `$PATH`
55+
56+
$ go get github.com/michenriksen/gitrob
57+
58+
This command will download gitrob, install its dependencies, compile it and move the `gitrob` executable to `$GOPATH/bin`.
59+
60+
### Github access token
61+
62+
Gitrob will need a Github access token in order to interact with the Github API. [Create a personal access token](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/) and save it in an environment variable in your `.bashrc` or similar shell configuration file:
63+
64+
export GITROB_ACCESS_TOKEN=deadbeefdeadbeefdeadbeefdeadbeefdeadbeef
65+
66+
Alternatively you can specify the access token with the `-github-access-token` option, but watch out for your command history!

build.sh

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
#!/bin/bash
2+
3+
BUILD_FOLDER=build
4+
VERSION=$(cat core/banner.go | grep Version | cut -d '"' -f 2)
5+
6+
bin_dep() {
7+
BIN=$1
8+
which $BIN > /dev/null || { echo "[-] Dependency $BIN not found !"; exit 1; }
9+
}
10+
11+
create_exe_archive() {
12+
bin_dep 'zip'
13+
14+
OUTPUT=$1
15+
16+
echo "[*] Creating archive $OUTPUT ..."
17+
zip -j "$OUTPUT" gitrob.exe ../README.md ../LICENSE.txt > /dev/null
18+
rm -rf gitrob gitrob.exe
19+
}
20+
21+
create_archive() {
22+
bin_dep 'zip'
23+
24+
OUTPUT=$1
25+
26+
echo "[*] Creating archive $OUTPUT ..."
27+
zip -j "$OUTPUT" gitrob ../README.md ../LICENSE.md > /dev/null
28+
rm -rf gitrob gitrob.exe
29+
}
30+
31+
build_linux_amd64() {
32+
echo "[*] Building linux/amd64 ..."
33+
GOOS=linux GOARCH=amd64 go build -o gitrob ..
34+
}
35+
36+
build_macos_amd64() {
37+
echo "[*] Building darwin/amd64 ..."
38+
GOOS=darwin GOARCH=amd64 go build -o gitrob ..
39+
}
40+
41+
build_windows_amd64() {
42+
echo "[*] Building windows/amd64 ..."
43+
GOOS=windows GOARCH=amd64 go build -o gitrob.exe ..
44+
}
45+
46+
rm -rf $BUILD_FOLDER
47+
mkdir $BUILD_FOLDER
48+
cd $BUILD_FOLDER
49+
50+
build_linux_amd64 && create_archive gitrob_linux_amd64_$VERSION.zip
51+
build_macos_amd64 && create_archive gitrob_macos_amd64_$VERSION.zip
52+
build_windows_amd64 && create_exe_archive gitrob_windows_amd64_$VERSION.zip
53+
shasum -a 256 * > checksums.txt
54+
55+
echo
56+
echo
57+
du -sh *
58+
59+
cd --

core/banner.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package core
2+
3+
const (
4+
Name = "gitrob"
5+
Version = "2.0.0-beta"
6+
Author = "Michael Henriksen"
7+
Website = "https://github.com/michenriksen/gitrob"
8+
ASCIIBanner = " _ __ __\n" +
9+
" ___ _(_) /________ / /\n" +
10+
" / _ `/ / __/ __/ _ \\/ _ \\\n" +
11+
" \\_, /_/\\__/_/ \\___/_.__/\n" +
12+
"/___/ by @michenriksen"
13+
)

0 commit comments

Comments
 (0)