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 property | MISP attribute types searched | Operators | Notes |
|---|---|---|---|
ipv4-addr:value, ipv6-addr:value | ip-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.value | ip-src, the address in ip-src|port | as above | |
network-traffic:dst_ref.value | ip-dst, the address in ip-dst|port | as above | |
network-traffic:dst_port | port, the port in ip-dst|port and hostname|port | = != IN NOT IN | Compared as text: no < or >. |
network-traffic:src_port | the port in ip-src|port | = != IN NOT IN | |
domain-name:value | domain, hostname, the domain in domain|ip and hostname|port | = != IN NOT IN LIKE MATCHES¹ | |
domain-name:resolves_to_refs[*].value | the address in domain|ip | = != IN NOT IN | |
url:value | url, uri, link | = != IN NOT IN LIKE MATCHES¹ | link is MISP's type for reference links, as misp-stix converts it. |
email-addr:value | email, email-src, email-dst | = != IN NOT IN LIKE MATCHES¹ | |
email-message:from_ref.value | email-src | as above | |
email-message:to_refs[*].value | email-dst | as above | |
email-message:subject, :body, :message_id | email-subject, email-body, email-message-id | as above | |
email-message:additional_header_fields.reply_to, .x_mailer | email-reply-to, email-x-mailer | as above | 'Reply-To' and 'X-Mailer' spellings work too. |
email-message:body_multipart[*].body_raw_ref.name | email-attachment | as above | |
file:name | filename, 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 LIKE | file: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, impfuzzy | as above | |
file:size | size-in-bytes | = != IN NOT IN | |
x509-certificate:hashes.'MD5', 'SHA-1', 'SHA-256' | x509-fingerprint-md5, -sha1, -sha256 | = != IN NOT IN LIKE | |
mac-addr:value | mac-address, mac-eui-64 | = != IN NOT IN LIKE | |
autonomous-system:number | AS | = != IN NOT IN | Finds both 64500 and AS64500. |
windows-registry-key:key | regkey, the key in regkey|value | = != IN NOT IN LIKE | |
windows-registry-key:values[*].data | the data in regkey|value | = != IN NOT IN | |
mutex:name | mutex | = != IN NOT IN LIKE | |
user-account:account_login | github-username | = != IN NOT IN LIKE | MISP's only user account attribute type misp-stix converts. |
network-traffic:extensions.'tls-ext'.client_ja3_hash | ja3-fingerprint-md5 | = != IN NOT IN LIKE | |
network-traffic:extensions.'http-request-ext'.request_method | http-method | as above | |
network-traffic:extensions.'http-request-ext'.request_header.'User-Agent' | user-agent | as above | |
x-misp-attribute:attribute_type (or :type), :value, :category, :tags, :comment, :object_relation | any attribute, by its MISP fields | = != IN NOT IN LIKE | Any 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, :distribution | any attribute | = != IN NOT IN < <= > >= | |
x-misp-attribute:to_ids | any attribute | = != | Write the value in quotes: 'true' or 'false'. |
x-misp-attribute:uuid | any attribute | = != IN NOT IN | |
x-misp-event:info, :org, :published, :threat_level_id, :id | attributes of matching events | as 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
ANDandORinside an observation, andAND/ORbetween 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.FOLLOWEDBYis not supported.WITHINhas 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:
LIKEwith a wildcard other than a leading or trailing%(such as'http://%/gate.php'), or with_;MATCHESwith 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:nameanduser-account:user_id. In anOR, that comparison is left out and the run says so; in anAND, 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
- MISP — connect, versions and query mode
- MispQL reference
- Query languages › STIX