rtexit-method 0.1.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/RTEXIT.md +127 -0
- package/_rtexit/config.toml +103 -0
- package/_rtexit/config.user.toml +28 -0
- package/_rtexit/custom/config.toml +12 -0
- package/_rtexit/scripts/autodoc_engine.py +203 -0
- package/_rtexit/scripts/finding_tracker.py +251 -0
- package/_rtexit/scripts/resolve_config.py +127 -0
- package/_rtexit/scripts/resolve_customization.py +154 -0
- package/package.json +53 -0
- package/resources/certifications.md +21 -0
- package/resources/payloads.md +21 -0
- package/resources/tools.md +53 -0
- package/resources/wordlists.md +15 -0
- package/templates/attack-chain-template.md +33 -0
- package/templates/executive-report-template.md +64 -0
- package/templates/executive-report.md +27 -0
- package/templates/finding-template.md +74 -0
- package/templates/remediation-roadmap.md +31 -0
- package/templates/sead-template.md +73 -0
- package/templates/technical-report.md +63 -0
- package/tools/installer/commands/install.js +40 -0
- package/tools/installer/lib/asset-manifest.js +11 -0
- package/tools/installer/lib/banner.js +12 -0
- package/tools/installer/lib/config-template.js +29 -0
- package/tools/installer/lib/copy-assets.js +39 -0
- package/tools/installer/lib/paths.js +11 -0
- package/tools/installer/lib/prompts.js +43 -0
- package/tools/installer/lib/write-config.js +32 -0
- package/tools/installer/rt-cli.js +20 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# RTExit Wordlist Reference
|
|
2
|
+
|
|
3
|
+
Keep wordlists local and versioned by source. Avoid running large lists without explicit rate limits.
|
|
4
|
+
|
|
5
|
+
| Category | Common Source | Use Case |
|
|
6
|
+
|---|---|---|
|
|
7
|
+
| Subdomains | SecLists DNS | Passive/active DNS discovery |
|
|
8
|
+
| Web content | SecLists Discovery/Web-Content | Directory and file discovery |
|
|
9
|
+
| API routes | SecLists API lists | API endpoint discovery |
|
|
10
|
+
| Usernames | SecLists Usernames | Authorized password-policy testing only |
|
|
11
|
+
| Passwords | rockyou or client-provided | Only when credential testing is approved |
|
|
12
|
+
| XSS markers | Custom harmless markers | Context validation |
|
|
13
|
+
|
|
14
|
+
Recommended paths can be overridden in `_rtexit/config.user.toml`.
|
|
15
|
+
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Attack Chain
|
|
2
|
+
|
|
3
|
+
| Field | Value |
|
|
4
|
+
|---|---|
|
|
5
|
+
| Chain ID | CHAIN-001 |
|
|
6
|
+
| Objective | [Objective] |
|
|
7
|
+
| Starting Access | [External/Internal/User/etc.] |
|
|
8
|
+
| Final Impact | [Impact] |
|
|
9
|
+
| Confidence | [Low/Medium/High] |
|
|
10
|
+
|
|
11
|
+
## Narrative
|
|
12
|
+
|
|
13
|
+
[Explain how independent findings combine into a realistic business-impact path.]
|
|
14
|
+
|
|
15
|
+
## Chain Steps
|
|
16
|
+
|
|
17
|
+
| Step | Finding | Technique | Evidence | Control Gap |
|
|
18
|
+
|---:|---|---|---|---|
|
|
19
|
+
| 1 | [F-XXX] | [Technique] | [Evidence] | [Gap] |
|
|
20
|
+
|
|
21
|
+
## MITRE ATT&CK Map
|
|
22
|
+
|
|
23
|
+
| Step | Tactic | Technique | Detection Opportunity |
|
|
24
|
+
|---:|---|---|---|
|
|
25
|
+
| 1 | [Tactic] | [Technique] | [Detection] |
|
|
26
|
+
|
|
27
|
+
## Break Points
|
|
28
|
+
|
|
29
|
+
List the controls that would break the chain earliest and reduce blast radius.
|
|
30
|
+
|
|
31
|
+
## Mitigations
|
|
32
|
+
|
|
33
|
+
- [Mitigation]
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# PENETRATION TEST EXECUTIVE REPORT
|
|
2
|
+
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
| Field | Value |
|
|
6
|
+
|-------|-------|
|
|
7
|
+
| **Engagement Reference** | [REF-NUMBER] |
|
|
8
|
+
| **Client** | [CLIENT NAME] |
|
|
9
|
+
| **Report Date** | [DATE] |
|
|
10
|
+
| **Classification** | STRICTLY CONFIDENTIAL |
|
|
11
|
+
| **Distribution** | [List authorized recipients] |
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## EXECUTIVE SUMMARY
|
|
16
|
+
|
|
17
|
+
### Overall Risk Rating: 🔴 CRITICAL
|
|
18
|
+
|
|
19
|
+
[2-3 paragraph non-technical summary of findings and business risk]
|
|
20
|
+
|
|
21
|
+
### Key Findings
|
|
22
|
+
|
|
23
|
+
| Severity | Count | Business Impact |
|
|
24
|
+
|----------|-------|-----------------|
|
|
25
|
+
| 🔴 Critical | X | Immediate threat to business operations |
|
|
26
|
+
| 🟠High | X | Significant risk requiring priority attention |
|
|
27
|
+
| 🟡 Medium | X | Moderate risk to be addressed within 30 days |
|
|
28
|
+
| 🔵 Low | X | Minor issues for scheduled remediation |
|
|
29
|
+
|
|
30
|
+
### Critical Business Risks Identified
|
|
31
|
+
|
|
32
|
+
1. **[Risk 1]**: [Plain language description of highest risk]
|
|
33
|
+
2. **[Risk 2]**: [Second highest risk]
|
|
34
|
+
3. **[Risk 3]**: [Third highest risk]
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## ATTACK NARRATIVE
|
|
39
|
+
|
|
40
|
+
*The following describes how an attacker with no prior access could compromise [CLIENT]'s systems:*
|
|
41
|
+
|
|
42
|
+
[Tell the attack story in plain language — no technical jargon]
|
|
43
|
+
|
|
44
|
+
An attacker beginning with only publicly available information would first [Phase 1 description]...
|
|
45
|
+
|
|
46
|
+
This initial access would then enable [Phase 2 description]...
|
|
47
|
+
|
|
48
|
+
Ultimately, an attacker could [impact description — what they could do with full access]...
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
## PRIORITIZED REMEDIATION ROADMAP
|
|
53
|
+
|
|
54
|
+
| Priority | Finding | Risk | Timeline | Owner |
|
|
55
|
+
|----------|---------|------|----------|-------|
|
|
56
|
+
| 1 | [Critical finding] | Business disruption | 24 hours | Security/IT |
|
|
57
|
+
| 2 | [High finding] | Data breach risk | 7 days | Development |
|
|
58
|
+
| 3 | [High finding] | Compliance violation | 30 days | IT/Security |
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
## CONCLUSION
|
|
63
|
+
|
|
64
|
+
[2-3 paragraphs on overall security posture, positive findings, and path forward]
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Executive Report
|
|
2
|
+
|
|
3
|
+
## Executive Summary
|
|
4
|
+
|
|
5
|
+
[Plain-language summary of business risk, scope, and overall posture.]
|
|
6
|
+
|
|
7
|
+
## Risk Overview
|
|
8
|
+
|
|
9
|
+
| Severity | Count | Business Meaning |
|
|
10
|
+
|---|---:|---|
|
|
11
|
+
| Critical | 0 | Immediate business risk |
|
|
12
|
+
| High | 0 | Priority remediation needed |
|
|
13
|
+
| Medium | 0 | Scheduled remediation |
|
|
14
|
+
| Low | 0 | Improvement opportunity |
|
|
15
|
+
|
|
16
|
+
## Key Risks
|
|
17
|
+
|
|
18
|
+
1. [Risk title]: [business impact]
|
|
19
|
+
2. [Risk title]: [business impact]
|
|
20
|
+
3. [Risk title]: [business impact]
|
|
21
|
+
|
|
22
|
+
## Priority Roadmap
|
|
23
|
+
|
|
24
|
+
| Priority | Action | Owner | Target Date |
|
|
25
|
+
|---:|---|---|---|
|
|
26
|
+
| 1 | [Action] | [Owner] | [Date] |
|
|
27
|
+
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: F-XXX
|
|
3
|
+
title: ""
|
|
4
|
+
severity: CRITICAL
|
|
5
|
+
cvss: 9.8
|
|
6
|
+
cvss_vector: "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N"
|
|
7
|
+
cwe: CWE-XXX
|
|
8
|
+
cve: ""
|
|
9
|
+
mitre: TXXXX.XXX
|
|
10
|
+
kill_chain: Exploitation
|
|
11
|
+
asset: ""
|
|
12
|
+
status: CONFIRMED
|
|
13
|
+
date: ""
|
|
14
|
+
operator: ""
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
# 🔴 F-XXX — [Finding Title]
|
|
18
|
+
|
|
19
|
+
> **Severity:** CRITICAL | **CVSS:** 9.8 | **Asset:** [URL/IP]
|
|
20
|
+
|
|
21
|
+
## Description
|
|
22
|
+
|
|
23
|
+
[Clear, concise description of the vulnerability — what it is and why it exists]
|
|
24
|
+
|
|
25
|
+
## Technical Evidence
|
|
26
|
+
|
|
27
|
+
```
|
|
28
|
+
[Paste command output, HTTP request/response, or tool output here]
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
**Screenshot:** [reference to screenshots/F-XXX-evidence-01.png]
|
|
32
|
+
|
|
33
|
+
## Impact
|
|
34
|
+
|
|
35
|
+
**Business Impact:** [What happens to the business if exploited]
|
|
36
|
+
**Technical Impact:** [Data exposed, systems compromised, services affected]
|
|
37
|
+
**Affected Users:** [How many users/systems affected]
|
|
38
|
+
|
|
39
|
+
## Reproduction Steps
|
|
40
|
+
|
|
41
|
+
**Prerequisites:** [What is needed to reproduce]
|
|
42
|
+
|
|
43
|
+
1. Navigate to [URL]
|
|
44
|
+
2. [Exact step with command or action]
|
|
45
|
+
3. [Expected result]
|
|
46
|
+
4. [Observed result demonstrating the vulnerability]
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
# Exact command to reproduce
|
|
50
|
+
[command here]
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Expected output:
|
|
54
|
+
```
|
|
55
|
+
[paste expected output]
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Remediation
|
|
59
|
+
|
|
60
|
+
### Immediate (0-24 hours)
|
|
61
|
+
- [ ] [Specific immediate action]
|
|
62
|
+
|
|
63
|
+
### Short-term (1-30 days)
|
|
64
|
+
- [ ] [Code fix or configuration change]
|
|
65
|
+
|
|
66
|
+
### Long-term
|
|
67
|
+
- [ ] [Architecture improvement or policy change]
|
|
68
|
+
|
|
69
|
+
## References
|
|
70
|
+
|
|
71
|
+
- CWE: https://cwe.mitre.org/data/definitions/XXX.html
|
|
72
|
+
- OWASP: [relevant OWASP page]
|
|
73
|
+
- CVE: [link if applicable]
|
|
74
|
+
- Vendor Advisory: [link if applicable]
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Remediation Roadmap
|
|
2
|
+
|
|
3
|
+
## Prioritization Model
|
|
4
|
+
|
|
5
|
+
Priority is based on severity, exploitability, exposed data, business process impact, internet exposure, and whether a finding enables another attack path.
|
|
6
|
+
|
|
7
|
+
| Priority | Finding | Recommended Action | Owner | Timeline | Dependency |
|
|
8
|
+
|---:|---|---|---|---|---|
|
|
9
|
+
| 1 | [F-XXX] | [Action] | [Owner] | 0-7 days | [None/F-YYY] |
|
|
10
|
+
|
|
11
|
+
## Immediate Actions: 0-7 Days
|
|
12
|
+
|
|
13
|
+
- [ ] Contain exposed systems or disable risky functionality.
|
|
14
|
+
- [ ] Rotate exposed credentials and invalidate affected sessions.
|
|
15
|
+
- [ ] Apply tactical configuration fixes for critical findings.
|
|
16
|
+
|
|
17
|
+
## Short-Term Actions: 8-30 Days
|
|
18
|
+
|
|
19
|
+
- [ ] Patch vulnerable components.
|
|
20
|
+
- [ ] Add server-side authorization checks.
|
|
21
|
+
- [ ] Harden identity, MFA, logging, and alerting controls.
|
|
22
|
+
|
|
23
|
+
## Long-Term Actions: 31-90 Days
|
|
24
|
+
|
|
25
|
+
- [ ] Add secure design review gates.
|
|
26
|
+
- [ ] Improve asset inventory and attack surface monitoring.
|
|
27
|
+
- [ ] Add regression tests for fixed vulnerability classes.
|
|
28
|
+
|
|
29
|
+
## Validation
|
|
30
|
+
|
|
31
|
+
Each remediation item should be retested and linked to closure evidence in `_rtexit-output/docs/evidence/`.
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# Statement of Engagement Authorization
|
|
2
|
+
|
|
3
|
+
| Field | Value |
|
|
4
|
+
|---|---|
|
|
5
|
+
| Engagement Reference | [REF] |
|
|
6
|
+
| Client | [CLIENT] |
|
|
7
|
+
| Client Sponsor | [NAME / ROLE / CONTACT] |
|
|
8
|
+
| Authorized Operator(s) | [NAMES] |
|
|
9
|
+
| Start Date | [YYYY-MM-DD] |
|
|
10
|
+
| End Date | [YYYY-MM-DD] |
|
|
11
|
+
| Scope Type | [blackbox/greybox/whitebox] |
|
|
12
|
+
| Methodology | [PTES/NIST/OWASP/TIBER/CBEST] |
|
|
13
|
+
| Classification | Confidential |
|
|
14
|
+
|
|
15
|
+
## 1. Purpose
|
|
16
|
+
|
|
17
|
+
This document authorizes RTExit operators to perform security testing against the assets, time windows, and techniques explicitly listed below.
|
|
18
|
+
|
|
19
|
+
## 2. Authorized Scope
|
|
20
|
+
|
|
21
|
+
| Asset | Type | Environment | Testing Window | Notes |
|
|
22
|
+
|---|---|---|---|---|
|
|
23
|
+
| [domain/app/IP] | [web/api/cloud/etc.] | [prod/stage/lab] | [window] | [notes] |
|
|
24
|
+
|
|
25
|
+
## 3. Exclusions
|
|
26
|
+
|
|
27
|
+
| Exclusion | Reason | Contact for Exception |
|
|
28
|
+
|---|---|---|
|
|
29
|
+
| [asset/technique/data] | [reason] | [contact] |
|
|
30
|
+
|
|
31
|
+
## 4. Approved Testing Categories
|
|
32
|
+
|
|
33
|
+
- [ ] Planning and documentation
|
|
34
|
+
- [ ] Passive reconnaissance
|
|
35
|
+
- [ ] Active reconnaissance
|
|
36
|
+
- [ ] Web/API testing
|
|
37
|
+
- [ ] Mobile/Desktop testing
|
|
38
|
+
- [ ] Network/Internal testing
|
|
39
|
+
- [ ] Cloud configuration review
|
|
40
|
+
- [ ] Active Directory testing
|
|
41
|
+
- [ ] Social engineering simulation
|
|
42
|
+
- [ ] Physical security assessment
|
|
43
|
+
- [ ] Post-exploitation validation
|
|
44
|
+
|
|
45
|
+
## 5. Rules of Engagement
|
|
46
|
+
|
|
47
|
+
| Rule | Value |
|
|
48
|
+
|---|---|
|
|
49
|
+
| Rate limits | [requests/sec, scan windows] |
|
|
50
|
+
| Accounts provided | [test users/roles] |
|
|
51
|
+
| Data access limits | [no PII dump, sample-only, etc.] |
|
|
52
|
+
| Destructive testing | [allowed/not allowed] |
|
|
53
|
+
| Social engineering | [allowed/not allowed and conditions] |
|
|
54
|
+
| Emergency stop contact | [name/phone/email] |
|
|
55
|
+
| Daily status cadence | [time/channel] |
|
|
56
|
+
|
|
57
|
+
## 6. Evidence Handling
|
|
58
|
+
|
|
59
|
+
Evidence must be stored under `_rtexit-output/docs/evidence/`, hashed with SHA-256 where practical, and referenced from findings by relative path.
|
|
60
|
+
|
|
61
|
+
## 7. Stop Conditions
|
|
62
|
+
|
|
63
|
+
Testing must pause immediately if service instability, unauthorized data exposure, legal uncertainty, client request, or safety concerns are observed.
|
|
64
|
+
|
|
65
|
+
## 8. Authorization
|
|
66
|
+
|
|
67
|
+
Client representative:
|
|
68
|
+
|
|
69
|
+
Signature/date:
|
|
70
|
+
|
|
71
|
+
RTExit operator:
|
|
72
|
+
|
|
73
|
+
Signature/date:
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# Technical Report
|
|
2
|
+
|
|
3
|
+
## Document Control
|
|
4
|
+
|
|
5
|
+
| Field | Value |
|
|
6
|
+
|---|---|
|
|
7
|
+
| Reference | [REF] |
|
|
8
|
+
| Client | [CLIENT] |
|
|
9
|
+
| Report Date | [YYYY-MM-DD] |
|
|
10
|
+
| Classification | Confidential |
|
|
11
|
+
| Methodology | [PTES/NIST/OWASP/etc.] |
|
|
12
|
+
| Operators | [NAMES] |
|
|
13
|
+
|
|
14
|
+
## Scope
|
|
15
|
+
|
|
16
|
+
| Asset | Type | Environment | Status |
|
|
17
|
+
|---|---|---|---|
|
|
18
|
+
| [asset] | [web/api/cloud/etc.] | [prod/stage/lab] | In scope |
|
|
19
|
+
|
|
20
|
+
## Exclusions and Constraints
|
|
21
|
+
|
|
22
|
+
[Document excluded systems, unsafe techniques, testing windows, data handling limits, and assumptions.]
|
|
23
|
+
|
|
24
|
+
## Methodology
|
|
25
|
+
|
|
26
|
+
Testing followed the approved SEAD and Rules of Engagement. Activities were grouped into planning, reconnaissance, exploitation validation, post-exploitation impact analysis, and reporting.
|
|
27
|
+
|
|
28
|
+
## Tooling Summary
|
|
29
|
+
|
|
30
|
+
| Category | Tools | Purpose |
|
|
31
|
+
|---|---|---|
|
|
32
|
+
| Reconnaissance | [tools] | Asset discovery and exposure review |
|
|
33
|
+
| Web/API | [tools] | Manual and assisted validation |
|
|
34
|
+
| Cloud/Infra | [tools] | Configuration and identity review |
|
|
35
|
+
| Reporting | RTExit scripts | Evidence, findings, and report generation |
|
|
36
|
+
|
|
37
|
+
## Findings Summary
|
|
38
|
+
|
|
39
|
+
| ID | Title | Severity | CVSS | Asset | Status |
|
|
40
|
+
|---|---|---|---:|---|---|
|
|
41
|
+
| F-001 | [Title] | [Severity] | [Score] | [Asset] | [Status] |
|
|
42
|
+
|
|
43
|
+
## Detailed Findings
|
|
44
|
+
|
|
45
|
+
Each finding should include description, affected assets, evidence, reproduction steps, impact, CVSS vector, MITRE mapping, and remediation.
|
|
46
|
+
|
|
47
|
+
## Attack Chains
|
|
48
|
+
|
|
49
|
+
| Chain | Findings | Objective | Business Impact |
|
|
50
|
+
|---|---|---|---|
|
|
51
|
+
| CHAIN-001 | [F-001, F-002] | [objective] | [impact] |
|
|
52
|
+
|
|
53
|
+
## Remediation Plan
|
|
54
|
+
|
|
55
|
+
Prioritize fixes by exploitability, business impact, exposed data, and dependency relationships.
|
|
56
|
+
|
|
57
|
+
## Appendices
|
|
58
|
+
|
|
59
|
+
- Evidence index
|
|
60
|
+
- Chain of custody
|
|
61
|
+
- MITRE ATT&CK mapping
|
|
62
|
+
- CVSS vectors
|
|
63
|
+
- Raw tool output references
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
const { renderBanner } = require('../lib/banner');
|
|
2
|
+
const { resolveRepoRoot, resolveTargetRoot } = require('../lib/paths');
|
|
3
|
+
const { copyPackagedAssets } = require('../lib/copy-assets');
|
|
4
|
+
const { writeUserConfig } = require('../lib/write-config');
|
|
5
|
+
const { askInstallQuestions } = require('../lib/prompts');
|
|
6
|
+
|
|
7
|
+
async function installCommand(options = {}) {
|
|
8
|
+
const repoRoot = options.repoRoot || resolveRepoRoot();
|
|
9
|
+
const cwd = options.cwd || process.cwd();
|
|
10
|
+
const io = options.io || console;
|
|
11
|
+
const promptAdapter = options.promptAdapter || askInstallQuestions;
|
|
12
|
+
|
|
13
|
+
io.log(renderBanner());
|
|
14
|
+
|
|
15
|
+
const answers = await promptAdapter({ cwd });
|
|
16
|
+
if (!answers.confirmed) {
|
|
17
|
+
io.log('RTExit install cancelled.');
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const targetRoot = resolveTargetRoot(answers.targetDirectory);
|
|
22
|
+
|
|
23
|
+
await copyPackagedAssets({ repoRoot, targetRoot });
|
|
24
|
+
await writeUserConfig({
|
|
25
|
+
targetRoot,
|
|
26
|
+
answers: {
|
|
27
|
+
language: answers.language,
|
|
28
|
+
document_output_language: answers.document_output_language,
|
|
29
|
+
skill_level: answers.skill_level,
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
io.log('RTExit installed successfully.');
|
|
34
|
+
io.log('Next steps:');
|
|
35
|
+
io.log('1. Open _rtexit/config.user.toml and complete client/project details');
|
|
36
|
+
io.log('2. Open your AI IDE in this project');
|
|
37
|
+
io.log('3. Start with rt-help');
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
module.exports = { installCommand };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
function getInstallEntries() {
|
|
2
|
+
return [
|
|
3
|
+
{ type: 'glob-dir-prefix', base: '.agents/skills', prefix: 'rt-' },
|
|
4
|
+
{ type: 'path', value: '_rtexit' },
|
|
5
|
+
{ type: 'path', value: 'templates' },
|
|
6
|
+
{ type: 'path', value: 'resources' },
|
|
7
|
+
{ type: 'path', value: 'RTEXIT.md' }
|
|
8
|
+
];
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
module.exports = { getInstallEntries };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
function renderBanner() {
|
|
2
|
+
return [
|
|
3
|
+
'+------------------------------------------------------------------------------+',
|
|
4
|
+
'| RTExit |',
|
|
5
|
+
'| AI-Assisted Red Team Methodology |',
|
|
6
|
+
'| Install official RTExit framework assets into your project. |',
|
|
7
|
+
'| Website: https://www.exitcode.me/ |',
|
|
8
|
+
'+------------------------------------------------------------------------------+',
|
|
9
|
+
].join('\n');
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
module.exports = { renderBanner };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
function buildConfigTemplate({ language, document_output_language, skill_level }) {
|
|
2
|
+
return [
|
|
3
|
+
'# RTExit User Configuration - Override base config here',
|
|
4
|
+
'',
|
|
5
|
+
'[core]',
|
|
6
|
+
'operator_name = ""',
|
|
7
|
+
'operator_email = ""',
|
|
8
|
+
'company = ""',
|
|
9
|
+
`language = "${language}"`,
|
|
10
|
+
`document_output_language = "${document_output_language}"`,
|
|
11
|
+
`skill_level = "${skill_level}"`,
|
|
12
|
+
'',
|
|
13
|
+
'[engagement]',
|
|
14
|
+
'ref = ""',
|
|
15
|
+
'client_name = ""',
|
|
16
|
+
'start_date = ""',
|
|
17
|
+
'end_date = ""',
|
|
18
|
+
'scope_type = ""',
|
|
19
|
+
'methodology = ""',
|
|
20
|
+
'primary_domain = ""',
|
|
21
|
+
'',
|
|
22
|
+
'[tools]',
|
|
23
|
+
'',
|
|
24
|
+
'[wordlists]',
|
|
25
|
+
'',
|
|
26
|
+
].join('\n');
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
module.exports = { buildConfigTemplate };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
const fs = require('node:fs');
|
|
2
|
+
const path = require('node:path');
|
|
3
|
+
const { getInstallEntries } = require('./asset-manifest');
|
|
4
|
+
|
|
5
|
+
function copyRecursive(source, target) {
|
|
6
|
+
const stats = fs.statSync(source);
|
|
7
|
+
|
|
8
|
+
if (stats.isDirectory()) {
|
|
9
|
+
fs.mkdirSync(target, { recursive: true });
|
|
10
|
+
for (const entry of fs.readdirSync(source)) {
|
|
11
|
+
copyRecursive(path.join(source, entry), path.join(target, entry));
|
|
12
|
+
}
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
fs.mkdirSync(path.dirname(target), { recursive: true });
|
|
17
|
+
fs.copyFileSync(source, target);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
async function copyPackagedAssets({ repoRoot, targetRoot }) {
|
|
21
|
+
for (const entry of getInstallEntries()) {
|
|
22
|
+
if (entry.type === 'path') {
|
|
23
|
+
copyRecursive(path.join(repoRoot, entry.value), path.join(targetRoot, entry.value));
|
|
24
|
+
continue;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const skillsRoot = path.join(repoRoot, entry.base);
|
|
28
|
+
for (const name of fs.readdirSync(skillsRoot)) {
|
|
29
|
+
if (name.startsWith(entry.prefix)) {
|
|
30
|
+
copyRecursive(
|
|
31
|
+
path.join(skillsRoot, name),
|
|
32
|
+
path.join(targetRoot, entry.base, name)
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
module.exports = { copyPackagedAssets };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
const path = require('node:path');
|
|
2
|
+
|
|
3
|
+
function resolveRepoRoot() {
|
|
4
|
+
return path.resolve(__dirname, '..', '..', '..');
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
function resolveTargetRoot(targetDirectory) {
|
|
8
|
+
return path.resolve(targetDirectory || process.cwd());
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
module.exports = { resolveRepoRoot, resolveTargetRoot };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
const prompts = require('@clack/prompts');
|
|
2
|
+
|
|
3
|
+
async function askInstallQuestions({ cwd }) {
|
|
4
|
+
const targetDirectory = await prompts.text({
|
|
5
|
+
message: 'Install RTExit into which directory?',
|
|
6
|
+
initialValue: cwd,
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
const language = await prompts.select({
|
|
10
|
+
message: 'Choose interface language',
|
|
11
|
+
options: [
|
|
12
|
+
{ value: 'en', label: 'English' },
|
|
13
|
+
{ value: 'ar', label: 'Arabic' },
|
|
14
|
+
],
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
const document_output_language = await prompts.select({
|
|
18
|
+
message: 'Choose report language',
|
|
19
|
+
options: [
|
|
20
|
+
{ value: 'en', label: 'English' },
|
|
21
|
+
{ value: 'ar', label: 'Arabic' },
|
|
22
|
+
],
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
const skill_level = await prompts.select({
|
|
26
|
+
message: 'Choose skill level',
|
|
27
|
+
options: [
|
|
28
|
+
{ value: 'beginner', label: 'Beginner' },
|
|
29
|
+
{ value: 'intermediate', label: 'Intermediate' },
|
|
30
|
+
{ value: 'advanced', label: 'Advanced' },
|
|
31
|
+
{ value: 'expert', label: 'Expert' },
|
|
32
|
+
],
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
const confirmed = await prompts.confirm({
|
|
36
|
+
message: `Install RTExit into ${targetDirectory}?`,
|
|
37
|
+
initialValue: true,
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
return { targetDirectory, language, document_output_language, skill_level, confirmed };
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
module.exports = { askInstallQuestions };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
const fs = require('node:fs');
|
|
2
|
+
const path = require('node:path');
|
|
3
|
+
const { buildConfigTemplate } = require('./config-template');
|
|
4
|
+
|
|
5
|
+
function upsertKey(content, key, value) {
|
|
6
|
+
const pattern = new RegExp(`^${key}\\s*=\\s*".*"$`, 'm');
|
|
7
|
+
const replacement = `${key} = "${value}"`;
|
|
8
|
+
return pattern.test(content)
|
|
9
|
+
? content.replace(pattern, replacement)
|
|
10
|
+
: `${content.trimEnd()}\n${replacement}\n`;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
async function writeUserConfig({ targetRoot, answers }) {
|
|
14
|
+
const configDir = path.join(targetRoot, '_rtexit');
|
|
15
|
+
const configPath = path.join(configDir, 'config.user.toml');
|
|
16
|
+
|
|
17
|
+
fs.mkdirSync(configDir, { recursive: true });
|
|
18
|
+
|
|
19
|
+
if (!fs.existsSync(configPath)) {
|
|
20
|
+
fs.writeFileSync(configPath, `${buildConfigTemplate(answers)}\n`);
|
|
21
|
+
return configPath;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
let content = fs.readFileSync(configPath, 'utf8');
|
|
25
|
+
content = upsertKey(content, 'language', answers.language);
|
|
26
|
+
content = upsertKey(content, 'document_output_language', answers.document_output_language);
|
|
27
|
+
content = upsertKey(content, 'skill_level', answers.skill_level);
|
|
28
|
+
fs.writeFileSync(configPath, content);
|
|
29
|
+
return configPath;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
module.exports = { writeUserConfig };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
const { program } = require('commander');
|
|
3
|
+
const packageJson = require('../../package.json');
|
|
4
|
+
const { installCommand } = require('./commands/install');
|
|
5
|
+
|
|
6
|
+
program
|
|
7
|
+
.name('rtexit')
|
|
8
|
+
.description('RTExit CLI - AI-assisted Red Team methodology installer')
|
|
9
|
+
.version(packageJson.version);
|
|
10
|
+
|
|
11
|
+
program
|
|
12
|
+
.command('install')
|
|
13
|
+
.description('Install RTExit into the current project')
|
|
14
|
+
.action(() => installCommand());
|
|
15
|
+
|
|
16
|
+
program.parse(process.argv);
|
|
17
|
+
|
|
18
|
+
if (process.argv.slice(2).length === 0) {
|
|
19
|
+
program.outputHelp();
|
|
20
|
+
}
|