The new docs.trellix.com features a modernized UI and AI-powered conversational search. Content is currently available in English, with additional languages expected in November 2026. We hope you enjoy the updated experience.

Multistage rule example: Detecting common exploit kit redirect attempts (Legacy)

Prev Next

The multistage rule in this example looks for executable files downloaded after a JAR file is downloaded. Exploits like this often take place after a user is redirected to a malicious website, and the executable file is usually some kind of malware, backdoor, or rootkit. In order to detect this type of exploit attempt, you will need to write two rules: one to identify the initial JAR download, and a second to identify an executable file download from the same IP address within a short period of time.

Note

For these rules to function correctly, both must be enabled.

Creating a rule with an assertion

  1. From the main menu, select Configure > Rules.

  2. Click Create Rule.

  3. Set the Generate Alerts toggle to Off.

  4. Set the Enable Rule toggle to On.

  5. Populate the rule fields as follows:

    1. Name: The name of the first rule in the rule chain, such as: "MALWARE METHODOLOGY [JAR Download]”.

    2. Description: A description of the rule, such as: “This rule triggers on a Java archive (jar) file download. This does not trigger an alert on its own. Instead, it sets an assertion to be used in combination with other rules."

    3. Links: A URL to further reference material for this type of attack.

    4. Tags: A tag name for the rule. Tags can help you and other users organize and categorize rules. The tags you use in rules are not related to the tags used for custom dashboards. Tag names can be up to 200 characters long. If you try to specify a tag that is larger than 200 characters, errors will result.

    5. Rule Pack: Default

    6. Confidence: High

    7. Severity: Low

    8. Query: ((metaclass:http_proxy uri:/\.jar$/) or (class:bro_files mimetype=“application/java-archive”))

    9. Distinguisher: srcipv4

    10. Threshold: 1

    11. Window: 1 hour

  6. Click Advanced.

  7. Click Add Assertion, and populate the fields as follows:

    1. Assertion Name: proxy.download.jar

    2. Time Valid: 1 minute

    3. Assertion Fields: srcipv4

  8. Click Create Rule.

This procedure creates the first of two rules that will detect malicious redirect to executable file exploit attempts. This rule will not generate alerts if its TQL query and threshold values are met. Instead, it will create the assertion “proxy.download.jar”, which will exist for one minute. If that assertion is not referenced by a dependency within that time, the assertion will be deleted.

Creating a rule with a dependency

  1. From the main menu, select Configure > Rules.

  2. Click Create Rule.

  3. Set the Generate Alerts toggle to On.

  4. Set the Enable Rule toggle to On.

  5. Populate the fields as follows:

    1. Name: The name of the second rule of the rule chain, such as: "MALWARE METHODOLOGY [JAR Followed by EXE]"

    2. Description: A description of the rule, such as: “This rule triggers on a JAR download, followed by an EXE download from the same IP within a short period."

    3. Links: A URL to further reference material for this type of attack.

    4. Tags: A tag name for the rule. Tags can help you and other users organize and categorize rules. The tags you use in rules are not related to the tags used for custom dashboards. Tag names can be up to 200 characters long. If you try to specify a tag that is larger than 200 characters, errors will result.

    5. Rule pack: Default

    6. Confidence: High

    7. Severity: High

    8. Query : ((metaclass:http_proxy uri:/\.exe$/) or (class:bro_files mimetype=“application/x-dosexec”))

    9. Distinguisher: srcipv4

    10. Threshold : 1

    11. Window :1 hour

  6. Click on Advanced.

  7. Click on Add Dependency, and populate the fields as follows:

    1. Assertion name: proxy.download.jar

    2. Applied fields: srcipv4

  8. Click Create Rule.

This procedure creates the second of two rules that will detect common exploit kit redirection attempts. If this rule’s TQL query and threshold values are met, it will check to see if the assertion “shellshock” exists. If it does, an alert will be generated. See the TQL Reference Guide for more information.