Beaconing C2 : connexions régulières à volume constant
Un implant qui « bat » vers son serveur de commande produit beaucoup de connexions vers la même destination avec des tailles quasi identiques : STD_DEV des octets proche de zéro sur une longue durée.
Cas d'usage
Chasse au command-and-control discret dans les logs de flux réseau.
Prérequis
Elasticsearch 8.14+, logs de flux (NetFlow/firewall)
SQL
FROM "logs-network-*"
| WHERE @timestamp >= NOW() - 24 hours
AND network.direction == "outbound"
| STATS
connexions = COUNT(*),
octets_moy = ROUND(AVG(network.bytes)),
ecart_type = ROUND(STD_DEV(network.bytes), 1),
premiere = MIN(@timestamp),
derniere = MAX(@timestamp)
BY source.ip, destination.ip, destination.port
| EVAL duree_h = DATE_DIFF("hour", premiere, derniere)
| WHERE connexions > 200 AND ecart_type < 50 AND duree_h >= 12
| KEEP source.ip, destination.ip, destination.port,
connexions, octets_moy, ecart_type, duree_h
| SORT connexions DESC
| LIMIT 25Résultat
source.ip | destination.ip | destination.port | connexions | octets_moy | ecart_type | duree_h -----------+----------------+------------------+------------+------------+------------+-------- 10.2.14.88 | 198.51.100.23 | 443 | 2871 | 1124 | 3.2 | 23 10.2.31.17 | 203.0.113.99 | 8443 | 1439 | 890 | 12.7 | 23 10.2.7.204 | 192.0.2.55 | 53 | 941 | 312 | 0.0 | 19 10.2.18.40 | 198.51.100.81 | 443 | 288 | 2048 | 41.9 | 14
SOCBeaconingC2STD_DEVRéseau