From f8bdf295a92492b6a1f144bbbbc7d4598734cb4f Mon Sep 17 00:00:00 2001 From: nikolasfil Date: Tue, 17 Dec 2024 16:10:26 +0200 Subject: [PATCH] updated the documentation --- app/ctfsolver.egg-info/PKG-INFO | 7 ++-- app/ctfsolver.egg-info/requires.txt | 5 +-- .../lib/ctfsolver/src/manager_connections.py | 27 ++++++++++++++-- docs/README.md | 17 ++++++++-- docs/{ => TODO}/TODO.md | 2 +- docs/{ => TODO}/modules/folders.md | 0 docs/pdoc/README.md | 6 ++++ docs/usage/current.md | 32 ------------------- 8 files changed, 53 insertions(+), 43 deletions(-) rename docs/{ => TODO}/TODO.md (97%) rename docs/{ => TODO}/modules/folders.md (100%) create mode 100644 docs/pdoc/README.md delete mode 100644 docs/usage/current.md diff --git a/app/ctfsolver.egg-info/PKG-INFO b/app/ctfsolver.egg-info/PKG-INFO index 09853a6..9a0fef9 100644 --- a/app/ctfsolver.egg-info/PKG-INFO +++ b/app/ctfsolver.egg-info/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: ctfsolver -Version: 0.0.7 +Version: 0.0.8 Summary: An all in one library for solving CTF challenges Home-page: https://github.com/nikolasfil/CTFSolverScript Author: Nikolas Filippatos @@ -11,10 +11,11 @@ Classifier: Operating System :: OS Independent Requires-Python: >=3.11 Description-Content-Type: text/markdown License-File: LICENSE -Requires-Dist: setuptools>=67.7.0 Requires-Dist: build>=0.7.0 -Requires-Dist: wheel>=0.37.0 Requires-Dist: pwntools>=4.0.0 +Requires-Dist: scapy>=2.0.0 +Requires-Dist: setuptools>=67.7.0 +Requires-Dist: wheel>=0.37.0 Provides-Extra: dev Requires-Dist: pytest>=6.2.4; extra == "dev" Requires-Dist: twine>=3.4.2; extra == "dev" diff --git a/app/ctfsolver.egg-info/requires.txt b/app/ctfsolver.egg-info/requires.txt index 9bb1f22..aa9b97f 100644 --- a/app/ctfsolver.egg-info/requires.txt +++ b/app/ctfsolver.egg-info/requires.txt @@ -1,7 +1,8 @@ -setuptools>=67.7.0 build>=0.7.0 -wheel>=0.37.0 pwntools>=4.0.0 +scapy>=2.0.0 +setuptools>=67.7.0 +wheel>=0.37.0 [dev] pytest>=6.2.4 diff --git a/build/lib/ctfsolver/src/manager_connections.py b/build/lib/ctfsolver/src/manager_connections.py index ea7c94a..492ceaf 100644 --- a/build/lib/ctfsolver/src/manager_connections.py +++ b/build/lib/ctfsolver/src/manager_connections.py @@ -26,11 +26,34 @@ def connect(self, *args, **kwargs) -> None: Connects to the challenge based on the connection type. If the connection type is remote, it connects to the url and port provided. If the connection type is local, it starts a process with the file provided. + + + local: + kwargs : + argv: Any | None = None, + shell: bool = False, + executable: Any | None = None, + cwd: Any | None = None, + env: Any | None = None, + ignore_environ: Any | None = None, + stdin: int = PIPE, + stdout: PTY | int = PTY if not IS_WINDOWS else PIPE, + stderr: int = STDOUT, + close_fds: bool = True, + preexec_fn: Any = lambda : None, + raw: bool = True, + aslr: Any | None = None, + setuid: Any | None = None, + where: str = 'local', + display: Any | None = None, + alarm: Any | None = None, + creationflags: int = 0 + """ if self.conn_type == "remote" and self.url and self.port: - self.conn = pwn.remote(self.url, self.port) + self.conn = self.pwn.remote(self.url, self.port) elif self.conn_type == "local" and self.file: - self.conn = pwn.process(str(self.challenge_file)) + self.conn = self.pwn.process(str(self.challenge_file), **kwargs) def recv_menu(self, number=1, display=False, save=False): """ diff --git a/docs/README.md b/docs/README.md index c664e65..03c8ed7 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,6 +1,17 @@ -## Pdoc +## Documentation -Autodocumentation with pdoc +### Module ctfsolver documentation : -pdoc ctfsolver --html -o ./docs/pdoc_html/ +[ctfsolver](https://nikolasfil.github.io/CTFSolverScript/ctfsolver/) +Uses modules : + +- pwntools +- scapy + +### Module ctfsolver bash commands + +find_usage: Finds the python files where ctfsolver is used +folders: Creates the folders (data, files, payloads) +run: Runs the python file payloads/solution.py if it exists +templ: Creates a python payloads/solution.py template for usage diff --git a/docs/TODO.md b/docs/TODO/TODO.md similarity index 97% rename from docs/TODO.md rename to docs/TODO/TODO.md index 2ffad94..838bf3c 100644 --- a/docs/TODO.md +++ b/docs/TODO/TODO.md @@ -12,7 +12,7 @@ ## Publish in pip ? -## Autoamted solver +## Automated solver - ~Automate the sphynx api documentation ( perhaps a git precommit )~ diff --git a/docs/modules/folders.md b/docs/TODO/modules/folders.md similarity index 100% rename from docs/modules/folders.md rename to docs/TODO/modules/folders.md diff --git a/docs/pdoc/README.md b/docs/pdoc/README.md new file mode 100644 index 0000000..c664e65 --- /dev/null +++ b/docs/pdoc/README.md @@ -0,0 +1,6 @@ +## Pdoc + +Autodocumentation with pdoc + +pdoc ctfsolver --html -o ./docs/pdoc_html/ + diff --git a/docs/usage/current.md b/docs/usage/current.md deleted file mode 100644 index 881adc9..0000000 --- a/docs/usage/current.md +++ /dev/null @@ -1,32 +0,0 @@ -## Current usage of the package - -```bash -find . -type d \( -name "app_venv" -o -name "venv" \) -prune -o -type f -exec grep -l "from ctfsolver import CTFSolver" {} + -``` - -``` -./Categories/Forensics/picoCTF/Blast_from_the_past_picoCTF_2024/payloads/solution.py -./Categories/Forensics/picoCTF/endianness_v2_picoCTF_2024/payloads/solution.py -./Categories/Forensics/picoCTF/PcapPoisoning/payloads/solution.py -./Categories/Forensics/picoCTF/hideme/payloads/solution.py -./Categories/General/picoCTF/SansAlpha/payloads/solution.py -./Categories/Binary/picoCTF/heap_0_picoCTF_2024/payloads/solution.py -./Categories/Binary/picoCTF/format_string_1/payloads/solution.py -./Categories/Binary/picoCTF/format_string_2/payloads/solution.py -./Categories/Binary/picoCTF/format_string_3/payloads/solution.py -./Categories/Binary/picoCTF/heap_1/payloads/solution.py -./Categories/Binary/picoCTF/heap_2/payloads/solution.py -./Categories/Binary/picoCTF/heap_3/payloads/solution.py -./Categories/Binary/picoCTF/Picker_4/payloads/solution.py -./Categories/Cryptography/picoCTF/ReadMyCert/payloads/solution.py -./Categories/Cryptography/picoCTF/basic_mod1/payloads/solution.py -./Categories/Reverse_Engineering/picoCTF/Picker_1/payloads/solution.py -./Categories/Reverse_Engineering/picoCTF/Picker_2/payloads/solution.py -./Categories/Reverse_Engineering/picoCTF/Picker_3/payloads/solution.py -``` - -Finding ctf folders that don't have the universal folder structure - -```bash -find . -mindepth 4 -maxdepth 4 -type d -not \( -path "*/.git*" -o -path "*/venv*" -o -path "*/app_venv*" \) -```