mirror of
https://github.com/bellingcat/octosuite.git
synced 2026-06-10 20:38:34 +03:00
Compare commits
28 Commits
1.5.2-alph
...
1.9.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
77ddfa4b02 | ||
|
|
66192c2a63 | ||
|
|
f591764343 | ||
|
|
f6dbd8ec49 | ||
|
|
99deaf04f3 | ||
|
|
56eead2f26 | ||
|
|
73e7c339e6 | ||
|
|
3cd6442d91 | ||
|
|
7ebb90790a | ||
|
|
ca0d2dc268 | ||
|
|
51babb3c45 | ||
|
|
12e9dbcae9 | ||
|
|
be4e88d99b | ||
|
|
f7ac0fb8d5 | ||
|
|
fc7a65c593 | ||
|
|
51f2a46c65 | ||
|
|
4afbc5adaa | ||
|
|
d7980c0726 | ||
|
|
f8221d8f58 | ||
|
|
9d86c4cc7b | ||
|
|
67db855322 | ||
|
|
1b5cfa2ebf | ||
|
|
0d2a939388 | ||
|
|
52c572f255 | ||
|
|
eeda47723e | ||
|
|
1a6e3bb3c9 | ||
|
|
82b6a3fd3c | ||
|
|
c994678fa1 |
105
README.md
105
README.md
@@ -1,17 +1,22 @@
|
||||

|
||||

