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
From the main menu, select Configure > Rules.
Click Create Rule.
Set the Generate Alerts toggle to Off.
Set the Enable Rule toggle to On.
Populate the rule fields as follows:
Name: The name of the first rule in the rule chain, such as: "MALWARE METHODOLOGY [JAR Download]”.
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."
Links: A URL to further reference material for this type of attack.
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.
Rule Pack: Default
Confidence: High
Severity: Low
Query:
((metaclass:http_proxy uri:/\.jar$/) or (class:bro_files mimetype=“application/java-archive”))Distinguisher:
srcipv4Threshold: 1
Window: 1 hour
Click Advanced.
Click Add Assertion, and populate the fields as follows:
Assertion Name: proxy.download.jar
Time Valid: 1 minute
Assertion Fields:
srcipv4
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
From the main menu, select Configure > Rules.
Click Create Rule.
Set the Generate Alerts toggle to On.
Set the Enable Rule toggle to On.
Populate the fields as follows:
Name: The name of the second rule of the rule chain, such as: "MALWARE METHODOLOGY [JAR Followed by EXE]"
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."
Links: A URL to further reference material for this type of attack.
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.
Rule pack: Default
Confidence: High
Severity: High
Query :
((metaclass:http_proxy uri:/\.exe$/) or (class:bro_files mimetype=“application/x-dosexec”))Distinguisher:
srcipv4Threshold : 1
Window :1 hour
Click on Advanced.
Click on Add Dependency, and populate the fields as follows:
Assertion name:
proxy.download.jarApplied fields:
srcipv4
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.