penpal-enum 0.2.0rc2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. penpal_enum-0.2.0rc2/LICENSE +21 -0
  2. penpal_enum-0.2.0rc2/PKG-INFO +146 -0
  3. penpal_enum-0.2.0rc2/README.md +119 -0
  4. penpal_enum-0.2.0rc2/penpal/__init__.py +3 -0
  5. penpal_enum-0.2.0rc2/penpal/__main__.py +5 -0
  6. penpal_enum-0.2.0rc2/penpal/advisor.py +481 -0
  7. penpal_enum-0.2.0rc2/penpal/api.py +332 -0
  8. penpal_enum-0.2.0rc2/penpal/cli.py +804 -0
  9. penpal_enum-0.2.0rc2/penpal/context.py +38 -0
  10. penpal_enum-0.2.0rc2/penpal/data/SOURCE_FACTS.json +36 -0
  11. penpal_enum-0.2.0rc2/penpal/data/SOURCE_SEEDS.json +169 -0
  12. penpal_enum-0.2.0rc2/penpal/doctor.py +141 -0
  13. penpal_enum-0.2.0rc2/penpal/ingest.py +232 -0
  14. penpal_enum-0.2.0rc2/penpal/mcp_server.py +170 -0
  15. penpal_enum-0.2.0rc2/penpal/models.py +258 -0
  16. penpal_enum-0.2.0rc2/penpal/module_cli.py +57 -0
  17. penpal_enum-0.2.0rc2/penpal/nmap_parser.py +58 -0
  18. penpal_enum-0.2.0rc2/penpal/playbooks.py +420 -0
  19. penpal_enum-0.2.0rc2/penpal/recommendations.py +101 -0
  20. penpal_enum-0.2.0rc2/penpal/runner.py +68 -0
  21. penpal_enum-0.2.0rc2/penpal/scan_profiles.py +87 -0
  22. penpal_enum-0.2.0rc2/penpal/scope.py +201 -0
  23. penpal_enum-0.2.0rc2/penpal/service_modules.py +401 -0
  24. penpal_enum-0.2.0rc2/penpal/sources.py +324 -0
  25. penpal_enum-0.2.0rc2/penpal/summary.py +51 -0
  26. penpal_enum-0.2.0rc2/penpal/workspace.py +349 -0
  27. penpal_enum-0.2.0rc2/penpal_enum.egg-info/PKG-INFO +146 -0
  28. penpal_enum-0.2.0rc2/penpal_enum.egg-info/SOURCES.txt +53 -0
  29. penpal_enum-0.2.0rc2/penpal_enum.egg-info/dependency_links.txt +1 -0
  30. penpal_enum-0.2.0rc2/penpal_enum.egg-info/entry_points.txt +2 -0
  31. penpal_enum-0.2.0rc2/penpal_enum.egg-info/requires.txt +7 -0
  32. penpal_enum-0.2.0rc2/penpal_enum.egg-info/top_level.txt +1 -0
  33. penpal_enum-0.2.0rc2/playbooks/http-vhosts-hidden-apps.json +49 -0
  34. penpal_enum-0.2.0rc2/playbooks/ldap-kerberos-ad-context.json +52 -0
  35. penpal_enum-0.2.0rc2/playbooks/smb-shares-configs-credentials.json +45 -0
  36. penpal_enum-0.2.0rc2/playbooks/snmp-mail-remote.json +61 -0
  37. penpal_enum-0.2.0rc2/pyproject.toml +52 -0
  38. penpal_enum-0.2.0rc2/setup.cfg +4 -0
  39. penpal_enum-0.2.0rc2/tests/test_api.py +389 -0
  40. penpal_enum-0.2.0rc2/tests/test_cli.py +311 -0
  41. penpal_enum-0.2.0rc2/tests/test_context.py +98 -0
  42. penpal_enum-0.2.0rc2/tests/test_contracts.py +149 -0
  43. penpal_enum-0.2.0rc2/tests/test_evals.py +68 -0
  44. penpal_enum-0.2.0rc2/tests/test_ingest.py +83 -0
  45. penpal_enum-0.2.0rc2/tests/test_ingest_fixtures.py +33 -0
  46. penpal_enum-0.2.0rc2/tests/test_mcp_evals.py +17 -0
  47. penpal_enum-0.2.0rc2/tests/test_nmap_parser.py +46 -0
  48. penpal_enum-0.2.0rc2/tests/test_playbooks.py +265 -0
  49. penpal_enum-0.2.0rc2/tests/test_release.py +15 -0
  50. penpal_enum-0.2.0rc2/tests/test_runner.py +61 -0
  51. penpal_enum-0.2.0rc2/tests/test_scope.py +51 -0
  52. penpal_enum-0.2.0rc2/tests/test_service_modules.py +79 -0
  53. penpal_enum-0.2.0rc2/tests/test_source_seeds.py +25 -0
  54. penpal_enum-0.2.0rc2/tests/test_sources.py +182 -0
  55. penpal_enum-0.2.0rc2/tests/test_workspace.py +307 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Yousif Nazhat
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,146 @@
1
+ Metadata-Version: 2.4
2
+ Name: penpal-enum
3
+ Version: 0.2.0rc2
4
+ Summary: Backend-first enumeration assistant for authorized pentesters.
5
+ Author: Yousif Nazhat
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/yousifnazhat/penpal
8
+ Project-URL: Issues, https://github.com/yousifnazhat/penpal/issues
9
+ Project-URL: Changelog, https://github.com/yousifnazhat/penpal/blob/main/CHANGELOG.md
10
+ Keywords: authorized-security,enumeration,pentesting,pi
11
+ Classifier: Development Status :: 4 - Beta
12
+ Classifier: Environment :: Console
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3.11
15
+ Classifier: Programming Language :: Python :: 3.12
16
+ Classifier: Programming Language :: Python :: 3.13
17
+ Classifier: Topic :: Security
18
+ Requires-Python: >=3.11
19
+ Description-Content-Type: text/markdown
20
+ License-File: LICENSE
21
+ Provides-Extra: dev
22
+ Requires-Dist: build==1.3.0; extra == "dev"
23
+ Requires-Dist: ruff==0.15.20; extra == "dev"
24
+ Provides-Extra: mcp
25
+ Requires-Dist: mcp<2,>=1.28; extra == "mcp"
26
+ Dynamic: license-file
27
+
28
+ # PenPal
29
+
30
+ PenPal is a local-first assistant for authorized enumeration. It turns services and tool output into stored evidence, clear next checks, and visible command syntax. The Python core is deterministic; PI is the optional conversational cockpit.
31
+
32
+ PenPal does not execute exploits, hide commands, use credentials automatically, or provide C2 tasking.
33
+
34
+ ## Choose Your Path
35
+
36
+ ### Run the demo with PI
37
+
38
+ Use this path when you want the conversational cockpit. Download a release archive or clone the repository. You need Python 3.11 or newer, Node.js 22.19 or newer, and npm.
39
+
40
+ ```bash
41
+ git clone https://github.com/yousifnazhat/penpal.git
42
+ cd penpal
43
+ python3 -m penpal doctor
44
+ python3 -m penpal --workspace penpal-workspace scope set --include 10.10.10.5
45
+ python3 -m penpal --workspace penpal-workspace init 10.10.10.5 --name demo
46
+ python3 -m penpal --workspace penpal-workspace parse-nmap demo examples/pi/demo-nmap.xml
47
+ python3 -m penpal --workspace penpal-workspace suggest demo
48
+ ./scripts/setup-pi.sh
49
+ pi
50
+ ```
51
+
52
+ On Windows PowerShell, run `./scripts/setup-pi.ps1` instead. The setup scripts install the pinned PI version when it is missing, then verify the project package without using a model or provider credentials.
53
+
54
+ Inside PI, approve project-local files if prompted, run `/login` when a provider is not configured, then try:
55
+
56
+ ```text
57
+ Use PenPal to summarize target demo and recommend next checks.
58
+ ```
59
+
60
+ Run `/penpal-status` for a provider-free check that PI, PenPal, and the bundled playbooks are connected.
61
+
62
+ ### Connect an MCP client
63
+
64
+ Use this path when your existing agent supports MCP rather than PI. Install the optional local server, then configure the client to start the shown command over stdio:
65
+
66
+ ```bash
67
+ python3 -m pip install --pre "penpal-enum[mcp]"
68
+ penpal --workspace penpal-workspace mcp
69
+ ```
70
+
71
+ The MCP server has the same seven read-only workflows as the PI cockpit. It masks sensitive values and does not execute commands or modify your workspace.
72
+
73
+ ### Use the Python core only
74
+
75
+ The core works without PI. Install it and create a target:
76
+
77
+ ```bash
78
+ python3 -m pip install --pre penpal-enum
79
+ penpal doctor
80
+ penpal init 10.10.10.5 --name demo
81
+ penpal parse-nmap demo ./scan.xml
82
+ penpal suggest demo
83
+ ```
84
+
85
+ The release wheel and source archive also include the Python core and bundled playbooks. Add the PI cockpit to a registry installation with:
86
+
87
+ ```bash
88
+ pi install npm:@yousif_nazhat/penpal-pi@0.2.0-rc.2
89
+ ```
90
+
91
+ ### Diagnose setup
92
+
93
+ ```bash
94
+ penpal doctor
95
+ penpal doctor --json
96
+ ```
97
+
98
+ Doctor checks the Python version, playbooks, workspace schemas, scope, plaintext sensitive parameters, missing environment variables, and PI status. It does not modify the workspace. Include the redacted JSON output in bug reports.
99
+
100
+ ## What PenPal Does
101
+
102
+ - Stores scoped targets, services, evidence, parameters, notes, and jobs in a local workspace.
103
+ - Parses Nmap XML and ingests pasted or saved tool output.
104
+ - Masks credential-like evidence and sensitive parameters by default.
105
+ - Uses deterministic suggestions, service modules, and reviewed playbooks to explain the next authorized check.
106
+ - Uses environment references for secrets so values are not persisted in workspace JSON.
107
+ - Provides a loopback-only JSON API for local integrations.
108
+
109
+ ## Everyday Commands
110
+
111
+ ```text
112
+ penpal doctor
113
+ penpal init <host> --name <name>
114
+ penpal scope set --include <host-or-cidr> [--exclude <host-or-cidr>]
115
+ penpal parse-nmap <name> <nmap.xml>
116
+ penpal ingest <name> --file <output.txt> --source <tool-name> --service <proto/port>
117
+ penpal services <name>
118
+ penpal evidence <name>
119
+ penpal suggest <name>
120
+ penpal context <name> --json
121
+ penpal mcp
122
+ penpal playbooks playbooks
123
+ penpal modules list
124
+ penpal modules plan <name> <module>
125
+ ```
126
+
127
+ `scan` prints commands by default. It runs them only with `--execute`. Use `params set-env` for passwords, tokens, and keys; `params set` keeps sensitive values in local plaintext for compatibility.
128
+
129
+ ## Safety
130
+
131
+ Configure engagement scope before a real assessment. Keep the local API on its default loopback address. Review every suggested command and remain responsible for authorization. Playbooks require authorized use and operator approval.
132
+
133
+ ## Help And Contributing
134
+
135
+ - [Support policy](SUPPORT.md)
136
+ - [Security policy](SECURITY.md)
137
+ - [Contributing](CONTRIBUTING.md)
138
+ - [Changelog](CHANGELOG.md)
139
+ - [Playbook template](playbooks/TEMPLATE.md)
140
+
141
+ Run the contributor checks with:
142
+
143
+ ```bash
144
+ python3 -m pip install ".[dev]"
145
+ python3 scripts/check.py
146
+ ```
@@ -0,0 +1,119 @@
1
+ # PenPal
2
+
3
+ PenPal is a local-first assistant for authorized enumeration. It turns services and tool output into stored evidence, clear next checks, and visible command syntax. The Python core is deterministic; PI is the optional conversational cockpit.
4
+
5
+ PenPal does not execute exploits, hide commands, use credentials automatically, or provide C2 tasking.
6
+
7
+ ## Choose Your Path
8
+
9
+ ### Run the demo with PI
10
+
11
+ Use this path when you want the conversational cockpit. Download a release archive or clone the repository. You need Python 3.11 or newer, Node.js 22.19 or newer, and npm.
12
+
13
+ ```bash
14
+ git clone https://github.com/yousifnazhat/penpal.git
15
+ cd penpal
16
+ python3 -m penpal doctor
17
+ python3 -m penpal --workspace penpal-workspace scope set --include 10.10.10.5
18
+ python3 -m penpal --workspace penpal-workspace init 10.10.10.5 --name demo
19
+ python3 -m penpal --workspace penpal-workspace parse-nmap demo examples/pi/demo-nmap.xml
20
+ python3 -m penpal --workspace penpal-workspace suggest demo
21
+ ./scripts/setup-pi.sh
22
+ pi
23
+ ```
24
+
25
+ On Windows PowerShell, run `./scripts/setup-pi.ps1` instead. The setup scripts install the pinned PI version when it is missing, then verify the project package without using a model or provider credentials.
26
+
27
+ Inside PI, approve project-local files if prompted, run `/login` when a provider is not configured, then try:
28
+
29
+ ```text
30
+ Use PenPal to summarize target demo and recommend next checks.
31
+ ```
32
+
33
+ Run `/penpal-status` for a provider-free check that PI, PenPal, and the bundled playbooks are connected.
34
+
35
+ ### Connect an MCP client
36
+
37
+ Use this path when your existing agent supports MCP rather than PI. Install the optional local server, then configure the client to start the shown command over stdio:
38
+
39
+ ```bash
40
+ python3 -m pip install --pre "penpal-enum[mcp]"
41
+ penpal --workspace penpal-workspace mcp
42
+ ```
43
+
44
+ The MCP server has the same seven read-only workflows as the PI cockpit. It masks sensitive values and does not execute commands or modify your workspace.
45
+
46
+ ### Use the Python core only
47
+
48
+ The core works without PI. Install it and create a target:
49
+
50
+ ```bash
51
+ python3 -m pip install --pre penpal-enum
52
+ penpal doctor
53
+ penpal init 10.10.10.5 --name demo
54
+ penpal parse-nmap demo ./scan.xml
55
+ penpal suggest demo
56
+ ```
57
+
58
+ The release wheel and source archive also include the Python core and bundled playbooks. Add the PI cockpit to a registry installation with:
59
+
60
+ ```bash
61
+ pi install npm:@yousif_nazhat/penpal-pi@0.2.0-rc.2
62
+ ```
63
+
64
+ ### Diagnose setup
65
+
66
+ ```bash
67
+ penpal doctor
68
+ penpal doctor --json
69
+ ```
70
+
71
+ Doctor checks the Python version, playbooks, workspace schemas, scope, plaintext sensitive parameters, missing environment variables, and PI status. It does not modify the workspace. Include the redacted JSON output in bug reports.
72
+
73
+ ## What PenPal Does
74
+
75
+ - Stores scoped targets, services, evidence, parameters, notes, and jobs in a local workspace.
76
+ - Parses Nmap XML and ingests pasted or saved tool output.
77
+ - Masks credential-like evidence and sensitive parameters by default.
78
+ - Uses deterministic suggestions, service modules, and reviewed playbooks to explain the next authorized check.
79
+ - Uses environment references for secrets so values are not persisted in workspace JSON.
80
+ - Provides a loopback-only JSON API for local integrations.
81
+
82
+ ## Everyday Commands
83
+
84
+ ```text
85
+ penpal doctor
86
+ penpal init <host> --name <name>
87
+ penpal scope set --include <host-or-cidr> [--exclude <host-or-cidr>]
88
+ penpal parse-nmap <name> <nmap.xml>
89
+ penpal ingest <name> --file <output.txt> --source <tool-name> --service <proto/port>
90
+ penpal services <name>
91
+ penpal evidence <name>
92
+ penpal suggest <name>
93
+ penpal context <name> --json
94
+ penpal mcp
95
+ penpal playbooks playbooks
96
+ penpal modules list
97
+ penpal modules plan <name> <module>
98
+ ```
99
+
100
+ `scan` prints commands by default. It runs them only with `--execute`. Use `params set-env` for passwords, tokens, and keys; `params set` keeps sensitive values in local plaintext for compatibility.
101
+
102
+ ## Safety
103
+
104
+ Configure engagement scope before a real assessment. Keep the local API on its default loopback address. Review every suggested command and remain responsible for authorization. Playbooks require authorized use and operator approval.
105
+
106
+ ## Help And Contributing
107
+
108
+ - [Support policy](SUPPORT.md)
109
+ - [Security policy](SECURITY.md)
110
+ - [Contributing](CONTRIBUTING.md)
111
+ - [Changelog](CHANGELOG.md)
112
+ - [Playbook template](playbooks/TEMPLATE.md)
113
+
114
+ Run the contributor checks with:
115
+
116
+ ```bash
117
+ python3 -m pip install ".[dev]"
118
+ python3 scripts/check.py
119
+ ```
@@ -0,0 +1,3 @@
1
+ """PenPal: backend-first enumeration assistant for authorized pentesters."""
2
+
3
+ __version__ = "0.2.0rc2"
@@ -0,0 +1,5 @@
1
+ from .cli import main
2
+
3
+
4
+ if __name__ == "__main__":
5
+ raise SystemExit(main())