Skip to main content

STIX patterns on MISP

STIX patterns run on a MISP connection in API (ingest and query) mode: in hunts, intel sweeps, when a search reaches every connected tool, and when Scout checks indicators. Huntbase translates each pattern into MispQL, the SQL-like language from the MISP project, and searches MISP's attributes. The MISP attribute types each STIX property searches are the ones the MISP project's own STIX converter (misp-stix) uses for that property.

[ipv4-addr:value = '198.51.100.23'] OR [domain-name:value = 'update-check.example.net']

Each attribute found is one result row, with its event, category, IDS flag, tags and TLP, the same as a MispQL search on attributes.

Supported STIX types​

STIX object and propertyMISP attribute types searchedOperatorsNotes
ipv4-addr:value, ipv6-addr:valueip-src, ip-dst, the address in ip-src|port, ip-dst|port and domain|ip= != IN NOT IN LIKE MATCHES¹!=, LIKE and the like also check the IP version. CIDR ranges (ISSUBSET) are not supported.
network-traffic:src_ref.valueip-src, the address in ip-src|portas above
network-traffic:dst_ref.valueip-dst, the address in ip-dst|portas above
network-traffic:dst_portport, the port in ip-dst|port and hostname|port= != IN NOT INCompared as text: no < or >.
network-traffic:src_portthe port in ip-src|port= != IN NOT IN
domain-name:valuedomain, hostname, the domain in domain|ip and hostname|port= != IN NOT IN LIKE MATCHES¹
domain-name:resolves_to_refs[*].valuethe address in domain|ip= != IN NOT IN
url:valueurl, uri, link= != IN NOT IN LIKE MATCHES¹link is MISP's type for reference links, as misp-stix converts it.
email-addr:valueemail, email-src, email-dst= != IN NOT IN LIKE MATCHES¹
email-message:from_ref.valueemail-srcas above
email-message:to_refs[*].valueemail-dstas above
email-message:subject, :body, :message_idemail-subject, email-body, email-message-idas above
email-message:additional_header_fields.reply_to, .x_maileremail-reply-to, email-x-maileras above'Reply-To' and 'X-Mailer' spellings work too.
email-message:body_multipart[*].body_raw_ref.nameemail-attachmentas above
file:namefilename, attachment, the name in malware-sample and filename|<hash>= != IN NOT IN LIKE MATCHES¹LIKE searches filename and attachment only.
file:hashes.'MD5', 'SHA-1', 'SHA-224', 'SHA-256', 'SHA-384', 'SHA-512', 'SHA-512/224', 'SHA-512/256', 'SHA3-224', 'SHA3-256', 'SHA3-384', 'SHA3-512', 'SSDEEP', 'TLSH', 'IMPHASH', 'AUTHENTIHASH', 'PEHASH'md5, sha1, … (the same hash type), the hash in filename|<hash> (and in malware-sample for MD5)= != IN NOT IN LIKEfile:name and a hash in one observation find filename|<hash> attributes holding both (MISP 3.0).
file:hashes.'VHASH', 'TELFHASH', 'CDHASH', 'IMPFUZZY'vhash, telfhash, cdhash, impfuzzyas above
file:sizesize-in-bytes= != IN NOT IN
x509-certificate:hashes.'MD5', 'SHA-1', 'SHA-256'x509-fingerprint-md5, -sha1, -sha256= != IN NOT IN LIKE
mac-addr:valuemac-address, mac-eui-64= != IN NOT IN LIKE
autonomous-system:numberAS= != IN NOT INFinds both 64500 and AS64500.
windows-registry-key:keyregkey, the key in regkey|value= != IN NOT IN LIKE
windows-registry-key:values[*].datathe data in regkey|value= != IN NOT IN
mutex:namemutex= != IN NOT IN LIKE
user-account:account_logingithub-username= != IN NOT IN LIKEMISP's only user account attribute type misp-stix converts.
network-traffic:extensions.'tls-ext'.client_ja3_hashja3-fingerprint-md5= != IN NOT IN LIKE
network-traffic:extensions.'http-request-ext'.request_methodhttp-methodas above
network-traffic:extensions.'http-request-ext'.request_header.'User-Agent'user-agentas above
x-misp-attribute:attribute_type (or :type), :value, :category, :tags, :comment, :object_relationany attribute, by its MISP fields= != IN NOT IN LIKEAny MISP type, such as [x-misp-attribute:type = 'btc'] or [x-misp-attribute:type = 'jarm-fingerprint' AND x-misp-attribute:value = '…']. tags matches a tag on the attribute or on its event.
x-misp-attribute:id, :event_id, :object_id, :distributionany attribute= != IN NOT IN < <= > >=
x-misp-attribute:to_idsany attribute= !=Write the value in quotes: 'true' or 'false'.
x-misp-attribute:uuidany attribute= != IN NOT IN
x-misp-event:info, :org, :published, :threat_level_id, :idattributes of matching eventsas for the attribute fields

¹ MATCHES works only for plain text with an optional ^ or $, which becomes = or LIKE. MISP has no regular expressions.

MISP compares values without regard to case.

Patterns​

  • AND and OR inside an observation, and AND/OR between observations (each observation's attributes are returned; one attribute is one observation).
  • START … STOP … (and a hunt's time range) limit results to attributes changed in that window.
  • FOLLOWEDBY is not supported. WITHIN has no effect on a single attribute.
  • Comparisons in one observation must fit one attribute: [ipv4-addr:value = '…' AND url:value = '…'] can't match anything in MISP and is refused. [domain-name:value = '…' AND ipv4-addr:value = '…'] finds domain|ip attributes holding both.

Exact or refused​

Huntbase never widens a STIX condition to make it fit MISP. These are refused, with an error that names the comparison:

  • LIKE with a wildcard other than a leading or trailing % (such as 'http://%/gate.php'), or with _;
  • MATCHES with a real regular expression;
  • an exact value (=) that starts or ends with %, which MISP would read as a wildcard;
  • ISSUBSET, ISSUPERSET, and <, > on values (MISP compares values as text);
  • a value MISP could find in the wrong half of a combined attribute, such as an IP address given as domain-name:value;
  • STIX properties MISP keeps only inside objects, such as process:name and user-account:user_id. In an OR, that comparison is left out and the run says so; in an AND, nothing is run.

MISP versions​

MISP 3.0, with a key whose role has the Complex query permission, runs every pattern above. MISP 2.4 and 2.5 run the patterns that MISP's classic search parameters express exactly, which covers most of them: one or more values of a type (=, !=, IN, NOT IN, LIKE, NOT LIKE), tags, the IDS flag and time ranges. A pattern that needs more is refused with an error that says it needs MISP 3.0, for example < or > on an attribute field, or a file name and a hash in one observation. Feed-mode connections can't be searched. See Which MISP versions.

Next steps​