Files
rengine/shared/models/scan_preview.py
T
Yogesh Ojha a5e6c0ac0d feat: add target enrichment, vhost discovery, and WAF detection stages
- Implemented TargetEnrichmentStage for enriching targets with DNS, WHOIS, and BGP context.
- Added VhostStage for virtual host discovery using host-header fuzzing.
- Introduced WafDetectStage for fingerprinting web application firewalls.
- Created configuration files for each new stage with relevant parameters.
- Updated Dockerfile to copy stages instead of engines.
- Enhanced existing tools and services for better integration with new stages.
- Refactored task management in Celery to accommodate new stages and improve error handling.
2026-09-02 10:18:03 +05:30

61 lines
1.7 KiB
Python

import uuid
from enum import StrEnum
from pydantic import BaseModel, Field
class PreviewToolStatus(StrEnum):
WILL_RUN = "will_run"
SKIPPED_DISABLED = "skipped_disabled"
SKIPPED_NEEDS_KEY = "skipped_needs_key"
SKIPPED_NOT_APPLICABLE = "skipped_not_applicable"
class PreviewTool(BaseModel):
capability: str
label: str
status: PreviewToolStatus
reason: str | None = None
rate: int | None = None
threads: int | None = None
timeout: int | None = None
class PreviewPhase(BaseModel):
phase: str
label: str
tools: list[PreviewTool] = Field(default_factory=list)
class PreviewSummary(BaseModel):
auth_summary: str
custom_header_names: list[str] = Field(default_factory=list)
rate_summary: str
thread_multiplier: float
timeout_multiplier: float
http_protocol: str
follow_redirects: bool | None = None
excluded_subdomains_count: int = 0
excluded_paths_count: int = 0
excluded_ips_count: int = 0
excluded_subdomains: list[str] = Field(default_factory=list)
excluded_paths: list[str] = Field(default_factory=list)
excluded_ips: list[str] = Field(default_factory=list)
included_subdomains: list[str] = Field(default_factory=list)
proxy_name: str | None = None
estimated_duration_seconds: int = 0
estimated_duration_human: str = ""
class ScanPreview(BaseModel):
target_id: uuid.UUID
target_value: str
target_type: str
engine_id: uuid.UUID
engine_name: str
context_id: uuid.UUID | None = None
context_name: str | None = None
phases: list[PreviewPhase] = Field(default_factory=list)
summary: PreviewSummary
warnings: list[str] = Field(default_factory=list)