The signature command configures a user-defined application signature.
The undo signature command deletes a user-defined application signature.
signature context { flow | packet } direction { request | response | both } { plain-string plain-string | regular-expression regular-expression } [ field field ]
undo signature
| Parameter | Description | Value |
|---|---|---|
| context | Indicates signature context. | - |
| flow | packet | Indicates signature (keyword) matching mode.
|
- |
| direction { request | response | both } | Indicates signature (keyword) detection direction.
|
- |
| plain-string plain-string | Specifies a plain-text string. | The value is a case-sensitive string of 3 to 128 characters. If the keyword contains any space and question mark (?), the value is a string of 5 to 130 characters and must be enclosed with double quotation marks (""), for example, "GET w?". If the keyword contains quotation marks, replace the quotation marks with \x22, for example, to set keyword abc"d, enter abc\x22d. |
| regular-expression regular-expression | Specifies a regular expression. | The value is a case-sensitive string of 3 to 128 characters. If the regular expression contains any space and question mark (?), the value is a string of 5 to 130 characters and must be enclosed with double quotation marks (""), for example, "GET w?". If the regular expression contains quotation marks, replace the quotation marks with \x22, for example, to set regular expression abc"d, enter abc\x22d. |
| field | Specifies a protocol field to search for a signature. |
|
# Configure regular expression GET.ab{3}c for the signature in user-defined application rule rule1, configure flow-based matching mode, and set the detection direction to request.
<sysname> system-view
[sysname] sa
[sysname-sa] user-defined-application name UD_abc
[sysname-sa-user-defined-app-UD_abc] rule name rule1
[sysname-sa-user-defined-app-UD_abc-rule-rule1] protocol tcp
[sysname-sa-user-defined-app-UD_abc-rule-rule1] signature context flow direction request regular-expression GET.ab{3}c field HTTP.Body