wize-dev-kit 0.14.0 → 0.16.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/ARCH.md +24 -77
- package/CHANGELOG.md +24 -0
- package/DECISIONS.md +1 -27
- package/README.md +7 -2
- package/ROSTER.md +3 -11
- package/adapters/README.md +7 -7
- package/adapters/antigravity/README.md +5 -5
- package/adapters/claude-code/README.md +1 -1
- package/adapters/codex/README.md +5 -5
- package/adapters/codex/adapter.yaml +1 -1
- package/adapters/codex/render.js +1 -1
- package/adapters/continue/README.md +5 -5
- package/adapters/cursor/README.md +2 -2
- package/adapters/generic/README.md +1 -1
- package/adapters/kimi-code/README.md +5 -5
- package/adapters/kimi-code/render.js +2 -2
- package/adapters/opencode/README.md +3 -3
- package/adapters/opencode/render.js +1 -27
- package/adapters/windsurf/README.md +3 -3
- package/package.json +1 -1
- package/schemas/agent.schema.json +2 -2
- package/schemas/workflow.schema.json +1 -1
- package/src/app-overlay/wize-app-release-channels/workflow.md +0 -2
- package/src/app-overlay/wize-app-scaffold/workflow.md +0 -2
- package/src/app-overlay/wize-app-store-listing/workflow.md +0 -2
- package/src/builder-skills/wize-create-agent/workflow.md +0 -2
- package/src/builder-skills/wize-create-skill/workflow.md +0 -2
- package/src/builder-skills/wize-create-workflow/workflow.md +0 -2
- package/src/core-skills/module.yaml +3 -0
- package/src/core-skills/wize-advanced-elicitation/skill.md +0 -2
- package/src/core-skills/wize-brainstorming/skill.md +0 -2
- package/src/core-skills/wize-eli5/skill.md +72 -0
- package/src/core-skills/wize-review-adversarial/skill.md +0 -3
- package/src/core-skills/wize-shard-doc/skill.md +0 -2
- package/src/method-skills/1-analysis/wize-agent-analyst/agent.yaml +0 -3
- package/src/method-skills/1-analysis/wize-document-project/workflow.md +20 -213
- package/src/method-skills/1-analysis/wize-prfaq/workflow.md +11 -152
- package/src/method-skills/1-analysis/wize-product-brief/workflow.md +19 -92
- package/src/method-skills/1-analysis/wize-research/workflow.md +12 -39
- package/src/method-skills/1-analysis/wize-trigger-map/workflow.md +16 -82
- package/src/method-skills/2-plan-workflows/wize-create-prd/workflow.md +23 -135
- package/src/method-skills/2-plan-workflows/wize-ux-design/workflow.md +28 -134
- package/src/method-skills/2-plan-workflows/wize-ux-scenarios/workflow.md +15 -93
- package/src/method-skills/2-plan-workflows/wize-validate-prd/workflow.md +12 -108
- package/src/method-skills/3-solutioning/wize-check-implementation-readiness/workflow.md +11 -103
- package/src/method-skills/3-solutioning/wize-create-architecture/workflow.md +48 -55
- package/src/method-skills/3-solutioning/wize-create-epics-and-stories/workflow.md +15 -154
- package/src/method-skills/3-solutioning/wize-design-system/workflow.md +22 -184
- package/src/method-skills/3-solutioning/wize-nfr-principles/workflow.md +17 -145
- package/src/method-skills/3-solutioning/wize-tech-vision/workflow.md +22 -130
- package/src/method-skills/4-implementation/wize-agent-dev/persona.md +0 -12
- package/src/method-skills/4-implementation/wize-code-review/workflow.md +12 -54
- package/src/method-skills/4-implementation/wize-create-story/workflow.md +10 -154
- package/src/method-skills/4-implementation/wize-dev-story/workflow.md +17 -185
- package/src/method-skills/4-implementation/wize-quick-dev/workflow.md +18 -136
- package/src/method-skills/4-implementation/wize-retrospective/workflow.md +10 -114
- package/src/method-skills/4-implementation/wize-sprint-planning/workflow.md +11 -78
- package/src/method-skills/4-implementation/wize-sprint-status/workflow.md +11 -45
- package/src/method-skills/module.yaml +0 -28
- package/src/orchestrator-skills/module.yaml +1 -7
- package/src/orchestrator-skills/wize-help/skill.md +67 -227
- package/src/orchestrator-skills/wize-onboarding/workflow.md +14 -78
- package/src/orchestrator-skills/wize-orchestrator/agent.yaml +0 -2
- package/src/orchestrator-skills/wize-orchestrator/persona.md +3 -44
- package/src/orchestrator-skills/wize-party-mode/workflow.md +0 -2
- package/src/tea-skills/wize-tea-design/workflow.md +13 -107
- package/src/tea-skills/wize-tea-gate/workflow.md +25 -118
- package/src/tea-skills/wize-tea-nfr/workflow.md +14 -107
- package/src/tea-skills/wize-tea-review/workflow.md +13 -123
- package/src/tea-skills/wize-tea-risk/workflow.md +10 -113
- package/src/tea-skills/wize-tea-trace/workflow.md +12 -86
- package/src/web-overlay/wize-web-deploy/workflow.md +0 -2
- package/src/web-overlay/wize-web-scaffold/workflow.md +0 -2
- package/src/web-overlay/wize-web-seo-audit/workflow.md +0 -2
- package/tools/check-eli5-all-adapters.js +50 -0
- package/tools/installer/onboarding.js +20 -14
- package/tools/installer/render-shared.js +14 -158
- package/tools/installer/validators/run-all.js +2 -3
- package/tools/installer/wize-cli.js +70 -499
- package/AGENTS.md +0 -37
- package/README.es.md +0 -294
- package/README.pt-BR.md +0 -292
- package/docs/harnesses/antigravity.md +0 -20
- package/docs/harnesses/antigravity.pt-BR.md +0 -20
- package/docs/harnesses/claude-code.md +0 -23
- package/docs/harnesses/claude-code.pt-BR.md +0 -23
- package/docs/harnesses/codex.md +0 -21
- package/docs/harnesses/codex.pt-BR.md +0 -21
- package/docs/harnesses/continue.md +0 -21
- package/docs/harnesses/continue.pt-BR.md +0 -21
- package/docs/harnesses/cursor.md +0 -22
- package/docs/harnesses/cursor.pt-BR.md +0 -22
- package/docs/harnesses/generic.md +0 -20
- package/docs/harnesses/generic.pt-BR.md +0 -20
- package/docs/harnesses/kimi-code.md +0 -19
- package/docs/harnesses/kimi-code.pt-BR.md +0 -19
- package/docs/harnesses/opencode.md +0 -31
- package/docs/harnesses/opencode.pt-BR.md +0 -31
- package/docs/harnesses/windsurf.md +0 -22
- package/docs/harnesses/windsurf.pt-BR.md +0 -22
- package/src/core-skills/wize-customize/skill.md +0 -116
- package/src/core-skills/wize-editorial-review-prose/skill.md +0 -94
- package/src/core-skills/wize-editorial-review-structure/skill.md +0 -99
- package/src/core-skills/wize-grill/skill.md +0 -77
- package/src/core-skills/wize-index-docs/skill.md +0 -119
- package/src/core-skills/wize-pre-pr-check/skill.md +0 -134
- package/src/core-skills/wize-review-edge-case-hunter/skill.md +0 -115
- package/src/core-skills/wize-spec/assets/headless-schemas.md +0 -39
- package/src/core-skills/wize-spec/assets/spec-template.md +0 -40
- package/src/core-skills/wize-spec/customize.toml +0 -20
- package/src/core-skills/wize-spec/skill.md +0 -112
- package/src/method-skills/1-analysis/wize-document-project/documentation-requirements.csv +0 -12
- package/src/method-skills/1-analysis/wize-document-project/templates/api-contracts-template.md +0 -38
- package/src/method-skills/1-analysis/wize-document-project/templates/architecture-template.md +0 -54
- package/src/method-skills/1-analysis/wize-document-project/templates/component-inventory-template.md +0 -40
- package/src/method-skills/1-analysis/wize-document-project/templates/contribution-guide-template.md +0 -34
- package/src/method-skills/1-analysis/wize-document-project/templates/data-models-template.md +0 -36
- package/src/method-skills/1-analysis/wize-document-project/templates/deep-dive-template.md +0 -312
- package/src/method-skills/1-analysis/wize-document-project/templates/deployment-guide-template.md +0 -42
- package/src/method-skills/1-analysis/wize-document-project/templates/development-guide-template.md +0 -61
- package/src/method-skills/1-analysis/wize-document-project/templates/index-template.md +0 -185
- package/src/method-skills/1-analysis/wize-document-project/templates/project-overview-template.md +0 -110
- package/src/method-skills/1-analysis/wize-document-project/templates/project-scan-report-schema.json +0 -159
- package/src/method-skills/1-analysis/wize-document-project/templates/source-tree-template.md +0 -142
- package/src/method-skills/1-analysis/wize-domain-research/customize.toml +0 -14
- package/src/method-skills/1-analysis/wize-domain-research/domain-steps/step-01-init.md +0 -49
- package/src/method-skills/1-analysis/wize-domain-research/domain-steps/step-02-domain-analysis.md +0 -39
- package/src/method-skills/1-analysis/wize-domain-research/domain-steps/step-03-competitive-landscape.md +0 -39
- package/src/method-skills/1-analysis/wize-domain-research/domain-steps/step-04-regulatory-focus.md +0 -39
- package/src/method-skills/1-analysis/wize-domain-research/domain-steps/step-05-technical-trends.md +0 -39
- package/src/method-skills/1-analysis/wize-domain-research/domain-steps/step-06-research-synthesis.md +0 -43
- package/src/method-skills/1-analysis/wize-domain-research/research.template.md +0 -31
- package/src/method-skills/1-analysis/wize-domain-research/workflow.md +0 -58
- package/src/method-skills/1-analysis/wize-market-research/customize.toml +0 -14
- package/src/method-skills/1-analysis/wize-market-research/research.template.md +0 -31
- package/src/method-skills/1-analysis/wize-market-research/steps/step-01-init.md +0 -57
- package/src/method-skills/1-analysis/wize-market-research/steps/step-02-customer-behavior.md +0 -39
- package/src/method-skills/1-analysis/wize-market-research/steps/step-03-customer-pain-points.md +0 -37
- package/src/method-skills/1-analysis/wize-market-research/steps/step-04-customer-decisions.md +0 -39
- package/src/method-skills/1-analysis/wize-market-research/steps/step-05-competitive-analysis.md +0 -37
- package/src/method-skills/1-analysis/wize-market-research/steps/step-06-research-completion.md +0 -47
- package/src/method-skills/1-analysis/wize-market-research/workflow.md +0 -66
- package/src/method-skills/1-analysis/wize-refresh-knowledge/workflow.md +0 -129
- package/src/method-skills/1-analysis/wize-technical-research/customize.toml +0 -14
- package/src/method-skills/1-analysis/wize-technical-research/research.template.md +0 -31
- package/src/method-skills/1-analysis/wize-technical-research/technical-steps/step-01-init.md +0 -49
- package/src/method-skills/1-analysis/wize-technical-research/technical-steps/step-02-technical-overview.md +0 -45
- package/src/method-skills/1-analysis/wize-technical-research/technical-steps/step-03-integration-patterns.md +0 -39
- package/src/method-skills/1-analysis/wize-technical-research/technical-steps/step-04-architectural-patterns.md +0 -39
- package/src/method-skills/1-analysis/wize-technical-research/technical-steps/step-05-implementation-research.md +0 -42
- package/src/method-skills/1-analysis/wize-technical-research/technical-steps/step-06-research-synthesis.md +0 -46
- package/src/method-skills/1-analysis/wize-technical-research/workflow.md +0 -60
- package/src/method-skills/2-plan-workflows/wize-edit-prd/workflow.md +0 -110
- package/src/method-skills/3-solutioning/wize-create-architecture/architecture-decision-template.md +0 -41
- package/src/method-skills/3-solutioning/wize-create-architecture/customize.toml +0 -20
- package/src/method-skills/3-solutioning/wize-create-architecture/steps/step-01-init.md +0 -95
- package/src/method-skills/3-solutioning/wize-create-architecture/steps/step-01b-continue.md +0 -32
- package/src/method-skills/3-solutioning/wize-create-architecture/steps/step-02-context.md +0 -126
- package/src/method-skills/3-solutioning/wize-create-architecture/steps/step-03-starter.md +0 -110
- package/src/method-skills/3-solutioning/wize-create-architecture/steps/step-04-decisions.md +0 -129
- package/src/method-skills/3-solutioning/wize-create-architecture/steps/step-05-patterns.md +0 -109
- package/src/method-skills/3-solutioning/wize-create-architecture/steps/step-06-structure.md +0 -97
- package/src/method-skills/3-solutioning/wize-create-architecture/steps/step-07-validation.md +0 -124
- package/src/method-skills/3-solutioning/wize-create-architecture/steps/step-08-complete.md +0 -59
- package/src/method-skills/3-solutioning/wize-project-context/workflow.md +0 -120
- package/src/method-skills/4-implementation/wize-changelog/workflow.md +0 -184
- package/src/method-skills/4-implementation/wize-checkpoint-preview/workflow.md +0 -117
- package/src/method-skills/4-implementation/wize-code-review/customize.toml +0 -21
- package/src/method-skills/4-implementation/wize-code-review/steps/step-01-gather-context.md +0 -64
- package/src/method-skills/4-implementation/wize-code-review/steps/step-02-review.md +0 -40
- package/src/method-skills/4-implementation/wize-code-review/steps/step-03-triage.md +0 -43
- package/src/method-skills/4-implementation/wize-code-review/steps/step-04-present.md +0 -100
- package/src/method-skills/4-implementation/wize-correct-course/workflow.md +0 -93
- package/src/method-skills/4-implementation/wize-investigate/workflow.md +0 -123
- package/src/method-skills/4-implementation/wize-release/workflow.md +0 -162
- package/src/orchestrator-skills/wize/skill.md +0 -164
- package/src/orchestrator-skills/wize-check/skill.md +0 -98
- package/src/security-overlay/_shared/allowlist.js +0 -154
- package/src/security-overlay/_shared/backlog.js +0 -169
- package/src/security-overlay/_shared/cli-runner.js +0 -87
- package/src/security-overlay/_shared/cvss.js +0 -108
- package/src/security-overlay/_shared/detect.js +0 -125
- package/src/security-overlay/_shared/install-script.js +0 -205
- package/src/security-overlay/_shared/invoke-phase.js +0 -86
- package/src/security-overlay/_shared/owasp.js +0 -56
- package/src/security-overlay/_shared/partial.js +0 -225
- package/src/security-overlay/_shared/preflight.js +0 -175
- package/src/security-overlay/_shared/scope-gate.js +0 -172
- package/src/security-overlay/_shared/scope-parser.js +0 -147
- package/src/security-overlay/agents/red-teamer/agent.yaml +0 -54
- package/src/security-overlay/agents/red-teamer/persona.md +0 -49
- package/src/security-overlay/data/common.txt +0 -115
- package/src/security-overlay/data/owasp-top10.json +0 -15
- package/src/security-overlay/data/tool-allowlist.json +0 -31
- package/src/security-overlay/skills/wize-sec-enumerate/scripts/run-enumerate.js +0 -180
- package/src/security-overlay/skills/wize-sec-enumerate/skill.md +0 -34
- package/src/security-overlay/skills/wize-sec-exploit/data/common.txt +0 -117
- package/src/security-overlay/skills/wize-sec-exploit/scripts/run-ffuf.js +0 -147
- package/src/security-overlay/skills/wize-sec-exploit/scripts/run-nikto.js +0 -145
- package/src/security-overlay/skills/wize-sec-exploit/scripts/run-nuclei.js +0 -176
- package/src/security-overlay/skills/wize-sec-exploit/scripts/run-sqlmap.js +0 -139
- package/src/security-overlay/skills/wize-sec-pentest/scripts/run-pipeline.js +0 -184
- package/src/security-overlay/skills/wize-sec-pentest/skill.md +0 -54
- package/src/security-overlay/skills/wize-sec-recon/scripts/run-gitleaks.js +0 -139
- package/src/security-overlay/skills/wize-sec-recon/scripts/run-osv.js +0 -227
- package/src/security-overlay/skills/wize-sec-recon/scripts/run-recon.js +0 -162
- package/src/security-overlay/skills/wize-sec-recon/skill.md +0 -37
- package/src/security-overlay/skills/wize-sec-report/scripts/render-report.js +0 -1033
- package/src/security-overlay/skills/wize-sec-scope/scripts/generate-scope.js +0 -106
- package/src/security-overlay/skills/wize-sec-scope/skill.md +0 -52
- package/src/tea-skills/wize-qa-generate-e2e-tests/workflow.md +0 -121
- package/tools/installer/baseline.js +0 -128
- package/tools/installer/commands/agent.js +0 -197
- package/tools/installer/commands/doctor.js +0 -319
- package/tools/installer/commands/document-project.js +0 -93
- package/tools/installer/commands/sync.js +0 -45
- package/tools/installer/commands/update.js +0 -172
- package/tools/installer/document-project/batch-scanner.js +0 -93
- package/tools/installer/document-project/classify.js +0 -170
- package/tools/installer/document-project/modes/deep-dive.js +0 -196
- package/tools/installer/document-project/modes/full-rescan.js +0 -15
- package/tools/installer/document-project/modes/initial-scan.js +0 -100
- package/tools/installer/document-project/modes/quick.js +0 -211
- package/tools/installer/document-project/render-index.js +0 -101
- package/tools/installer/document-project/state.js +0 -110
- package/tools/installer/version-check.js +0 -117
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
// scope-parser.js — file-first parser/validator for `.wize/security/scope.md`.
|
|
4
|
-
//
|
|
5
|
-
// Format (ADR-002):
|
|
6
|
-
// ---
|
|
7
|
-
// accepted_by: <string>
|
|
8
|
-
// accepted_at: <ISO-8601>
|
|
9
|
-
// scope_sha256: <hex SHA-256 of the body below>
|
|
10
|
-
// ---
|
|
11
|
-
//
|
|
12
|
-
// ## allowlist
|
|
13
|
-
// ...
|
|
14
|
-
//
|
|
15
|
-
// This module is the single source of truth for parsing + validating the
|
|
16
|
-
// scope. Skills that touch offensive tools must call loadScope() and abort
|
|
17
|
-
// on any ScopeError.
|
|
18
|
-
|
|
19
|
-
const fs = require('node:fs');
|
|
20
|
-
const crypto = require('node:crypto');
|
|
21
|
-
|
|
22
|
-
class ScopeError extends Error {
|
|
23
|
-
constructor(code, field, message) {
|
|
24
|
-
super(message || `${code}${field ? ` (${field})` : ''}`);
|
|
25
|
-
this.name = 'ScopeError';
|
|
26
|
-
this.code = code;
|
|
27
|
-
this.field = field || null;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
const REQUIRED_FIELDS = ['accepted_by', 'accepted_at', 'scope_sha256'];
|
|
32
|
-
|
|
33
|
-
// Split a `scope.md` text into { frontmatter, body }.
|
|
34
|
-
// The frontmatter is the YAML block delimited by `---` lines at the very top.
|
|
35
|
-
// We do NOT use a YAML library (zero-dep); we accept a flat `key: value` shape
|
|
36
|
-
// only, which is the entire scope of this overlay's frontmatter (ADR-002).
|
|
37
|
-
function parseScope(mdText) {
|
|
38
|
-
if (typeof mdText !== 'string' || !mdText.startsWith('---\n') && mdText !== '---') {
|
|
39
|
-
throw new ScopeError('INVALID_FORMAT', null,
|
|
40
|
-
'scope.md must start with a YAML frontmatter block (--- on line 1)');
|
|
41
|
-
}
|
|
42
|
-
// Normalize: accept either "---\n...\n---\n\nbody" or "---\n...\n---\nbody".
|
|
43
|
-
// The trailing \n after the closing --- is part of the separator, NOT the body.
|
|
44
|
-
// This is what the user signs when they run --sign-scope (and what they
|
|
45
|
-
// expect when the hash is computed on the body they wrote).
|
|
46
|
-
const fmMatch = mdText.match(/^---\n([\s\S]*?)\n---\n/);
|
|
47
|
-
if (!fmMatch) {
|
|
48
|
-
throw new ScopeError('INVALID_FORMAT', null,
|
|
49
|
-
'scope.md frontmatter is missing or not terminated by a second --- line');
|
|
50
|
-
}
|
|
51
|
-
const fmText = fmMatch[1];
|
|
52
|
-
const body = mdText.slice(fmMatch[0].length);
|
|
53
|
-
|
|
54
|
-
const frontmatter = {};
|
|
55
|
-
for (const line of fmText.split('\n')) {
|
|
56
|
-
const m = line.match(/^([a-zA-Z_][a-zA-Z0-9_-]*):\s*(.*?)\s*$/);
|
|
57
|
-
if (!m) continue;
|
|
58
|
-
frontmatter[m[1]] = m[2].replace(/^['"]|['"]$/g, ''); // strip wrapping quotes
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
return { frontmatter, body };
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
// Validate a parsed scope. Returns true on success; throws ScopeError otherwise.
|
|
65
|
-
// opts: { now?: Date } — for future `accepted_at` warning. Currently unused but
|
|
66
|
-
// reserved so we can add a warn() channel without breaking callers.
|
|
67
|
-
function validateScope(scope, opts = {}) {
|
|
68
|
-
if (!scope || typeof scope !== 'object') {
|
|
69
|
-
throw new ScopeError('INVALID_FORMAT', null, 'scope is not an object');
|
|
70
|
-
}
|
|
71
|
-
const fm = scope.frontmatter || {};
|
|
72
|
-
for (const field of REQUIRED_FIELDS) {
|
|
73
|
-
if (!fm[field] || typeof fm[field] !== 'string' || fm[field].trim() === '') {
|
|
74
|
-
throw new ScopeError('MISSING_FIELDS', field,
|
|
75
|
-
`scope.md frontmatter is missing required field "${field}" — ` +
|
|
76
|
-
`crie e assine com "wize-sec-pentest --sign-scope" ou preencha manualmente`);
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
// Hash integrity. Compute SHA-256 of the body and compare to scope_sha256.
|
|
81
|
-
// We re-parse the body as-is (already stripped of frontmatter) — the original
|
|
82
|
-
// signing was done on the raw body bytes, so byte-equality matters.
|
|
83
|
-
const expected = computeScopeSha256(scope.body || '');
|
|
84
|
-
if (expected !== fm.scope_sha256) {
|
|
85
|
-
throw new ScopeError('HASH_MISMATCH', 'scope_sha256',
|
|
86
|
-
`scope.md body was modified after acceptance (expected ${expected.slice(0, 12)}…, ` +
|
|
87
|
-
`got ${String(fm.scope_sha256).slice(0, 12)}…) — re-assine com "wize-sec-pentest --sign-scope"`);
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
// Soft check: accepted_at in the future is a warning, not an error.
|
|
91
|
-
// We don't surface the warning through this function (no logger plumbed
|
|
92
|
-
// here); consumers can inspect frontmatter.accepted_at themselves.
|
|
93
|
-
|
|
94
|
-
return true;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
function computeScopeSha256(bodyText) {
|
|
98
|
-
return crypto.createHash('sha256').update(String(bodyText || ''), 'utf8').digest('hex');
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
// Read + parse + validate a scope.md file. The single entry point used by
|
|
102
|
-
// every offensive skill (AC-E02-1, AC-E02-3).
|
|
103
|
-
function loadScope(scopePath) {
|
|
104
|
-
if (!fs.existsSync(scopePath)) {
|
|
105
|
-
throw new ScopeError('MISSING_FILE', null,
|
|
106
|
-
`scope.md ausente em ${scopePath} — crie e assine em .wize/security/scope.md antes de rodar o pipeline`);
|
|
107
|
-
}
|
|
108
|
-
const text = fs.readFileSync(scopePath, 'utf8');
|
|
109
|
-
const scope = parseScope(text);
|
|
110
|
-
validateScope(scope);
|
|
111
|
-
return scope;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
// signScope(scopePath) — read, parse, recompute SHA-256 of the body, and
|
|
115
|
-
// rewrite the scope_sha256 field in the frontmatter. Returns metadata about
|
|
116
|
-
// the signed scope. Throws ScopeError on missing file or invalid format.
|
|
117
|
-
// Idempotent: running twice on the same body produces the same hash.
|
|
118
|
-
function signScope(scopePath) {
|
|
119
|
-
if (!fs.existsSync(scopePath)) {
|
|
120
|
-
throw new ScopeError('MISSING_FILE', null,
|
|
121
|
-
`scope.md ausente em ${scopePath} — crie com wize-sec-scope antes de assinar`);
|
|
122
|
-
}
|
|
123
|
-
const text = fs.readFileSync(scopePath, 'utf8');
|
|
124
|
-
const scope = parseScope(text);
|
|
125
|
-
|
|
126
|
-
const newHash = computeScopeSha256(scope.body);
|
|
127
|
-
|
|
128
|
-
// Replace scope_sha256 within the frontmatter block only (avoid
|
|
129
|
-
// accidental matches in the body).
|
|
130
|
-
const fmMatch = text.match(/^---\n([\s\S]*?)\n---\n/);
|
|
131
|
-
const fmBlock = fmMatch[0];
|
|
132
|
-
const newFmBlock = fmBlock.replace(/^(scope_sha256:\s*).*$/m, `$1${newHash}`);
|
|
133
|
-
const newText = text.replace(fmBlock, newFmBlock);
|
|
134
|
-
|
|
135
|
-
fs.writeFileSync(scopePath, newText, 'utf8');
|
|
136
|
-
|
|
137
|
-
return { path: scopePath, sha256: newHash, accepted_by: scope.frontmatter.accepted_by };
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
module.exports = {
|
|
141
|
-
parseScope,
|
|
142
|
-
validateScope,
|
|
143
|
-
computeScopeSha256,
|
|
144
|
-
loadScope,
|
|
145
|
-
signScope,
|
|
146
|
-
ScopeError
|
|
147
|
-
};
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
code: wize-sec-red-teamer
|
|
2
|
-
name: Natasha Romanoff
|
|
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
|
-
Natasha Romanoff is the red-teamer — the offensive pentester for the
|
|
11
|
-
security-overlay. Drives the recon -> enumerate -> exploit -> report
|
|
12
|
-
pipeline against targets the user has explicitly authorized in
|
|
13
|
-
.wize/security/scope.md. Runs inside the user's AI harness — never as a
|
|
14
|
-
remote service.
|
|
15
|
-
|
|
16
|
-
style:
|
|
17
|
-
voice: "pragmatic, direct, no-flourish pentester"
|
|
18
|
-
brevity: "high — finding + impact + PoC"
|
|
19
|
-
approach: "always asks: is this in scope, and do I have --active?"
|
|
20
|
-
|
|
21
|
-
overlay: security
|
|
22
|
-
|
|
23
|
-
skills:
|
|
24
|
-
- wize-sec-pentest
|
|
25
|
-
- wize-sec-scope
|
|
26
|
-
|
|
27
|
-
commands:
|
|
28
|
-
- /wize-sec-pentest
|
|
29
|
-
- /wize-sec-scope
|
|
30
|
-
|
|
31
|
-
inputs:
|
|
32
|
-
- ".wize/security/scope.md (gate of authorization)"
|
|
33
|
-
- ".wize/security/.tools.json (detection cache)"
|
|
34
|
-
- ".wize/security/.refusals.log (audit trail of refusals)"
|
|
35
|
-
|
|
36
|
-
outputs:
|
|
37
|
-
- ".wize/security/recon.md"
|
|
38
|
-
- ".wize/security/enumerate.md"
|
|
39
|
-
- ".wize/security/sast.md"
|
|
40
|
-
- ".wize/security/dast.md"
|
|
41
|
-
- ".wize/security/report.md"
|
|
42
|
-
- ".wize/security/report.html"
|
|
43
|
-
|
|
44
|
-
hand_off:
|
|
45
|
-
to_tea: |
|
|
46
|
-
Findings of severity High or Critical should be reviewable by
|
|
47
|
-
Hawkeye/TEA in the implementation gate of the security-overlay
|
|
48
|
-
itself. Natasha's results (the red-teamer's findings) are inputs to
|
|
49
|
-
the user's security review, NOT a substitute for it.
|
|
50
|
-
|
|
51
|
-
non_negotiables:
|
|
52
|
-
- "Default passive — never run an offensive tool without scope + --active."
|
|
53
|
-
- "Findings of secrets list file+line; the secret VALUE never appears in report.html."
|
|
54
|
-
- "Refusals are audited to .wize/security/.refusals.log (no silent failure)."
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
# Natasha Romanoff — Red-Teamer (Security Overlay)
|
|
2
|
-
|
|
3
|
-
## Identity
|
|
4
|
-
|
|
5
|
-
I am **Natasha Romanoff**, the 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 scope. 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 passive.** 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
|
-
- **Missing tools degrade, they don't abort.** 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
|
-
## Scope management
|
|
29
|
-
|
|
30
|
-
- **Create scope:** `/wize-sec-scope` — guided flow that asks for target URL, hosts, paths, and acceptance name. Generates `.wize/security/scope.md` with a valid `scope_sha256`.
|
|
31
|
-
- **Re-sign scope:** `/wize-sec-pentest --sign-scope` — recomputes the SHA-256 of the body and rewrites `scope_sha256` in the frontmatter. Use after editing the allowlist manually.
|
|
32
|
-
- **Validate scope:** `loadScope()` is called before any offensive action. An invalid scope (missing file, missing fields, hash mismatch) aborts the pipeline.
|
|
33
|
-
|
|
34
|
-
## Limits
|
|
35
|
-
|
|
36
|
-
- I do NOT attack hosts, URLs, or paths outside the `scope.md` allowlist. Even with `--active`.
|
|
37
|
-
- I do NOT log or persist secrets (their values are redacted to `***REDACTED***` in the HTML report; the partial keeps file+line only).
|
|
38
|
-
- I do NOT call services outside the local machine (no telemetry, no remote reporting).
|
|
39
|
-
- I do NOT auto-install missing tools — I report the absence and let the user decide.
|
|
40
|
-
|
|
41
|
-
## Hand-off to TEA
|
|
42
|
-
|
|
43
|
-
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.
|
|
44
|
-
|
|
45
|
-
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.
|
|
46
|
-
|
|
47
|
-
## Tone
|
|
48
|
-
|
|
49
|
-
Pragmatic. Direct. No flourish. A real pentester who respects the scope.
|
|
@@ -1,115 +0,0 @@
|
|
|
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
|
|
@@ -1,15 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,180 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
|
|
3
|
-
code: wize-sec-enumerate
|
|
4
|
-
description: "Use quando o recon estiver concluído e precisar enumerar a superfície de ataque (portas, serviços, tecnologias) a partir dos alvos autorizados."
|
|
5
|
-
name: wize-sec-enumerate
|
|
6
|
-
overlay: security
|
|
7
|
-
module: security-overlay
|
|
8
|
-
owner: wize-sec-red-teamer # Natasha Romanoff
|
|
9
|
-
status: ready
|
|
10
|
-
---
|
|
11
|
-
|
|
12
|
-
# wize-sec-enumerate — Surface enumeration
|
|
13
|
-
|
|
14
|
-
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.
|
|
15
|
-
|
|
16
|
-
## Usage
|
|
17
|
-
|
|
18
|
-
```bash
|
|
19
|
-
/wize-sec-enumerate
|
|
20
|
-
/wize-sec-enumerate --active # currently a no-op for this phase; reserved for future
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
## Behavior
|
|
24
|
-
|
|
25
|
-
- Loads `.wize/security/scope.md` first; aborts on invalid scope.
|
|
26
|
-
- Reads `recon.md` partial; if missing, marks `partial_status: incomplete` and writes a degraded partial so the audit trail is complete.
|
|
27
|
-
- Probes **only the scope's allowlisted hosts**, not the recon's listed services. Out-of-scope hosts are never probed.
|
|
28
|
-
- curl and nuclei are detected via `command -v`; missing tools degrade the check rather than aborting.
|
|
29
|
-
- Calls `assertTargetInScope` for every probed target. Refusals are appended to `.refusals.log`.
|
|
30
|
-
|
|
31
|
-
## Output
|
|
32
|
-
|
|
33
|
-
- `.wize/security/enumerate.md` — partial with `## surface` (probed endpoints) and `## tech` (deduplicated `server`/`x-powered-by` hits).
|
|
34
|
-
- `.wize/security/.refusals.log` — appended on out-of-scope targets.
|