Queries AQL, Custom Properties y reglas de correlación para detectar huellas TLS maliciosas en IBM QRadar SIEM.
QRadar no extrae JA3 por defecto — los datos deben venir de una fuente que ya calcule el hash: Suricata, Zeek/Bro, FortiGate, un proxy con módulo JA3, o un script de tshark. Una vez en QRadar, se mapean como Custom Properties.
La fuente más limpia. Suricata genera JSON estructurado con JA3. Configurar QRadar Log Source para el endpoint de syslog donde Suricata envía sus alertas:
Log Source Type: Suricata IDS (o "Universal CEF" si usás CEF output)
Log Source Name: Suricata-Sensor-DC01
Protocol: Syslog (UDP/TCP 514 o el puerto configurado)
# Formato esperado del log Suricata (abreviado):
# Jan 15 10:30:00 sensor01 suricata: {"timestamp":"...","event_type":"tls",
# "src_ip":"192.168.1.105","dest_ip":"185.220.101.4","dest_port":443,
# "tls":{"sni":"c2.evil.example","version":"TLS 1.2",
# "ja3":{"hash":"e7d705a3286e19ea42f587b344ee6865","string":"769,..."}}}
# DSM de Suricata en QRadar 7.5+ parsea el campo ja3.hash automáticamente
# Verificar: Log Activity → columna "Custom Property: JA3 Hash"
# Zeek ssl.log contiene el campo ja3 por defecto desde v3.0
# Ejemplo de línea ssl.log:
# ts uid id.orig_h id.resp_h version ja3 ja3s
# 1704067200 CGfzId... 192.168.1.105 185.220.101.4 TLSv12 e7d705a3286e19ea42f587b344ee6865 649d6810...
# Convertir ssl.log a JSON para QRadar:
# zeek -r captura.pcap && cat ssl.log | zeek-cut ts uid id.orig_h ja3 | python3 -c "
# import sys, json, csv
# r = csv.DictReader(sys.stdin, delimiter='\t')
# for row in r: print(json.dumps(row))" | logger -t zeek-ssl
# En QRadar: Log Source Type = "Zeek Network Security Monitor"
# El DSM de Zeek mapea ssl.log automáticamente
Si el DSM no mapea JA3 automáticamente, crear Custom Properties manualmente:
# Admin → Custom Event Properties → New Custom Property
# Propiedad: JA3 Hash
# Tipo de dato: Text
# Optimización: Yes (para que sea buscable en AQL)
# Expression Type: Regular Expression
# Para logs de Suricata JSON:
"ja3":\s*\{\s*"hash":\s*"([a-f0-9]{32})"
# Para logs de Zeek (tab-separated):
^[^\t]+\t[^\t]+\t[^\t]+\t[^\t]+\t[^\t]+\t([a-f0-9]{32})
# Para logs de FortiGate (key=value format):
ja3=["\s]*([a-f0-9]{32})
# Para logs genéricos que incluyen el hash en cualquier posición:
(?:ja3[_\.]hash|ja3["\s:=]+)["]*([a-f0-9]{32})
# Propiedad: JA3 SNI (para correlación adicional)
"sni":\s*"([^"]+)"
# Verificar la regex en: Admin → Custom Event Properties → Test Expression
AQL (Ariel Query Language) es el lenguaje SQL-like de QRadar para consultar
eventos y flows almacenados. Usado en Log Activity, Search y APIs. Los campos Custom Property
se referencian como "JA3 Hash" (con comillas si tienen espacios).
-- Buscar todas las conexiones con un hash JA3 de Metasploit
SELECT
DATEFORMAT(starttime, 'YYYY-MM-dd HH:mm:ss') AS timestamp,
sourceip,
destinationip,
destinationport,
"JA3 Hash",
"JA3 SNI",
eventcount
FROM events
WHERE
"JA3 Hash" = 'e7d705a3286e19ea42f587b344ee6865' -- Metasploit
AND starttime > NOW() - 86400000 -- Últimas 24 horas (milisegundos)
ORDER BY starttime DESC
LAST 24 HOURS
-- Identificar qué huellas TLS dominan el tráfico
-- Útil para establecer baseline y detectar anomalías
SELECT
"JA3 Hash",
COUNT(*) AS conexiones,
COUNT(DISTINCT sourceip) AS hosts_origen,
COUNT(DISTINCT destinationip) AS destinos_unicos,
MIN(DATEFORMAT(starttime,'HH:mm')) AS primera_vez,
MAX(DATEFORMAT(starttime,'HH:mm')) AS ultima_vez
FROM events
WHERE
"JA3 Hash" IS NOT NULL
AND "JA3 Hash" != ''
GROUP BY "JA3 Hash"
ORDER BY conexiones DESC
LIMIT 10
LAST 7 DAYS
-- Lista de hashes conocidos maliciosos (threat intel feed)
-- Ideal para ejecutar diariamente como búsqueda programada
SELECT
DATEFORMAT(starttime, 'YYYY-MM-dd HH:mm:ss') AS timestamp,
sourceip,
destinationip,
destinationport,
"JA3 Hash",
"JA3 SNI",
CASE "JA3 Hash"
WHEN 'e7d705a3286e19ea42f587b344ee6865' THEN 'Metasploit Meterpreter'
WHEN 'de350869b8c85de67a350c8d186f11e6' THEN 'Cobalt Strike default'
WHEN '8bab54f22de07d88e90f5e8e5edb5a69' THEN 'Emotet C2'
WHEN '19e29534fd49dd27d09234e7b95b86c1' THEN 'Dridex/BitPaymer'
WHEN 'a0e9f5d64349fb13191bc781f81f42e1' THEN 'Tor/Cobalt Strike overlap'
WHEN '6d1a47b7b9e7d98e1c7c9d82da2bf1a6' THEN 'AsyncRAT/QuasarRAT'
ELSE 'UNKNOWN'
END AS malware_family
FROM events
WHERE
"JA3 Hash" IN (
'e7d705a3286e19ea42f587b344ee6865',
'de350869b8c85de67a350c8d186f11e6',
'8bab54f22de07d88e90f5e8e5edb5a69',
'19e29534fd49dd27d09234e7b95b86c1',
'a0e9f5d64349fb13191bc781f81f42e1',
'6d1a47b7b9e7d98e1c7c9d82da2bf1a6'
)
ORDER BY starttime DESC
LAST 24 HOURS
-- Hashes JA3 que aparecen hoy pero NO en los últimos 30 días
-- Indicador de nuevas herramientas/malware en la red
SELECT
"JA3 Hash",
sourceip,
COUNT(*) AS ocurrencias_hoy
FROM events
WHERE
"JA3 Hash" IS NOT NULL
AND "JA3 Hash" != ''
AND starttime > NOW() - 86400000 -- hoy
AND "JA3 Hash" NOT IN (
-- Subquery: hashes vistos en los últimos 30 días
SELECT DISTINCT "JA3 Hash"
FROM events
WHERE
"JA3 Hash" IS NOT NULL
AND starttime BETWEEN NOW() - 2678400000 AND NOW() - 86400000
)
GROUP BY "JA3 Hash", sourceip
ORDER BY ocurrencias_hoy DESC
LAST 24 HOURS
-- Detectar beaconing: mismo (src, dst, ja3) con alta frecuencia
-- Los C2 beaconan cada 30-300 segundos con jitter
SELECT
sourceip,
destinationip,
destinationport,
"JA3 Hash",
COUNT(*) AS total_conexiones,
(MAX(starttime) - MIN(starttime)) / (COUNT(*) * 1000.0) AS intervalo_promedio_seg,
MIN(DATEFORMAT(starttime, 'HH:mm:ss')) AS primera_conexion,
MAX(DATEFORMAT(starttime, 'HH:mm:ss')) AS ultima_conexion
FROM events
WHERE
"JA3 Hash" IS NOT NULL
AND "JA3 Hash" != ''
GROUP BY sourceip, destinationip, destinationport, "JA3 Hash"
HAVING
COUNT(*) >= 10 -- mínimo 10 conexiones
AND intervalo_promedio_seg BETWEEN 20 AND 600 -- intervalo 20s-10min
ORDER BY total_conexiones DESC
LAST 6 HOURS
Los Building Blocks en QRadar son reglas reutilizables que actúan como condiciones compartidas entre múltiples reglas de correlación. Permiten centralizar la lógica de detección.
Building Block Name: BB: Known Malicious JA3 Hash
Tipo: Event Rule
Condición:
AND when the event Custom Property 'JA3_Hash'
is contained in Reference Set 'Malicious_JA3_Hashes'
Reference Set: Malicious_JA3_Hashes (tipo: ALN)
Contenido:
de350869b8c85de67a350c8d186f11e6 (Cobalt Strike)
e7d705a3286e19ea42f587b344ee6865 (Metasploit)
8bab54f22de07d88e90f5e8e5edb5a69 (Emotet)
19e29534fd49dd27d09234e7b95b86c1 (Dridex)
Uso: Este BB se referencia en múltiples reglas de correlación
sin duplicar la lista de hashes en cada regla.
Esta query detecta hosts que se conectan al mismo destino con el mismo JA3 a intervalos regulares — patrón típico de C2 beacon.
SELECT
sourceip,
destinationip,
destinationport,
CUSTOMPROPERTYVALUE('JA3_Hash') AS ja3,
COUNT(*) AS total_conexiones,
MIN(starttime) AS primera_conexion,
MAX(starttime) AS ultima_conexion,
(MAX(starttime) - MIN(starttime)) / NULLIF(COUNT(*) - 1, 0) AS intervalo_promedio_ms
FROM events
WHERE
CUSTOMPROPERTYVALUE('JA3_Hash') IS NOT NULL
AND LOGSOURCETYPENAME(devicetype) LIKE '%TLS%'
AND destinationport NOT IN (80, 443)
GROUP BY sourceip, destinationip, destinationport, ja3
HAVING
COUNT(*) >= 8
AND intervalo_promedio_ms BETWEEN 270000 AND 330000
ORDER BY total_conexiones DESC
LAST 24 HOURS
SELECT
sourceip,
destinationip,
destinationport,
CUSTOMPROPERTYVALUE('JA3_Hash') AS ja3,
CUSTOMPROPERTYVALUE('TLS_SNI') AS server_name,
COUNT(*) AS ocurrencias,
DATEFORMAT(MIN(starttime), 'YYYY-MM-dd HH:mm:ss') AS primera_vez
FROM events
WHERE
CUSTOMPROPERTYVALUE('JA3_Hash') IS NOT NULL
AND destinationport NOT IN (443, 8443, 993, 465, 636, 5061)
AND (CUSTOMPROPERTYVALUE('TLS_SNI') IS NULL
OR CUSTOMPROPERTYVALUE('TLS_SNI') = '')
GROUP BY sourceip, destinationip, destinationport, ja3, server_name
HAVING COUNT(*) > 3
ORDER BY ocurrencias DESC
LAST 7 DAYS
QRadar genera offense por JA3 malicioso. Revisá: IP origen, destino, frecuencia, magnitud del offense.
Corré la query de beaconing sobre la IP origen del offense. Confirmá si hay patrón de intervalo regular.
Lookups: IP destino en threat intel, WHOIS, Shodan. ¿El JA3S del servidor coincide con infra C2 conocida?
¿Otros hosts internos conectaron al mismo destino o tienen el mismo JA3? → Posible compromiso múltiple.
Documentar IOCs: IPs, JA3 hashes, rangos temporales. Contención: bloquear destino en firewall / aislar host.
Reglas de correlación en QRadar generan Offenses automáticamente cuando se detecta actividad sospechosa. Se configuran en Offenses → Rules → Create Rule. Se basan en eventos individuales o en combinaciones (correlación multi-evento).
Rule Name: SOC-JA3-001 — Malware C2 JA3 Hash Detectado
Rule Type: Event Rule
Enabled: Yes
Response: Create an Offense | Notify | Email (si severity = Critical)
── Condición ──
when the event matches the following custom event property:
[ Custom Property "JA3 Hash" ] matches one of the following values:
e7d705a3286e19ea42f587b344ee6865 (Metasploit)
de350869b8c85de67a350c8d186f11e6 (Cobalt Strike)
8bab54f22de07d88e90f5e8e5edb5a69 (Emotet)
19e29534fd49dd27d09234e7b95b86c1 (Dridex)
6d1a47b7b9e7d98e1c7c9d82da2bf1a6 (AsyncRAT)
── Respuesta ──
Offense Naming: "JA3 Malicioso: [JA3 Hash] desde [sourceip]"
Offense Magnitude: 9 (Critical)
Groups: Malware, TLS Anomaly
Credibility: 5
Severity: 9
── Excepción ──
Excluir IPs de pentest autorizado:
NOT sourceip matches reference set "Pentest_Authorized_IPs"
Rule Name: SOC-JA3-002 — Hash JA3 No Visto en 30 días
Rule Type: Anomaly Rule (Behavioral)
Enabled: Yes
── Condición ──
when the number of UNIQUE [ Custom Property: JA3 Hash ] values
is greater than 0
in 1 minute intervals
for 3 or more times
when the flow is NOT in reference set "JA3_Known_Baseline"
── Alternative: Event Rule con Reference Set ──
when Custom Property "JA3 Hash" is NOT contained in the Reference Set
"JA3_Known_Baseline"
AND Custom Property "JA3 Hash" is not empty
── Poblar la Reference Set de baseline ──
-- Ejecutar esta AQL y exportar los resultados a la Reference Set:
SELECT DISTINCT "JA3 Hash"
FROM events
WHERE "JA3 Hash" IS NOT NULL
LAST 30 DAYS
-- Admin → Reference Data → Reference Sets → JA3_Known_Baseline
-- Importar el CSV con los hashes del baseline
Rule Name: SOC-JA3-003 — JA3 Dual-Use hacia IP de Baja Reputación
Rule Type: Event Rule
Enabled: Yes
── Condición (AND) ──
1. Custom Property "JA3 Hash" is contained in Reference Set "JA3_DualUse_Tools"
[curl, Python, Golang, Tor]
2. AND destinationip is contained in Reference Set "Suspicious_IP_List"
[feeds de abuse.ch, Tor exit nodes, Shodan C2 IPs]
3. AND sourceip is NOT in Reference Set "Authorized_Script_Servers"
── Response ──
Offense Magnitude: 6
Note: "Herramienta dual-use contactando IP sospechosa — puede ser legítimo o malicioso"
Analyst Action Required: Yes
── Poblar Reference Sets (automatizable via API QRadar) ──
# curl para actualizar desde abuse.ch:
curl -s "https://sslbl.abuse.ch/blacklist/ja3_fingerprints.csv" \
| grep -v '#' | cut -d',' -f1 \
| while read hash; do
curl -X POST \
"https://QRADAR-IP/api/reference_data/sets/entries/JA3_Malicious_Feed" \
-H "SEC: YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d "{\"value\":\"$hash\"}"
done
Rule Name: SOC-JA3-004 — Posible Beaconing TLS
Rule Type: Event Rule (con grouping)
Enabled: Yes
── Condición ──
when the event(s) were detected by the local system
AND Custom Property "JA3 Hash" is not empty
AND sourceip is part of $HOME_NET
── Agrupación (Building Block) ──
Group by: sourceip, destinationip, destinationport, "JA3 Hash"
Time: 15 minutes
Threshold: 10 or more matching events
── Indicador de beaconing ──
If the same (src, dst, ja3) tuple aparece 10+ veces en 15 minutos
→ generar Offense: "Posible C2 Beaconing — [src] → [dst] JA3:[hash]"
Magnitude: 7
Requires Analyst Investigation
Dashboards de QRadar para monitoreo continuo de huellas JA3. Configurados en Dashboard → Add Item → Saved Searches usando las AQL queries del módulo anterior.
-- Dashboard: "TLS Threat Monitor"
-- Tipo: Bar Chart — X: malware_family, Y: conexiones
SELECT
CASE "JA3 Hash"
WHEN 'e7d705a3286e19ea42f587b344ee6865' THEN '🔴 Metasploit'
WHEN 'de350869b8c85de67a350c8d186f11e6' THEN '🔴 Cobalt Strike'
WHEN '8bab54f22de07d88e90f5e8e5edb5a69' THEN '🔴 Emotet'
WHEN 'b386946a5a44d1ddcc843bc75336dfce' THEN '🟡 Python requests'
WHEN '51c64c77e60f3980eea90869b68c58a8' THEN '🟡 Go TLS'
WHEN 'cd08e31494f9531f560d64c695473da9' THEN '🟡 curl'
ELSE '⚪ Otros'
END AS categoria,
COUNT(*) AS conexiones
FROM events
WHERE "JA3 Hash" IS NOT NULL
GROUP BY "JA3 Hash"
ORDER BY conexiones DESC
LAST 24 HOURS
-- Tipo: Table Widget
-- Muestra los hosts que más huellas JA3 no-baseline generan
SELECT
sourceip,
COUNT(DISTINCT "JA3 Hash") AS hashes_unicos,
COUNT(*) AS total_eventos,
ARRAY_AGG(DISTINCT "JA3 SNI" LIMIT 3) AS destinos_sni
FROM events
WHERE
"JA3 Hash" IS NOT NULL
AND "JA3 Hash" NOT IN (
SELECT DISTINCT "JA3 Hash" FROM events LAST 30 DAYS
-- En QRadar 7.5+ usar Reference Sets para mejor performance
)
GROUP BY sourceip
ORDER BY hashes_unicos DESC
LIMIT 10
LAST 24 HOURS
Offense → Ver detalles. Revisar: Source IP (¿qué host?), Destination IP (¿C2 IP conocida?), Event Count (¿único o repetido?), Time Range (¿cuándo empezó?). Asignar el Offense al analista correspondiente.
Desde el Offense, hacer clic en "Contributing Events" para ver el detalle. Filtrar por el hash JA3 en cuestión y expandir el evento para ver los campos completos: SNI, IP destino, puerto, timestamp exacto, y el evento raw (Suricata/Zeek).
Desde la IP origen: "Network Activity → Search" para ver todo el tráfico del host. Desde la IP destino: X-Force Exchange para ver reputación. Correlacionar con User Activity: ¿quién estaba logueado en ese host en ese momento? (Integrar con AD via Wincollect o QRadar UBA si está disponible).
Offense Notes: documentar hallazgos, IPs involucradas, timeline, decisión tomada. Si es verdadero positivo: Status = "Open", Severity = 9, escalar a IR. Si es FP: Status = "Closed", Close Reason = "Non-Issue", agregar la IP a la whitelist correspondiente para evitar ruido futuro.
Continuá el lab TLS: JA3 Core · Wireshark · Snort · FortiGate · Teoría TLS
← Volver al inicio