Skip to content

Commit 6cbd059

Browse files
committed
Added all initial changes
1 parent 51b5190 commit 6cbd059

File tree

5 files changed

+44
-26
lines changed

5 files changed

+44
-26
lines changed

init_repo.py

Lines changed: 27 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,37 +8,49 @@ def log(message: str) -> None:
88

99

1010
def check_python_version() -> bool:
11+
"""
12+
Check if the current Python version is between 3.6 and 3.8 inclusive.
13+
"""
1114
version_info = sys.version_info
1215
if version_info.major != 3:
1316
return False
1417
if version_info.minor < 6 or version_info.minor > 8:
1518
return False
16-
1719
return True
1820

1921

22+
def find_python() -> str:
23+
"""
24+
Get the path of the currently running Python executable.
25+
"""
26+
return sys.executable
27+
28+
2029
def main() -> None:
21-
if check_python_version():
22-
log("Creating virtual environment")
23-
subprocess.run("python -m venv .venv") # nosec
30+
if not check_python_version():
31+
log("Error: Supported Python versions are between 3.6 and 3.8.")
32+
log(f"Detected Python version: {sys.version_info.major}.{sys.version_info.minor}.{sys.version_info.micro}")
33+
sys.exit(1)
2434

25-
log("Installing python packages")
26-
py_path = os.path.join(".venv", "Scripts", "python")
35+
python_executable = find_python()
36+
log(f"Using Python executable: {python_executable}")
2737

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

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

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

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

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

40-
else:
41-
log("Supported python versions are 3.6-3.8")
52+
log("Python packages installed successfully")
53+
log("DONE!")
4254

4355

4456
if __name__ == "__main__":

readme.md

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
<br>
55
<br>
66
<a href="https://www.zenity.io">
7-
<img src="/zenity_logo.svg"/>
7+
<img src="/zenity_logo.png"/>
88
</a>
9-
<p>
9+
<p>git
1010
Empower your business, not the adversaries.
1111
</p>
1212
</p>
@@ -40,22 +40,22 @@ An review of the tool's basic modules is available here:
4040
- [CopilotM365](https://github.com/mbrg/power-pwn/wiki/Modules:-Copilot-Connector-and-Automator)
4141

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

4545
```
46-
python init_repo.py
46+
python init_repo.py
4747
```
48-
To activate the virtual environment (.venv) run:
48+
2. If not active already, run the folloeing to activate the virtual environment (.venv):
4949
```
50-
.\.venv\Scripts\activate (Windows)
50+
.\.venv\Scripts\activate (Windows)
5151
52-
./.venv/bin/activate (Linux)
52+
source .venv/bin/activate (Linux & MacOS)
5353
```
5454

55-
Run:
55+
3. Verify all dependencies are installed:
5656

5757
```
58-
pip install .
58+
pip install .
5959
```
6060

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

7070
# Usage
71+
## Quick Start
7172
1. For quickly getting started with scanning your tenant, please check the [powerdump](https://github.com/mbrg/power-pwn/wiki/Modules:-PowerDump) module here.
72-
2. Please check out the relevant [Wiki](https://github.com/mbrg/power-pwn/wiki) page for each module for further information.
73+
2. For testing your M365 Copilot for retrieval of internal information (e.g., via a compromised user), please check the C365 modules:
74+
* [whoami](https://github.com/mbrg/power-pwn/wiki/Modules:-Copilot-M365-%E2%80%90-Whoami)
75+
* [C365 dump](https://github.com/mbrg/power-pwn/wiki/Modules:-Copilot-M365-%E2%80%90-Dump)
76+
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).
77+
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.
78+
79+
Please review the [Wiki](https://github.com/mbrg/power-pwn/wiki) for a full module list and detailed usage.

src/powerpwn/powerpages/__init__.py

Whitespace-only changes.

zenity_logo.png

76.4 KB
Loading

zenity_logo.svg

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)