Heuristic:0x4m4 Hexstrike ai Attack Surface Scoring Weights
| Knowledge Sources | |
|---|---|
| Domains | Target_Profiling, Optimization, Security |
| Last Updated | 2026-10-10 00:00 GMT |
Overview
Weighted scoring formula for calculating a target's attack surface score based on target type, detected technologies, open ports, subdomains, and CMS presence.
Description
The IntelligentDecisionEngine calculates an attack surface score (0-10) for each target to determine risk level and prioritize tool selection. The formula starts with a base score determined by target type (web app=7.0, network host=8.0, API=6.0, cloud=5.0, binary=4.0), then adds weighted points for each additional attack vector: technologies (+0.5 each), open ports (+0.3 each), subdomains (+0.2 each), and CMS detection (+1.5). The final score is capped at 10.0.
Usage
Use this heuristic when profiling targets to determine risk level (critical, high, medium, low, minimal) and to prioritize which targets deserve more aggressive scanning. Applied by the IntelligentDecisionEngine.analyze_target method.
The Insight (Rule of Thumb)
- Action: Calculate score = type_base + technologies*0.5 + ports*0.3 + subdomains*0.2 + cms_bonus
- Values:
- Type base: WEB_APPLICATION=7.0, NETWORK_HOST=8.0, API_ENDPOINT=6.0, CLOUD_SERVICE=5.0, BINARY_FILE=4.0, UNKNOWN=3.0
- CMS bonus: +1.5 if CMS detected (WordPress, Drupal, Joomla)
- Cap: min(score, 10.0)
- Trade-off: Network hosts score highest (8.0) because they expose more direct attack vectors; cloud services score lower (5.0) because access is typically API-mediated.
- Risk thresholds: >=8.0 = critical, >=6.0 = high, >=4.0 = medium, >=2.0 = low, <2.0 = minimal
Reasoning
The weights reflect the relative attack surface each vector exposes. Network hosts get the highest base score (8.0) because they expose raw services (SSH, SMB, web servers) that can be directly exploited. Web applications (7.0) are next because they combine multiple attack vectors (injection, XSS, auth bypass). Technologies add 0.5 each because each detected technology (Apache, PHP, WordPress) is a potential exploit target with known CVEs. Open ports add 0.3 each—less than technologies because not every open port has an exploitable service. Subdomains add only 0.2 each because they often mirror the main application's attack surface. CMS detection adds a significant 1.5 bonus because CMSes (especially WordPress) have large plugin ecosystems with known vulnerabilities.
Code Evidence
Attack surface calculation from `hexstrike_server.py:912-940`:
def _calculate_attack_surface(self, profile: TargetProfile) -> float:
score = 0.0
# Base score by target type
type_scores = {
TargetType.WEB_APPLICATION: 7.0,
TargetType.API_ENDPOINT: 6.0,
TargetType.NETWORK_HOST: 8.0,
TargetType.CLOUD_SERVICE: 5.0,
TargetType.BINARY_FILE: 4.0
}
score += type_scores.get(profile.target_type, 3.0)
# Add points for technologies
score += len(profile.technologies) * 0.5
# Add points for open ports
score += len(profile.open_ports) * 0.3
# Add points for subdomains
score += len(profile.subdomains) * 0.2
# CMS adds attack surface
if profile.cms_type:
score += 1.5
return min(score, 10.0) # Cap at 10.0
Risk level determination from `hexstrike_server.py:942-953`:
def _determine_risk_level(self, profile: TargetProfile) -> str:
if profile.attack_surface_score >= 8.0:
return "critical"
elif profile.attack_surface_score >= 6.0:
return "high"
elif profile.attack_surface_score >= 4.0:
return "medium"
elif profile.attack_surface_score >= 2.0:
return "low"
else:
return "minimal"