Guest User

github private key scan issue creator.py

a guest
Aug 18th, 2015
521
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.58 KB | None | 0 0
  1. github, all_repos = __import__('tortilla').wrap('https://api.github.com'), set()
  2. for i in range(1000):
  3.     all_repos += set([result.repository.full_name for result in github.search.code.get(params=dict(q='filename:id_rsa path:.ssh', per_page=100, page=1}).items]))
  4. for repo in all_repos:
  5.     github.repos(repo).issues.post(data=dict(title='SSH Private Keys found in this repository', body='We found SSH private keys publicly available in your repository. \n\nThis is an automated ticket created to warn you of the dangers of sharing your private keys'), headers=dict(token='my_github_api_key'))
Advertisement
Add Comment
Please, Sign In to add comment