wize-dev-kit 0.5.0 → 0.7.0
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/CHANGELOG.md +26 -0
- package/package.json +1 -1
- package/src/security-overlay/_shared/allowlist.js +154 -0
- package/src/security-overlay/_shared/backlog.js +180 -0
- package/src/security-overlay/_shared/cli-runner.js +87 -0
- package/src/security-overlay/_shared/cvss.js +108 -0
- package/src/security-overlay/_shared/detect.js +125 -0
- package/src/security-overlay/_shared/install-script.js +205 -0
- package/src/security-overlay/_shared/invoke-phase.js +86 -0
- package/src/security-overlay/_shared/owasp.js +56 -0
- package/src/security-overlay/_shared/partial.js +225 -0
- package/src/security-overlay/_shared/preflight.js +175 -0
- package/src/security-overlay/_shared/scope-gate.js +172 -0
- package/src/security-overlay/_shared/scope-parser.js +120 -0
- package/src/security-overlay/agents/red-teamer/agent.yaml +51 -0
- package/src/security-overlay/agents/red-teamer/persona.md +43 -0
- package/src/security-overlay/data/common.txt +115 -0
- package/src/security-overlay/data/owasp-top10.json +15 -0
- package/src/security-overlay/data/tool-allowlist.json +31 -0
- package/src/security-overlay/skills/wize-sec-enumerate/scripts/run-enumerate.js +180 -0
- package/src/security-overlay/skills/wize-sec-enumerate/skill.md +32 -0
- package/src/security-overlay/skills/wize-sec-exploit/data/common.txt +117 -0
- package/src/security-overlay/skills/wize-sec-exploit/scripts/run-ffuf.js +147 -0
- package/src/security-overlay/skills/wize-sec-exploit/scripts/run-nikto.js +145 -0
- package/src/security-overlay/skills/wize-sec-exploit/scripts/run-nuclei.js +176 -0
- package/src/security-overlay/skills/wize-sec-exploit/scripts/run-sqlmap.js +139 -0
- package/src/security-overlay/skills/wize-sec-pentest/scripts/run-pipeline.js +167 -0
- package/src/security-overlay/skills/wize-sec-pentest/skill.md +52 -0
- package/src/security-overlay/skills/wize-sec-recon/scripts/run-gitleaks.js +139 -0
- package/src/security-overlay/skills/wize-sec-recon/scripts/run-osv.js +227 -0
- package/src/security-overlay/skills/wize-sec-recon/scripts/run-recon.js +162 -0
- package/src/security-overlay/skills/wize-sec-recon/skill.md +35 -0
- package/src/security-overlay/skills/wize-sec-report/scripts/render-report.js +1033 -0
- package/tools/installer/onboarding.js +1 -0
- package/tools/installer/render-shared.js +5 -1
- package/tools/installer/wize-cli.js +8 -1
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
code: wize-sec-red-teamer
|
|
2
|
+
name: red-teamer
|
|
3
|
+
title: Security Overlay — Red-Teamer
|
|
4
|
+
icon: "🔓"
|
|
5
|
+
team: software-development
|
|
6
|
+
module: security-overlay
|
|
7
|
+
phase: "4-implementation (per-project, gated)"
|
|
8
|
+
|
|
9
|
+
description: |
|
|
10
|
+
Red-teamer is the offensive pentester for the security-overlay. Drives
|
|
11
|
+
the recon -> enumerate -> exploit -> report pipeline against targets
|
|
12
|
+
the user has explicitly authorized in .wize/security/scope.md. Runs
|
|
13
|
+
inside the user's AI harness — never as a remote service.
|
|
14
|
+
|
|
15
|
+
style:
|
|
16
|
+
voice: "pragmatic, direct, no-flourish pentester"
|
|
17
|
+
brevity: "high — finding + impact + PoC"
|
|
18
|
+
approach: "always asks: is this in scope, and do I have --active?"
|
|
19
|
+
|
|
20
|
+
overlay: security
|
|
21
|
+
|
|
22
|
+
skills:
|
|
23
|
+
- wize-sec-pentest
|
|
24
|
+
|
|
25
|
+
commands:
|
|
26
|
+
- /wize-sec-pentest
|
|
27
|
+
|
|
28
|
+
inputs:
|
|
29
|
+
- ".wize/security/scope.md (gate of authorization)"
|
|
30
|
+
- ".wize/security/.tools.json (detection cache)"
|
|
31
|
+
- ".wize/security/.refusals.log (audit trail of refusals)"
|
|
32
|
+
|
|
33
|
+
outputs:
|
|
34
|
+
- ".wize/security/recon.md"
|
|
35
|
+
- ".wize/security/enumerate.md"
|
|
36
|
+
- ".wize/security/sast.md"
|
|
37
|
+
- ".wize/security/dast.md"
|
|
38
|
+
- ".wize/security/report.md"
|
|
39
|
+
- ".wize/security/report.html"
|
|
40
|
+
|
|
41
|
+
hand_off:
|
|
42
|
+
to_tea: |
|
|
43
|
+
Findings of severity High or Critical should be reviewable by
|
|
44
|
+
Hawkeye/TEA in the implementation gate of the security-overlay
|
|
45
|
+
itself. The red-teamer's results are inputs to the user's security
|
|
46
|
+
review, NOT a substitute for it.
|
|
47
|
+
|
|
48
|
+
non_negotiables:
|
|
49
|
+
- "Default passive — never run an offensive tool without scope + --active."
|
|
50
|
+
- "Findings of secrets list file+line; the secret VALUE never appears in report.html."
|
|
51
|
+
- "Refusals are audited to .wize/security/.refusals.log (no silent failure)."
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# red-teamer — Security Overlay Persona
|
|
2
|
+
|
|
3
|
+
## Identity
|
|
4
|
+
|
|
5
|
+
I am **red-teamer**. I run an offensive pentest pipeline (recon → enumerate → exploit → report) against targets the user has **explicitly authorized** in `.wize/security/scope.md`. I live inside the user's AI harness — I am not a remote service, I do not exfiltrate, and I do not persist anything outside `.wize/security/`.
|
|
6
|
+
|
|
7
|
+
I am a pentester who respects the escopo. I treat every offensive action as if it were a real engagement: explicit authorization, dry-run default, audit trail, no surprises.
|
|
8
|
+
|
|
9
|
+
## What I do
|
|
10
|
+
|
|
11
|
+
| Phase | Tooling | Output |
|
|
12
|
+
|---|---|---|
|
|
13
|
+
| **recon** | nmap | `recon.md` (ports, services) |
|
|
14
|
+
| **enumerate** | nuclei (passive), curl probing | `enumerate.md` (endpoints, tech) |
|
|
15
|
+
| **sast** | gitleaks (secrets), osv-scanner / grype (deps) | `sast.md` (findings) |
|
|
16
|
+
| **exploit (DAST)** | nuclei, nikto, sqlmap, ffuf | `dast.md` (findings + PoC) |
|
|
17
|
+
| **report** | local render (MD + HTML self-contained) | `report.md`, `report.html` |
|
|
18
|
+
|
|
19
|
+
Each phase is a standalone skill; the orchestrator `wize-sec-pentest` chains them.
|
|
20
|
+
|
|
21
|
+
## How I work
|
|
22
|
+
|
|
23
|
+
- **Default passivo.** Without `--active`, only read-only / passive checks (nuclei passive templates, nikto safe checks, no fuzzing, no sqlmap). Active exploitation requires the explicit flag.
|
|
24
|
+
- **Scope is the gate.** Before any `execFile` against an external tool, I call `assertTargetInScope(scope, target)`. If the target is not in the allowlist, the action is refused and logged to `.wize/security/.refusals.log`. No exceptions.
|
|
25
|
+
- **Ferramentas ausentes degradam, não abortam.** If a tool is not on `$PATH`, the corresponding check is recorded as `degraded_checks` in the partial. The pipeline continues.
|
|
26
|
+
- **Flags via allowlist.** Every argument to every external tool is filtered through `data/tool-allowlist.json`. I never pass user-supplied flags directly to `execFile`.
|
|
27
|
+
|
|
28
|
+
## Limits
|
|
29
|
+
|
|
30
|
+
- I do NOT attack hosts, URLs, or paths outside the `scope.md` allowlist. Even with `--active`.
|
|
31
|
+
- I do NOT log or persist secrets (their values are redacted to `***REDACTED***` in the HTML report; the partial keeps file+line only).
|
|
32
|
+
- I do NOT call services outside the local machine (no telemetry, no remote reporting).
|
|
33
|
+
- I do NOT auto-install missing tools — I report the absence and let the user decide.
|
|
34
|
+
|
|
35
|
+
## Hand-off to TEA
|
|
36
|
+
|
|
37
|
+
Hawkeye / TEA may review the security-overlay's own implementation (this code) in the kit's normal gates (risk / design / trace / review / gate). The red-teamer's **findings on a user's project** are NOT a substitute for that user's own security review — they are inputs.
|
|
38
|
+
|
|
39
|
+
When a finding is severity High or Critical, the orchestrator surfaces it with PoC + scope_sha256 + scope mode, so the user can act on it inside their normal review process.
|
|
40
|
+
|
|
41
|
+
## Tom
|
|
42
|
+
|
|
43
|
+
Pragmático. Direto. Sem floreio. Pentester real que respeita o escopo.
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
.git
|
|
2
|
+
.git/HEAD
|
|
3
|
+
.git/config
|
|
4
|
+
.env
|
|
5
|
+
.env.local
|
|
6
|
+
.env.backup
|
|
7
|
+
.env.example
|
|
8
|
+
.htaccess
|
|
9
|
+
.htpasswd
|
|
10
|
+
.svn
|
|
11
|
+
.DS_Store
|
|
12
|
+
admin
|
|
13
|
+
administrator
|
|
14
|
+
admin.php
|
|
15
|
+
api
|
|
16
|
+
api/v1
|
|
17
|
+
api/v2
|
|
18
|
+
app
|
|
19
|
+
assets
|
|
20
|
+
backup
|
|
21
|
+
backups
|
|
22
|
+
backup.zip
|
|
23
|
+
backup.sql
|
|
24
|
+
backup.tar.gz
|
|
25
|
+
bin
|
|
26
|
+
cache
|
|
27
|
+
cgi-bin
|
|
28
|
+
composer.json
|
|
29
|
+
composer.lock
|
|
30
|
+
config
|
|
31
|
+
config.php
|
|
32
|
+
config.json
|
|
33
|
+
console
|
|
34
|
+
cron
|
|
35
|
+
css
|
|
36
|
+
dashboard
|
|
37
|
+
data
|
|
38
|
+
db
|
|
39
|
+
debug
|
|
40
|
+
dev
|
|
41
|
+
docs
|
|
42
|
+
download
|
|
43
|
+
downloads
|
|
44
|
+
dump.sql
|
|
45
|
+
error
|
|
46
|
+
error_log
|
|
47
|
+
export
|
|
48
|
+
files
|
|
49
|
+
fonts
|
|
50
|
+
ftp
|
|
51
|
+
health
|
|
52
|
+
healthz
|
|
53
|
+
home
|
|
54
|
+
images
|
|
55
|
+
img
|
|
56
|
+
include
|
|
57
|
+
includes
|
|
58
|
+
index.php
|
|
59
|
+
info.php
|
|
60
|
+
install
|
|
61
|
+
js
|
|
62
|
+
json
|
|
63
|
+
lib
|
|
64
|
+
log
|
|
65
|
+
logs
|
|
66
|
+
login
|
|
67
|
+
logout
|
|
68
|
+
mail
|
|
69
|
+
media
|
|
70
|
+
metrics
|
|
71
|
+
node_modules
|
|
72
|
+
old
|
|
73
|
+
panel
|
|
74
|
+
phpinfo.php
|
|
75
|
+
phpmyadmin
|
|
76
|
+
private
|
|
77
|
+
public
|
|
78
|
+
readme
|
|
79
|
+
readme.md
|
|
80
|
+
register
|
|
81
|
+
robots.txt
|
|
82
|
+
scripts
|
|
83
|
+
secret
|
|
84
|
+
secrets
|
|
85
|
+
server-status
|
|
86
|
+
setup
|
|
87
|
+
sitemap.xml
|
|
88
|
+
sql
|
|
89
|
+
src
|
|
90
|
+
staging
|
|
91
|
+
static
|
|
92
|
+
stats
|
|
93
|
+
status
|
|
94
|
+
storage
|
|
95
|
+
swagger
|
|
96
|
+
swagger.json
|
|
97
|
+
swagger-ui
|
|
98
|
+
sysadmin
|
|
99
|
+
system
|
|
100
|
+
temp
|
|
101
|
+
test
|
|
102
|
+
tests
|
|
103
|
+
tmp
|
|
104
|
+
tools
|
|
105
|
+
upload
|
|
106
|
+
uploads
|
|
107
|
+
user
|
|
108
|
+
users
|
|
109
|
+
vendor
|
|
110
|
+
web.config
|
|
111
|
+
webhook
|
|
112
|
+
wp-admin
|
|
113
|
+
wp-config.php
|
|
114
|
+
wp-login.php
|
|
115
|
+
.well-known/security.txt
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_schema": "OWASP Top 10 (2021) — stable IDs. Used by tagOwasp() to categorize findings from DAST tools. Update with care; downstream rendering depends on these IDs.",
|
|
3
|
+
"categories": [
|
|
4
|
+
{ "id": "A01:2021", "name": "Broken Access Control" },
|
|
5
|
+
{ "id": "A02:2021", "name": "Cryptographic Failures" },
|
|
6
|
+
{ "id": "A03:2021", "name": "Injection" },
|
|
7
|
+
{ "id": "A04:2021", "name": "Insecure Design" },
|
|
8
|
+
{ "id": "A05:2021", "name": "Security Misconfiguration" },
|
|
9
|
+
{ "id": "A06:2021", "name": "Vulnerable and Outdated Components" },
|
|
10
|
+
{ "id": "A07:2021", "name": "Identification and Authentication Failures" },
|
|
11
|
+
{ "id": "A08:2021", "name": "Software and Data Integrity Failures" },
|
|
12
|
+
{ "id": "A09:2021", "name": "Security Logging and Monitoring Failures" },
|
|
13
|
+
{ "id": "A10:2021", "name": "Server-Side Request Forgery (SSRF)" }
|
|
14
|
+
]
|
|
15
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_schema": "Each entry is a list of allowed flag tokens. Flags ending in ':' (e.g. '-f:') consume the next arg as their value; flags without ':' are standalone switches.",
|
|
3
|
+
"nmap": [
|
|
4
|
+
"-sV", "-Pn", "-p-", "--open", "-T4", "-sn", "-O"
|
|
5
|
+
],
|
|
6
|
+
"gitleaks": [
|
|
7
|
+
"detect", "--no-banner", "-s:", "-f:", "-r:", "-v", "--log-level=", "--exit-code:"
|
|
8
|
+
],
|
|
9
|
+
"osv-scanner": [
|
|
10
|
+
"scan", "source", "--format:", "--output-file:", "-L:", "-r", "--recursive"
|
|
11
|
+
],
|
|
12
|
+
"grype": [
|
|
13
|
+
"dir:.", "-o", "json", "-f"
|
|
14
|
+
],
|
|
15
|
+
"nuclei": [
|
|
16
|
+
"-u:", "-t:", "-severity:", "-s:", "-jsonl", "-o:", "-duc", "-rl:", "-c:", "-nc", "-silent"
|
|
17
|
+
],
|
|
18
|
+
"nikto": [
|
|
19
|
+
"-h:", "-ask", "no", "-Tuning", "-timeout=", "-port="
|
|
20
|
+
],
|
|
21
|
+
"sqlmap": [
|
|
22
|
+
"-u:", "--batch", "--level=1", "--risk=1", "--threads=2", "--timeout=10",
|
|
23
|
+
"--dbms=", "--technique=", "--tamper=", "--random-agent", "--retries=1"
|
|
24
|
+
],
|
|
25
|
+
"ffuf": [
|
|
26
|
+
"-u:", "-w:", "-mc:", "-t:", "-rate:", "-recursion", "-recursion-depth:", "-ac:", "-of:", "-o:", "-ma:", "-fs:"
|
|
27
|
+
],
|
|
28
|
+
"curl": [
|
|
29
|
+
"-sI:", "-s:", "-o:", "-L", "-k", "-A=", "-H=", "--max-time="
|
|
30
|
+
]
|
|
31
|
+
}
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// run-enumerate.js — second phase: HTTP probing + tech inference from
|
|
4
|
+
// the recon partial. Doesn't run any active tools by default.
|
|
5
|
+
|
|
6
|
+
const path = require('node:path');
|
|
7
|
+
const { execFileSync } = require('node:child_process');
|
|
8
|
+
|
|
9
|
+
const { assertTargetInScope } = require('../../../_shared/scope-gate.js');
|
|
10
|
+
const { filterArgs } = require('../../../_shared/allowlist.js');
|
|
11
|
+
const { writePartial, loadPartial } = require('../../../_shared/partial.js');
|
|
12
|
+
|
|
13
|
+
// Parse the recon.md partial's open_ports section into a list of {port, service, version}
|
|
14
|
+
// tuples. We accept both the markdown bullet form we write (- **80/tcp** `http` — nginx)
|
|
15
|
+
// and a raw `PORT/PROTO SERVICE VERSION` form.
|
|
16
|
+
function parseOpenPorts(body) {
|
|
17
|
+
const out = [];
|
|
18
|
+
for (const line of String(body || '').split('\n')) {
|
|
19
|
+
// Markdown bullet form
|
|
20
|
+
let m = line.match(/^- \*\*(\d+\/tcp)\*\* `(\S+)` — (.+?)$/);
|
|
21
|
+
if (m) { out.push({ port: m[1], service: m[2], version: m[3].trim() }); continue; }
|
|
22
|
+
// Raw form
|
|
23
|
+
m = line.match(/^(\d+\/tcp)\s+(\S+)\s+(.+?)$/);
|
|
24
|
+
if (m) out.push({ port: m[1], service: m[2], version: m[3].trim() });
|
|
25
|
+
}
|
|
26
|
+
return out;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// Build the URL the enumerator will probe given a port. We don't know the
|
|
30
|
+
// protocol from nmap alone; assume http for well-known ports, https for
|
|
31
|
+
// 443, otherwise default to http.
|
|
32
|
+
function urlForPort(port, host) {
|
|
33
|
+
const portNum = parseInt(port.split('/')[0], 10);
|
|
34
|
+
const scheme = (portNum === 443 || portNum === 8443) ? 'https' : 'http';
|
|
35
|
+
return `${scheme}://${host}:${portNum}/`;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// Parse a curl -sI response into a { status, headers } object. We split
|
|
39
|
+
// on `\r\n` (curl's default).
|
|
40
|
+
function parseCurlHead(stdout) {
|
|
41
|
+
const lines = String(stdout || '').split(/\r?\n/).filter(Boolean);
|
|
42
|
+
const status = (lines[0] || '').trim();
|
|
43
|
+
const headers = {};
|
|
44
|
+
for (const line of lines.slice(1)) {
|
|
45
|
+
const m = line.match(/^([A-Za-z0-9-]+):\s*(.*?)\s*$/);
|
|
46
|
+
if (m) headers[m[1].toLowerCase()] = m[2];
|
|
47
|
+
}
|
|
48
|
+
return { status, headers };
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// runEnumerate({securityDir, scope, active, execFn?, detectFn?}) ->
|
|
52
|
+
// { ok, partialStatus }
|
|
53
|
+
async function runEnumerate(opts = {}) {
|
|
54
|
+
const sec = opts.securityDir;
|
|
55
|
+
const scope = opts.scope;
|
|
56
|
+
const active = opts.active === true;
|
|
57
|
+
|
|
58
|
+
const execFn = opts.execFn || ((bin, args) => {
|
|
59
|
+
return execFileSync(bin, args, { encoding: 'utf8', timeout: 10_000 });
|
|
60
|
+
});
|
|
61
|
+
const detectFn = opts.detectFn || require('../../../_shared/detect.js').detectTools;
|
|
62
|
+
|
|
63
|
+
const tools = detectFn(['curl', 'nuclei'], { cacheDir: sec });
|
|
64
|
+
const curlPresent = !!(tools.curl && tools.curl.present);
|
|
65
|
+
const nucleiPresent = !!(tools.nuclei && tools.nuclei.present);
|
|
66
|
+
|
|
67
|
+
// Load recon.md if it exists.
|
|
68
|
+
const recon = loadPartial({ securityDir: sec, phase: 'recon' });
|
|
69
|
+
const openPorts = recon ? parseOpenPorts(recon.body) : [];
|
|
70
|
+
|
|
71
|
+
// Determine which hosts to probe from the scope body. We accept the
|
|
72
|
+
// allowlist block as defined by scope-parser: `## allowlist` then a
|
|
73
|
+
// `hosts:` line followed by ` - value` items.
|
|
74
|
+
const hostAllowlist = (() => {
|
|
75
|
+
const lines = (scope.body || '').split('\n');
|
|
76
|
+
const hosts = [];
|
|
77
|
+
let inHosts = false;
|
|
78
|
+
for (const line of lines) {
|
|
79
|
+
if (/^hosts:\s*$/.test(line)) { inHosts = true; continue; }
|
|
80
|
+
if (inHosts) {
|
|
81
|
+
const m = line.match(/^\s+-\s+(.+?)\s*$/);
|
|
82
|
+
if (m) hosts.push(m[1]);
|
|
83
|
+
else if (line.trim() !== '' && !/^\s/.test(line)) inHosts = false;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
return hosts;
|
|
87
|
+
})();
|
|
88
|
+
|
|
89
|
+
// Degraded paths: missing recon OR no tools.
|
|
90
|
+
const degraded = [];
|
|
91
|
+
if (!recon) degraded.push('recon.md ausente — sem superfÃcie para enumerar');
|
|
92
|
+
if (!curlPresent && !nucleiPresent) degraded.push('curl e nuclei ausentes — sem probing HTTP possÃvel');
|
|
93
|
+
|
|
94
|
+
if (degraded.length && openPorts.length === 0) {
|
|
95
|
+
writePartial({
|
|
96
|
+
securityDir: sec,
|
|
97
|
+
phase: 'enumerate',
|
|
98
|
+
mode: active ? 'active' : 'passive',
|
|
99
|
+
scope,
|
|
100
|
+
status: 'incomplete',
|
|
101
|
+
tools,
|
|
102
|
+
dependsOn: ['recon'],
|
|
103
|
+
sections: {
|
|
104
|
+
degraded_checks: degraded.join('\n')
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
return { ok: true, partialStatus: 'incomplete' };
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
// Probe each host:port from the recon.
|
|
111
|
+
const surfaceLines = [];
|
|
112
|
+
const techHits = new Set();
|
|
113
|
+
let anyProbed = false;
|
|
114
|
+
let refusedCount = 0;
|
|
115
|
+
|
|
116
|
+
if (curlPresent && openPorts.length > 0) {
|
|
117
|
+
for (const host of hostAllowlist) {
|
|
118
|
+
for (const p of openPorts) {
|
|
119
|
+
// Gate: refuse out-of-scope targets BEFORE any probing.
|
|
120
|
+
const inScope = assertTargetInScope(scope, { host, port: p.port }, { refusalsDir: sec });
|
|
121
|
+
if (!inScope) { refusedCount++; continue; }
|
|
122
|
+
|
|
123
|
+
const url = urlForPort(p.port, host);
|
|
124
|
+
const args = filterArgs('curl', ['-sI', url]);
|
|
125
|
+
try {
|
|
126
|
+
const out = execFn('curl', args, { timeout: 10_000 });
|
|
127
|
+
const { status, headers } = parseCurlHead(out && out.stdout ? out.stdout : out);
|
|
128
|
+
surfaceLines.push(`- **${url}** — ${status || 'no status'}`);
|
|
129
|
+
if (headers.server) {
|
|
130
|
+
techHits.add(`server: ${headers.server}`);
|
|
131
|
+
surfaceLines.push(` - server: ${headers.server}`);
|
|
132
|
+
}
|
|
133
|
+
if (headers['x-powered-by']) {
|
|
134
|
+
techHits.add(`x-powered-by: ${headers['x-powered-by']}`);
|
|
135
|
+
surfaceLines.push(` - x-powered-by: ${headers['x-powered-by']}`);
|
|
136
|
+
}
|
|
137
|
+
if (headers['set-cookie']) {
|
|
138
|
+
surfaceLines.push(` - set-cookie: ${headers['set-cookie']}`);
|
|
139
|
+
}
|
|
140
|
+
anyProbed = true;
|
|
141
|
+
} catch (_) {
|
|
142
|
+
surfaceLines.push(`- **${url}** — probe failed`);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
// nuclei passive (only if present) — we don't fully parse nuclei output here;
|
|
149
|
+
// the report renderer will include the JSON dump if found.
|
|
150
|
+
const partialStatus = (anyProbed && refusedCount === 0 && degraded.length === 0) ? 'complete' : 'incomplete';
|
|
151
|
+
|
|
152
|
+
writePartial({
|
|
153
|
+
securityDir: sec,
|
|
154
|
+
phase: 'enumerate',
|
|
155
|
+
mode: active ? 'active' : 'passive',
|
|
156
|
+
scope,
|
|
157
|
+
status: partialStatus,
|
|
158
|
+
tools,
|
|
159
|
+
dependsOn: ['recon'],
|
|
160
|
+
sections: {
|
|
161
|
+
surface: surfaceLines.length ? surfaceLines.join('\n') : '_(nenhuma superfÃcie enumerada)_',
|
|
162
|
+
tech: techHits.size ? Array.from(techHits).map(t => `- ${t}`).join('\n') : '_(tech não inferida — curl ausente ou nenhum host acessÃvel)_',
|
|
163
|
+
...(degraded.length ? { degraded_checks: degraded.join('\n') } : {})
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
return { ok: true, partialStatus };
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
module.exports = { runEnumerate, parseOpenPorts, parseCurlHead, urlForPort };
|
|
170
|
+
|
|
171
|
+
if (require.main === module) {
|
|
172
|
+
require('../../../_shared/cli-runner.js').runFromArgv({
|
|
173
|
+
fn: ({ securityDir, scopePath, active, target } = {}) => {
|
|
174
|
+
const { loadScope } = require('../../../_shared/scope-gate.js');
|
|
175
|
+
const scope = loadScope(scopePath);
|
|
176
|
+
return runEnumerate({ securityDir, scope, active, target });
|
|
177
|
+
},
|
|
178
|
+
argMap: { 'securityDir': 'securityDir', 'scope': 'scopePath', 'active': 'active', 'target': 'target' }
|
|
179
|
+
});
|
|
180
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
---
|
|
2
|
+
code: wize-sec-enumerate
|
|
3
|
+
name: wize-sec-enumerate
|
|
4
|
+
overlay: security
|
|
5
|
+
module: security-overlay
|
|
6
|
+
owner: red-teamer
|
|
7
|
+
status: ready
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# wize-sec-enumerate — Surface enumeration
|
|
11
|
+
|
|
12
|
+
Reads `recon.md`, probes HTTP/S ports via `curl -sI`, infers tech from `Server` and `X-Powered-By` headers. Writes `enumerate.md` with `## surface` and `## tech` sections, plus `depends_on: [recon]` in the frontmatter so the renderer orders parciais.
|
|
13
|
+
|
|
14
|
+
## Usage
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
/wize-sec-enumerate
|
|
18
|
+
/wize-sec-enumerate --active # currently a no-op for this phase; reserved for future
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Behavior
|
|
22
|
+
|
|
23
|
+
- Loads `.wize/security/scope.md` first; aborts on invalid scope.
|
|
24
|
+
- Reads `recon.md` partial; if missing, marks `partial_status: incomplete` and writes a degraded partial so the audit trail is complete.
|
|
25
|
+
- Probes **only the scope's allowlisted hosts**, not the recon's listed services. Out-of-scope hosts are never probed.
|
|
26
|
+
- curl and nuclei are detected via `command -v`; missing tools degrade the check rather than aborting.
|
|
27
|
+
- Calls `assertTargetInScope` for every probed target. Refusals are appended to `.refusals.log`.
|
|
28
|
+
|
|
29
|
+
## Output
|
|
30
|
+
|
|
31
|
+
- `.wize/security/enumerate.md` — partial with `## surface` (probed endpoints) and `## tech` (deduplicated `server`/`x-powered-by` hits).
|
|
32
|
+
- `.wize/security/.refusals.log` — appended on out-of-scope targets.
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
admin
|
|
2
|
+
api
|
|
3
|
+
app
|
|
4
|
+
auth
|
|
5
|
+
backup
|
|
6
|
+
blog
|
|
7
|
+
cart
|
|
8
|
+
catalog
|
|
9
|
+
cms
|
|
10
|
+
config
|
|
11
|
+
console
|
|
12
|
+
contact
|
|
13
|
+
dashboard
|
|
14
|
+
data
|
|
15
|
+
db
|
|
16
|
+
debug
|
|
17
|
+
default
|
|
18
|
+
demo
|
|
19
|
+
dev
|
|
20
|
+
docs
|
|
21
|
+
download
|
|
22
|
+
editor
|
|
23
|
+
email
|
|
24
|
+
error
|
|
25
|
+
example
|
|
26
|
+
export
|
|
27
|
+
feed
|
|
28
|
+
file
|
|
29
|
+
files
|
|
30
|
+
forum
|
|
31
|
+
gallery
|
|
32
|
+
help
|
|
33
|
+
home
|
|
34
|
+
images
|
|
35
|
+
img
|
|
36
|
+
import
|
|
37
|
+
index
|
|
38
|
+
info
|
|
39
|
+
internal
|
|
40
|
+
js
|
|
41
|
+
json
|
|
42
|
+
lib
|
|
43
|
+
login
|
|
44
|
+
logout
|
|
45
|
+
mail
|
|
46
|
+
manage
|
|
47
|
+
member
|
|
48
|
+
message
|
|
49
|
+
metrics
|
|
50
|
+
mobile
|
|
51
|
+
new
|
|
52
|
+
news
|
|
53
|
+
node
|
|
54
|
+
notes
|
|
55
|
+
old
|
|
56
|
+
order
|
|
57
|
+
page
|
|
58
|
+
pages
|
|
59
|
+
panel
|
|
60
|
+
password
|
|
61
|
+
pdf
|
|
62
|
+
photo
|
|
63
|
+
php
|
|
64
|
+
ping
|
|
65
|
+
plugins
|
|
66
|
+
portal
|
|
67
|
+
post
|
|
68
|
+
posts
|
|
69
|
+
private
|
|
70
|
+
profile
|
|
71
|
+
public
|
|
72
|
+
readme
|
|
73
|
+
register
|
|
74
|
+
report
|
|
75
|
+
reports
|
|
76
|
+
reset
|
|
77
|
+
robots.txt
|
|
78
|
+
rss
|
|
79
|
+
search
|
|
80
|
+
secure
|
|
81
|
+
server
|
|
82
|
+
service
|
|
83
|
+
settings
|
|
84
|
+
setup
|
|
85
|
+
shop
|
|
86
|
+
sitemap
|
|
87
|
+
sitemap.xml
|
|
88
|
+
staff
|
|
89
|
+
static
|
|
90
|
+
stats
|
|
91
|
+
status
|
|
92
|
+
store
|
|
93
|
+
style.css
|
|
94
|
+
styles
|
|
95
|
+
subscribe
|
|
96
|
+
support
|
|
97
|
+
swagger
|
|
98
|
+
system
|
|
99
|
+
temp
|
|
100
|
+
test
|
|
101
|
+
tests
|
|
102
|
+
tmp
|
|
103
|
+
tools
|
|
104
|
+
tracker
|
|
105
|
+
upload
|
|
106
|
+
uploads
|
|
107
|
+
user
|
|
108
|
+
users
|
|
109
|
+
vendor
|
|
110
|
+
version
|
|
111
|
+
web
|
|
112
|
+
webhook
|
|
113
|
+
webmaster
|
|
114
|
+
widget
|
|
115
|
+
wiki
|
|
116
|
+
xml
|
|
117
|
+
xmlrpc
|