Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
168 changes: 163 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,165 @@
./venv

# VSCode
.vscode/

# Byte-compiled / optimized / DLL files
__pycache__/
.vs/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
.vscode/
.cursor/
location.txt
*.code-workspace
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/#use-with-ide
.pdm.toml

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
Empty file removed GraphSpy/__init__.py
Empty file.
1 change: 0 additions & 1 deletion GraphSpy/version.txt

This file was deleted.

2 changes: 0 additions & 2 deletions MANIFEST.in

This file was deleted.

27 changes: 27 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[build-system]
requires = ["uv_build"]
build-backend = "uv_build"

[project]
name = "graphspy"
version = "1.5.1"
description = "Initial Access and Post-Exploitation Tool for AAD and O365 with a browser-based GUI."
authors = [
{name = "RedByte1337"}
]
license = {text = "BSD-3-Clause"}
readme = "README.md"
requires-python = ">=3.10,<4.0"
dependencies = [
"flask>=3.1.2,<4.0.0",
"pyjwt>=2.10.1,<3.0.0",
"requests>=2.32.5,<3.0.0",
"pyotp>=2.9.0,<3.0.0",
"fido2>=2.0.0,<3.0.0"
]

[project.urls]
repository = "https://github.com/RedByte1337/GraphSpy"

[project.scripts]
graphspy = 'graphspy.cli:main'
5 changes: 0 additions & 5 deletions requirements.txt

This file was deleted.

29 changes: 0 additions & 29 deletions setup.py

This file was deleted.

17 changes: 17 additions & 0 deletions src/graphspy/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from importlib.metadata import version, PackageNotFoundError
from pathlib import Path
import tomllib

try:
__version__ = version("graphspy")
except PackageNotFoundError:
# Fallback: read directly from pyproject.toml for development
try:
pyproject_path = Path(__file__).parent.parent.parent / "pyproject.toml"
with open(pyproject_path, "rb") as f:
pyproject_data = tomllib.load(f)
__version__ = pyproject_data["project"]["version"] + "-dev"
except (FileNotFoundError, KeyError):
__version__ = "unknown"

__all__ = ["__version__"]
9 changes: 9 additions & 0 deletions src/graphspy/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env python3

import sys

# Local library imports
from . import cli

if __name__ == "__main__":
sys.exit(cli.main())
40 changes: 25 additions & 15 deletions GraphSpy/GraphSpy.py → src/graphspy/cli.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,32 @@
#!/usr/bin/env python3
from flask import Flask,render_template,request,g,redirect,Response,jsonify
import flask.helpers
import requests
import jwt
# graphspy/cli.py

# Built-in imports
import os
import sys
import shutil
import traceback
import logging
import inspect
import sqlite3
from datetime import datetime, timezone
import time
import os,sys,shutil,traceback,logging,inspect
from threading import Thread
import json, base64, uuid, urllib.parse, binascii
import json
import base64
import uuid
import urllib.parse
import binascii
import re
from datetime import datetime, timezone
from threading import Thread

# External library imports
from flask import Flask, render_template, request, g, redirect, Response, jsonify
import flask.helpers
import requests
import jwt
import pyotp

with open(os.path.join(os.path.dirname(os.path.abspath(__file__)),"version.txt")) as f:
__version__ = f.read()
# Local library imports
from . import __version__

# ========== Database ==========

Expand Down Expand Up @@ -2758,7 +2771,7 @@ def main():
""")
# Argument Parser
import argparse
parser = argparse.ArgumentParser(prog="GraphSpy", description="Launches the GraphSpy Flask application", epilog="For more information, see https://github.com/RedByte1337/GraphSpy")
parser = argparse.ArgumentParser(prog="graphspy", description="Launches the GraphSpy Flask application", epilog="For more information, see https://github.com/RedByte1337/GraphSpy")
parser.add_argument("-i","--interface", type=str, help="The interface to bind to. Use 0.0.0.0 for all interfaces. (Default = 127.0.0.1)")
parser.add_argument("-p", "--port", type=int, help="The port to bind to. (Default = 5000)")
parser.add_argument("-d","--database", type=str, default="database.db", help="Database file to utilize. (Default = database.db)")
Expand Down Expand Up @@ -2820,6 +2833,3 @@ def main():
# Run flask
print(f"[*] Starting GraphSpy. Open in your browser by going to the url displayed below.\n")
app.run(debug=args.debug, host=args.interface, port=args.port)

if __name__ == '__main__':
main()
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading