alert tls $EXTERNAL_NET [443,4443] -> $HOME_NET any (
msg:"ET MALWARE Possible Dyre SSL Cert M1 (L O)";
flow:established,to_client;
tls.cert_serial;
content:"00:"; startswith; bsize:26;
tls.certs;
content:"|06 03 55 04 06 13 02|";
pcre:"/^[A-Z]{2}[01]/R";
content:"|30 09 06 03 55 04 08 0c 02|"; distance:1; within:9; fast_pattern;
pcre:"/^[A-Z]{2}[01]/R";
content:"|06 03 55 04 07 0c|"; within:9;
byte_test:1,>,9,0,relative;
byte_test:1,<,121,0,relative;
pcre:"/^.{1}(?=[a-z0-9]{0,119}[A-Z])(?=[A-Z0-9]{0,119}[a-z])[a-zA-Z0-9]{10,120}[01]/R";
content:"|06 03 55 04 0a 0c|"; within:9;
byte_extract:1,0,orglen,relative;
content:!"|20|"; within:orglen;
pcre:"/^(?=[a-z0-9]{0,119}[A-Z])(?=[A-Z0-9]{0,119}[a-z])[a-zA-Z0-9]{10,120}[01]/R";
content:"|06 03 55 04 03 0c|"; within:9;
byte_extract:1,0,cnlen,relative;
content:!"|2e|"; within:cnlen;
content:!"|2a|"; within:cnlen;
pcre:"/^(?P<var>[a-zA-Z0-9]{1,120}[01]).+?\x55\x04\x03.{2}(?P=var)/Rs";
classtype:trojan-activity;
sid:2021432; rev:5;
metadata:attack_target Client_Endpoint, created_at 2015_07_17, deployment Perimeter, confidence Medium, signature_severity Major, tag SSL_Malicious_Cert, updated_at 2022_03_27;
)