Compare commits

...

15 Commits

Author SHA1 Message Date
Richard Mwewa
8364053f97 Update README.md 2023-01-26 21:33:29 +02:00
Richard Mwewa
1f288d503f Update octosuite.py 2023-01-25 23:00:05 +02:00
Richard Mwewa
57911bd68f Update octosuite.py 2023-01-25 22:50:19 +02:00
Richard Mwewa
264048e4bf Update README.md 2023-01-25 14:38:34 +02:00
Richard Mwewa
671fbdcaa4 Update README.md 2023-01-25 14:36:45 +02:00
Richard Mwewa
5fc5af4157 Update octosuite.py 2023-01-25 14:29:13 +02:00
Richard Mwewa
8bc799c829 Update README.md 2023-01-25 14:28:14 +02:00
Richard Mwewa
85cadefd50 v3.1.0 2023-01-25 14:11:25 +02:00
Richard Mwewa
646ea3cb51 Update README.md 2023-01-23 03:08:49 +02:00
Richard Mwewa
3e18a3301a Merge pull request from #9
fix: bad indentation leading to reference before assignment error #9
2023-01-22 17:02:39 +02:00
Richard Mwewa
d4b595d79e Merge pull request from #9
fix: bad indentation leading to reference before assignment error #9
2023-01-22 17:01:34 +02:00
Richard Mwewa
0f247d1dd8 Merge pull request from issue #9
fix: bad identation leading to reference before assigment error #9
2023-01-22 16:55:55 +02:00
Richard Mwewa
1b2c441237 Merge pull request #9 from albertollamaso/fix-var-assigment
fix: bad identation leading to `reference before assigment` error
2023-01-22 16:50:36 +02:00
albertollamaso
2723c2f8dd fix: bad identation leading to reference before assigment error 2023-01-22 13:59:26 +01:00
Richard Mwewa
7576fa64a1 Update setup.py 2023-01-22 03:17:01 +02:00
6 changed files with 58 additions and 10 deletions

View File

