Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i74/task - Several changes related to installation fixes and instructions #86

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
42 changes: 27 additions & 15 deletions init_repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,37 +8,49 @@ def log(message: str) -> None:


def check_python_version() -> bool:
"""
Check if the current Python version is between 3.6 and 3.8 inclusive.
"""
version_info = sys.version_info
if version_info.major != 3:
return False
if version_info.minor < 6 or version_info.minor > 8:
return False

return True


def find_python() -> str:
"""
Get the path of the currently running Python executable.
"""
return sys.executable


def main() -> None:
if check_python_version():
log("Creating virtual environment")
subprocess.run("python -m venv .venv") # nosec
if not check_python_version():
log("Error: Supported Python versions are between 3.6 and 3.8.")
log(f"Detected Python version: {sys.version_info.major}.{sys.version_info.minor}.{sys.version_info.micro}")
sys.exit(1)

log("Installing python packages")
py_path = os.path.join(".venv", "Scripts", "python")
python_executable = find_python()
log(f"Using Python executable: {python_executable}")

if not sys.platform.startswith("win"):
py_path = os.path.join(".venv", "bin", "python")
log("Creating virtual environment")
subprocess.run(f"{python_executable} -m venv .venv", shell=True) # nosec

subprocess.run(f"{py_path} -m pip install --upgrade pip", shell=True) # nosec
log("Installing Python packages")
py_path = os.path.join(".venv", "bin", "python")

# install packages
subprocess.run(f"{py_path} -m pip install -r requirements.txt", shell=True) # nosec
if sys.platform.startswith("win"):
py_path = os.path.join(".venv", "Scripts", "python")

log("Python packages installed successfully")
subprocess.run(f"{py_path} -m pip install --upgrade pip", shell=True) # nosec

log("DONE!")
# Install packages from requirements.txt
subprocess.run(f"{py_path} -m pip install -r requirements.txt", shell=True) # nosec

else:
log("Supported python versions are 3.6-3.8")
log("Python packages installed successfully")
log("DONE!")


if __name__ == "__main__":
Expand Down
27 changes: 17 additions & 10 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
<br>
<br>
<a href="https://www.zenity.io">
<img src="/zenity_logo.svg"/>
<img src="/zenity_logo.png"/>
</a>
<p>
<p>git
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should probably not be here

Empower your business, not the adversaries.
</p>
</p>
Expand Down Expand Up @@ -40,22 +40,22 @@ An review of the tool's basic modules is available here:
- [CopilotM365](https://github.com/mbrg/power-pwn/wiki/Modules:-Copilot-Connector-and-Automator)

## Quick Guide for Developers
Clone the repository and setup a virtual environment in your IDE. Install python packages by running:
1. Clone the repository and setup a virtual environment in your IDE. Install python packages by running:

```
python init_repo.py
python init_repo.py
```
To activate the virtual environment (.venv) run:
2. If not active already, run the folloeing to activate the virtual environment (.venv):
```
.\.venv\Scripts\activate (Windows)
.\.venv\Scripts\activate (Windows)

./.venv/bin/activate (Linux)
source .venv/bin/activate (Linux & MacOS)
```

Run:
3. Verify all dependencies are installed:

```
pip install .
pip install .
```

**Notes**:
Expand All @@ -68,5 +68,12 @@ pip install .
4. When pushing PR, you can run `black -C -l 150 {file to path}` to fix any formatting issues related to _black_.

# Usage
## Quick Start
1. For quickly getting started with scanning your tenant, please check the [powerdump](https://github.com/mbrg/power-pwn/wiki/Modules:-PowerDump) module here.
2. Please check out the relevant [Wiki](https://github.com/mbrg/power-pwn/wiki) page for each module for further information.
2. For testing your M365 Copilot for retrieval of internal information (e.g., via a compromised user), please check the C365 modules:
* [whoami](https://github.com/mbrg/power-pwn/wiki/Modules:-Copilot-M365-%E2%80%90-Whoami)
* [C365 dump](https://github.com/mbrg/power-pwn/wiki/Modules:-Copilot-M365-%E2%80%90-Dump)
3. For testing misconfigured Copilot Studio bots available to unauthenticated users please check the Copilot Hunter _deep-scan_ module [here](https://github.com/mbrg/power-pwn/wiki/Modules:-Copilot-Studio-Hunter-%E2%80%90-Deep-Scan).
4. To test misconfigured Power Pages which could allow for Dataverse tables to be leak, please check the [powerpages](https://github.com/mbrg/power-pwn/wiki/Modules:-Power-Pages) module.

Please review the [Wiki](https://github.com/mbrg/power-pwn/wiki) for a full module list and detailed usage.
Empty file.
Binary file added zenity_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion zenity_logo.svg

This file was deleted.

Loading