SonicOS 7 Rules and Policies

Custom Signature

You can create a custom match object that matches any part of a packet if you want to control traffic that does not have a predefined object type in App Rules. This allows you to create a custom signature for any network protocol.

For instance, you can create a custom signature to match HTTP GET request packets. You might use this if you want to prevent Web browsing from your local area network.

To determine a unique identifier for a HTTP GET packet, you can use the Wireshark network protocol analyzer to view the packet header. For more information about using Wireshark, see Wireshark. In Wireshark, capture some packets that include the traffic you are interested in. In this case, you want to capture a HTTP GET request packet. You can use any Web browser to generate the HTTP GET request. HTTP GET Request Packet in Wireshark shows an HTTP GET request packet displayed by Wireshark.

HTTP GET Request Packet in Wireshark

To crete a custom signature for a a network protocol

  1. In the top pane of Wireshark, scroll down to find the HTTP GET packet
  2. Click on that line.

    The packet is displayed in the two lower panes. For a SYN packet, the center pane provides a human-readable interpretation of the packet header, and the actual header bytes are displayed in hexadecimal in the lower pane.

  3. In the center pane, expand the Hypertext Transfer Protocol section to see the packet payload.

  4. Find the identifier that you want to reference in App Rules. In this case, the identifier is the GET command in the first three bytes.

  5. Click on the identifier to highlight the corresponding bytes in the lower pane.

  6. You can determine the offset and the depth of the highlighted bytes in the lower pane.

    • Offset indicates which byte in the packet to start matching against.
    • Depth indicates the last byte to match.

    Using an offset allows very specific matching and minimizes false positives. Decimal numbers are used rather than hexadecimal to calculate offset and depth.

    When you calculate offset and depth, the first byte in the packet is counted as number one (not zero).

    Offset and depth associated with a custom match object are calculated starting from the packet payload (the beginning of the TCP or UDP payload). In this case, the offset is 1 and the depth is 3.

  7. Create a custom match object that uses this information.

  8. In the Match Object Settings dialog, type a descriptive name for the object in the Object Name field.

  9. Select Custom Object from the Match Object Type drop-down menu.

  10. Select the Enable Settings checkbox.

  11. In the Offset field, type 1 (the starting byte of the identifier).

  12. In the Depth text box, type 3 (the last byte of the identifier).

  13. You can leave the Payload Size set to the default. The Payload Size is used to indicate the amount of data in the packet, but in this case we are only concerned with the packet header.

  14. For Input Representation, click Hexadecimal.

  15. In the Content text box, type the bytes as shown by Wireshark: 474554. Do not use spaces in hexadecimal content.

  16. Use this match object in an App Rules policy.

    1. In the App Control Policy Settings dialog, type a descriptive policy name.

    2. Select HTTP Client for the policy type.

    3. In the Match Object drop-down menu, select the match object that you just defined.

    4. Select a custom action or a default action such as Reset/Drop.

    5. For the Connection Side, select Client Side.

    6. You can also modify other settings. For more information about creating a policy, see Configuring an App Rules Policy.

Was This Article Helpful?

Help us to improve our support portal

Techdocs Article Helpful form

Techdocs Article NOT Helpful form

  • Still can't find what you're looking for? Try our knowledge base or ask our community for more help.