updated README
This commit is contained in:
parent
378c54dbc7
commit
f0fc98b6d7
2 changed files with 48 additions and 14 deletions
40
README.md
40
README.md
|
@ -1 +1,39 @@
|
|||
# github_searcher
|
||||
# GitHub Searcher
|
||||
|
||||
GitHub Searcher is a command-line tool to search for PoC exploits for CVEs and security vulnerabilities in open-source software on GitHub. It allows you to search repositories, users, and repository names, and optionally fetch open issues and repository contents.
|
||||
|
||||
## Features
|
||||
|
||||
- Search GitHub repositories, users, and repository names.
|
||||
- Fetch open issues of a repository.
|
||||
- Fetch contents of a repository.
|
||||
|
||||
## Requirements
|
||||
|
||||
- Python 3.x
|
||||
- `PyGithub` library
|
||||
|
||||
## Installation
|
||||
|
||||
1. Clone the repository:
|
||||
```bash
|
||||
git clone https://github.com/yourusername/github_searcher.git
|
||||
cd github_searcher
|
||||
```
|
||||
|
||||
2. Install the required dependencies:
|
||||
```bash
|
||||
pip install PyGithub
|
||||
```
|
||||
|
||||
3. Set your GitHub access token as an environment variable:
|
||||
```bash
|
||||
export GITHUB_ACCESS_TOKEN=your_access_token
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
Run the script with the required arguments:
|
||||
|
||||
```bash
|
||||
python3 github_searcher.py --query=<query> --search_type=<search_type> [--get_open_issues] [--get_file_contents]
|
|
@ -43,7 +43,11 @@ class GithubSearcher():
|
|||
|
||||
def get_repo_open_issues(self, repo):
|
||||
try:
|
||||
return repo.get_issues(state='open')
|
||||
issues = repo.get_issues(state='open')
|
||||
for issue in issues:
|
||||
print(issue)
|
||||
return issues
|
||||
|
||||
except GithubException as e:
|
||||
logging.error(f"Error getting open issues: {e}")
|
||||
return None
|
||||
|
@ -92,20 +96,12 @@ def main():
|
|||
print(item.html_url)
|
||||
|
||||
if args.get_open_issues:
|
||||
issues = searcher.get_repo_open_issues(item)
|
||||
if issues:
|
||||
print("Open issues:")
|
||||
for issue in issues:
|
||||
print(f"Issue: {issue.title}")
|
||||
print("\n")
|
||||
searcher.get_repo_open_issues(item)
|
||||
print("\n")
|
||||
|
||||
if args.get_file_contents:
|
||||
contents = searcher.get_repo_contents(item)
|
||||
if contents:
|
||||
print("Contents:")
|
||||
for content in contents:
|
||||
print(f"File: {content.path}")
|
||||
print("\n")
|
||||
searcher.get_repo_contents(item)
|
||||
print("\n")
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
Loading…
Add table
Reference in a new issue