|
||||
|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||
|
||||
> *Simply gather OSINT on Github users & organizations like a God🔥*
|
||||
|
||||
# INSTALLATION
|
||||
Installation instructions are on the wiki, in addition to all other documentation.
|
||||
|
||||
[Refer to the Wiki](https://github.com/rly0nheart/octosuite/wiki)
|
||||
|
||||
***
|
||||
# FEATURES
|
||||
- [x] Fetches organization info
|
||||
- [x] Fetches user info
|
||||
@@ -29,78 +34,9 @@
|
||||
- [x] Searches commits
|
||||
- [x] Easily updates with the 'update' command
|
||||
- [x] Automatically logs network activity (.logs folder)
|
||||
- [x] User can view, read and delete log files
|
||||
|
||||
# INSTALLATION
|
||||
## Clone from Github
|
||||
|
||||
```
|
||||
git clone https://github.com/rly0nheart/octosuite.git
|
||||
```
|
||||

|
||||
|
||||
|
||||
```
|
||||
cd octosuite
|
||||
```
|
||||

|
||||
|
||||
|
||||
```
|
||||
pip install -r requirements.txt
|
||||
```
|
||||

|
||||
|
||||
|
||||
|
||||
## Install from PyPI
|
||||
```
|
||||
pip install octosuite
|
||||
```
|
||||

|
||||
|
||||
|
||||
# GITHUB FORK USAGE
|
||||
## Linux
|
||||
```
|
||||
sudo chmod +x octosuite
|
||||
```
|
||||

|
||||
|
||||
|
||||
```
|
||||
sudo ./octosuite
|
||||
```
|
||||

|
||||
|
||||
|
||||
|
||||
|
||||
## Windows
|
||||
```
|
||||
python3 octosuite
|
||||
```
|
||||
|
||||
## Mac
|
||||
```
|
||||
python3 octosuite
|
||||
```
|
||||
|
||||
# PYPI PACKAGE USAGE
|
||||
## Linux
|
||||
```
|
||||
octosuite
|
||||
```
|
||||
|
||||
## Windows
|
||||
```
|
||||
octosuite
|
||||
```
|
||||
|
||||
## Mac
|
||||
```
|
||||
octosuite
|
||||
```
|
||||
|
||||
***
|
||||
# AVAILABLE COMMANDS
|
||||
| COMMAND | DESCRIPTION|
|
||||
| ------------- |:---------:|
|
||||
@@ -119,21 +55,36 @@ octosuite
|
||||
| ``search:topics`` | *search topics(s)* |
|
||||
| ``search:issues`` | *search issue(s)* |
|
||||
| ``search:commits`` | *search commit(s)* |
|
||||
| ``logs:view`` | *view octosuite log files* |
|
||||
| ``logs:read`` | *read a specified log file* |
|
||||
| ``logs:delete`` | *delete a specified log file* |
|
||||
| ``update`` | *update octosuite* |
|
||||
| ``changelog`` | *show changelog* |
|
||||
| ``help`` | *show usage/help* |
|
||||
| ``exit`` | *exit session* |
|
||||
|
||||
|
||||
# NOTE
|
||||
***
|
||||
# NOTES
|
||||
* *octosuite automatically logs network and minor user activity. The logs are saved by date and time in .logs folder*
|
||||
* *Although octosuite was developed to work on **Mac**, **Windows**, or any **Linux** *Distribution*, it has only been tested on **Termux** *and* **Kali Linux***
|
||||
* *If you believe octosuite can be better, feel free to open a pull request with your improvements* ✌🏾🙂
|
||||
|
||||
***
|
||||
# PYPI
|
||||
[PyPI](https://pypi.org/project/octosuite)
|
||||
[PyPI Package](https://pypi.org/project/octosuite)
|
||||
|
||||

|
||||
|
||||
***
|
||||
# LICENSE
|
||||

|
||||
|
||||
***
|
||||
# ABOUT DEVELOPER
|
||||
[About.me](https://about.me/rly0nheart)
|
||||
|
||||
***
|
||||
# DONATIONS
|
||||
Love octosuite? Please consider buying me a coffee, I will appreciate really it. ☕👌🏾😊
|
||||
|
||||
<a href="https://www.buymeacoffee.com/189381184" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/default-orange.png" alt="Buy Me A Coffee" height="41" width="174"></a>
|
||||
|
||||
@@ -1,23 +1,25 @@
|
||||
import os
|
||||
from lib.colors import red,white,white_bg,red_bg,reset
|
||||
from lib.colors import red, white, green, red_bg,reset
|
||||
|
||||
version = 'v1.9.0'
|
||||
banner = f'''{red}
|
||||
▒█████ ▄████▄ ▄▄▄█████▓ ▒█████ ██████ █ ██ ██▓▄▄▄█████▓▓█████
|
||||
▒██▒ ██▒▒██▀ ▀█ ▓ ██▒ ▓▒▒██▒ ██▒▒██ ▒ ██ ▓██▒▓██▒▓ ██▒ ▓▒▓█ ▀
|
||||
▒██░ ██▒▒▓█ ▄ ▒ ▓██░ ▒░▒██░ ██▒░ ▓██▄ ▓██ ▒██░▒██▒▒ ▓██░ ▒░▒███
|
||||
▒██ ██░▒▓▓▄ ▄██▒░ ▓██▓ ░ ▒██ ██░ ▒ ██▒▓▓█ ░██░░██░░ ▓██▓ ░ ▒▓█ ▄
|
||||
░ ████▓▒░▒ ▓███▀ ░ ▒██▒ ░ ░ ████▓▒░▒██████▒▒▒█████▓ ░██░ ▒██▒ ░ ░▒████▒
|
||||
░ ▒░▒░▒░ ░ ░▒ ▒ ░ ▒ ░░ ░ ▒░▒░▒░ ▒ ▒▓▒ ▒ ░░▒▓▒ ▒ ▒ ░▓ ▒ ░░ ░░ ▒░ ░
|
||||
░ ▒ ▒░ ░ ▒ ░ ░ ▒ ▒░ ░ ░▒ ░ ░░░▒░ ░ ░ ▒ ░ ░ ░ ░ ░
|
||||
░ ░ ░ ▒ ░ ░ ░ ░ ░ ▒ ░ ░ ░ ░░░ ░ ░ ▒ {red_bg}v1.5.2-alpha{reset}{red}
|
||||
░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░
|
||||
░ {white}— Advanced Github {red}OSINT{white} Framework{reset}
|
||||
▒█████ ▄████▄ ▄▄▄█████▓ ▒█████ ██████ █ ██ ██▓▄▄▄█████▓▓█████
|
||||
▒██▒ ██▒▒██▀ ▀█ ▓ ██▒ ▓▒▒██▒ ██▒▒██ ▒ ██ ▓██▒▓██▒▓ ██▒ ▓▒▓█ ▀
|
||||
▒██░ ██▒▒▓█ ▄ ▒ ▓██░ ▒░▒██░ ██▒░ ▓██▄ ▓██ ▒██░▒██▒▒ ▓██░ ▒░▒███
|
||||
▒██ ██░▒▓▓▄ ▄██▒░ ▓██▓ ░ ▒██ ██░ ▒ ██▒▓▓█ ░██░░██░░ ▓██▓ ░ ▒▓█ ▄
|
||||
░ ████▓▒░▒ ▓███▀ ░ ▒██▒ ░ ░ ████▓▒░▒██████▒▒▒█████▓ ░██░ ▒██▒ ░ ░▒████▒
|
||||
░ ▒░▒░▒░ ░ ░▒ ▒ ░ ▒ ░░ ░ ▒░▒░▒░ ▒ ▒▓▒ ▒ ░░▒▓▒ ▒ ▒ ░▓ ▒ ░░ ░░ ▒░ ░
|
||||
░ ▒ ▒░ ░ ▒ ░ ░ ▒ ▒░ ░ ░▒ ░ ░░░▒░ ░ ░ ▒ ░ ░ ░ ░ ░
|
||||
░ ░ ░ ▒ ░ ░ ░ ░ ░ ▒ ░ ░ ░ ░░░ ░ ░ ▒ {red_bg} {version} {reset}{red}
|
||||
░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░
|
||||
░ {white}— Advanced Github {red}OSINT{white} Framework{reset}
|
||||
|
||||
|
||||
|
||||
> {white}Current user: {white_bg}{os.getlogin()}{reset}
|
||||
> {white}Use {white_bg}help{reset}{white} command for usage{reset}
|
||||
> {white}Commands are {white_bg}case sensitive{reset}
|
||||
{'-'*30}
|
||||
> {white}Current user: {green}{os.getlogin()}{reset}
|
||||
> {white}Use {green}help{reset}{white} command for usage{reset}
|
||||
> {white}Commands are case sensitive{reset}
|
||||
{'-'*27}
|
||||
|
||||
|
||||
'''
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import os
|
||||
import sys
|
||||
import platform
|
||||
from datetime import datetime
|
||||
|
||||
colors = True
|
||||
machine = sys.platform
|
||||
@@ -8,21 +10,42 @@ if machine.lower().startswith(("os", "win", "darwin","ios")):
|
||||
colors = False
|
||||
|
||||
if not colors:
|
||||
reset = red = white = green = green_bg = white_bg = red_bg = ""
|
||||
reset = red = white = green = red_bg = ""
|
||||
|
||||
else:
|
||||
try:
|
||||
color_chooser = input(f"[ ? ] Welcome {os.getlogin()}, would you like to enable colors for this session? [Y/n] ")
|
||||
if color_chooser.lower() == "y":
|
||||
white = "\033[97m"
|
||||
white_bg = "\033[47;30m"
|
||||
red = "\033[91m"
|
||||
reset = "\033[0m"
|
||||
green = "\033[92m"
|
||||
green_bg = "\033[42;37m"
|
||||
red_bg = "\033[41;37m"
|
||||
else:
|
||||
red = white = green = green_bg = white_bg = red_bg = reset = ""
|
||||
|
||||
except KeyboardInterrupt:
|
||||
exit(f"[ ! ] Process interrupted with Ctrl+C")
|
||||
date_time = datetime.now()
|
||||
sys_info = [("Processor",platform.processor),
|
||||
("Node", platform.node),
|
||||
("Release", platform.release),
|
||||
("Architecture", platform.architecture),
|
||||
("Version", platform.version)]
|
||||
|
||||
banner = f"""
|
||||
OCTOSUITE © 2022 Richard Mwewa
|
||||
{date_time.strftime('%A %d %B %Y, %H:%M:%S%p')}
|
||||
|
||||
|
||||
{platform.system()}"""
|
||||
|
||||
print(banner)
|
||||
for key, value in sys_info:
|
||||
print(f"\t├─ {key}: {value()}")
|
||||
print("\n")
|
||||
while True:
|
||||
try:
|
||||
color_chooser = input(f"[ ? ] Welcome {os.getlogin()}, would you like to enable colors for this session? (y/n) ")
|
||||
if color_chooser.lower() == "y":
|
||||
white = "\033[97m"
|
||||
red = "\033[91m"
|
||||
reset = "\033[0m"
|
||||
green = "\033[92m"
|
||||
red_bg = "\033[41;37m"
|
||||
break
|
||||
elif color_chooser.lower() == "n":
|
||||
red = white = green = red_bg = reset = ""
|
||||
break
|
||||
else:
|
||||
print(f"\n[ ! ] Your response ({color_chooser}) is invalid (expected y or n)")
|
||||
|
||||
except KeyboardInterrupt:
|
||||
exit(f"[ ! ] Process interrupted with (Ctrl+C)")
|
||||
|
||||
@@ -2,16 +2,16 @@
|
||||
|
||||
import logging
|
||||
from src.main import *
|
||||
from lib.colors import red,red_bg,white,reset
|
||||
from lib.colors import red,white,reset
|
||||
|
||||
if __name__ == '__main__':
|
||||
try:
|
||||
octosuite().on_start()
|
||||
|
||||
except KeyboardInterrupt:
|
||||
logging.warning('Process interrupted with Ctrl+C')
|
||||
exit(f'\n{white}[{red} x {white}] Process interrupted with {red_bg}Ctrl+C{reset}')
|
||||
logging.warning('Session terminated with (Ctrl+C)')
|
||||
exit(f'\n{white}[{red} x {white}] Session terminated with ({red}Ctrl{white}+{red}C{reset}{white}).{reset}')
|
||||
|
||||
except Exception as e:
|
||||
logging.error(f'Session terminated on error: {e}')
|
||||
exit(f'\n{white}[{red} ! {white}] Session {red_bg}terminated{reset}{white} on error: {red}{e}{reset}')
|
||||
exit(f'\n{white}[{red} ! {white}] Session terminated on error: {red}{e}{reset}')
|
||||
|
||||
147
src/main.py
147
src/main.py
@@ -14,15 +14,16 @@
|
||||
'''
|
||||
|
||||
import os
|
||||
import sys
|
||||
import logging
|
||||
import requests
|
||||
import platform
|
||||
import subprocess
|
||||
from tqdm import tqdm
|
||||
from pprint import pprint
|
||||
from lib.banner import banner
|
||||
from datetime import datetime
|
||||
from lib.colors import red, white, green, green_bg, white_bg, red_bg, reset
|
||||
from lib.banner import banner, version
|
||||
from lib.colors import red, white, green, red_bg, reset
|
||||
|
||||
class octosuite:
|
||||
def __init__(self):
|
||||
@@ -41,6 +42,9 @@ class octosuite:
|
||||
('search:topics', self.topic_search),
|
||||
('search:issues', self.issue_search),
|
||||
('search:commits', self.commits_search),
|
||||
('logs:view',self.view_logs),
|
||||
('logs:read',self.read_log),
|
||||
('logs:delete',self.delete_log),
|
||||
('update', self.update),
|
||||
('changelog', self.changelog),
|
||||
('info:dev', self.author),
|
||||
@@ -196,7 +200,8 @@ class octosuite:
|
||||
# Author dictionary
|
||||
self.author_dict = {'Alias': 'rly0nheart',
|
||||
'Country': 'Zambia, Africa',
|
||||
'About.me': 'https://about.me/rly0nheart'}
|
||||
'About.me': 'https://about.me/rly0nheart',
|
||||
'BuyMeACoffee': 'https://buymeacoffee.com/189381184'}
|
||||
|
||||
|
||||
def on_start(self):
|
||||
@@ -206,13 +211,13 @@ class octosuite:
|
||||
# Use 'cls' to clear screen on Windows based machines
|
||||
# Otherwise, use 'clear'
|
||||
while True:
|
||||
if platform.system().lower().startswith(('win','darwin')):
|
||||
if sys.platform.lower().startswith(('win','darwin')):
|
||||
subprocess.run(['cls'])
|
||||
else:
|
||||
subprocess.run(['clear'],shell=False)
|
||||
|
||||
print(banner)
|
||||
command_input = input(f'''{white}┌───({red}{os.getlogin()}{white}@{red}octosuite{white})-[{green}{os.getcwd()}{white}]\n└─╼[{green}:~{white}]{reset} ''')
|
||||
command_input = input(f'''{white}┌──({red}{os.getlogin()}{white}@{red}octosuite{white})-[{green}{os.getcwd()}{white}]\n└╼[{green}:~{white}]{reset} ''')
|
||||
# Looping through the commands base to check if the user input command matches any command in the commands base, and return its functionality
|
||||
# If no match is found, we ignore it
|
||||
for command, functionality in self.commands_base:
|
||||
@@ -221,15 +226,15 @@ class octosuite:
|
||||
else:
|
||||
pass
|
||||
|
||||
input(f'\n{white}[{green} ? {white}] Press {white_bg}any key{reset}{white} to continue{reset} ')
|
||||
|
||||
input(f'\n{white}[{green} ? {white}] Press any key to continue{reset} ')
|
||||
|
||||
# Fetching organization info
|
||||
def org_info(self):
|
||||
organization = input(f'\n{white}[{white_bg}@Organization{reset}{white}] (username){reset} ')
|
||||
organization = input(f'\n{white}--> @{green}organization{white} (username){reset} ')
|
||||
api = f'https://api.github.com/orgs/{organization}'
|
||||
response = requests.get(api)
|
||||
if response.status_code != 200:
|
||||
print(f'\n{white}[{red}-{white}] Organization @{organization} {red_bg}Not Found{reset}')
|
||||
print(f'\n{white}[{red} - {white}] Organization ({organization}) not found.{reset}')
|
||||
else:
|
||||
response = response.json()
|
||||
print(f"\n{white}{response['name']}{reset}")
|
||||
@@ -239,11 +244,11 @@ class octosuite:
|
||||
|
||||
# Fetching user information
|
||||
def user_profile(self):
|
||||
username = input(f'\n{white}[{white_bg}@Username{reset}{white}]{reset} ')
|
||||
username = input(f'\n{white}--> @{green}username{reset} ')
|
||||
api = f'https://api.github.com/users/{username}'
|
||||
response = requests.get(api)
|
||||
if response.status_code != 200:
|
||||
print(f'\n{white}[{red} - {white}] User @{username} {red_bg}Not Found{reset}')
|
||||
print(f'\n{white}[{red} - {white}] User ({username}) not found.{reset}')
|
||||
else:
|
||||
response = response.json()
|
||||
print(f"\n{white}{response['name']}{reset}")
|
||||
@@ -253,12 +258,12 @@ class octosuite:
|
||||
|
||||
# Fetching repository information
|
||||
def repo_info(self):
|
||||
repo_name = input(f'\n{white}[{white_bg}%reponame{reset}{white}]{reset} ')
|
||||
username = input(f'{white}[{white_bg}@Owner{reset}{white}] (username){reset} ')
|
||||
repo_name = input(f'\n{white}--> %{green}reponame{reset} ')
|
||||
username = input(f'{white}--> @{green}owner{white} (username){reset} ')
|
||||
api = f'https://api.github.com/repos/{username}/{repo_name}'
|
||||
response = requests.get(api)
|
||||
if response.status_code != 200:
|
||||
print(f'\n{white}[{red} - {white}] Repository %{repo_name} or user @{username} {red_bg}Not Found{reset}')
|
||||
print(f'\n{white}[{red} - {white}] Repository ({repo_name}) or user ({username}) not found.{reset}')
|
||||
else:
|
||||
response = response.json()
|
||||
print(f"\n{white}{response['full_name']}{reset}")
|
||||
@@ -268,13 +273,13 @@ class octosuite:
|
||||
|
||||
# Get path contents
|
||||
def path_contents(self):
|
||||
username = input(f'\n{white}[{white_bg}@Owner{reset}{white}] (username){reset} ')
|
||||
repo_name = input(f'{white}[{white_bg}%reponame{reset}{white}]{reset} ')
|
||||
path_name = input(f'{white}[{white_bg}/path/name{reset}{white}]{reset} ')
|
||||
repo_name = input(f'\n{white}--> %{green}reponame{reset} ')
|
||||
username = input(f'{white}--> @{green}owner{white} (username){reset} ')
|
||||
path_name = input(f'{white}--> ~{green}/path/name{reset} ')
|
||||
api = f'https://api.github.com/repos/{username}/{repo_name}/contents/{path_name}'
|
||||
response = requests.get(api)
|
||||
if response.status_code != 200:
|
||||
print(f'\n{white}[{red} - {white}] Information {red_bg}Not Found{reset}')
|
||||
print(f'\n{white}[{red} - {white}] Information not found.{reset}')
|
||||
else:
|
||||
response = response.json()
|
||||
for item in response:
|
||||
@@ -283,13 +288,13 @@ class octosuite:
|
||||
print(f'{white}├─ {self.path_attr_dict[attr]}: {green}{item[attr]}{reset}')
|
||||
|
||||
|
||||
# Fetching organozation repositories
|
||||
# Fetching organization repositories
|
||||
def org_repos(self):
|
||||
organization = input(f'\n{white}[{white_bg}@Organization{reset}{white}] (username){reset} ')
|
||||
organization = input(f'\n{white}--> @{green}organization{white} (username){reset} ')
|
||||
api = f'https://api.github.com/orgs/{organization}/repos?per_page=100'
|
||||
response = requests.get(api)
|
||||
if response.status_code != 200:
|
||||
print(f'\n{white}[{red} - {white}] Organization @{organization} {red_bg}Not Found{reset}')
|
||||
print(f'\n{white}[{red} - {white}] Organization ({organization}) not found.{reset}')
|
||||
else:
|
||||
response = response.json()
|
||||
for repo in response:
|
||||
@@ -301,11 +306,11 @@ class octosuite:
|
||||
|
||||
# Fetching user repositories
|
||||
def user_repos(self):
|
||||
username = input(f'\n{white}[{white_bg}@Username{reset}{white}]{reset} ')
|
||||
username = input(f'\n{white}--> @{green}username{reset} ')
|
||||
api = f'https://api.github.com/users/{username}/repos?per_page=100'
|
||||
response = requests.get(api)
|
||||
if response.status_code != 200:
|
||||
print(f'\n{white}[{red} - {white}] User @{username} {red_bg}Not Found{reset}')
|
||||
print(f'\n{white}[{red} - {white}] User ({username}) not found.{reset}')
|
||||
else:
|
||||
response = response.json()
|
||||
for repo in response:
|
||||
@@ -317,13 +322,13 @@ class octosuite:
|
||||
|
||||
# Fetching user's gists
|
||||
def user_gists(self):
|
||||
username = input(f'\n{white}[{white_bg}@Username{reset}{white}]{reset} ')
|
||||
username = input(f'\n{white}--> @{green}username{reset} ')
|
||||
api = f'https://api.github.com/users/{username}/gists'
|
||||
response = requests.get(api).json()
|
||||
if response == []:
|
||||
print(f'\n{white}[{red} - {white}] User @{username} {red_bg}does not{reset}{white} have any active gists.{reset}')
|
||||
elif "Not Found" in response['message']:
|
||||
print(f'\n{white}[{red} - {white}] User @{username} {red_bg}Not Found{reset}')
|
||||
print(f'\n{white}[{red} - {white}] User ({username}) does not have any active gists.{reset}')
|
||||
elif "not found" in response['message']:
|
||||
print(f'\n{white}[{red} - {white}] User ({username}) not found.{reset}')
|
||||
else:
|
||||
for item in response:
|
||||
print(f"\n{white}{item['id']}{reset}")
|
||||
@@ -334,13 +339,13 @@ class octosuite:
|
||||
|
||||
# Fetching user's followera'
|
||||
def followers(self):
|
||||
username = input(f'\n{white}[{white_bg}@Username{reset}{white}]{reset} ')
|
||||
username = input(f'\n{white}--> @{green}username{reset} ')
|
||||
api = f'https://api.github.com/users/{username}/followers?per_page=100'
|
||||
response = requests.get(api).json()
|
||||
if response == []:
|
||||
print(f'\n{white}[{red} - {white}]User @{username} {red_bg}does not{reset}{white} have followers.{reset}')
|
||||
elif "Not Found" in response['message']:
|
||||
print(f'\n{white}[{red} - {white}] User @{username} {red_bg}Not Found{reset}')
|
||||
print(f'\n{white}[{red} - {white}]User ({username}) does not have followers.{reset}')
|
||||
elif "not found" in response['message']:
|
||||
print(f'\n{white}[{red} - {white}] User ({username}) not found.{reset}')
|
||||
else:
|
||||
for item in response:
|
||||
print(f"\n{white}@{item['login']}{reset}")
|
||||
@@ -351,19 +356,19 @@ class octosuite:
|
||||
|
||||
# Checking whether or not user[A] follows user[B]
|
||||
def following(self):
|
||||
user_a = input(f'\n{white}[{white_bg}@User A{reset}{white}] (username){reset} ')
|
||||
user_b = input(f'{white}[{white_bg}@User B{reset}{white}] (username){reset} ')
|
||||
user_a = input(f'\n{white}--> @{green}user{white}[A] (username){reset} ')
|
||||
user_b = input(f'{white}--> @{green}user{white}[B] (username){reset} ')
|
||||
api = f'https://api.github.com/users/{user_a}/following/{user_b}'
|
||||
response = requests.get(api)
|
||||
if response.status_code == 204:
|
||||
print(f'\n{white}[{green} + {white}] @{user_a} {green_bg}follows{reset}{white} @{user_b}.{reset}')
|
||||
print(f'\n{white}[{green} + {white}] @{user_a} follows @{user_b}.{reset}')
|
||||
else:
|
||||
print(f'\n{white}[{red} - {white}] @{user_a} {red_bg}does not{reset}{white} follow @{user_b}.{reset}')
|
||||
print(f'\n{white}[{red} - {white}] @{user_a} does not follow @{user_b}.{reset}')
|
||||
|
||||
|
||||
# User search
|
||||
def user_search(self):
|
||||
query = input(f'\n{white}[{white_bg}#@Query{reset}{white}]{reset} ')
|
||||
query = input(f'\n{white}--> @{green}query{white} (eg. john){reset} ')
|
||||
api = f'https://api.github.com/search/users?q={query}&per_page=100'
|
||||
response = requests.get(api).json()
|
||||
for item in response['items']:
|
||||
@@ -375,7 +380,7 @@ class octosuite:
|
||||
|
||||
# Repository search
|
||||
def repo_search(self):
|
||||
query = input(f'\n{white}[{white_bg}#%Query{reset}{white}]{reset} ')
|
||||
query = input(f'\n{white}--> %{green}query{white} (eg. git){reset} ')
|
||||
api = f'https://api.github.com/search/repositories?q={query}&per_page=100'
|
||||
response = requests.get(api).json()
|
||||
for item in response['items']:
|
||||
@@ -387,7 +392,7 @@ class octosuite:
|
||||
|
||||
# Topics search
|
||||
def topic_search(self):
|
||||
query = input(f'\n{white}[{white_bg}##Query{reset}{white}]{reset} ')
|
||||
query = input(f'\n{white}--> #{green}query{white} (eg. osint){reset} ')
|
||||
api = f'https://api.github.com/search/topics?q={query}&per_page=100'
|
||||
response = requests.get(api).json()
|
||||
for item in response['items']:
|
||||
@@ -399,7 +404,7 @@ class octosuite:
|
||||
|
||||
# Issue search
|
||||
def issue_search(self):
|
||||
query = input(f'\n{white}[{white_bg}#!Query{reset}{white}]{reset} ')
|
||||
query = input(f'\n{white}--> !{green}query{white} (eg. error){reset} ')
|
||||
api = f'https://api.github.com/search/issues?q={query}&per_page=100'
|
||||
response = requests.get(api).json()
|
||||
for item in response['items']:
|
||||
@@ -411,15 +416,44 @@ class octosuite:
|
||||
|
||||
# Commits search
|
||||
def commits_search(self):
|
||||
query = input(f'\n{white}[{white_bg}#:Query{reset}{white}]{reset} ')
|
||||
query = input(f'\n{white}--> :{green}query{white} (eg. filename:index.php){reset} ')
|
||||
api = f'https://api.github.com/search/commits?q={query}&per_page=100'
|
||||
response = requests.get(api).json()
|
||||
number=0
|
||||
for item in response['items']:
|
||||
number+=1
|
||||
print(f'{white}{number}.{reset}')
|
||||
print(f'\n{white}-> {number}.{reset}')
|
||||
pprint(item['commit'])
|
||||
print('\n')
|
||||
|
||||
|
||||
# View octosuite log files
|
||||
def view_logs(self):
|
||||
logs = os.listdir('.logs')
|
||||
print(f"\n {red_bg}[LOG] [SIZE] {reset}")
|
||||
for log in logs:
|
||||
print(f" {log}\t ",os.path.getsize(".logs/"+log),"bytes")
|
||||
print(f" {red_bg} {reset}")
|
||||
|
||||
|
||||
# Delete a specified log file
|
||||
def delete_log(self):
|
||||
log_file = input(f"\n{white}--> logfile (eg. 2022-04-27 10:09:36.068312.log){reset} ")
|
||||
if sys.platform.lower().startswith(('win','darwin')):
|
||||
subprocess.run(['del',f'{os.getcwd()}/.logs/{log_file}'])
|
||||
else:
|
||||
subprocess.run(['sudo','rm',f'.logs/{log_file}'],shell=False)
|
||||
|
||||
logging.info(f'Deleted log file: {log_file}')
|
||||
print(f"{white}[{green} + {white}] Deleted log file: {green}{log_file}{reset}")
|
||||
|
||||
|
||||
# Read a specified log file
|
||||
def read_log(self):
|
||||
log_file = input(f"\n{white}--> logfile (eg. 2022-04-27 10:09:36.068312.log){reset} ")
|
||||
with open(f'.logs/{log_file}', 'r') as log:
|
||||
logging.info(f'Reading log file: {log_file}')
|
||||
print("\n"+log.read())
|
||||
|
||||
|
||||
# Update program
|
||||
@@ -433,7 +467,7 @@ class octosuite:
|
||||
code.close()
|
||||
|
||||
logging.info('Update complete.')
|
||||
exit(f'{white}[{green} + {white}] {green_bg}Updated{reset}{white} successfully. Re-run octosuite.{reset}')
|
||||
exit(f'{white}[{green} + {white}] Update complete. Re-run octosuite.{reset}')
|
||||
|
||||
|
||||
# Show changelog
|
||||
@@ -441,14 +475,9 @@ class octosuite:
|
||||
# lol yes the changelog is hard coded
|
||||
changelog_text = f'''
|
||||
|
||||
{red_bg}v1.5.2-alpha [CHANGELOG]{reset}
|
||||
• Users will now get to choose whether to enable colors or not
|
||||
• Cleaned code
|
||||
• Improved perfomance
|
||||
• Will be ignoring unknown commands instead of printing the error
|
||||
• Major bug fixes
|
||||
{red_bg} {reset}
|
||||
'''
|
||||
{red_bg} {version} [CHANGELOG] {reset}
|
||||
• Minor bug fixes and improvements
|
||||
{red_bg} {reset}'''
|
||||
print(changelog_text)
|
||||
|
||||
|
||||
@@ -458,12 +487,14 @@ class octosuite:
|
||||
for key,value in self.author_dict.items():
|
||||
print(f'{white}├─ {key}: {green}{value}{reset}')
|
||||
|
||||
|
||||
|
||||
# Close session
|
||||
def exit_session(self):
|
||||
logging.info('Session closed with \'exit\' command.')
|
||||
exit(f'\n{white}[{green} ! {white}] Session closed with {white_bg}exit{reset}{white} command.{reset}')
|
||||
|
||||
logging.info('Session closed with (exit) command.')
|
||||
exit(f'\n{white}[{green} ! {white}] Session closed with ({green}exit{reset}{white}) command.{reset}')
|
||||
|
||||
|
||||
# Help/usage
|
||||
def help(self):
|
||||
help = f'''
|
||||
|
||||
@@ -483,12 +514,14 @@ class octosuite:
|
||||
search:topics Search topic(s)
|
||||
search:issues Search issue(s)
|
||||
search:commits Search commit(s)
|
||||
logs:view View log files
|
||||
logs:read Read a specified log file
|
||||
logs:delete Delete a specified log file
|
||||
update Update octosuite
|
||||
changelog Show changelog
|
||||
help Show usage/help
|
||||
exit Exit session
|
||||
{red_bg} {reset}
|
||||
'''
|
||||
{red_bg} {reset}'''
|
||||
print(help)
|
||||
|
||||
|
||||
@@ -500,7 +533,7 @@ else:
|
||||
# Creating the .logs directory
|
||||
# If the current system is Windows based, we run mkdir command without sudo
|
||||
# Else we run the mkdir command with sudo
|
||||
if platform.system().lower().startswith(('win','darwin')):
|
||||
if sys.platform.lower().startswith(('win','darwin')):
|
||||
subprocess.run(['mkdir','.logs'])
|
||||
else:
|
||||
subprocess.run(['sudo','mkdir','.logs'],shell=False)
|
||||
|
||||
Reference in New Issue
Block a user