-
Notifications
You must be signed in to change notification settings - Fork 17
Creating Match Rules
August Detlefsen edited this page Jan 24, 2018
·
1 revision
Match rules are loaded from a tab-delimited file at extension startup. Each match rule consists of the following fields:
- A Java regular expression that matches the target string
- An integer specifying which capturing group contains the version number
- A short description of the software that was matched
- Vulnerability severity (High|Medium|Low)
- Vulnerability confidence (Certain|Firm|Tentative)
- The number of test strings to match in unit tests *Optional, default 1
For example, the match rule for Jetty looks like:
Jetty\s?\(?([a-z\d.]+)\)? 1 Jetty Low Certain 2
^ ^ ^ ^ ^ ^
regex capturing group | severity | unit tests
software confidence
In addition to adding match rules you should also add one or more example match strings to /src/test/resources/burp/testResponse.txt
. These will be used by the unit tests to ensure that the match rules actually work.
For Jetty, there are two match strings specified:
Server: Jetty(9.4.0.v20161208)
ContainerVersion=Jetty 9.4.4.qstv15
When the unit tests run you will see output like the following, indicating that both test strings were matched:
Testing rule: Jetty\s?\(?([a-z\d.]+)\)? matches: 2