aiptx 2.0.2__py3-none-any.whl
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.
Potentially problematic release.
This version of aiptx might be problematic. Click here for more details.
- aipt_v2/__init__.py +110 -0
- aipt_v2/__main__.py +24 -0
- aipt_v2/agents/AIPTxAgent/__init__.py +10 -0
- aipt_v2/agents/AIPTxAgent/aiptx_agent.py +211 -0
- aipt_v2/agents/__init__.py +24 -0
- aipt_v2/agents/base.py +520 -0
- aipt_v2/agents/ptt.py +406 -0
- aipt_v2/agents/state.py +168 -0
- aipt_v2/app.py +960 -0
- aipt_v2/browser/__init__.py +31 -0
- aipt_v2/browser/automation.py +458 -0
- aipt_v2/browser/crawler.py +453 -0
- aipt_v2/cli.py +321 -0
- aipt_v2/compliance/__init__.py +71 -0
- aipt_v2/compliance/compliance_report.py +449 -0
- aipt_v2/compliance/framework_mapper.py +424 -0
- aipt_v2/compliance/nist_mapping.py +345 -0
- aipt_v2/compliance/owasp_mapping.py +330 -0
- aipt_v2/compliance/pci_mapping.py +297 -0
- aipt_v2/config.py +288 -0
- aipt_v2/core/__init__.py +43 -0
- aipt_v2/core/agent.py +630 -0
- aipt_v2/core/llm.py +395 -0
- aipt_v2/core/memory.py +305 -0
- aipt_v2/core/ptt.py +329 -0
- aipt_v2/database/__init__.py +14 -0
- aipt_v2/database/models.py +232 -0
- aipt_v2/database/repository.py +384 -0
- aipt_v2/docker/__init__.py +23 -0
- aipt_v2/docker/builder.py +260 -0
- aipt_v2/docker/manager.py +222 -0
- aipt_v2/docker/sandbox.py +371 -0
- aipt_v2/evasion/__init__.py +58 -0
- aipt_v2/evasion/request_obfuscator.py +272 -0
- aipt_v2/evasion/tls_fingerprint.py +285 -0
- aipt_v2/evasion/ua_rotator.py +301 -0
- aipt_v2/evasion/waf_bypass.py +439 -0
- aipt_v2/execution/__init__.py +23 -0
- aipt_v2/execution/executor.py +302 -0
- aipt_v2/execution/parser.py +544 -0
- aipt_v2/execution/terminal.py +337 -0
- aipt_v2/health.py +437 -0
- aipt_v2/intelligence/__init__.py +85 -0
- aipt_v2/intelligence/auth.py +520 -0
- aipt_v2/intelligence/chaining.py +775 -0
- aipt_v2/intelligence/cve_aipt.py +334 -0
- aipt_v2/intelligence/cve_info.py +1111 -0
- aipt_v2/intelligence/rag.py +239 -0
- aipt_v2/intelligence/scope.py +442 -0
- aipt_v2/intelligence/searchers/__init__.py +5 -0
- aipt_v2/intelligence/searchers/exploitdb_searcher.py +523 -0
- aipt_v2/intelligence/searchers/github_searcher.py +467 -0
- aipt_v2/intelligence/searchers/google_searcher.py +281 -0
- aipt_v2/intelligence/tools.json +443 -0
- aipt_v2/intelligence/triage.py +670 -0
- aipt_v2/interface/__init__.py +5 -0
- aipt_v2/interface/cli.py +230 -0
- aipt_v2/interface/main.py +501 -0
- aipt_v2/interface/tui.py +1276 -0
- aipt_v2/interface/utils.py +583 -0
- aipt_v2/llm/__init__.py +39 -0
- aipt_v2/llm/config.py +26 -0
- aipt_v2/llm/llm.py +514 -0
- aipt_v2/llm/memory.py +214 -0
- aipt_v2/llm/request_queue.py +89 -0
- aipt_v2/llm/utils.py +89 -0
- aipt_v2/models/__init__.py +15 -0
- aipt_v2/models/findings.py +295 -0
- aipt_v2/models/phase_result.py +224 -0
- aipt_v2/models/scan_config.py +207 -0
- aipt_v2/monitoring/grafana/dashboards/aipt-dashboard.json +355 -0
- aipt_v2/monitoring/grafana/dashboards/default.yml +17 -0
- aipt_v2/monitoring/grafana/datasources/prometheus.yml +17 -0
- aipt_v2/monitoring/prometheus.yml +60 -0
- aipt_v2/orchestration/__init__.py +52 -0
- aipt_v2/orchestration/pipeline.py +398 -0
- aipt_v2/orchestration/progress.py +300 -0
- aipt_v2/orchestration/scheduler.py +296 -0
- aipt_v2/orchestrator.py +2284 -0
- aipt_v2/payloads/__init__.py +27 -0
- aipt_v2/payloads/cmdi.py +150 -0
- aipt_v2/payloads/sqli.py +263 -0
- aipt_v2/payloads/ssrf.py +204 -0
- aipt_v2/payloads/templates.py +222 -0
- aipt_v2/payloads/traversal.py +166 -0
- aipt_v2/payloads/xss.py +204 -0
- aipt_v2/prompts/__init__.py +60 -0
- aipt_v2/proxy/__init__.py +29 -0
- aipt_v2/proxy/history.py +352 -0
- aipt_v2/proxy/interceptor.py +452 -0
- aipt_v2/recon/__init__.py +44 -0
- aipt_v2/recon/dns.py +241 -0
- aipt_v2/recon/osint.py +367 -0
- aipt_v2/recon/subdomain.py +372 -0
- aipt_v2/recon/tech_detect.py +311 -0
- aipt_v2/reports/__init__.py +17 -0
- aipt_v2/reports/generator.py +313 -0
- aipt_v2/reports/html_report.py +378 -0
- aipt_v2/runtime/__init__.py +44 -0
- aipt_v2/runtime/base.py +30 -0
- aipt_v2/runtime/docker.py +401 -0
- aipt_v2/runtime/local.py +346 -0
- aipt_v2/runtime/tool_server.py +205 -0
- aipt_v2/scanners/__init__.py +28 -0
- aipt_v2/scanners/base.py +273 -0
- aipt_v2/scanners/nikto.py +244 -0
- aipt_v2/scanners/nmap.py +402 -0
- aipt_v2/scanners/nuclei.py +273 -0
- aipt_v2/scanners/web.py +454 -0
- aipt_v2/scripts/security_audit.py +366 -0
- aipt_v2/telemetry/__init__.py +7 -0
- aipt_v2/telemetry/tracer.py +347 -0
- aipt_v2/terminal/__init__.py +28 -0
- aipt_v2/terminal/executor.py +400 -0
- aipt_v2/terminal/sandbox.py +350 -0
- aipt_v2/tools/__init__.py +44 -0
- aipt_v2/tools/active_directory/__init__.py +78 -0
- aipt_v2/tools/active_directory/ad_config.py +238 -0
- aipt_v2/tools/active_directory/bloodhound_wrapper.py +447 -0
- aipt_v2/tools/active_directory/kerberos_attacks.py +430 -0
- aipt_v2/tools/active_directory/ldap_enum.py +533 -0
- aipt_v2/tools/active_directory/smb_attacks.py +505 -0
- aipt_v2/tools/agents_graph/__init__.py +19 -0
- aipt_v2/tools/agents_graph/agents_graph_actions.py +69 -0
- aipt_v2/tools/api_security/__init__.py +76 -0
- aipt_v2/tools/api_security/api_discovery.py +608 -0
- aipt_v2/tools/api_security/graphql_scanner.py +622 -0
- aipt_v2/tools/api_security/jwt_analyzer.py +577 -0
- aipt_v2/tools/api_security/openapi_fuzzer.py +761 -0
- aipt_v2/tools/browser/__init__.py +5 -0
- aipt_v2/tools/browser/browser_actions.py +238 -0
- aipt_v2/tools/browser/browser_instance.py +535 -0
- aipt_v2/tools/browser/tab_manager.py +344 -0
- aipt_v2/tools/cloud/__init__.py +70 -0
- aipt_v2/tools/cloud/cloud_config.py +273 -0
- aipt_v2/tools/cloud/cloud_scanner.py +639 -0
- aipt_v2/tools/cloud/prowler_tool.py +571 -0
- aipt_v2/tools/cloud/scoutsuite_tool.py +359 -0
- aipt_v2/tools/executor.py +307 -0
- aipt_v2/tools/parser.py +408 -0
- aipt_v2/tools/proxy/__init__.py +5 -0
- aipt_v2/tools/proxy/proxy_actions.py +103 -0
- aipt_v2/tools/proxy/proxy_manager.py +789 -0
- aipt_v2/tools/registry.py +196 -0
- aipt_v2/tools/scanners/__init__.py +343 -0
- aipt_v2/tools/scanners/acunetix_tool.py +712 -0
- aipt_v2/tools/scanners/burp_tool.py +631 -0
- aipt_v2/tools/scanners/config.py +156 -0
- aipt_v2/tools/scanners/nessus_tool.py +588 -0
- aipt_v2/tools/scanners/zap_tool.py +612 -0
- aipt_v2/tools/terminal/__init__.py +5 -0
- aipt_v2/tools/terminal/terminal_actions.py +37 -0
- aipt_v2/tools/terminal/terminal_manager.py +153 -0
- aipt_v2/tools/terminal/terminal_session.py +449 -0
- aipt_v2/tools/tool_processing.py +108 -0
- aipt_v2/utils/__init__.py +17 -0
- aipt_v2/utils/logging.py +201 -0
- aipt_v2/utils/model_manager.py +187 -0
- aipt_v2/utils/searchers/__init__.py +269 -0
- aiptx-2.0.2.dist-info/METADATA +324 -0
- aiptx-2.0.2.dist-info/RECORD +165 -0
- aiptx-2.0.2.dist-info/WHEEL +5 -0
- aiptx-2.0.2.dist-info/entry_points.txt +7 -0
- aiptx-2.0.2.dist-info/licenses/LICENSE +21 -0
- aiptx-2.0.2.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
"""
|
|
2
|
+
AIPT Phase Result Model
|
|
3
|
+
|
|
4
|
+
Tracks results and status for each phase of the scanning pipeline.
|
|
5
|
+
"""
|
|
6
|
+
from __future__ import annotations
|
|
7
|
+
|
|
8
|
+
from dataclasses import dataclass, field
|
|
9
|
+
from datetime import datetime
|
|
10
|
+
from enum import Enum
|
|
11
|
+
from typing import Any
|
|
12
|
+
|
|
13
|
+
from .findings import Finding
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class Phase(Enum):
|
|
17
|
+
"""
|
|
18
|
+
AIPT Pipeline Phases
|
|
19
|
+
|
|
20
|
+
The pipeline executes in order:
|
|
21
|
+
1. RECON - Asset discovery and reconnaissance
|
|
22
|
+
2. SCAN - Traditional vulnerability scanning (Acunetix, Burp, Nuclei, ZAP)
|
|
23
|
+
3. AI_PENTEST - AI-autonomous penetration testing (Strix)
|
|
24
|
+
4. EXPLOIT - Exploitation and validation of findings
|
|
25
|
+
5. REPORT - Report generation and delivery
|
|
26
|
+
"""
|
|
27
|
+
RECON = "recon"
|
|
28
|
+
SCAN = "scan"
|
|
29
|
+
AI_PENTEST = "ai_pentest" # NEW: Strix integration
|
|
30
|
+
EXPLOIT = "exploit"
|
|
31
|
+
REPORT = "report"
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
class PhaseStatus(Enum):
|
|
35
|
+
"""Status of a pipeline phase"""
|
|
36
|
+
PENDING = "pending"
|
|
37
|
+
RUNNING = "running"
|
|
38
|
+
COMPLETED = "completed"
|
|
39
|
+
FAILED = "failed"
|
|
40
|
+
SKIPPED = "skipped"
|
|
41
|
+
TIMEOUT = "timeout"
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
@dataclass
|
|
45
|
+
class PhaseResult:
|
|
46
|
+
"""
|
|
47
|
+
Result of a single pipeline phase
|
|
48
|
+
|
|
49
|
+
Contains all findings, errors, and metadata from phase execution.
|
|
50
|
+
"""
|
|
51
|
+
|
|
52
|
+
phase: Phase
|
|
53
|
+
status: PhaseStatus = PhaseStatus.PENDING
|
|
54
|
+
|
|
55
|
+
# Findings discovered in this phase
|
|
56
|
+
findings: list[Finding] = field(default_factory=list)
|
|
57
|
+
|
|
58
|
+
# Timing
|
|
59
|
+
started_at: datetime | None = None
|
|
60
|
+
completed_at: datetime | None = None
|
|
61
|
+
|
|
62
|
+
# Error tracking
|
|
63
|
+
errors: list[str] = field(default_factory=list)
|
|
64
|
+
warnings: list[str] = field(default_factory=list)
|
|
65
|
+
|
|
66
|
+
# Phase-specific data
|
|
67
|
+
metadata: dict[str, Any] = field(default_factory=dict)
|
|
68
|
+
|
|
69
|
+
# Scanner results (for SCAN phase)
|
|
70
|
+
scanner_results: dict[str, Any] = field(default_factory=dict)
|
|
71
|
+
|
|
72
|
+
# AI agent traces (for AI_PENTEST phase)
|
|
73
|
+
agent_traces: list[dict[str, Any]] = field(default_factory=list)
|
|
74
|
+
|
|
75
|
+
def start(self) -> None:
|
|
76
|
+
"""Mark phase as started"""
|
|
77
|
+
self.status = PhaseStatus.RUNNING
|
|
78
|
+
self.started_at = datetime.utcnow()
|
|
79
|
+
|
|
80
|
+
def complete(self) -> None:
|
|
81
|
+
"""Mark phase as completed"""
|
|
82
|
+
self.status = PhaseStatus.COMPLETED
|
|
83
|
+
self.completed_at = datetime.utcnow()
|
|
84
|
+
|
|
85
|
+
def fail(self, error: str) -> None:
|
|
86
|
+
"""Mark phase as failed"""
|
|
87
|
+
self.status = PhaseStatus.FAILED
|
|
88
|
+
self.completed_at = datetime.utcnow()
|
|
89
|
+
self.errors.append(error)
|
|
90
|
+
|
|
91
|
+
def skip(self, reason: str) -> None:
|
|
92
|
+
"""Mark phase as skipped"""
|
|
93
|
+
self.status = PhaseStatus.SKIPPED
|
|
94
|
+
self.completed_at = datetime.utcnow()
|
|
95
|
+
self.metadata["skip_reason"] = reason
|
|
96
|
+
|
|
97
|
+
def add_finding(self, finding: Finding) -> None:
|
|
98
|
+
"""Add a finding to this phase"""
|
|
99
|
+
self.findings.append(finding)
|
|
100
|
+
|
|
101
|
+
def add_findings(self, findings: list[Finding]) -> None:
|
|
102
|
+
"""Add multiple findings"""
|
|
103
|
+
self.findings.extend(findings)
|
|
104
|
+
|
|
105
|
+
@property
|
|
106
|
+
def duration_seconds(self) -> float | None:
|
|
107
|
+
"""Get phase duration in seconds"""
|
|
108
|
+
if self.started_at and self.completed_at:
|
|
109
|
+
return (self.completed_at - self.started_at).total_seconds()
|
|
110
|
+
return None
|
|
111
|
+
|
|
112
|
+
@property
|
|
113
|
+
def finding_counts(self) -> dict[str, int]:
|
|
114
|
+
"""Get finding counts by severity"""
|
|
115
|
+
from .findings import Severity
|
|
116
|
+
counts = {s.value: 0 for s in Severity}
|
|
117
|
+
for finding in self.findings:
|
|
118
|
+
counts[finding.severity.value] += 1
|
|
119
|
+
return counts
|
|
120
|
+
|
|
121
|
+
def to_dict(self) -> dict[str, Any]:
|
|
122
|
+
"""Convert to dictionary for JSON serialization"""
|
|
123
|
+
return {
|
|
124
|
+
"phase": self.phase.value,
|
|
125
|
+
"status": self.status.value,
|
|
126
|
+
"findings": [f.to_dict() for f in self.findings],
|
|
127
|
+
"finding_counts": self.finding_counts,
|
|
128
|
+
"started_at": self.started_at.isoformat() if self.started_at else None,
|
|
129
|
+
"completed_at": self.completed_at.isoformat() if self.completed_at else None,
|
|
130
|
+
"duration_seconds": self.duration_seconds,
|
|
131
|
+
"errors": self.errors,
|
|
132
|
+
"warnings": self.warnings,
|
|
133
|
+
"metadata": self.metadata,
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
@dataclass
|
|
138
|
+
class PipelineResult:
|
|
139
|
+
"""
|
|
140
|
+
Complete result of an AIPT scan pipeline
|
|
141
|
+
|
|
142
|
+
Aggregates results from all phases with deduplication.
|
|
143
|
+
"""
|
|
144
|
+
|
|
145
|
+
scan_id: str
|
|
146
|
+
target: str
|
|
147
|
+
started_at: datetime = field(default_factory=datetime.utcnow)
|
|
148
|
+
completed_at: datetime | None = None
|
|
149
|
+
|
|
150
|
+
# Phase results
|
|
151
|
+
phases: dict[Phase, PhaseResult] = field(default_factory=dict)
|
|
152
|
+
|
|
153
|
+
# Aggregated and deduplicated findings
|
|
154
|
+
_all_findings: list[Finding] = field(default_factory=list)
|
|
155
|
+
|
|
156
|
+
def add_phase_result(self, result: PhaseResult) -> None:
|
|
157
|
+
"""Add a phase result and merge findings"""
|
|
158
|
+
self.phases[result.phase] = result
|
|
159
|
+
|
|
160
|
+
def get_all_findings(self, deduplicate: bool = True) -> list[Finding]:
|
|
161
|
+
"""
|
|
162
|
+
Get all findings across all phases.
|
|
163
|
+
|
|
164
|
+
If deduplicate=True, merges duplicate findings from different sources.
|
|
165
|
+
"""
|
|
166
|
+
all_findings: list[Finding] = []
|
|
167
|
+
for phase_result in self.phases.values():
|
|
168
|
+
all_findings.extend(phase_result.findings)
|
|
169
|
+
|
|
170
|
+
if not deduplicate:
|
|
171
|
+
return all_findings
|
|
172
|
+
|
|
173
|
+
# Deduplicate by fingerprint
|
|
174
|
+
unique_findings: dict[str, Finding] = {}
|
|
175
|
+
for finding in all_findings:
|
|
176
|
+
if finding.fingerprint in unique_findings:
|
|
177
|
+
# Merge with existing finding
|
|
178
|
+
existing = unique_findings[finding.fingerprint]
|
|
179
|
+
unique_findings[finding.fingerprint] = existing.merge_with(finding)
|
|
180
|
+
else:
|
|
181
|
+
unique_findings[finding.fingerprint] = finding
|
|
182
|
+
|
|
183
|
+
return list(unique_findings.values())
|
|
184
|
+
|
|
185
|
+
def get_findings_by_severity(self) -> dict[str, list[Finding]]:
|
|
186
|
+
"""Group findings by severity"""
|
|
187
|
+
from .findings import Severity
|
|
188
|
+
grouped = {s.value: [] for s in Severity}
|
|
189
|
+
for finding in self.get_all_findings():
|
|
190
|
+
grouped[finding.severity.value].append(finding)
|
|
191
|
+
return grouped
|
|
192
|
+
|
|
193
|
+
def get_summary(self) -> dict[str, Any]:
|
|
194
|
+
"""Get executive summary of the scan"""
|
|
195
|
+
findings = self.get_all_findings()
|
|
196
|
+
from .findings import Severity
|
|
197
|
+
|
|
198
|
+
return {
|
|
199
|
+
"scan_id": self.scan_id,
|
|
200
|
+
"target": self.target,
|
|
201
|
+
"total_findings": len(findings),
|
|
202
|
+
"critical": len([f for f in findings if f.severity == Severity.CRITICAL]),
|
|
203
|
+
"high": len([f for f in findings if f.severity == Severity.HIGH]),
|
|
204
|
+
"medium": len([f for f in findings if f.severity == Severity.MEDIUM]),
|
|
205
|
+
"low": len([f for f in findings if f.severity == Severity.LOW]),
|
|
206
|
+
"info": len([f for f in findings if f.severity == Severity.INFO]),
|
|
207
|
+
"confirmed_findings": len([f for f in findings if f.confirmed]),
|
|
208
|
+
"exploited_findings": len([f for f in findings if f.exploited]),
|
|
209
|
+
"ai_findings": len([f for f in findings if f.source == "aipt"]),
|
|
210
|
+
"phases_completed": len([p for p in self.phases.values() if p.status == PhaseStatus.COMPLETED]),
|
|
211
|
+
"phases_failed": len([p for p in self.phases.values() if p.status == PhaseStatus.FAILED]),
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
def to_dict(self) -> dict[str, Any]:
|
|
215
|
+
"""Convert to dictionary for JSON serialization"""
|
|
216
|
+
return {
|
|
217
|
+
"scan_id": self.scan_id,
|
|
218
|
+
"target": self.target,
|
|
219
|
+
"started_at": self.started_at.isoformat(),
|
|
220
|
+
"completed_at": self.completed_at.isoformat() if self.completed_at else None,
|
|
221
|
+
"summary": self.get_summary(),
|
|
222
|
+
"phases": {p.value: r.to_dict() for p, r in self.phases.items()},
|
|
223
|
+
"all_findings": [f.to_dict() for f in self.get_all_findings()],
|
|
224
|
+
}
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
"""
|
|
2
|
+
AIPT Scan Configuration
|
|
3
|
+
|
|
4
|
+
Defines scan modes and configuration options for the unified pipeline.
|
|
5
|
+
"""
|
|
6
|
+
from __future__ import annotations
|
|
7
|
+
|
|
8
|
+
from dataclasses import dataclass, field
|
|
9
|
+
from enum import Enum
|
|
10
|
+
from typing import Any
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class ScanMode(Enum):
|
|
14
|
+
"""
|
|
15
|
+
Scan intensity modes
|
|
16
|
+
|
|
17
|
+
QUICK: Fast reconnaissance + AI-autonomous testing only (Aipt)
|
|
18
|
+
STANDARD: Traditional scanners + AI testing (balanced)
|
|
19
|
+
COMPREHENSIVE: All scanners + aggressive AI testing + exploitation
|
|
20
|
+
STEALTH: Low-noise scanning with minimal active probing
|
|
21
|
+
"""
|
|
22
|
+
QUICK = "quick"
|
|
23
|
+
STANDARD = "standard"
|
|
24
|
+
COMPREHENSIVE = "comprehensive"
|
|
25
|
+
STEALTH = "stealth"
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class ScannerType(Enum):
|
|
29
|
+
"""Available scanners in the pipeline"""
|
|
30
|
+
# Traditional DAST
|
|
31
|
+
ACUNETIX = "acunetix"
|
|
32
|
+
BURP_SUITE = "burp"
|
|
33
|
+
ZAP = "zap"
|
|
34
|
+
|
|
35
|
+
# Template-based
|
|
36
|
+
NUCLEI = "nuclei"
|
|
37
|
+
|
|
38
|
+
# AI-Autonomous
|
|
39
|
+
STRIX = "aipt"
|
|
40
|
+
|
|
41
|
+
# Reconnaissance
|
|
42
|
+
NMAP = "nmap"
|
|
43
|
+
SUBFINDER = "subfinder"
|
|
44
|
+
HTTPX = "httpx"
|
|
45
|
+
|
|
46
|
+
# Fuzzing
|
|
47
|
+
FFUF = "ffuf"
|
|
48
|
+
SQLMAP = "sqlmap"
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
@dataclass
|
|
52
|
+
class ScanConfig:
|
|
53
|
+
"""
|
|
54
|
+
Unified scan configuration for AIPT
|
|
55
|
+
|
|
56
|
+
This config controls all aspects of the scanning pipeline:
|
|
57
|
+
- Target specification
|
|
58
|
+
- Scanner selection and configuration
|
|
59
|
+
- AI agent settings
|
|
60
|
+
- Output and reporting options
|
|
61
|
+
"""
|
|
62
|
+
|
|
63
|
+
# Target configuration
|
|
64
|
+
target: str # Primary target URL or domain
|
|
65
|
+
scope: list[str] = field(default_factory=list) # Additional in-scope URLs/patterns
|
|
66
|
+
exclude_patterns: list[str] = field(default_factory=list) # URLs to exclude
|
|
67
|
+
|
|
68
|
+
# Scan mode
|
|
69
|
+
mode: ScanMode = ScanMode.STANDARD
|
|
70
|
+
|
|
71
|
+
# Phase configuration
|
|
72
|
+
enable_recon: bool = True
|
|
73
|
+
enable_traditional_scan: bool = True
|
|
74
|
+
enable_ai_pentest: bool = True # NEW: Aipt AI-autonomous testing
|
|
75
|
+
enable_exploitation: bool = False # Disabled by default for safety
|
|
76
|
+
enable_reporting: bool = True
|
|
77
|
+
|
|
78
|
+
# Scanner selection
|
|
79
|
+
enabled_scanners: list[ScannerType] = field(default_factory=lambda: [
|
|
80
|
+
ScannerType.NUCLEI,
|
|
81
|
+
ScannerType.STRIX,
|
|
82
|
+
])
|
|
83
|
+
|
|
84
|
+
# Traditional scanner configs
|
|
85
|
+
acunetix_config: dict[str, Any] = field(default_factory=dict)
|
|
86
|
+
burp_config: dict[str, Any] = field(default_factory=dict)
|
|
87
|
+
zap_config: dict[str, Any] = field(default_factory=dict)
|
|
88
|
+
nuclei_config: dict[str, Any] = field(default_factory=dict)
|
|
89
|
+
|
|
90
|
+
# Aipt AI configuration
|
|
91
|
+
aipt_config: "AiptConfig" = field(default_factory=lambda: AiptConfig())
|
|
92
|
+
|
|
93
|
+
# Authentication
|
|
94
|
+
auth_config: dict[str, Any] | None = None
|
|
95
|
+
|
|
96
|
+
# Rate limiting
|
|
97
|
+
max_requests_per_second: int = 10
|
|
98
|
+
max_concurrent_scans: int = 3
|
|
99
|
+
|
|
100
|
+
# Timeouts (in seconds)
|
|
101
|
+
phase_timeout: int = 3600 # 1 hour per phase
|
|
102
|
+
total_timeout: int = 14400 # 4 hours total
|
|
103
|
+
|
|
104
|
+
# Output configuration
|
|
105
|
+
output_dir: str = "./aipt_results"
|
|
106
|
+
report_formats: list[str] = field(default_factory=lambda: ["html", "json", "pdf"])
|
|
107
|
+
|
|
108
|
+
# Verbosity
|
|
109
|
+
verbose: bool = False
|
|
110
|
+
debug: bool = False
|
|
111
|
+
|
|
112
|
+
@classmethod
|
|
113
|
+
def quick(cls, target: str) -> "ScanConfig":
|
|
114
|
+
"""Create a quick scan config (AI + Nuclei only)"""
|
|
115
|
+
return cls(
|
|
116
|
+
target=target,
|
|
117
|
+
mode=ScanMode.QUICK,
|
|
118
|
+
enable_recon=True,
|
|
119
|
+
enable_traditional_scan=False,
|
|
120
|
+
enable_ai_pentest=True,
|
|
121
|
+
enable_exploitation=False,
|
|
122
|
+
enabled_scanners=[ScannerType.NUCLEI, ScannerType.STRIX],
|
|
123
|
+
phase_timeout=1800, # 30 min
|
|
124
|
+
total_timeout=3600, # 1 hour
|
|
125
|
+
)
|
|
126
|
+
|
|
127
|
+
@classmethod
|
|
128
|
+
def standard(cls, target: str) -> "ScanConfig":
|
|
129
|
+
"""Create a standard scan config"""
|
|
130
|
+
return cls(
|
|
131
|
+
target=target,
|
|
132
|
+
mode=ScanMode.STANDARD,
|
|
133
|
+
enabled_scanners=[
|
|
134
|
+
ScannerType.NUCLEI,
|
|
135
|
+
ScannerType.ZAP,
|
|
136
|
+
ScannerType.STRIX,
|
|
137
|
+
],
|
|
138
|
+
)
|
|
139
|
+
|
|
140
|
+
@classmethod
|
|
141
|
+
def comprehensive(cls, target: str) -> "ScanConfig":
|
|
142
|
+
"""Create a comprehensive scan config (all scanners + exploitation)"""
|
|
143
|
+
return cls(
|
|
144
|
+
target=target,
|
|
145
|
+
mode=ScanMode.COMPREHENSIVE,
|
|
146
|
+
enable_exploitation=True,
|
|
147
|
+
enabled_scanners=[
|
|
148
|
+
ScannerType.ACUNETIX,
|
|
149
|
+
ScannerType.BURP_SUITE,
|
|
150
|
+
ScannerType.ZAP,
|
|
151
|
+
ScannerType.NUCLEI,
|
|
152
|
+
ScannerType.STRIX,
|
|
153
|
+
],
|
|
154
|
+
aipt_config=AiptConfig(
|
|
155
|
+
modules=["all"],
|
|
156
|
+
autonomous_exploitation=True,
|
|
157
|
+
max_agent_iterations=50,
|
|
158
|
+
),
|
|
159
|
+
phase_timeout=7200, # 2 hours
|
|
160
|
+
total_timeout=28800, # 8 hours
|
|
161
|
+
)
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
@dataclass
|
|
165
|
+
class AiptConfig:
|
|
166
|
+
"""
|
|
167
|
+
Aipt AI Agent Configuration
|
|
168
|
+
|
|
169
|
+
Controls how the AI-autonomous pentesting phase operates.
|
|
170
|
+
"""
|
|
171
|
+
|
|
172
|
+
# LLM configuration
|
|
173
|
+
llm_provider: str = "openai" # openai, anthropic, azure
|
|
174
|
+
llm_model: str = "gpt-4o" # gpt-4o, claude-3-5-sonnet, etc.
|
|
175
|
+
llm_api_key: str | None = None # If None, uses environment variable
|
|
176
|
+
|
|
177
|
+
# Prompt modules to load (vulnerability knowledge)
|
|
178
|
+
modules: list[str] = field(default_factory=lambda: [
|
|
179
|
+
"sql_injection",
|
|
180
|
+
"xss",
|
|
181
|
+
"rce",
|
|
182
|
+
"ssrf",
|
|
183
|
+
"auth_bypass",
|
|
184
|
+
])
|
|
185
|
+
|
|
186
|
+
# Agent behavior
|
|
187
|
+
max_agent_iterations: int = 30 # Max tool calls per session
|
|
188
|
+
autonomous_exploitation: bool = False # If True, attempts full exploitation
|
|
189
|
+
confirm_before_exploit: bool = True # Require human confirmation
|
|
190
|
+
|
|
191
|
+
# Scope constraints
|
|
192
|
+
stay_in_scope: bool = True
|
|
193
|
+
allowed_methods: list[str] = field(default_factory=lambda: ["GET", "POST"])
|
|
194
|
+
disallowed_paths: list[str] = field(default_factory=lambda: [
|
|
195
|
+
"/admin",
|
|
196
|
+
"/logout",
|
|
197
|
+
"/delete",
|
|
198
|
+
])
|
|
199
|
+
|
|
200
|
+
# Sandbox settings
|
|
201
|
+
use_docker_sandbox: bool = True
|
|
202
|
+
sandbox_network_mode: str = "bridge"
|
|
203
|
+
sandbox_timeout: int = 300 # 5 min per sandbox session
|
|
204
|
+
|
|
205
|
+
# Output
|
|
206
|
+
save_agent_traces: bool = True
|
|
207
|
+
trace_output_dir: str = "./aipt_traces"
|