Skip to content

Commit eae0828

Browse files
committed
v0.0.12
1 parent 723d59e commit eae0828

79 files changed

Lines changed: 3346 additions & 1840 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ __pycache__
22
**/__pycache__/*
33
temp/*
44
venv_*
5+
.env

Makefile

Lines changed: 207 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,207 @@
1+
VENV_DIR=venvs/venv_app
2+
PYTHON=python3
3+
SHELL := /bin/bash
4+
5+
6+
all: setup
7+
8+
9+
# ╔═══════════════════════════════╗
10+
# ║ Virtual Environment Functions ║
11+
# ╚═══════════════════════════════╝
12+
13+
# Creates the virtual envirnoment folder and immediately gives them a gitignore
14+
$(VENV_DIR):
15+
@mkdir -p $(VENV_DIR)
16+
@echo "*" > $(VENV_DIR)/.gitignore
17+
@echo "Created virtual environment directory $(VENV_DIR)"
18+
19+
create-venv: $(VENV_DIR)
20+
@$(PYTHON) -m venv $(VENV_DIR)
21+
@echo "Virtual environment created in $(VENV_DIR)"
22+
23+
clean-venv:
24+
@rm -rf $(VENV_DIR)
25+
@echo "Removed virtual environment"
26+
27+
venv-upgrade-pip:
28+
@source $(VENV_DIR)/bin/activate && pip install --upgrade pip
29+
30+
31+
venv-copy:
32+
@echo "source $(VENV_DIR)/bin/activate" | xsel -ib
33+
34+
# ╔═══════════════════════════════════════════════╗
35+
# ║ Extra functions for extra packages to install ║
36+
# ╚═══════════════════════════════════════════════╝
37+
38+
39+
40+
install-pack-dev:
41+
@source $(VENV_DIR)/bin/activate && pip install --editable .
42+
43+
install-req-dev:
44+
@source $(VENV_DIR)/bin/activate && pip install -e .[dev]
45+
@echo "Development dependencies installed."
46+
47+
install-req-docs:
48+
@source $(VENV_DIR)/bin/activate && pip install -e .[docs]
49+
@echo "Documentation dependencies installed."
50+
51+
install-req-all:
52+
@source $(VENV_DIR)/bin/activate && pip install -e .[dev,docs]
53+
@echo "All dependencies installed."
54+
55+
56+
# ╔══════════════════════════════════╗
57+
# ║ All in one create venv and setup ║
58+
# ╚══════════════════════════════════╝
59+
60+
setup-all-dev: create-venv venv-upgrade-pip install-dev
61+
@echo "All development setup steps completed."
62+
63+
setup: create-venv venv-upgrade-pip install
64+
@echo "All setup steps completed."
65+
66+
67+
68+
# Install the package in editable mode for development process
69+
install-dev:
70+
@source $(VENV_DIR)/bin/activate && pip install --editable .
71+
72+
# Install the package in normal mode for usage
73+
install:
74+
@source $(VENV_DIR)/bin/activate && pip install .
75+
76+
77+
78+
79+
# ╔══════════════════════════════════════════════════════════╗
80+
# ║ Build source distribution and wheel using pyproject.toml ║
81+
# ╚══════════════════════════════════════════════════════════╝
82+
83+
84+
85+
build:
86+
@source $(VENV_DIR)/bin/activate && python -m build --sdist --wheel
87+
@echo "Source distribution and wheel built."
88+
@echo "Build completed."
89+
90+
build-check:
91+
@source $(VENV_DIR)/bin/activate && python -m twine check dist/*
92+
@echo "Source distribution with twine check."
93+
@echo "Build check completed."
94+
95+
96+
97+
build-clean:
98+
@rm -rf dist/*
99+
@echo "Cleaned up the dist directory."
100+
101+
102+
103+
# ╔═══════════════════╗
104+
# ║ Upload Functions ║
105+
# ╚═══════════════════╝
106+
107+
108+
109+
upload:
110+
@echo "To upload, it will need to authenticate the credentials"
111+
@source $(VENV_DIR)/bin/activate && twine upload dist/*
112+
113+
upload-test:
114+
@echo "To upload, it will need to authenticate the credentials"
115+
@source $(VENV_DIR)/bin/activate && twine upload -r testpypi --verbose dist/fileagent-$(VERSION)*
116+
@echo "Uploaded to Test PyPI."
117+
118+
119+
120+
121+
# ╔════════════════════╗
122+
# ║ Testing Functions ║
123+
# ╚════════════════════╝
124+
125+
126+
test:
127+
@source $(VENV_DIR)/bin/activate && pytest -v --tb=short --disable-warnings --maxfail=1
128+
@echo "Tests completed."
129+
130+
131+
132+
133+
134+
# ╔═════════════════╗
135+
# ║ Documentations ║
136+
# ╚═════════════════╝
137+
138+
# Documentation using pdoc
139+
# pdoc is a documentation generator for Python projects
140+
# Directory for the pdoc documentation
141+
PDOC_DIR=docs/pdoc/
142+
143+
# Function to ctreate the pdoc directory
144+
$(PDOC_DIR):
145+
@mkdir -p $(PDOC_DIR)
146+
@echo "Created documentation directory $(PDOC_DIR)"
147+
148+
SPHINX_DIR=docs/sphinx/
149+
150+
# Function to create the documentation using pdoc
151+
# Leverages the makefile inside docs/
152+
doc-pdoc: $(PDOC_DIR)
153+
@echo "Generating documentation using pdoc..."
154+
@source $(VENV_DIR)/bin/activate && make -C $(PDOC_DIR) create
155+
@echo "Documentation created using pdoc."
156+
157+
# Function to host the documentation html created by pdoc, using pdoc
158+
# Leverages the makefile inside docs/
159+
doc-pdoc-host:
160+
@echo "Documentation created and hosted by using pdoc."
161+
@source $(VENV_DIR)/bin/activate && make -C $(PDOC_DIR) host
162+
163+
164+
doc-sphinx: $(SPHINX_DIR)
165+
@echo "Generating documentation using Sphinx..."
166+
@source $(VENV_DIR)/bin/activate && make -C $(SPHINX_DIR) html
167+
@echo "Documentation created using Sphinx."
168+
169+
doc-sphinx-host:
170+
@echo "Hosting documentation using Sphinx..."
171+
@source $(VENV_DIR)/bin/activate && cd $(SPHINX_DIR)/build/html && python -m http.server 8500
172+
@echo "Documentation hosted using Sphinx."
173+
174+
175+
# ╔════════════════╗
176+
# ║ Help Function ║
177+
# ╚════════════════╝
178+
179+
180+
help:
181+
@echo "Makefile for managing Python package setup, testing, and documentation."
182+
@echo ""
183+
@echo "Targets:"
184+
@echo " create-venv Create a virtual environment."
185+
@echo " clean-venv Remove the virtual environment."
186+
@echo " venv-upgrade-pip Upgrade pip in the virtual environment."
187+
@echo " install-dev Install the package in editable mode."
188+
@echo " install-pack-dev Install the package in editable mode (alias)."
189+
@echo " install-req-dev Install development dependencies."
190+
@echo " install-req-docs Install documentation dependencies."
191+
@echo " install-req-all Install all dependencies (dev and docs)."
192+
@echo " setup-all-dev Create venv, upgrade pip, and install all dependencies."
193+
@echo " build Build source distribution and wheel using pyproject.toml."
194+
@echo " build-check Check the build with twine."
195+
@echo " upload Upload to PyPI using twine."
196+
@echo " upload-test Upload to Test PyPI using twine."
197+
@echo " test Run tests using pytest."
198+
@echo " doc-pdoc Generate documentation using pdoc."
199+
@echo " doc-pdoc-host Host documentation using pdoc."
200+
@echo " help Show this help message."
201+
@echo ""
202+
@echo "Note: Use 'source $(VENV_DIR)/bin/activate' to activate the virtual environment."
203+
@echo " Use 'deactivate' to exit the virtual environment."
204+
@echo ""
205+
206+
.PHONY: create-venv clean-venv venv-upgrade-pip setup-old setup-toml install-pack-dev install-req-dev install-req-docs setup-all-dev upload-pypi doc-pdoc doc-pdoc-host help
207+

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.0.8
1+
0.0.12
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
Metadata-Version: 2.4
2+
Name: CTFSolverScript
3+
Version: 0.0.11
4+
Summary: An all in one library for solving CTF challenges
5+
Home-page: https://github.com/nikolasfil/CTFSolverScript
6+
Author: Nikolas Filippatos
7+
License: MIT
8+
Project-URL: Homepage, https://github.com/nikolasfil/CTFSolverScript
9+
Classifier: License :: OSI Approved :: MIT License
10+
Classifier: Programming Language :: Python :: 3.11
11+
Classifier: Operating System :: OS Independent
12+
Requires-Python: >=3.11
13+
Description-Content-Type: text/markdown
14+
License-File: LICENSE
15+
Requires-Dist: build>=0.7.0
16+
Requires-Dist: pwntools>=4.0.0
17+
Requires-Dist: scapy>=2.0.0
18+
Requires-Dist: argcomplete>=2.0.0
19+
Requires-Dist: setuptools>=67.7.0
20+
Requires-Dist: wheel>=0.37.0
21+
Provides-Extra: dev
22+
Requires-Dist: pytest>=6.2.4; extra == "dev"
23+
Requires-Dist: twine>=3.4.2; extra == "dev"
24+
Requires-Dist: pipdeptree>=2.0.0; extra == "dev"
25+
Provides-Extra: docs
26+
Requires-Dist: pdoc3>=0.11.4; extra == "docs"
27+
Dynamic: home-page
28+
Dynamic: license-file
29+
Dynamic: requires-python
30+
31+
# CTFSolverScript
32+
33+
CTFSolverScript is a tool designed to assist in solving Capture The Flag (CTF) challenges. It provides utilities and scripts to streamline the process of solving various types of CTF problems.
34+
35+
## Features
36+
37+
- **Automated Scripts**: Pre-built scripts for common CTF tasks.
38+
- **Modular Design**: Easily extendable to add custom scripts.
39+
- **Cross-Platform**: Works on Linux, macOS, and Windows.
40+
- **Lightweight**: Minimal dependencies for quick setup.
41+
42+
## Installation
43+
44+
1. Clone the repository:
45+
46+
```bash
47+
git clone https://github.com/YourUsername/CTFSolverScript.git
48+
cd CTFSolverScript
49+
```
50+
51+
2. Use the Makefile to install dependencies:
52+
53+
```bash
54+
make install
55+
```
56+
57+
## Usage
58+
59+
1. Navigate to the project directory:
60+
61+
```bash
62+
cd CTFSolverScript
63+
```
64+
65+
2. Run the main script:
66+
67+
```bash
68+
python solver.py
69+
```
70+
71+
3. Follow the prompts to select the type of challenge you want to solve.
72+
73+
## Directory Structure
74+
75+
```
76+
CTFSolverScript/
77+
├── solver.py # Main script
78+
├── modules/ # Custom modules for solving challenges
79+
├── examples/ # Example challenges and solutions
80+
├── requirements.txt # Python dependencies
81+
├── Makefile # Build and installation commands
82+
└── README.md # Project documentation
83+
```
84+
85+
## Contributing
86+
87+
Contributions are welcome! Please follow these steps:
88+
89+
1. Fork the repository.
90+
2. Create a new branch for your feature or bugfix.
91+
3. Submit a pull request with a detailed description of your changes.
92+
93+
## License
94+
95+
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
96+
97+
## Contact
98+
99+
For questions or suggestions, feel free to open an issue or contact the maintainer at `your.email@example.com`.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
LICENSE
2+
README.md
3+
pyproject.toml
4+
setup.cfg
5+
setup.py
6+
app/CTFSolverScript.egg-info/PKG-INFO
7+
app/CTFSolverScript.egg-info/SOURCES.txt
8+
app/CTFSolverScript.egg-info/dependency_links.txt
9+
app/CTFSolverScript.egg-info/entry_points.txt
10+
app/CTFSolverScript.egg-info/requires.txt
11+
app/CTFSolverScript.egg-info/top_level.txt
12+
app/ctfsolver/__init__.py
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[console_scripts]
2+
clean_folders = ctfsolver.scripts.run_clean_folders:main
3+
ctfsolver = ctfsolver.inline.__main__:main
4+
find_usage = ctfsolver.scripts.run_find_usage:main
5+
folders = ctfsolver.scripts.run_folders:main
6+
run = ctfsolver.scripts.run_solution:main
7+
templ = ctfsolver.scripts.__main__:run_template
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
build>=0.7.0
2+
pwntools>=4.0.0
3+
scapy>=2.0.0
4+
argcomplete>=2.0.0
5+
setuptools>=67.7.0
6+
wheel>=0.37.0
7+
8+
[dev]
9+
pytest>=6.2.4
10+
twine>=3.4.2
11+
pipdeptree>=2.0.0
12+
13+
[docs]
14+
pdoc3>=0.11.4
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ctfsolver

0 commit comments

Comments
 (0)