@@ -11,10 +11,10 @@ A framework for gathering open-source intelligence on GitHub users, repositories
![GitHub repo size](https://img.shields.io/github/repo-size/bellingcat/octosuite?style=flat&logo=github)
![octosuite_gui_exe (2)](https://user-images.githubusercontent.com/74001397/186889610-4530ee26-d3c6-46fc-8c92-8709f89617fd.png "Octosuite' about window")
![2023-01-23_01-01](https://user-images.githubusercontent.com/74001397/213950701-44b3f98b-89e1-443a-abb5-1be8969b611f.png "Octosuite about")
![octosuite_gui_exe (4)](https://user-images.githubusercontent.com/74001397/186889897-c1c17fac-fddc-4967-9084-39cfe2d1307f.png "Octosuite user profile window")
![Screen Shot 2023-01-26 at 9 27 22 PM](https://user-images.githubusercontent.com/74001397/214932206-40ec42ba-4fe8-4115-b2dd-52c4d7be9b5c.png)
# Wiki
[Refer to the Wiki](https://github.com/bellingcat/octosuite/wiki) for installation instructions, in addition to all other documentation.
@@ -52,6 +52,7 @@ A framework for gathering open-source intelligence on GitHub users, repositories
- [x] All the above can be used with command-line arguments (PyPI Package only)
- [x] ...And more
## Note
> Octosuite automatically logs network and user activity of each session, the logs are saved by date and time in the .logs folder
@@ -59,6 +60,10 @@ A framework for gathering open-source intelligence on GitHub users, repositories
# License
![license](https://user-images.githubusercontent.com/74001397/137917929-2f2cdb0c-4d1d-4e4b-9f0d-e01589e027b5.png)
# Credits
* The code used for finding emails from usernames is taken from [Somdev Sangwan](https://github.com/s0md3v)'s [Zen](https://github.com/s0md3v/zen)
# Donations
If you like OctoSuite and would like to show support, you can Buy A Coffee for the developer using the button below

View File

@@ -4,7 +4,7 @@ from octosuite.config import red, white, green, reset, Tree
# banner.py
# This file holds the program's banner and version tag
version_tag = "3.0.1"
version_tag = "3.1.0"
def banner():
@@ -16,7 +16,7 @@ def banner():
| |.----.| |_.-----.| __|.--.--.|__| |_.-----.
| - || __|| _| _ ||__ || | || | _| -__|
|_______||____||____|_____||_______||_____||__|____|_____|
v{version_tag}#dev
v{version_tag}
{white}— Advanced Github {red}OSINT{white} Framework

View File

@@ -124,7 +124,7 @@ def usage():
def create_parser():
parser = argparse.ArgumentParser(description='OCTOSUITE: Advanced GitHub osint framework — by Richard Mwewa | https://about.me/rly0nheart', usage=usage())
parser.add_argument('-m', '--method', help='method', choices=['user_profile', 'user_repos', 'user_gists', 'user_orgs', 'user_events',
parser.add_argument('-m', '--method', help='method', choices=['user_email', 'user_profile', 'user_repos', 'user_gists', 'user_orgs', 'user_events',
'user_subscriptions', 'user_following', 'user_followers', 'user_follows',
'org_profile', 'org_repos', 'org_events', 'org_member',
'repo_profile', 'repo_contributors', 'repo_stargazers', 'repo_forks',

View File

@@ -67,6 +67,7 @@ def user_command():
user_cmd_table = Table(show_header=True, header_style=header_title)
user_cmd_table.add_column("Command", style="dim")
user_cmd_table.add_column("Description")
user_cmd_table.add_row("email", "Return a target's email")
user_cmd_table.add_row("profile", "Get a target's profile info")
user_cmd_table.add_row("gists", "Return a users's gists")
user_cmd_table.add_row("org", "Return organizations that a target belongs to/owns")

View File

@@ -1,5 +1,6 @@
#!usr/bin/python
import re
import os
import sys
import shutil
@@ -9,6 +10,7 @@ import requests
import platform
import subprocess
from datetime import datetime
from requests.auth import HTTPBasicAuth
from octosuite.banner import version_tag, banner
from octosuite.config import Tree, Text, Table, Prompt, Confirm, xprint, create_parser, args, red, white, green, yellow, header_title, reset
from octosuite.message_prefixes import ERROR, WARNING, PROMPT, POSITIVE, NEGATIVE, INFO # wondering why I name all the variables instead of just using the * wildcard?, because it's the pythonic way lol
@@ -29,7 +31,7 @@ if os.name == "nt":
try:
from pyreadline3 import Readline
except ImportError:
subprocess.run(['pip3', 'install', 'pyreadline3'])
subprocess.run(['pip3', 'install', 'pyreadline3'], shell=False)
readline = Readline()
else:
import readline
@@ -199,7 +201,7 @@ An advanced and lightning fast framework for gathering open-source intelligence
Whats new in v{version_tag}?
[{green}FIXED{reset}] Fixed a bug '[ERROR] An error occurred: can only concatenate str (not "NoneType") to str'
[{green}IMPROVED{reset}] Added a subcommand to the 'user' commands, that will be used to get a user's email 'user:email' (CLI only)
Read the wiki: https://github.com/bellingcat/octosuite/wiki
GitHub REST API documentation: https://docs.github.com/rest
@@ -207,6 +209,22 @@ GitHub REST API documentation: https://docs.github.com/rest
xprint(about_text)
def get_email_from_contributor(username, repo, contributor):
response = requests.get(f"https://github.com/{username}/{repo}/commits?author={contributor}",
auth=HTTPBasicAuth(username, '')).text
latest_commit = re.search(rf'href="/{username}/{repo}/commit/(.*?)"', response)
if latest_commit:
latest_commit = latest_commit.group(1)
else:
latest_commit = 'dummy'
commit_details = requests.get(f"https://github.com/{username}/{repo}/commit/{latest_commit}.patch",
auth=HTTPBasicAuth(username, '')).text
email = re.search(r'<(.*)>', commit_details)
if email:
email = email.group(1)
return email
class Octosuite:
def __init__(self):
# API endpoint
@@ -243,6 +261,7 @@ class Octosuite:
("repo:issues", self.repo_issues),
("repo:releases", self.repo_releases),
("user", user),
("user:email", self.get_user_email),
("user:repos", self.user_repos),
("user:gists", self.user_gists),
("user:orgs", self.user_orgs),
@@ -271,6 +290,7 @@ class Octosuite:
# Arguments map will be used to run Octosuite with argparse
self.argument_map = [("user_profile", self.user_profile),
("user_email", self.get_user_email),
("user_repos", self.user_repos),
("user_gists", self.user_gists),
("user_orgs", self.user_orgs),
@@ -510,6 +530,28 @@ class Octosuite:
'About.me': 'https://about.me/rly0nheart',
'Buy Me A Coffee': 'https://buymeacoffee.com/189381184'}
def get_repos_from_username(self, username):
response = requests.get(f"{self.endpoint}/users/{username}/repos?per_page=100&sort=pushed",
auth=HTTPBasicAuth(username, '')).text
repositories = re.findall(rf'"full_name":"{username}/(.*?)",.*?"fork":(.*?),', response)
unforked_repos = []
for repository in repositories:
if repository[1] == 'false':
unforked_repos.append(repository[0])
return unforked_repos
def get_user_email(self):
if args.username:
username = args.username
else:
username = Prompt.ask(f"{white}@{green}Username{reset}")
repos = self.get_repos_from_username(username)
for repo in repos:
email = get_email_from_contributor(username, repo, username)
if email:
xprint(f"{username}: {email}")
break
# Fetching organization info
def org_profile(self):
if args.organization:
@@ -769,8 +811,8 @@ class Octosuite:
events_tree = Tree("\n" + event['id'])
events_tree.add(f"Type: {event['type']}")
events_tree.add(f"Created at: {event['created_at']}")
xprint(events_tree)
xprint(event['payload'])
xprint(events_tree)
xprint(event['payload'])
# log_org_events(event, organization)
else:
xprint(response.json())

View File

@@ -5,7 +5,7 @@ with open("README.md", "r", encoding="utf-8") as file:
setuptools.setup(
name="octosuite",
version="3.0.2",
version="3.1.0",
author="Richard Mwewa",
author_email="rly0nheart@duck.com",
packages=["octosuite"],