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
Empty file removed GraphSpy/__init__.py
Empty file.
1 change: 0 additions & 1 deletion GraphSpy/version.txt

This file was deleted.

17 changes: 17 additions & 0 deletions 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 / "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 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 graphspy import cli

if __name__ == "__main__":
sys.exit(cli.main())
9 changes: 3 additions & 6 deletions GraphSpy/GraphSpy.py → graphspy/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
import re
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 graphspy import __version__

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

Expand Down Expand Up @@ -1939,7 +1939,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 @@ -2001,6 +2001,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.
File renamed without changes.
660 changes: 660 additions & 0 deletions poetry.lock

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions poetry.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[virtualenvs]
create = true
in-project = true
always-copy = false
system-site-packages = true
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 = ["poetry-core>=2.1.1,<3.0.0"]
build-backend = "poetry.core.masonry.api"

[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'