Skip to content

Commit

Permalink
Changing regexes to install regex package
Browse files Browse the repository at this point in the history
  • Loading branch information
dxa4481 committed Apr 14, 2018
1 parent 0c19853 commit 58690fe
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 36 deletions.
9 changes: 5 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
GitPython
unittest2
pytest-cov
codecov
GitPython==2.1.1
unittest2==1.1.0
pytest-cov==2.5.1
codecov==2.0.15
truffleHogRegexes==0.0.4
14 changes: 8 additions & 6 deletions scripts/searchOrg.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@
via https://github.com/dxa4481/truffleHog/pull/9
"""
import requests
import truffleHog
from truffleHog import truffleHog

def get_org_repos(orgname):
response = requests.get(url='https://api.github.com/users/' + orgname + '/repos')
def get_org_repos(orgname, page):
response = requests.get(url='https://api.github.com/users/' + orgname + '/repos?page={}'.format(page))
json = response.json()
if not json:
return None
for item in json:
if item['private'] == False:
print('searching ' + item["html_url"])
truffleHog.find_strings(item["html_url"])

get_org_repos("Netflix")
truffleHog.find_strings(item["html_url"], do_regex=True, do_entropy=False, max_depth=100000)
get_org_repos(orgname, page + 1)
get_org_repos("twitter", 1)
5 changes: 3 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@

setup(
name='truffleHog',
version='2.0.90',
version='2.0.91',
description='Searches through git repositories for high entropy strings, digging deep into commit history.',
url='https://github.com/dxa4481/truffleHog',
author='Dylan Ayrey',
author_email='dxa4481@rit.edu',
license='GNU',
packages = ['truffleHog', 'truffleHog.defaultRegexes'],
install_requires=[
'GitPython == 2.1.1'
'GitPython == 2.1.1',
'truffleHogRegexes == 0.0.4'
],
entry_points = {
'console_scripts': ['trufflehog = truffleHog.truffleHog:main'],
Expand Down
1 change: 0 additions & 1 deletion truffleHog/defaultRegexes/__init__.py

This file was deleted.

19 changes: 0 additions & 19 deletions truffleHog/defaultRegexes/regexChecks.py

This file was deleted.

6 changes: 2 additions & 4 deletions truffleHog/truffleHog.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,8 @@
import stat
from git import Repo
from git import NULL_TREE
try:
from defaultRegexes.regexChecks import regexes
except ImportError:
from truffleHog.defaultRegexes.regexChecks import regexes
from truffleHogRegexes.regexChecks import regexes


def main():
parser = argparse.ArgumentParser(description='Find secrets hidden in the depths of git.')
Expand Down

0 comments on commit 58690fe

Please sign in to comment.