{# ── Type-aware result body rendering ────────────────────────────────────── Shared by scans/results.html (tabbed view) and scans/summary.html (single-page category view). Renders the inner body of one ScanResult based on result_type. #} {% macro ri(result) %} {% set d = result.data %}
{%- if result.result_type == 'open_port' -%}
{{ d.port }} {{ d.service }} {% if d.version %}{{ d.version[:60] }}{% endif %} {% if d.protocol %}{{ d.protocol }}{% endif %} {% if d.scan_engine %}{{ d.scan_engine }}{% endif %} {% if d.danger_warning %} ⚠ {{ d.danger_warning }} {% endif %}
{% if d.banner %}
{{ d.banner[:120] }}
{% endif %} {%- elif result.result_type == 'port_scan_summary' -%} {% set ra = d.risk_assessment or {} %}
OPEN {{ d.open_count }}
SCANNED {{ d.total_scanned }}
{% if d.scan_engine %}
ENGINE {{ d.scan_engine }}
{% endif %} {% if ra.level %}
RISK {{ ra.level }}
{% endif %}
{% if d.dangerous_ports %}
⚠ Dangerous: {% for p in d.dangerous_ports[:8] %}{{ p.port }} — {{ p.warning[:35] }}{% if not loop.last %} · {% endif %}{% endfor %}
{% endif %} {% if d.open_ports %}
{{ d.open_ports | join(' ') }}
{% endif %} {%- elif result.result_type == 'os_detection' -%}
{{ d.os_name or '?' }} {% if d.os_family %}{{ d.os_family }}{% endif %} {% if d.os_gen %}{{ d.os_gen }}{% endif %} {{ d.accuracy }}% accuracy
{% if d.cpe %}
{{ d.cpe }}
{% endif %} {%- elif result.result_type == 'dns_records' -%} {% for rtype, vals in (d.records or {}).items() %}
{{ rtype }} {{ vals[:4] | join(' · ') }}
{% endfor %} {%- elif result.result_type == 'ip_address' -%}
{{ d.ip }} {% if d.domain %}← {{ d.domain }}{% endif %}
{%- elif result.result_type == 'subdomain_summary' -%}
{{ d.discovered_count }} subdomains discovered
{{ (d.subdomains or []) | join(' ') }}
{%- elif result.result_type == 'subdomain' -%}
{{ d.subdomain }} {% if d.ip %}→ {{ d.ip }}{% endif %} {% if d.cname %}CNAME {{ d.cname }}{% endif %}
{%- elif result.result_type == 'email_security' -%}
{% if d.spf_configured %}✓{% else %}✗{% endif %} SPF {% if d.dmarc_configured %}✓{% else %}✗{% endif %} DMARC {% if d.spoofable %} ⚠ DOMAIN SPOOFABLE {% else %} ✓ Not spoofable {% endif %}
{% if d.spf_record %}
{{ d.spf_record }}
{% endif %} {% if d.dmarc_record %}
{{ d.dmarc_record }}
{% endif %} {%- elif result.result_type == 'dnssec' -%}
{% if d.dnssec_enabled %}✓ DNSSEC ENABLED{% else %}⚠ DNSSEC NOT CONFIGURED{% endif %}
{%- elif result.result_type == 'zone_transfer' -%} {% if d.vulnerable %}
⚠ CRITICAL — Zone Transfer Allowed
Nameserver: {{ d.nameserver }} — {{ d.record_count }} records leaked
{% else %}
✓ Zone transfer blocked
{% endif %} {%- elif result.result_type == 'cert_transparency' -%}
{% if d.common_name %}{{ d.common_name }}{% endif %} {% if d.issuer %}{{ d.issuer }}{% endif %} {% if d.not_after %}expires {{ d.not_after }}{% endif %}
{%- elif result.result_type == 'reverse_dns' -%}
{{ d.ip }} {{ d.hostname }}
{%- elif result.result_type == 'technology' -%}
{% if d.category %}{{ d.category }}{% endif %} {{ d.name }} {% if d.version %}{{ d.version }}{% endif %} {{ "%.0f"|format((d.confidence or 0)*100) }}% confidence
{% if d.evidence %}
Evidence: {{ d.evidence[:3] | join(' · ') }}
{% endif %} {%- elif result.result_type == 'security_posture' -%}
Grade {{ d.rating }} {{ d.score }}/100
{% if d.missing %}
Missing: {{ d.missing | join(', ') }}
{% endif %} {% if d.present %}
Present: {{ d.present.keys() | list | join(', ') }}
{% endif %} {% if d.recommendation %}
{{ d.recommendation }}
{% endif %} {%- elif result.result_type == 'tls_certificate' -%}
{{ d.version }} {% if d.issuer and d.issuer.organizationName %} issuer: {{ d.issuer.organizationName }} {% endif %} {% if d.not_after %}expires: {{ d.not_after }}{% endif %}
{% if d.subject and d.subject.commonName %}
CN={{ d.subject.commonName }}
{% endif %} {% if d.cipher %}
cipher: {{ d.cipher[0] if d.cipher is iterable else d.cipher }}
{% endif %} {%- elif result.result_type == 'http_headers' -%} {% if d.server_fingerprint %}
Server{{ d.server_fingerprint }}
{% endif %} {% if d.powered_by %}
X-Powered-By{{ d.powered_by }}
{% endif %} {% if d.interesting_headers %}
{% for h in d.interesting_headers.keys() %}{{ h }}{% endfor %}
{% endif %} {%- elif result.result_type in ('api_endpoint', 'web_resource') -%}
{{ d.status_code }} {{ (d.path or d.url or '?')[:60] }} {% if d.endpoint_type %}{{ d.endpoint_type }}{% endif %} {% if d.is_sensitive %}⚠ SENSITIVE{% endif %} {% if d.requires_auth %}AUTH REQUIRED{% endif %}
{% if d.data_preview %}
{{ d.data_preview | tojson(indent=2) | truncate(300) }}
{% endif %} {%- elif result.result_type == 'graphql_schema' -%}
GraphQL schema — {{ (d.types or []) | length }} types
{{ (d.types or [])[:20] | join(' ') }}
{%- elif result.result_type == 'ip_geolocation' -%}
{% if d.city %}{{ d.city }}{% if d.region or d.country %}, {% endif %}{% endif %} {% if d.region %}{{ d.region }}{% if d.country %}, {% endif %}{% endif %} {% if d.country %}{{ d.country }}{% endif %} {% if d.org %}{{ d.org }}{% endif %}
{% if d.asn %}{{ d.asn }}{% endif %} {% if d.timezone %}{{ d.timezone }}{% endif %} {% if d.is_tor %}⚠ TOR EXIT NODE{% endif %} {% if d.is_vpn %}VPN{% endif %} {% if d.is_proxy %}PROXY{% endif %}
{%- elif result.result_type == 'signature_match' -%}
{{ d.severity | upper }} {{ d.name }}
{% if d.matched_source %}
matched {{ d.matched_type }} from {{ d.matched_source }}
{% endif %} {% if d.evidence %}
{{ d.evidence | tojson(indent=2) | truncate(320) }}
{% endif %} {% if d.references %}
{% for ref in d.references[:3] %}ref ↗{% endfor %}
{% endif %} {%- elif result.result_type == 'dork' -%}
{{ d.severity | upper }} {{ d.name }} {{ d.engine }} · {{ (d.queries or []) | length }} dorks
{% for q in d.queries %}
{{ q }} RUN ↗
{% endfor %}
{%- elif result.result_type == 'smtp_users' -%}
SMTP USERS via {{ d.method }} · {{ d.host }}
{{ d.valid_users | join(', ') }}
{%- elif result.result_type == 'smtp_open_relay' -%}
OPEN RELAY {{ d.host }}
{{ d.detail }}
{%- elif result.result_type == 'snmp_community' -%}
SNMP community: {{ d.community }}
{{ d.sys_descr }}
{%- elif result.result_type == 'favicon_hash' -%}
Favicon hash {{ d.value }}
{{ d.shodan_dork }}
{%- elif result.result_type == 'jarm_fingerprint' -%}
JARM {{ d.value }}
{{ d.shodan_dork }}
{%- elif result.result_type == 'tls_cert_fingerprint' -%}
TLS cert {{ d.value }}
CN {{ d.subject_cn or '—' }} · issuer {{ d.issuer or '—' }} · {{ d.san_count }} SANs
{%- elif result.result_type == 'infra_sibling' -%}
{{ d.pivot_kind }} {{ d.ip }} {% if d.org %}{{ d.org }}{% endif %}
{% if d.hostnames %}
{{ d.hostnames | join(', ') }}
{% endif %} {%- elif result.result_type == 'archive_url' -%}
{% if 'sensitive-file' in d.flags %}SENSITIVE FILE{% endif %} {% for f in d.flags if f != 'sensitive-file' %}{{ f }}{% endfor %}
{{ d.url }}
{% if d.params %}
params: {{ d.params | join(', ') }}
{% endif %} {%- elif result.result_type == 'archive_summary' -%}
{{ d.total_urls }} historical URLs · {{ d.interesting_urls }} flagged · {{ d.historical_subdomains }} subdomains · {{ d.param_count }} params — {{ d.domain }}
{%- elif result.result_type == 'js_secret' -%}
{{ d.severity | upper }} {{ d.kind }} {{ d.preview }}
{{ d.script }}
{%- elif result.result_type == 'js_endpoint' -%}
{{ d.endpoint }}
{% if d.script and d.script != '(inline)' %}
from {{ d.script }}
{% endif %} {%- elif result.result_type == 'js_mine_summary' -%}
{{ d.scripts_analyzed }} scripts analyzed · {{ d.endpoints_found }} endpoints · {{ d.secrets_found }} secrets — {{ d.base_url }}
{%- elif result.result_type in ('takeover_vulnerable', 'takeover_candidate') -%}
{% if result.result_type == 'takeover_vulnerable' %} VULNERABLE {% else %} CANDIDATE {% endif %} {{ d.subdomain }} → {{ d.cname }}
{{ d.service }}
{{ d.reason }}
{%- elif result.result_type == 'shodan_host' -%}
{{ d.ip }} {% if d.org %}{{ d.org }}{% endif %} {% if d.asn %}{{ d.asn }}{% endif %}
{% if d.city or d.country %}{{ d.city }}{% if d.city and d.country %}, {% endif %}{{ d.country }}{% endif %} {% if d.open_port_count %}OPEN PORTS {{ d.open_port_count }}{% endif %}
{% if d.ports %}
{{ d.ports | join(' ') }}
{% endif %} {% if d.hostnames %}
{{ d.hostnames[:6] | join(', ') }}
{% endif %} {%- elif result.result_type == 'otx_indicator' -%}
{{ d.indicator }} {% if d.type %}{{ d.type }}{% endif %} {{ d.pulse_count or 0 }} threat pulse{{ 's' if (d.pulse_count or 0) != 1 }}
{% if d.validation %}
{% for v in d.validation[:3] %}{{ v.name or v.message }}{% if not loop.last %} · {% endif %}{% endfor %}
{% endif %} {% if d.country or d.asn %}
{{ d.city }}{% if d.city and d.country %}, {% endif %}{{ d.country }}{% if d.asn %} · {{ d.asn }}{% endif %}
{% endif %} {%- elif result.result_type == 'urlscan_result' -%}
{% if d.malicious %}MALICIOUS{% else %}✓ clean{% endif %} {% if d.server %}{{ d.server }}{% endif %} {% if d.ip %}{{ d.ip }}{% endif %} {% if d.country %}{{ d.country }}{% endif %}
{{ d.url }}
{% if d.result_url %}
scan report ↗ {% if d.screenshot %}screenshot ↗{% endif %}
{% endif %} {%- elif result.result_type == 'whois_record' -%}
{{ d.registrar or 'Unknown registrar' }} {% if d.country %}{{ d.country }}{% endif %} {% if d.dnssec %}DNSSEC {{ d.dnssec }}{% endif %}
{% if d.creation_date %}CREATED {{ d.creation_date[:10] }}{% endif %} {% if d.expiration_date %}EXPIRES {{ d.expiration_date[:10] }}{% endif %}
{% if d.nameservers %}
NS: {{ d.nameservers[:4] | join(' ') }}
{% endif %} {% if d.emails %}
{% if d.emails is string %}{{ d.emails }}{% else %}{{ d.emails[:3] | join(', ') }}{% endif %}
{% endif %} {%- elif result.result_type == 'securitytrails_whois' -%} {% set rec = d.record or {} %}
{{ rec.ip or d.query }} {% if rec.source %}{{ rec.source }}{% endif %}
{% for c in (rec.contacts or [])[:2] %}
{% if c.organization %}{{ c.organization }}{% endif %} {% if c.type %}{{ c.type }}{% endif %} {% if c.country_code %}{{ c.country_code }}{% endif %}
{% if c.email %}
{{ c.email[:120] }}
{% endif %}
{% endfor %} {%- elif result.result_type == 'cdn_detected' -%}
{% if d.fronted %} WAF / CDN {{ d.cdn or 'CDN' }} {% else %} ✓ No CDN fronting {% endif %} {{ d.detail }}
{% if d.edge_ips %}
edge: {{ d.edge_ips | join(' ') }}
{% endif %} {%- elif result.result_type == 'origin_confirmed' -%}
ORIGIN FOUND {{ d.ip }} {{ "%.0f"|format((d.similarity or 0)*100) }}% match
{{ d.verdict }}
{% for s in d.sources %}{{ s }}{% endfor %}
{% if d.match and d.match.title %}
“{{ d.match.title }}” · {{ d.match.scheme }} {{ d.match.status }}
{% endif %} {%- elif result.result_type == 'origin_candidate' -%}
CANDIDATE {{ d.ip }} {% if d.similarity is defined %}{{ "%.0f"|format((d.similarity or 0)*100) }}% match{% endif %}
{{ d.verdict }}
{% for s in d.sources %}{{ s }}{% endfor %}
{%- else -%}
{{ result.data | tojson(indent=2) }}
{%- endif %}
{% endmacro %}