Skip to content

armgit / ARES

Public Imported from GitHub
0

ARES - authorized red-team engagement automation with dashboard, campaign scope, module orchestration, OPSEC controls, encrypted vault, and reporting.

feat(feasibility): enterprise credential & persistence matrix + API route & dashboard 1-click alternative switch

Mafifrizib6b3b511897a
diff --git a/ares/api/server.py b/ares/api/server.py
index 0771790..8cad9ac 100644
--- a/ares/api/server.py
+++ b/ares/api/server.py
@@ -2029,6 +2029,44 @@ async def run_module(
return payload
+class FeasibilityRequest(BaseModel):
+ campaign_id: str
+ target: str = ""
+ params: dict[str, Any] = {}
+
+
[email protected]("/modules/{module_id}/feasibility", tags=["modules"])
+async def assess_module_feasibility_endpoint(
+ module_id: str,
+ body: FeasibilityRequest,
+ actor: AuthenticatedUser = Depends(require_operator()),
+ engine: AresEngine = Depends(get_engine),
+ db: AresDatabase = Depends(get_db),
+) -> dict[str, Any]:
+ """
+ Pre-flight defense feasibility assessment before module execution.
+ Evaluates target defense posture (EDR, Credential Guard, PPL, MDI, Sysmon),
+ calculates risk score, and recommends stealthy alternatives.
+ """
+ if isinstance(engine, AresEngine):
+ engine.bind_database(db)
+
+ campaign = await db.get_campaign(body.campaign_id)
+ if not campaign:
+ raise HTTPException(404, "Campaign not found")
+
+ params = dict(body.params)
+ if body.target and not params.get("target"):
+ params["target"] = body.target
+
+ report = await engine.assess_module_feasibility(module_id, campaign, params)
+ return {
+ "module_id": module_id,
+ "campaign_id": body.campaign_id,
+ "report": report.to_dict(),
+ }
+
+
# ── WebSocket ─────────────────────────────────────────────────────────────────
diff --git a/ares/modules/credential/golden_ticket.py b/ares/modules/credential/golden_ticket.py
index 4ca9868..1c84c9c 100644
--- a/ares/modules/credential/golden_ticket.py
+++ b/ares/modules/credential/golden_ticket.py
@@ -45,6 +45,80 @@ class GoldenTicketModule(BaseModule):
OUTPUTS = ["golden_ticket", "kerberos_ticket"]
MITRE_TECHNIQUES = ["T1558.001"]
+ async def assess_feasibility(self, ctx: "Any") -> "FeasibilityReport":
+ """
+ Pre-flight Defense Feasibility Assessment:
+ Evaluates domain SID, krbtgt credentials (AES256 vs RC4), and DC PAC validation.
+ Recommends Diamond Ticket or AES256 encryption if MDI (Defender for Identity) is active.
+ """
+ from ares.modules.base import FeasibilityReport
+ from ares.core.campaign import NoiseProfile
+ from ares.core.security import sanitize_hostname
+
+ blockers: list[str] = []
+ recommendations: list[str] = []
+ opsec_tuning: dict[str, Any] = {}
+ score = 1.0
+ risk = "medium"
+
+ domain = getattr(ctx, "domain", "") or getattr(ctx, "params", {}).get("domain", "")
+ krbtgt_hash = (
+ getattr(ctx, "params", {}).get("krbtgt_hash", "")
+ or getattr(ctx, "params", {}).get("krbtgt_aes256", "")
+ or getattr(ctx, "params", {}).get("krbtgt_key", "")
+ )
+ domain_sid = getattr(ctx, "params", {}).get("domain_sid", "")
+
+ if not domain:
+ blockers.append("No domain specified")
+ score -= 0.4
+ if not krbtgt_hash:
+ blockers.append("krbtgt hash or AES key required for ticket forgery (run ad.dcsync first)")
+ score -= 0.5
+ recommendations.append("ad.dcsync")
+ if not domain_sid:
+ blockers.append("domain_sid required for Kerberos PAC construction")
+ score -= 0.3
+ recommendations.append("ad.dcsync")
+
+ target_dc = sanitize_hostname(getattr(ctx, "target", "") or getattr(ctx, "params", {}).get("dc", ""))
+ session = getattr(ctx, "session", None)
+ if session and hasattr(session, "get_host") and target_dc:
+ host_state = session.get_host(target_dc)
+ if host_state:
+ if host_state.has_defense("mdi") or host_state.has_defense("mde_identity") or host_state.has_defense("pac_validation"):
+ # Classic RC4 golden tickets trigger MDI anomaly alert
+ opsec_tuning["recommended_variant"] = "Diamond Ticket / AES256"
+ opsec_tuning["warning"] = (
+ "Domain Controller has Microsoft Defender for Identity / PAC validation active. "
+ "Do NOT use classic RC4 tickets without Event ID 4768 pre-authentication. "
+ "Forge using AES256 keys or use Diamond Ticket method."
+ )
+ score = 0.1
+ risk = "critical_alarm"
+ recommendations.append("ad.dcsync")
+
+ noise = getattr(getattr(ctx, "campaign", None), "noise_profile", None)
+ if noise == NoiseProfile.STEALTH:
+ opsec_tuning["lifetime_hours"] = 10
+ opsec_tuning["note"] = "Stealth profile: restrict ticket lifetime to 10h to match standard enterprise Kerberos policies"
+
+ unique_recs: list[str] = []
+ for r in recommendations:
+ if r not in unique_recs:
+ unique_recs.append(r)
+
+ feasible = len(blockers) == 0 and score >= 0.4
+ return FeasibilityReport(
+ feasible=feasible,
+ score=max(0.0, min(1.0, score)),
+ risk_level=risk,
+ blockers=blockers,
+ recommended_alternatives=unique_recs,
+ opsec_tuning=opsec_tuning,
+ details={"domain": domain, "domain_sid": domain_sid},
+ )
+
async def validate(self, ctx: "Any") -> None:
"""Enforce domain, krbtgt hash, and domain SID before ticket forge."""
await super().validate(ctx)
diff --git a/ares/modules/credential/pass_spray.py b/ares/modules/credential/pass_spray.py
index d35f1fd..2e8d742 100644
--- a/ares/modules/credential/pass_spray.py
+++ b/ares/modules/credential/pass_spray.py
@@ -230,6 +230,79 @@ class PassSprayModule(BaseModule):
OUTPUTS = ["valid_credentials"]
MITRE_TECHNIQUES = ["T1110.003"]
+ async def assess_feasibility(self, ctx: "Any") -> "FeasibilityReport":
+ """
+ Pre-flight Defense Feasibility Assessment:
+ Evaluates domain target, user list, and lockout threshold risks.
+ Recommends ad.asreproast or ad.kerberoast under STEALTH to completely prevent
+ account lockout risks and Event ID 4625 failed logon spikes.
+ """
+ from ares.modules.base import FeasibilityReport
+ from ares.core.campaign import NoiseProfile
+ from ares.core.security import sanitize_hostname
+
+ blockers: list[str] = []
+ recommendations: list[str] = []
+ opsec_tuning: dict[str, Any] = {}
+ score = 1.0
+ risk = "medium"
+
+ target = sanitize_hostname(getattr(ctx, "target", "") or getattr(ctx, "params", {}).get("target", ""))
+ users = getattr(ctx, "params", {}).get("users", []) or getattr(ctx, "params", {}).get("user_list", [])
+
+ if not target:
+ blockers.append("No Domain Controller or target IP specified")
+ score -= 0.5
+ if not users:
+ blockers.append("No target user list provided for password spraying (user_list required)")
+ score -= 0.4
+ recommendations.append("ad.enum_users")
+
+ noise = getattr(getattr(ctx, "campaign", None), "noise_profile", None)
+ if noise == NoiseProfile.STEALTH:
+ score = 0.35
+ risk = "high_noise"
+ blockers.append("Password spraying generates rapid Event ID 4625 failed logins — strictly blocked in STEALTH mode")
+ opsec_tuning["note"] = (
+ "Password spraying in STEALTH profile creates Event ID 4625 failed logons. "
+ "Recommend offline cracking techniques that never touch target authenticators."
+ )
+ recommendations.extend(["ad.asreproast", "ad.kerberoast"])
+
+ session = getattr(ctx, "session", None)
+ if session and hasattr(session, "get_host") and target:
+ host_state = session.get_host(target)
+ if host_state:
+ threshold = host_state.defense_profile.get("lockout_threshold")
+ is_strict = (
+ host_state.has_defense("smart_lockout")
+ or host_state.has_defense("strict_lockout")
+ or (isinstance(threshold, (int, float)) and threshold <= 5)
+ )
+ if is_strict:
+ blockers.append("Strict lockout policy detected (threshold <= 5) — password spraying blocked to avoid account lockouts")
+ score = 0.1
+ risk = "critical_alarm"
+ opsec_tuning["safe_spray_rate"] = "1 attempt per 45 minutes"
+ opsec_tuning["lockout_warning"] = "Strict lockout policy detected. Spraying rate capped to 1 attempt per observation window."
+ recommendations.extend(["ad.asreproast", "ad.kerberoast"])
+
+ unique_recs: list[str] = []
+ for r in recommendations:
+ if r not in unique_recs:
+ unique_recs.append(r)
+
+ feasible = len(blockers) == 0 and score >= 0.4
+ return FeasibilityReport(
+ feasible=feasible,
+ score=max(0.0, min(1.0, score)),
+ risk_level=risk,
+ blockers=blockers,
+ recommended_alternatives=unique_recs,
+ opsec_tuning=opsec_tuning,
+ details={"target": target, "user_count": len(users)},
+ )
+
async def validate(self, ctx: "Any") -> None:
"""Enforce target, user list, and password list before spray."""
await super().validate(ctx)
diff --git a/ares/modules/credential/pass_the_hash.py b/ares/modules/credential/pass_the_hash.py
index 7a59278..e8a209e 100644
--- a/ares/modules/credential/pass_the_hash.py
+++ b/ares/modules/credential/pass_the_hash.py
@@ -42,6 +42,66 @@ class PassTheHashModule(BaseModule):
OUTPUTS = ["valid_credentials", "owned_hosts"]
MITRE_TECHNIQUES = ["T1550.002"]
+ async def assess_feasibility(self, ctx: "Any") -> "FeasibilityReport":
+ """
+ Pre-flight Defense Feasibility Assessment:
+ Evaluates NTLM hash presence, target host, and Kerberos-only/NTLM-disabled policies.
+ Recommends Overpass-the-Hash (ad.kerberoast / credential.golden_ticket) if NTLM is blocked.
+ """
+ from ares.modules.base import FeasibilityReport
+ from ares.core.security import sanitize_hostname
+
+ blockers: list[str] = []
+ recommendations: list[str] = []
+ opsec_tuning: dict[str, Any] = {}
+ score = 1.0
+ risk = "medium"
+
+ target = sanitize_hostname(getattr(ctx, "target", "") or getattr(ctx, "params", {}).get("target", ""))
+ nt_hash = (
+ getattr(ctx, "params", {}).get("nt_hash", "")
+ or getattr(ctx, "params", {}).get("hash", "")
+ or getattr(ctx, "params", {}).get("nthash", "")
+ or getattr(ctx, "params", {}).get("ntlm_hash", "")
+ )
+
+ if not target:
+ blockers.append("No target host specified")
+ score -= 0.5
+ if not nt_hash:
+ blockers.append("NTLM hash is required (nt_hash required)")
+ score -= 0.5
+ recommendations.extend(["windows.lsass_dump", "ad.dcsync"])
+
+ session = getattr(ctx, "session", None)
+ if session and hasattr(session, "get_host") and target:
+ host_state = session.get_host(target)
+ if host_state:
+ if host_state.has_defense("ntlm_disabled") or host_state.has_defense("kerberos_only"):
+ blockers.append("Target host enforces Kerberos-only authentication (NTLM disabled by security policy)")
+ score = 0.1
+ risk = "critical_alarm"
+ recommendations.extend(["credential.golden_ticket", "ad.kerberoast"])
+ opsec_tuning["evasion_alternative"] = "Use Overpass-the-Hash (Pass-the-Key) to request Kerberos TGT using the NT hash."
+ if host_state.has_defense("restricted_admin"):
+ opsec_tuning["note"] = "Restricted Admin mode active: Pass-the-Hash will not deposit plaintext credentials into target LSASS."
+
+ unique_recs: list[str] = []
+ for r in recommendations:
+ if r not in unique_recs:
+ unique_recs.append(r)
+
+ feasible = len(blockers) == 0 and score >= 0.4
+ return FeasibilityReport(
+ feasible=feasible,
+ score=max(0.0, min(1.0, score)),
+ risk_level=risk,
+ blockers=blockers,
+ recommended_alternatives=unique_recs,
+ opsec_tuning=opsec_tuning,
+ details={"target": target},
+ )
+
async def validate(self, ctx: "Any") -> None:
"""Enforce target and NTLM hash before any SMB connection."""
await super().validate(ctx)
diff --git a/ares/modules/persistence/scheduled_task.py b/ares/modules/persistence/scheduled_task.py
index ccd4ca8..66a3875 100644
--- a/ares/modules/persistence/scheduled_task.py
+++ b/ares/modules/persistence/scheduled_task.py
@@ -109,6 +109,69 @@ class ScheduledTaskPersistence(BaseModule):
OPSEC_LEVEL = OpsecLevel.MEDIUM
+ async def assess_feasibility(self, ctx: "Any") -> "FeasibilityReport":
+ """
+ Pre-flight Defense Feasibility Assessment:
+ Evaluates task creation risks, Event ID 4698 logging, and noise profile.
+ Recommends persistence.wmi_subscription under STEALTH for cleaner footprint.
+ """
+ from ares.modules.base import FeasibilityReport
+ from ares.core.campaign import NoiseProfile
+ from ares.core.security import sanitize_hostname
+
+ blockers: list[str] = []
+ recommendations: list[str] = []
+ opsec_tuning: dict[str, Any] = {}
+ score = 1.0
+ risk = "medium"
+
+ target = sanitize_hostname(getattr(ctx, "target", "") or getattr(ctx, "params", {}).get("target", ""))
+ username = getattr(ctx, "params", {}).get("username", "")
+
+ if not target:
+ blockers.append("No target host specified")
+ score -= 0.5
+ if not username:
+ cred = getattr(ctx, "best_credential", lambda: None)()
+ if cred:
+ username = cred.username
+ if not username:
+ blockers.append("No local administrator credentials provided")
+ score -= 0.4
+
+ noise = getattr(getattr(ctx, "campaign", None), "noise_profile", None)
+ if noise == NoiseProfile.STEALTH:
+ score = 0.3
+ risk = "high_noise"
+ blockers.append("Scheduled task registration generates Windows Security Event ID 4698 — blocked in STEALTH")
+ recommendations.append("persistence.wmi_subscription")
+
+ session = getattr(ctx, "session", None)
+ if session and hasattr(session, "get_host") and target:
+ host_state = session.get_host(target)
+ if host_state:
+ if host_state.has_defense("edr") or host_state.has_defense("task_scheduler_auditing"):
+ risk = "high_noise"
+ score -= 0.2
+ opsec_tuning["masquerade"] = "Task name should mimic standard Microsoft Update tasks (e.g. OneDrive Standalone Update Task)"
+ recommendations.append("persistence.wmi_subscription")
+
+ unique_recs: list[str] = []
+ for r in recommendations:
+ if r not in unique_recs:
+ unique_recs.append(r)
+
+ feasible = len(blockers) == 0 and score >= 0.4
+ return FeasibilityReport(
+ feasible=feasible,
+ score=max(0.0, min(1.0, score)),
+ risk_level=risk,
+ blockers=blockers,
+ recommended_alternatives=unique_recs,
+ opsec_tuning=opsec_tuning,
+ details={"target": target, "username": username},
+ )
+
async def validate(self, ctx: "Any") -> None:
"""Pre-flight param checks before any network call."""
await super().validate(ctx)
diff --git a/ares/modules/persistence/wmi_subscription.py b/ares/modules/persistence/wmi_subscription.py
index ac7494e..ad8a551 100644
--- a/ares/modules/persistence/wmi_subscription.py
+++ b/ares/modules/persistence/wmi_subscription.py
@@ -40,6 +40,65 @@ class WMISubscriptionModule(BaseModule):
OUTPUTS = ["persistence_established"]
MITRE_TECHNIQUES = ["T1546.003"]
+ async def assess_feasibility(self, ctx: "Any") -> "FeasibilityReport":
+ """
+ Pre-flight Defense Feasibility Assessment:
+ Evaluates WMI event subscription persistence feasibility (survives reboot, stealthy).
+ Checks Sysmon Event ID 19/20/21 and WMI monitoring on target.
+ """
+ from ares.modules.base import FeasibilityReport
+ from ares.core.campaign import NoiseProfile
+ from ares.core.security import sanitize_hostname
+
+ blockers: list[str] = []
+ recommendations: list[str] = []
+ opsec_tuning: dict[str, Any] = {}
+ score = 1.0
+ risk = "medium"
+
+ target = sanitize_hostname(getattr(ctx, "target", "") or getattr(ctx, "params", {}).get("target", ""))
+ username = getattr(ctx, "params", {}).get("username", "")
+
+ if not target:
+ blockers.append("No target host specified")
+ score -= 0.5
+ if not username:
+ cred = getattr(ctx, "best_credential", lambda: None)()
+ if cred:
+ username = cred.username
+ if not username:
+ blockers.append("No local administrator credentials provided")
+ score -= 0.4
+
+ session = getattr(ctx, "session", None)
+ if session and hasattr(session, "get_host") and target:
+ host_state = session.get_host(target)
+ if host_state:
+ if host_state.has_defense("sysmon_id19") or host_state.has_defense("wmi_monitoring"):
+ score = min(score, 0.6)
+ opsec_tuning["note"] = "Target audits WMI Event Filter/Consumer creation (Sysmon 19/20/21)."
+
+ noise = getattr(getattr(ctx, "campaign", None), "noise_profile", None)
+ if noise == NoiseProfile.STEALTH:
+ score -= 0.1
+ opsec_tuning["stealth_note"] = "WMI subscription is stealthier than Scheduled Task, but emits WMI repository telemetry."
+
+ unique_recs: list[str] = []
+ for r in recommendations:
+ if r not in unique_recs:
+ unique_recs.append(r)
+
+ feasible = len(blockers) == 0 and score >= 0.4
+ return FeasibilityReport(
+ feasible=feasible,
+ score=max(0.0, min(1.0, score)),
+ risk_level=risk,
+ blockers=blockers,
+ recommended_alternatives=unique_recs,
+ opsec_tuning=opsec_tuning,
+ details={"target": target, "username": username},
+ )
+
async def validate(self, ctx: "Any") -> None:
"""Pre-flight param checks before any network call."""
await super().validate(ctx)
diff --git a/frontend/src/api/endpoints.ts b/frontend/src/api/endpoints.ts
index 8ee1c2f..c0ca3ed 100644
--- a/frontend/src/api/endpoints.ts
+++ b/frontend/src/api/endpoints.ts
@@ -5,6 +5,7 @@ import type {
Campaign,
CampaignGraph,
ExecutionChain,
+ FeasibilityResponse,
Finding,
LiveExecutionResponse,
LiveSubmissionOptions,
@@ -219,6 +220,15 @@ export const api = {
})
: liveExecutionRequest(path, payload, options);
},
+ moduleFeasibility: (
+ moduleId: string,
+ body: { campaign_id: string; params?: Record<string, unknown>; target?: string }
+ ) =>
+ apiRequest<FeasibilityResponse>(`/modules/${encodeURIComponent(moduleId)}/feasibility`, {
+ method: "POST",
+ headers: { "Content-Type": "application/json" },
+ body: JSON.stringify(body)
+ }),
generateReport: (campaignId: string, format: string) =>
apiRequest<Record<string, string>>(
`/reports/${encodeURIComponent(campaignId)}?fmt=${encodeURIComponent(format)}`,
diff --git a/frontend/src/api/types.ts b/frontend/src/api/types.ts
index 1402e7f..78ae7c5 100644
--- a/frontend/src/api/types.ts
+++ b/frontend/src/api/types.ts
@@ -211,3 +211,20 @@ export interface AttackPathsResponse {
message?: string;
stats?: Record<string, SafeGraphValue>;
}
+
+export interface FeasibilityReportData {
+ feasible: boolean;
+ score: number;
+ risk_level: string;
+ blockers: string[];
+ recommended_alternatives: string[];
+ opsec_tuning: Record<string, unknown>;
+ details: Record<string, unknown>;
+}
+
+export interface FeasibilityResponse {
+ module_id: string;
+ campaign_id: string;
+ report: FeasibilityReportData;
+}
+
diff --git a/frontend/src/features/dashboard/DashboardPages.tsx b/frontend/src/features/dashboard/DashboardPages.tsx
index c63a823..78e9a57 100644
--- a/frontend/src/features/dashboard/DashboardPages.tsx
+++ b/frontend/src/features/dashboard/DashboardPages.tsx
@@ -24,6 +24,7 @@ import {
ShieldAlert,
ShieldCheck,
Target,
+ ArrowRight,
Trash2,
TrendingUp,
UserCog,
@@ -51,7 +52,7 @@ import {
captureSession,
isSessionCurrent
} from "../../api/client";
-import type { ApiKeyMeta, Campaign, ExecutionChain, Finding, ModuleMeta, MonthlyFindingStats, ParamField, ReportItem } from "../../api/types";
+import type { ApiKeyMeta, Campaign, ExecutionChain, FeasibilityReportData, FeasibilityResponse, Finding, ModuleMeta, MonthlyFindingStats, ParamField, ReportItem } from "../../api/types";
import { useAuth } from "../auth/authContext";
import { DashboardUiProvider } from "./dashboardUi";
import {
@@ -1227,9 +1228,23 @@ export function ModulesPage() {
);
});
const sensitive = isSensitiveModule(selected);
+ const feasibility = useQuery({
+ queryKey: ["moduleFeasibility", selectedId, campaignId, params],
+ queryFn: () =>
+ api.moduleFeasibility(selectedId, {
+ campaign_id: campaignId,
+ params,
+ target: typeof params.target === "string" ? params.target : undefined
+ }),
+ enabled: Boolean(selectedId && campaignId),
+ staleTime: 10_000
+ });
+ const feasibilityReport = feasibility.data?.report;
+ const isFeasibilityBlocked = Boolean(feasibilityReport && !feasibilityReport.feasible);
+ const requiresConfirmation = sensitive || isFeasibilityBlocked;
const dryRunSupported = selected?.dry_run_supported !== false;
const kerberoastTargetMissing = selected?.id === "ad.kerberoast" && !String(params.target_user ?? "").trim();
- const canRun = Boolean(campaignId && selectedId) && (!sensitive || confirmed) && !run.isPending && (!dryRun || dryRunSupported);
+ const canRun = Boolean(campaignId && selectedId) && (!requiresConfirmation || confirmed) && !run.isPending && (!dryRun || dryRunSupported);
const runBlocked = !canRun || Boolean(scopeWarning) || kerberoastTargetMissing;
const runHint = moduleRunHint(campaignId, selected, selectedCampaign, sensitive, confirmed, dryRun);
const persistedRun = lastRunRecord?.campaignId === campaignId && lastRunRecord.moduleId === selectedId ? lastRunRecord : null;
@@ -1364,6 +1379,111 @@ export function ModulesPage() {
onChange={setParams}
requiredOverrides={selected.id === "ad.kerberoast" ? { target_user: true } : undefined}
/>
+ {feasibility.isFetching && !feasibilityReport && (
+ <div className="notice text-xs">
+ <Loader2 className="spin shrink-0" size={14} /> Assessing target defensive posture...
+ </div>
+ )}
+ {feasibilityReport && (
+ <div
+ className={`defense-feasibility-card ${
+ !feasibilityReport.feasible || feasibilityReport.risk_level === "critical_alarm"
+ ? "danger"
+ : feasibilityReport.score >= 0.8
+ ? "optimal"
+ : ""
+ }`}
+ >
+ <div className="flex items-center justify-between gap-2 flex-wrap">
+ <div className="flex items-center gap-2">
+ {!feasibilityReport.feasible || feasibilityReport.risk_level === "critical_alarm" ? (
+ <ShieldAlert size={18} className="text-rose-400 shrink-0" />
+ ) : feasibilityReport.risk_level === "high_noise" ? (
+ <AlertTriangle size={18} className="text-amber-400 shrink-0" />
+ ) : (
+ <ShieldCheck size={18} className="text-emerald-400 shrink-0" />
+ )}
+ <div>
+ <div className="font-semibold text-sm flex items-center gap-2 flex-wrap">
+ <span>Pre-Flight Defense Feasibility</span>
+ <span
+ className={
+ !feasibilityReport.feasible
+ ? "badge badge-high"
+ : feasibilityReport.score >= 0.8
+ ? "badge badge-low"
+ : "badge badge-medium"
+ }
+ >
+ {Math.round(feasibilityReport.score * 100)}% Feasible
+ </span>
+ <span
+ className={
+ feasibilityReport.risk_level === "critical_alarm" || feasibilityReport.risk_level === "high_noise"
+ ? "badge badge-high"
+ : feasibilityReport.risk_level === "medium"
+ ? "badge badge-medium"
+ : "badge badge-low"
+ }
+ >
+ Risk: {feasibilityReport.risk_level.replace(/_/g, " ").toUpperCase()}
+ </span>
+ </div>
+ </div>
+ </div>
+ </div>
+
+ {feasibilityReport.blockers.length > 0 && (
+ <div className="mt-2.5 p-2 rounded bg-rose-950/40 border border-rose-800/40 text-rose-300 text-xs space-y-1">
+ <div className="font-medium text-rose-200 flex items-center gap-1.5">
+ <AlertTriangle size={14} className="shrink-0" />
+ <span>Defensive Telemetry & Policy Blockers:</span>
+ </div>
+ <ul className="list-disc list-inside space-y-0.5 text-zinc-300">
+ {feasibilityReport.blockers.map((blocker, idx) => (
+ <li key={idx}>{blocker}</li>
+ ))}
+ </ul>
+ </div>
+ )}
+
+ {Object.keys(feasibilityReport.opsec_tuning || {}).length > 0 && (
+ <div className="mt-2 text-xs text-zinc-400 space-y-1 bg-zinc-900/60 p-2 rounded border border-zinc-800">
+ <span className="font-medium text-zinc-300">OPSEC Tuning Guidance:</span>
+ {Object.entries(feasibilityReport.opsec_tuning).map(([k, v]) => (
+ <div key={k} className="text-zinc-400">
+ <span className="text-amber-400 font-mono text-[11px]">{k}:</span> {String(v)}
+ </div>
+ ))}
+ </div>
+ )}
+
+ {feasibilityReport.recommended_alternatives.length > 0 && (
+ <div className="mt-3 pt-2.5 border-t border-zinc-800">
+ <div className="text-xs font-semibold text-zinc-200 mb-1.5 flex items-center gap-1.5">
+ <ShieldCheck size={14} className="text-amber-400" />
+ <span>Recommended Defense Evasion Alternatives:</span>
+ </div>
+ <div className="flex flex-wrap gap-2">
+ {feasibilityReport.recommended_alternatives.map((altId) => (
+ <button
+ key={altId}
+ type="button"
+ className="btn btn-secondary flex items-center gap-1.5 text-xs py-1 px-2.5 border border-amber-500/40 hover:border-amber-400 text-amber-200 hover:bg-amber-950/30 transition-colors"
+ onClick={() => {
+ setSelectedId(altId);
+ }}
+ title={`Switch module to ${altId}`}
+ >
+ <span>Switch to <strong>{altId}</strong></span>
+ <ArrowRight size={13} className="text-amber-400 shrink-0" />
+ </button>
+ ))}
+ </div>
+ </div>
+ )}
+ </div>
+ )}
{runHint && (
<p className="notice">
{runHint}
@@ -1378,10 +1498,12 @@ export function ModulesPage() {
<input type="checkbox" checked={dryRun} onChange={(e) => setDryRun(e.target.checked)} />
{dryRunSupported ? "Dry run" : "Dry run unavailable"}
</label>
- {sensitive && (
+ {requiresConfirmation && (
<label className="notice notice-danger">
<input className="mr-2" type="checkbox" checked={confirmed} onChange={(e) => setConfirmed(e.target.checked)} />
- Confirm authorized high-noise or sensitive execution
+ {isFeasibilityBlocked
+ ? "Override pre-flight defense blocker and confirm authorized execution"
+ : "Confirm authorized high-noise or sensitive execution"}
</label>
)}
<button className="btn btn-primary" type="submit" disabled={runBlocked}>
diff --git a/frontend/src/styles.css b/frontend/src/styles.css
index fc82563..f8ac429 100644
--- a/frontend/src/styles.css
+++ b/frontend/src/styles.css
@@ -1128,6 +1128,24 @@ textarea.field {
color: #fda4af;
}
+.defense-feasibility-card {
+ border: 1px solid rgba(245, 158, 11, 0.35);
+ background: linear-gradient(180deg, rgba(28, 25, 23, 0.95) 0%, rgba(20, 20, 24, 0.95) 100%);
+ border-radius: 8px;
+ padding: 0.85rem 1rem;
+ margin-top: 0.5rem;
+}
+
+.defense-feasibility-card.danger {
+ border-color: rgba(244, 63, 94, 0.45);
+ background: linear-gradient(180deg, rgba(40, 16, 24, 0.9) 0%, rgba(24, 24, 27, 0.95) 100%);
+}
+
+.defense-feasibility-card.optimal {
+ border-color: rgba(16, 185, 129, 0.35);
+ background: linear-gradient(180deg, rgba(16, 36, 28, 0.85) 0%, rgba(24, 24, 27, 0.95) 100%);
+}
+
.loading-row {
display: flex;
align-items: center;
diff --git a/tests/unit/test_defense_feasibility_matrix.py b/tests/unit/test_defense_feasibility_matrix.py
index bd724bc..2aaf2c5 100644
--- a/tests/unit/test_defense_feasibility_matrix.py
+++ b/tests/unit/test_defense_feasibility_matrix.py
@@ -24,6 +24,11 @@ from ares.modules.windows.lsa_secrets import LSASecretsModule
from ares.modules.windows.token_impersonation import TokenImpersonationModule
from ares.modules.lateral.modules import PsExecLateral, WmiExecLateral, WinRMLateral, RDPLateral
from ares.modules.lateral.dcom import DCOMLateral
+from ares.modules.credential.golden_ticket import GoldenTicketModule
+from ares.modules.credential.pass_spray import PassSprayModule
+from ares.modules.credential.pass_the_hash import PassTheHashModule
+from ares.modules.persistence.scheduled_task import ScheduledTaskPersistence
+from ares.modules.persistence.wmi_subscription import WMISubscriptionModule
@pytest.fixture
@@ -418,3 +423,247 @@ class TestEngineFeasibilityAPI:
)
assert report.feasible is False
assert any("not found" in b for b in report.blockers)
+
+
+class TestGoldenTicketFeasibility:
+ @pytest.mark.asyncio
+ async def test_missing_credentials_blockers(self, dummy_settings, test_campaign, test_noise):
+ mod = GoldenTicketModule(dummy_settings, test_campaign, test_noise)
+ ctx = ExecutionContext.build(
+ campaign=test_campaign,
+ target="10.10.10.1",
+ module_id="credential.golden_ticket",
+ params={},
+ )
+ report = await mod.assess_feasibility(ctx)
+ assert report.feasible is False
+ assert any("domain_sid" in b.lower() for b in report.blockers)
+ assert any("krbtgt" in b.lower() for b in report.blockers)
+
+ @pytest.mark.asyncio
+ async def test_baseline_feasible(self, dummy_settings, test_campaign, test_noise):
+ mod = GoldenTicketModule(dummy_settings, test_campaign, test_noise)
+ ctx = ExecutionContext.build(
+ campaign=test_campaign,
+ target="10.10.10.1",
+ module_id="credential.golden_ticket",
+ params={
+ "domain": "corp.local",
+ "domain_sid": "S-1-5-21-123456789-123456789-123456789",
+ "krbtgt_key": "aad3b435b51404eeaad3b435b51404ee",
+ },
+ )
+ report = await mod.assess_feasibility(ctx)
+ assert report.feasible is True
+ assert report.score >= 0.8
+
+ @pytest.mark.asyncio
+ async def test_mdi_pac_validation_risk(self, dummy_settings, test_campaign, test_noise):
+ mod = GoldenTicketModule(dummy_settings, test_campaign, test_noise)
+ session = OperatorSession(campaign_id="test-camp")
+ host = session.add_host("10.10.10.1", is_dc=True)
+ host.update_defense_profile(controls={"mdi": True, "pac_validation": True})
+
+ ctx = ExecutionContext.build(
+ campaign=test_campaign,
+ target="10.10.10.1",
+ module_id="credential.golden_ticket",
+ params={"domain": "corp.local", "domain_sid": "S-1-5-21-123", "krbtgt_key": "abcdef"},
+ session=session,
+ )
+ report = await mod.assess_feasibility(ctx)
+ assert report.risk_level == "critical_alarm"
+ assert report.score <= 0.1
+ assert "ad.dcsync" in report.recommended_alternatives
+
+
+class TestPassSprayFeasibility:
+ @pytest.mark.asyncio
+ async def test_missing_user_list(self, dummy_settings, test_campaign, test_noise):
+ mod = PassSprayModule(dummy_settings, test_campaign, test_noise)
+ ctx = ExecutionContext.build(
+ campaign=test_campaign,
+ target="10.10.10.1",
+ module_id="credential.pass_spray",
+ params={},
+ )
+ report = await mod.assess_feasibility(ctx)
+ assert report.feasible is False
+ assert any("user_list" in b.lower() for b in report.blockers)
+
+ @pytest.mark.asyncio
+ async def test_stealth_noise_blocked(self, dummy_settings, stealth_campaign, stealth_noise):
+ mod = PassSprayModule(dummy_settings, stealth_campaign, stealth_noise)
+ ctx = ExecutionContext.build(
+ campaign=stealth_campaign,
+ target="10.10.10.1",
+ module_id="credential.pass_spray",
+ params={"user_list": ["user1", "user2"], "password": "Password1!"},
+ )
+ report = await mod.assess_feasibility(ctx)
+ assert report.feasible is False
+ assert any("4625" in b for b in report.blockers)
+ assert "ad.asreproast" in report.recommended_alternatives
+ assert "ad.kerberoast" in report.recommended_alternatives
+
+ @pytest.mark.asyncio
+ async def test_strict_lockout_blocked(self, dummy_settings, test_campaign, test_noise):
+ mod = PassSprayModule(dummy_settings, test_campaign, test_noise)
+ session = OperatorSession(campaign_id="test-camp")
+ host = session.add_host("10.10.10.1", is_dc=True)
+ host.update_defense_profile(controls={"lockout_threshold": 3})
+
+ ctx = ExecutionContext.build(
+ campaign=test_campaign,
+ target="10.10.10.1",
+ module_id="credential.pass_spray",
+ params={"user_list": ["user1", "user2"], "password": "Password1!"},
+ session=session,
+ )
+ report = await mod.assess_feasibility(ctx)
+ assert report.feasible is False
+ assert any("lockout" in b.lower() for b in report.blockers)
+
+
+class TestPassTheHashFeasibility:
+ @pytest.mark.asyncio
+ async def test_missing_hash(self, dummy_settings, test_campaign, test_noise):
+ mod = PassTheHashModule(dummy_settings, test_campaign, test_noise)
+ ctx = ExecutionContext.build(
+ campaign=test_campaign,
+ target="10.10.10.50",
+ module_id="credential.pass_the_hash",
+ params={"username": "Administrator"},
+ )
+ report = await mod.assess_feasibility(ctx)
+ assert report.feasible is False
+ assert any("ntlm hash is required" in b.lower() for b in report.blockers)
+
+ @pytest.mark.asyncio
+ async def test_ntlm_disabled_blocked(self, dummy_settings, test_campaign, test_noise):
+ mod = PassTheHashModule(dummy_settings, test_campaign, test_noise)
+ session = OperatorSession(campaign_id="test-camp")
+ host = session.add_host("10.10.10.50")
+ host.update_defense_profile(controls={"ntlm_disabled": True})
+
+ ctx = ExecutionContext.build(
+ campaign=test_campaign,
+ target="10.10.10.50",
+ module_id="credential.pass_the_hash",
+ params={"username": "Administrator", "nthash": "31d6cfe0d16ae931b73c59d7e0c089c0"},
+ session=session,
+ )
+ report = await mod.assess_feasibility(ctx)
+ assert report.feasible is False
+ assert any("kerberos-only" in b.lower() or "ntlm disabled" in b.lower() for b in report.blockers)
+ assert "credential.golden_ticket" in report.recommended_alternatives
+
+
+class TestScheduledTaskFeasibility:
+ @pytest.mark.asyncio
+ async def test_missing_target(self, dummy_settings, test_campaign, test_noise):
+ mod = ScheduledTaskPersistence(dummy_settings, test_campaign, test_noise)
+ ctx = ExecutionContext.build(
+ campaign=test_campaign,
+ target="",
+ module_id="persistence.scheduled_task",
+ params={},
+ )
+ report = await mod.assess_feasibility(ctx)
+ assert report.feasible is False
+ assert any("No target host specified" in b for b in report.blockers)
+
+ @pytest.mark.asyncio
+ async def test_stealth_noise_blocked(self, dummy_settings, stealth_campaign, stealth_noise):
+ mod = ScheduledTaskPersistence(dummy_settings, stealth_campaign, stealth_noise)
+ ctx = ExecutionContext.build(
+ campaign=stealth_campaign,
+ target="10.10.10.50",
+ module_id="persistence.scheduled_task",
+ params={"username": "admin"},
+ )
+ report = await mod.assess_feasibility(ctx)
+ assert report.feasible is False
+ assert any("4698" in b for b in report.blockers)
+ assert "persistence.wmi_subscription" in report.recommended_alternatives
+
+
+class TestWMISubscriptionFeasibility:
+ @pytest.mark.asyncio
+ async def test_baseline_feasible(self, dummy_settings, test_campaign, test_noise):
+ mod = WMISubscriptionModule(dummy_settings, test_campaign, test_noise)
+ ctx = ExecutionContext.build(
+ campaign=test_campaign,
+ target="10.10.10.50",
+ module_id="persistence.wmi_subscription",
+ params={"username": "admin"},
+ )
+ report = await mod.assess_feasibility(ctx)
+ assert report.feasible is True
+ assert report.score >= 0.8
+
+ @pytest.mark.asyncio
+ async def test_sysmon_telemetry_detected(self, dummy_settings, test_campaign, test_noise):
+ mod = WMISubscriptionModule(dummy_settings, test_campaign, test_noise)
+ session = OperatorSession(campaign_id="test-camp")
+ host = session.add_host("10.10.10.50")
+ host.update_defense_profile(controls={"sysmon_id19": True})
+
+ ctx = ExecutionContext.build(
+ campaign=test_campaign,
+ target="10.10.10.50",
+ module_id="persistence.wmi_subscription",
+ params={"username": "admin"},
+ session=session,
+ )
+ report = await mod.assess_feasibility(ctx)
+ assert "Sysmon 19/20/21" in report.opsec_tuning.get("note", "")
+
+
+class TestModuleFeasibilityEndpoint:
+ def test_feasibility_endpoint_success(self, test_campaign):
+ from unittest.mock import AsyncMock, MagicMock
+ from fastapi.testclient import TestClient
+ from ares.api.server import app, get_engine, get_db, get_current_user
+ from ares.core.engine import AresEngine
+ from ares.api.rbac import AuthenticatedUser
+ from ares.modules.base import FeasibilityReport
+
+ mock_user = AuthenticatedUser(username="operator1", role="operator")
+ mock_db = MagicMock()
+ mock_db.get_campaign = AsyncMock(return_value=test_campaign)
+ mock_engine = MagicMock(spec=AresEngine)
+ mock_report = FeasibilityReport(
+ feasible=True,
+ score=0.85,
+ risk_level="low",
+ blockers=[],
+ recommended_alternatives=[],
+ opsec_tuning={"test": "tuning"},
+ )
+ mock_engine.assess_module_feasibility = AsyncMock(return_value=mock_report)
+ mock_engine.bind_database = MagicMock()
+
+ app.dependency_overrides[get_current_user] = lambda: mock_user
+ app.dependency_overrides[get_db] = lambda: mock_db
+ app.dependency_overrides[get_engine] = lambda: mock_engine
+
+ try:
+ client = TestClient(app, base_url="http://localhost:8000")
+ resp = client.post(
+ "/modules/credential.pass_the_hash/feasibility",
+ json={
+ "campaign_id": test_campaign.id,
+ "target": "10.10.10.50",
+ "params": {"nthash": "aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0"},
+ },
+ )
+ assert resp.status_code == 200
+ data = resp.json()
+ assert data["module_id"] == "credential.pass_the_hash"
+ assert data["campaign_id"] == test_campaign.id
+ assert data["report"]["feasible"] is True
+ assert data["report"]["score"] == 0.85
+ finally:
+ app.dependency_overrides.clear()
+