pwnkit-cli 0.3.2 → 0.3.4
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.
- package/LICENSE +188 -0
- package/README.md +305 -0
- package/dist/LICENSE +188 -0
- package/dist/README.md +305 -0
- package/dist/attacks/data-exfiltration/pii-leakage.yaml +27 -0
- package/dist/attacks/encoding-bypass/base64-encoding.yaml +24 -0
- package/dist/attacks/jailbreak/dan-roleplay.yaml +27 -0
- package/dist/attacks/jailbreak/hypothetical-scenario.yaml +25 -0
- package/dist/attacks/jailbreak/multilingual-bypass.yaml +22 -0
- package/dist/attacks/output-manipulation/harmful-content.yaml +25 -0
- package/dist/attacks/prompt-injection/context-manipulation.yaml +32 -0
- package/dist/attacks/prompt-injection/direct-injection.yaml +28 -0
- package/dist/attacks/prompt-injection/indirect-injection.yaml +33 -0
- package/dist/attacks/system-prompt-extraction/direct-ask.yaml +30 -0
- package/dist/attacks/system-prompt-extraction/markdown-exfil.yaml +26 -0
- package/dist/attacks/tool-misuse/ssrf-via-tools.yaml +27 -0
- package/dist/index.js +58795 -125
- package/dist/package.json +40 -0
- package/package.json +46 -19
- package/dist/commands/audit.d.ts +0 -3
- package/dist/commands/audit.d.ts.map +0 -1
- package/dist/commands/audit.js +0 -32
- package/dist/commands/audit.js.map +0 -1
- package/dist/commands/findings.d.ts +0 -3
- package/dist/commands/findings.d.ts.map +0 -1
- package/dist/commands/findings.js +0 -110
- package/dist/commands/findings.js.map +0 -1
- package/dist/commands/history.d.ts +0 -3
- package/dist/commands/history.d.ts.map +0 -1
- package/dist/commands/history.js +0 -34
- package/dist/commands/history.js.map +0 -1
- package/dist/commands/index.d.ts +0 -7
- package/dist/commands/index.d.ts.map +0 -1
- package/dist/commands/index.js +0 -7
- package/dist/commands/index.js.map +0 -1
- package/dist/commands/replay.d.ts +0 -3
- package/dist/commands/replay.d.ts.map +0 -1
- package/dist/commands/replay.js +0 -83
- package/dist/commands/replay.js.map +0 -1
- package/dist/commands/review.d.ts +0 -3
- package/dist/commands/review.d.ts.map +0 -1
- package/dist/commands/review.js +0 -30
- package/dist/commands/review.js.map +0 -1
- package/dist/commands/run.d.ts +0 -16
- package/dist/commands/run.d.ts.map +0 -1
- package/dist/commands/run.js +0 -83
- package/dist/commands/run.js.map +0 -1
- package/dist/commands/scan.d.ts +0 -3
- package/dist/commands/scan.d.ts.map +0 -1
- package/dist/commands/scan.js +0 -187
- package/dist/commands/scan.js.map +0 -1
- package/dist/event-handler.d.ts +0 -19
- package/dist/event-handler.d.ts.map +0 -1
- package/dist/event-handler.js +0 -63
- package/dist/event-handler.js.map +0 -1
- package/dist/formatters/index.d.ts +0 -14
- package/dist/formatters/index.d.ts.map +0 -1
- package/dist/formatters/index.js +0 -56
- package/dist/formatters/index.js.map +0 -1
- package/dist/formatters/json.d.ts +0 -3
- package/dist/formatters/json.d.ts.map +0 -1
- package/dist/formatters/json.js +0 -4
- package/dist/formatters/json.js.map +0 -1
- package/dist/formatters/markdown.d.ts +0 -3
- package/dist/formatters/markdown.d.ts.map +0 -1
- package/dist/formatters/markdown.js +0 -90
- package/dist/formatters/markdown.js.map +0 -1
- package/dist/formatters/replay.d.ts +0 -24
- package/dist/formatters/replay.d.ts.map +0 -1
- package/dist/formatters/replay.js +0 -357
- package/dist/formatters/replay.js.map +0 -1
- package/dist/formatters/terminal.d.ts +0 -4
- package/dist/formatters/terminal.d.ts.map +0 -1
- package/dist/formatters/terminal.js +0 -190
- package/dist/formatters/terminal.js.map +0 -1
- package/dist/index.d.ts +0 -3
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/spinner.d.ts +0 -16
- package/dist/spinner.d.ts.map +0 -1
- package/dist/spinner.js +0 -97
- package/dist/spinner.js.map +0 -1
- package/dist/ui/ScanUI.d.ts +0 -37
- package/dist/ui/ScanUI.d.ts.map +0 -1
- package/dist/ui/ScanUI.js +0 -58
- package/dist/ui/ScanUI.js.map +0 -1
- package/dist/ui/renderScan.d.ts +0 -21
- package/dist/ui/renderScan.d.ts.map +0 -1
- package/dist/ui/renderScan.js +0 -191
- package/dist/ui/renderScan.js.map +0 -1
- package/dist/utils.d.ts +0 -12
- package/dist/utils.d.ts.map +0 -1
- package/dist/utils.js +0 -40
- package/dist/utils.js.map +0 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship made available under
|
|
36
|
+
the License, as indicated by a copyright notice that is included in
|
|
37
|
+
or attached to the work (an example is provided in the Appendix below).
|
|
38
|
+
|
|
39
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
40
|
+
form, that is based on (or derived from) the Work and for which the
|
|
41
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
42
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
43
|
+
of this License, Derivative Works shall not include works that remain
|
|
44
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
45
|
+
the Work and Derivative Works thereof.
|
|
46
|
+
|
|
47
|
+
"Contribution" shall mean, as submitted to the Licensor for inclusion
|
|
48
|
+
in the Work by the copyright owner or by an individual or Legal Entity
|
|
49
|
+
authorized to submit on behalf of the copyright owner. For the purposes
|
|
50
|
+
of this definition, "submitted" means any form of electronic, verbal,
|
|
51
|
+
or written communication sent to the Licensor or its representatives,
|
|
52
|
+
including but not limited to communication on electronic mailing lists,
|
|
53
|
+
source code control systems, and issue tracking systems that are managed
|
|
54
|
+
by, or on behalf of, the Licensor for the purpose of submitting and
|
|
55
|
+
discussing improvements to the Work, but excluding communication that is
|
|
56
|
+
conspicuously marked or designated in writing by the copyright owner as
|
|
57
|
+
"Not a Contribution."
|
|
58
|
+
|
|
59
|
+
"Contributor" shall mean Licensor and any Legal Entity on behalf of
|
|
60
|
+
whom a Contribution has been received by the Licensor and included
|
|
61
|
+
within the Work.
|
|
62
|
+
|
|
63
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
64
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
65
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
66
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
67
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
68
|
+
Work and such Derivative Works in Source or Object form.
|
|
69
|
+
|
|
70
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
71
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
72
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
73
|
+
(except as stated in this section) patent license to make, have made,
|
|
74
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
75
|
+
where such license applies only to those patent claims licensable
|
|
76
|
+
by such Contributor that are necessarily infringed by their
|
|
77
|
+
Contribution(s) alone or by the combined Work (with their
|
|
78
|
+
Contribution(s)). If You institute patent litigation against any
|
|
79
|
+
entity (including a cross-claim or counterclaim in a lawsuit)
|
|
80
|
+
alleging that the Work or any Contribution embodied within the Work
|
|
81
|
+
constitutes a patent or copyright infringement, then any patent
|
|
82
|
+
licenses granted to You under this License for that Work shall
|
|
83
|
+
terminate as of the date such litigation is filed.
|
|
84
|
+
|
|
85
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
86
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
87
|
+
modifications, and in Source or Object form, provided that You
|
|
88
|
+
meet the following conditions:
|
|
89
|
+
|
|
90
|
+
(a) You must give any other recipients of the Work or Derivative
|
|
91
|
+
Works a copy of this License; and
|
|
92
|
+
|
|
93
|
+
(b) You must cause any modified files to carry prominent notices
|
|
94
|
+
stating that You changed the files; and
|
|
95
|
+
|
|
96
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
97
|
+
that You distribute, all copyright, patent, trademark, and
|
|
98
|
+
attribution notices from the Source form of the Work,
|
|
99
|
+
excluding those notices that do not pertain to any part of
|
|
100
|
+
the Derivative Works; and
|
|
101
|
+
|
|
102
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
103
|
+
distribution, You must include a readable copy of the
|
|
104
|
+
attribution notices contained within such NOTICE file, in
|
|
105
|
+
at least one of the following places: within a NOTICE text
|
|
106
|
+
file distributed as part of the Derivative Works; within
|
|
107
|
+
the Source form or documentation, if provided along with the
|
|
108
|
+
Derivative Works; or, within a display generated by the
|
|
109
|
+
Derivative Works, if and wherever such third-party notices
|
|
110
|
+
normally appear. The contents of the NOTICE file are for
|
|
111
|
+
informational purposes only and do not modify the License.
|
|
112
|
+
You may add Your own attribution notices within Derivative
|
|
113
|
+
Works that You distribute, alongside or in addition to the
|
|
114
|
+
NOTICE text from the Work, provided that such additional
|
|
115
|
+
attribution notices cannot be construed as modifying the License.
|
|
116
|
+
|
|
117
|
+
You may add Your own license statement for Your modifications and
|
|
118
|
+
may provide additional grant of rights to use, copy, modify, merge,
|
|
119
|
+
publish, distribute, sublicense, and/or sell copies of the
|
|
120
|
+
Contribution.
|
|
121
|
+
|
|
122
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
123
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
124
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
125
|
+
this License, without any additional terms or conditions.
|
|
126
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
127
|
+
the terms of any separate license agreement you may have executed
|
|
128
|
+
with Licensor regarding such Contributions.
|
|
129
|
+
|
|
130
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
131
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
132
|
+
except as required for reasonable and customary use in describing the
|
|
133
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
134
|
+
|
|
135
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
136
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
137
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
138
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
139
|
+
implied, including, without limitation, any warranties or conditions
|
|
140
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
141
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
142
|
+
appropriateness of using or reproducing the Work and assume any
|
|
143
|
+
risks associated with Your exercise of permissions under this License.
|
|
144
|
+
|
|
145
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
146
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
147
|
+
unless required by applicable law (such as deliberate and grossly
|
|
148
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
149
|
+
liable to You for damages, including any direct, indirect, special,
|
|
150
|
+
incidental, or exemplary damages of any character arising as a
|
|
151
|
+
result of this License or out of the use or inability to use the
|
|
152
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
153
|
+
work stoppage, computer failure or malfunction, or all other
|
|
154
|
+
commercial damages or losses), even if such Contributor has been
|
|
155
|
+
advised of the possibility of such damages.
|
|
156
|
+
|
|
157
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
158
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
159
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
160
|
+
or other liability obligations and/or rights consistent with this
|
|
161
|
+
License. However, in accepting such obligations, You may offer only
|
|
162
|
+
conditions consistent with this License.
|
|
163
|
+
|
|
164
|
+
END OF TERMS AND CONDITIONS
|
|
165
|
+
|
|
166
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
167
|
+
|
|
168
|
+
To apply the Apache License to your work, attach the following
|
|
169
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
170
|
+
replaced with your own identifying information. (Don't include
|
|
171
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
172
|
+
comment syntax for the syntax of the file. We also recommend
|
|
173
|
+
that a file or directory "LICENSE" or "COPYING" be included with
|
|
174
|
+
your work.
|
|
175
|
+
|
|
176
|
+
Copyright 2026 Doruk Tan Ozturk (Peak Twilight)
|
|
177
|
+
|
|
178
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
179
|
+
you may not use this file except in compliance with the License.
|
|
180
|
+
You may obtain a copy of the License at
|
|
181
|
+
|
|
182
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
183
|
+
|
|
184
|
+
Unless required by applicable law or agreed to in writing, software
|
|
185
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
186
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
187
|
+
See the License for the specific language governing permissions and
|
|
188
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,305 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="assets/pwnkit-icon.gif" alt="pwnkit" width="80" />
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
<h1 align="center">pwnkit</h1>
|
|
6
|
+
|
|
7
|
+
<p align="center">
|
|
8
|
+
<strong>General-purpose autonomous pentesting framework</strong><br/>
|
|
9
|
+
<em>Scan LLM endpoints. Audit npm packages. Review source code. Re-exploit to kill false positives.</em>
|
|
10
|
+
</p>
|
|
11
|
+
|
|
12
|
+
<p align="center">
|
|
13
|
+
<a href="https://www.npmjs.com/package/pwnkit-cli"><img src="https://img.shields.io/npm/v/pwnkit-cli?color=crimson&style=flat-square" alt="npm version" /></a>
|
|
14
|
+
<a href="https://github.com/peaktwilight/pwnkit/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-Apache%202.0-blue?style=flat-square" alt="license" /></a>
|
|
15
|
+
<a href="https://github.com/peaktwilight/pwnkit/actions"><img src="https://img.shields.io/github/actions/workflow/status/peaktwilight/pwnkit/ci.yml?style=flat-square" alt="CI" /></a>
|
|
16
|
+
<a href="https://github.com/peaktwilight/pwnkit/stargazers"><img src="https://img.shields.io/github/stars/peaktwilight/pwnkit?style=flat-square&color=gold" alt="stars" /></a>
|
|
17
|
+
<a href="https://pwnkit.com"><img src="https://pwnkit.com/badge/peaktwilight/pwnkit" alt="pwnkit verified" /></a>
|
|
18
|
+
</p>
|
|
19
|
+
|
|
20
|
+
<p align="center">
|
|
21
|
+
<img src="assets/demo.gif" alt="pwnkit Demo" width="700" />
|
|
22
|
+
</p>
|
|
23
|
+
|
|
24
|
+
<p align="center">
|
|
25
|
+
<a href="#quick-start">Quick Start</a> ·
|
|
26
|
+
<a href="#commands">Commands</a> ·
|
|
27
|
+
<a href="#how-it-works">How It Works</a> ·
|
|
28
|
+
<a href="#what-pwnkit-scans">What It Scans</a> ·
|
|
29
|
+
<a href="#how-it-compares">Comparison</a> ·
|
|
30
|
+
<a href="#github-action">CI/CD</a> ·
|
|
31
|
+
<a href="#built-by">About</a>
|
|
32
|
+
</p>
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
pwnkit is an open-source agentic security toolkit. A research agent discovers, attacks, and writes proof-of-concept code for vulnerabilities across LLM endpoints, npm packages, and Git repositories. Then a blind verify agent — given ONLY the PoC and file path, not the reasoning — independently reproduces each finding to **kill false positives**. No templates, no static rules — multi-turn agentic reasoning that thinks like an attacker.
|
|
37
|
+
|
|
38
|
+
One command. Zero config. Every finding re-exploited or dropped.
|
|
39
|
+
|
|
40
|
+
## Quick Start
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
# Scan an LLM endpoint
|
|
44
|
+
npx pwnkit-cli scan --target https://your-app.com/api/chat
|
|
45
|
+
|
|
46
|
+
# Audit an npm package for vulnerabilities
|
|
47
|
+
npx pwnkit-cli audit lodash
|
|
48
|
+
|
|
49
|
+
# Deep security review of a codebase
|
|
50
|
+
npx pwnkit-cli review ./my-ai-app
|
|
51
|
+
|
|
52
|
+
# Or just point pwnkit-cli at a target — it auto-detects what to do
|
|
53
|
+
npx pwnkit-cli express # audits npm package
|
|
54
|
+
npx pwnkit-cli ./my-repo # reviews source code
|
|
55
|
+
npx pwnkit-cli https://github.com/user/repo # clones and reviews
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
That's it. pwnkit discovers your attack surface, launches targeted attacks, verifies findings, and generates a report — all in under 5 minutes.
|
|
59
|
+
|
|
60
|
+
### Auto-Detect
|
|
61
|
+
|
|
62
|
+
`pwnkit-cli <target>` figures out what you mean without explicit subcommands:
|
|
63
|
+
|
|
64
|
+
| Input | What pwnkit-cli does |
|
|
65
|
+
|-------|-----------------|
|
|
66
|
+
| `pwnkit-cli express` | Treats it as an npm package name and runs `audit` |
|
|
67
|
+
| `pwnkit-cli ./my-repo` | Detects a local path and runs `review` |
|
|
68
|
+
| `pwnkit-cli https://github.com/user/repo` | Clones the repo and runs `review` |
|
|
69
|
+
| `pwnkit-cli https://example.com/api/chat` | Detects an LLM endpoint URL and runs `scan` |
|
|
70
|
+
|
|
71
|
+
Explicit subcommands (`scan`, `audit`, `review`) still work — auto-detect is just a convenience layer on top.
|
|
72
|
+
|
|
73
|
+
## Commands
|
|
74
|
+
|
|
75
|
+
All commands are available via `npx pwnkit-cli <command>`. Explicit subcommands are optional — thanks to auto-detect, `npx pwnkit-cli <target>` works for most use cases (see [Auto-Detect](#auto-detect) above).
|
|
76
|
+
|
|
77
|
+
pwnkit ships five commands — from quick API probes to deep source-level audits:
|
|
78
|
+
|
|
79
|
+
| Command | What It Does | Example |
|
|
80
|
+
|---------|-------------|---------|
|
|
81
|
+
| **`scan`** | Probe LLM endpoints and AI APIs for vulnerabilities | `npx pwnkit-cli scan --target https://api.example.com/chat` |
|
|
82
|
+
| **`audit`** | Install and security-audit any npm package with static analysis + AI review | `npx pwnkit-cli audit express@4.18.2` |
|
|
83
|
+
| **`review`** | Deep source code security review of a local repo or GitHub URL | `npx pwnkit-cli review https://github.com/user/repo` |
|
|
84
|
+
| **`history`** | Browse past scans with status, depth, findings count, and duration | `npx pwnkit-cli history --limit 20` |
|
|
85
|
+
| **`findings`** | Query, filter, and inspect verified findings across all scans | `npx pwnkit-cli findings list --severity critical` |
|
|
86
|
+
|
|
87
|
+
## How It Works
|
|
88
|
+
|
|
89
|
+
pwnkit runs autonomous AI agents in a research-then-verify pipeline. Each agent uses tools (`read_file`, `run_command`, `send_prompt`, `save_finding`) and makes multi-turn decisions — adapting its strategy based on what it learns:
|
|
90
|
+
|
|
91
|
+
```mermaid
|
|
92
|
+
graph LR
|
|
93
|
+
A["Research\ndiscover + attack + PoC\nsingle agent session"] --> B["Blind Verify\ngets ONLY PoC + path\nno reasoning, no bias"]
|
|
94
|
+
B --> C["Report\nSARIF, Markdown, JSON\nonly confirmed findings"]
|
|
95
|
+
B -->|can't reproduce| D["Killed"]
|
|
96
|
+
|
|
97
|
+
style A fill:#1a1a2e,stroke:#DC2626,color:#fff
|
|
98
|
+
style B fill:#1a1a2e,stroke:#3B82F6,color:#fff
|
|
99
|
+
style C fill:#1a1a2e,stroke:#8B5CF6,color:#fff
|
|
100
|
+
style D fill:#1a1a2e,stroke:#6B7280,color:#6B7280
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
| Agent | Role | What It Does |
|
|
104
|
+
|-------|------|-------------|
|
|
105
|
+
| **Research** | Discover + Attack + PoC | Maps endpoints, detects models, extracts system prompts, crafts multi-turn attacks (prompt injection, jailbreaks, tool poisoning, data exfiltration), and writes proof-of-concept code — all in one agent session |
|
|
106
|
+
| **Verify** | Blind validation | Gets ONLY the PoC code and file path — not the research agent's reasoning. Independently traces data flow and reproduces each finding. Can't reproduce? Killed as false positive |
|
|
107
|
+
| **Report** | Output | SARIF for GitHub Security tab, Markdown for humans, JSON for pipelines — only confirmed findings with severity scores and remediation |
|
|
108
|
+
|
|
109
|
+
The **blind verification is the differentiator.** The verify agent can't be biased by the research agent's reasoning — same principle as double-blind peer review. No more triaging 200 "possible prompt injections" that turn out to be nothing.
|
|
110
|
+
|
|
111
|
+
## What pwnkit Scans
|
|
112
|
+
|
|
113
|
+
| Target | Command | How |
|
|
114
|
+
|--------|---------|-----|
|
|
115
|
+
| **LLM Endpoints** — ChatGPT, Claude, Llama APIs, custom chatbots | `pwnkit-cli scan --target <url>` | HTTP probing + multi-turn agent attacks |
|
|
116
|
+
| **npm Packages** — Dependency supply chain, malicious code | `pwnkit-cli audit <package>` | Installs in sandbox, runs semgrep + AI code review |
|
|
117
|
+
| **Git Repositories** — Source-level security review | `pwnkit-cli review <path-or-url>` | Deep analysis with Claude Code, Codex, or Gemini CLI |
|
|
118
|
+
| **Auto-detect** — Give it anything | `pwnkit-cli <target>` | URL, package name, or path — pwnkit-cli figures it out |
|
|
119
|
+
|
|
120
|
+
## Example Output
|
|
121
|
+
|
|
122
|
+
See the [demo GIF above](#) for real scan output, or run it yourself:
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
npx pwnkit-cli scan --target https://your-app.com/api/chat --depth quick
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
For a verbose view with the animated attack replay:
|
|
129
|
+
|
|
130
|
+
```bash
|
|
131
|
+
npx pwnkit-cli scan --target https://your-app.com/api/chat --verbose
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
## Scan Depth
|
|
135
|
+
|
|
136
|
+
| Depth | Test Cases | Time |
|
|
137
|
+
|-------|-----------|------|
|
|
138
|
+
| `quick` | ~15 | ~1 min |
|
|
139
|
+
| `default` | ~50 | ~3 min |
|
|
140
|
+
| `deep` | ~150 | ~10 min |
|
|
141
|
+
|
|
142
|
+
pwnkit is an agentic harness — bring your own AI. Use your API key (OpenRouter, Anthropic, OpenAI, Ollama), or use the Claude Code CLI or Codex CLI with your existing subscription via `--runtime claude` or `--runtime codex`.
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
# Quick scan for CI
|
|
146
|
+
npx pwnkit-cli scan --target https://api.example.com/chat --depth quick
|
|
147
|
+
|
|
148
|
+
# Deep audit before launch
|
|
149
|
+
npx pwnkit-cli scan --target https://api.example.com/chat --depth deep
|
|
150
|
+
|
|
151
|
+
# Deep scan with Claude Code CLI
|
|
152
|
+
npx pwnkit-cli scan --target https://api.example.com/chat --depth deep --runtime claude
|
|
153
|
+
|
|
154
|
+
# Audit an npm package
|
|
155
|
+
npx pwnkit-cli audit react --depth deep --runtime claude
|
|
156
|
+
|
|
157
|
+
# Review a GitHub repo
|
|
158
|
+
npx pwnkit-cli review https://github.com/user/repo --runtime codex --depth deep
|
|
159
|
+
|
|
160
|
+
# Auto-detect — just give it a target
|
|
161
|
+
npx pwnkit-cli express
|
|
162
|
+
npx pwnkit-cli ./my-repo
|
|
163
|
+
npx pwnkit-cli https://api.example.com
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
## Runtime Modes
|
|
167
|
+
|
|
168
|
+
Bring your own agent CLI — pwnkit orchestrates it:
|
|
169
|
+
|
|
170
|
+
| Runtime | Flag | Best For |
|
|
171
|
+
|---------|------|----------|
|
|
172
|
+
| `api` | `--runtime api` | CI, quick scans — uses your API key (OpenRouter, Anthropic, OpenAI). Default |
|
|
173
|
+
| `claude` | `--runtime claude` | Deep analysis — spawns Claude Code CLI with your subscription |
|
|
174
|
+
| `codex` | `--runtime codex` | Source analysis — spawns Codex CLI |
|
|
175
|
+
| `gemini` | `--runtime gemini` | Large context source analysis — spawns Gemini CLI |
|
|
176
|
+
| `auto` | `--runtime auto` | Auto-detects installed CLIs, picks best per stage |
|
|
177
|
+
|
|
178
|
+
## How It Compares
|
|
179
|
+
|
|
180
|
+
| Feature | pwnkit | promptfoo | garak | semgrep | nuclei |
|
|
181
|
+
|---------|--------|-----------|-------|---------|--------|
|
|
182
|
+
| **Agentic multi-turn pipeline** | Yes — Autonomous agents with tool use | No — Single runner | No — Single runner | No — Rule-based | No — Template runner |
|
|
183
|
+
| **Verification (no false positives)** | Yes — Re-exploits to confirm | No | No | No | No |
|
|
184
|
+
| **LLM endpoint scanning** | Yes — Prompt injection, jailbreaks, exfil | Yes — Red-teaming | Yes — Probes | No | No |
|
|
185
|
+
| **npm package audit** | Yes — Semgrep + AI review | No | No | Yes — Rules only | No |
|
|
186
|
+
| **Source code review** | Yes — AI-powered deep analysis | No | No | Yes — Rules only | No |
|
|
187
|
+
| **OWASP LLM Top 10** | Yes — Covered | Partial | Partial | N/A | N/A |
|
|
188
|
+
| **SARIF + GitHub Security tab** | Yes | Yes | No | Yes | Yes |
|
|
189
|
+
| **One command, zero config** | Yes — `npx pwnkit-cli scan` | Needs YAML config | Needs Python setup | Needs rules config | Needs templates |
|
|
190
|
+
| **Open source** | Yes — Apache-2.0 | Yes — (acquired by OpenAI) | Yes — MIT | Yes — LGPL / Paid Pro | Yes — MIT |
|
|
191
|
+
| **Pricing** | Free + bring your own AI | Varies | Free (local) | Free (OSS) / Paid (Pro) | Free |
|
|
192
|
+
|
|
193
|
+
pwnkit isn't replacing semgrep or nuclei — it covers the AI-specific attack surface they can't see. Use them together.
|
|
194
|
+
|
|
195
|
+
## GitHub Action
|
|
196
|
+
|
|
197
|
+
Add pwnkit to your CI/CD pipeline:
|
|
198
|
+
|
|
199
|
+
```yaml
|
|
200
|
+
name: AI Security Scan
|
|
201
|
+
on: [push, pull_request]
|
|
202
|
+
|
|
203
|
+
permissions:
|
|
204
|
+
contents: read
|
|
205
|
+
security-events: write
|
|
206
|
+
|
|
207
|
+
jobs:
|
|
208
|
+
pwnkit:
|
|
209
|
+
runs-on: ubuntu-latest
|
|
210
|
+
steps:
|
|
211
|
+
- uses: actions/checkout@v4
|
|
212
|
+
|
|
213
|
+
- name: Run pwnkit
|
|
214
|
+
uses: peaktwilight/pwnkit/action@v1
|
|
215
|
+
with:
|
|
216
|
+
target: ${{ secrets.STAGING_API_URL }}
|
|
217
|
+
depth: default # quick | default | deep
|
|
218
|
+
fail-on-severity: high # critical | high | medium | low | info | none
|
|
219
|
+
env:
|
|
220
|
+
OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }}
|
|
221
|
+
|
|
222
|
+
- name: Upload SARIF
|
|
223
|
+
uses: github/codeql-action/upload-sarif@v3
|
|
224
|
+
with:
|
|
225
|
+
sarif_file: pwnkit-report/report.sarif
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
> **API Key Priority:** pwnkit checks for `OPENROUTER_API_KEY` first, then `ANTHROPIC_API_KEY`, then `OPENAI_API_KEY`. OpenRouter gives you access to many models (including free ones) through a single key at [openrouter.ai](https://openrouter.ai).
|
|
229
|
+
|
|
230
|
+
Findings show up directly in the **Security** tab of your repository.
|
|
231
|
+
|
|
232
|
+
### Badge
|
|
233
|
+
|
|
234
|
+
Add a pwnkit badge to your README:
|
|
235
|
+
|
|
236
|
+
```markdown
|
|
237
|
+
[](https://pwnkit.com)
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
The badge auto-updates from your GitHub Actions scan results. Shows `verified` (green), finding counts (yellow/red), or `not scanned` (gray).
|
|
241
|
+
|
|
242
|
+
Also available as a [shields.io endpoint](https://shields.io/endpoint):
|
|
243
|
+
```
|
|
244
|
+
https://img.shields.io/endpoint?url=https://pwnkit.com/badge/YOUR_ORG/YOUR_REPO/shield
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
## Findings Management
|
|
248
|
+
|
|
249
|
+
Every finding is persisted in a local SQLite database. Query across scans:
|
|
250
|
+
|
|
251
|
+
```bash
|
|
252
|
+
# List critical findings
|
|
253
|
+
npx pwnkit-cli findings list --severity critical
|
|
254
|
+
|
|
255
|
+
# Filter by category
|
|
256
|
+
npx pwnkit-cli findings list --category prompt-injection --status confirmed
|
|
257
|
+
|
|
258
|
+
# Inspect a specific finding with full evidence
|
|
259
|
+
npx pwnkit-cli findings show NF-001
|
|
260
|
+
|
|
261
|
+
# Browse scan history
|
|
262
|
+
npx pwnkit-cli history --limit 10
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
Finding lifecycle: `discovered → verified → confirmed → scored → reported` (or `false-positive` if verification fails).
|
|
266
|
+
|
|
267
|
+
## Roadmap
|
|
268
|
+
|
|
269
|
+
- [x] Core autonomous agent pipeline (research, blind verify, report)
|
|
270
|
+
- [x] OWASP LLM Top 10 coverage
|
|
271
|
+
- [x] SARIF output + GitHub Action
|
|
272
|
+
- [x] npm package auditing
|
|
273
|
+
- [x] Source code review (local + GitHub)
|
|
274
|
+
- [x] Multi-runtime support (Claude, Codex, Gemini)
|
|
275
|
+
- [x] Multi-turn agentic attacks (agents adapt payloads based on responses)
|
|
276
|
+
- [ ] MCP server scanning (tool poisoning, schema abuse)
|
|
277
|
+
- [ ] Web pentesting mode (SQLi, XSS, SSRF, auth bypass, IDOR)
|
|
278
|
+
- [ ] RAG pipeline security (poisoning, extraction)
|
|
279
|
+
- [ ] Agentic workflow testing (multi-tool chains)
|
|
280
|
+
- [ ] VS Code extension
|
|
281
|
+
- [ ] Team dashboard & historical tracking
|
|
282
|
+
- [ ] SOC 2 / compliance report generation
|
|
283
|
+
|
|
284
|
+
## Built By
|
|
285
|
+
|
|
286
|
+
Created by a security researcher with [7 published CVEs](https://doruk.ch/blog) across node-forge, mysql2, uptime-kuma, liquidjs, picomatch, and jspdf.
|
|
287
|
+
|
|
288
|
+
pwnkit is a general-purpose autonomous pentesting framework. It exists because modern attack surfaces — LLM endpoints, npm supply chains, AI-powered codebases — require agents that adapt, not static rules that don't. You can't `nmap` a language model. You can't write a rule for a jailbreak that hasn't been invented yet. Static analysis alone misses logical flaws and semantic vulnerabilities that only an agent tracing data flow can find.
|
|
289
|
+
|
|
290
|
+
pwnkit uses autonomous agents that think like attackers, adapt their strategy mid-scan, and re-exploit every finding before reporting it. The result: real vulnerabilities, zero noise.
|
|
291
|
+
|
|
292
|
+
## Contributing
|
|
293
|
+
|
|
294
|
+
Contributions welcome! See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
|
|
295
|
+
|
|
296
|
+
```bash
|
|
297
|
+
git clone https://github.com/peaktwilight/pwnkit.git
|
|
298
|
+
cd pwnkit
|
|
299
|
+
pnpm install
|
|
300
|
+
pnpm test
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
## License
|
|
304
|
+
|
|
305
|
+
[Apache 2.0](LICENSE) — use it, fork it, ship it.
|