How to block ASCII compatible encoding (Punycode) in PAN-OS
6952
Created On 04/28/21 22:21 PM - Last Modified 07/18/24 21:09 PM
Objective
In this article we will show you how to block ASCII compatible encoding (Punycode) Anti-Spyware signature in PAN-OS.
Background
Threat actors may cloak phishing websites using Punycode/ASCII compatible encoding to trick users into visiting them. The technique involves creating domain names using international encoding. The characters under this encoding are translated by web-browsers on the fly, and presented to the user using visually equivalent ASCII text, which is indistinguishable from the original domain name of the trusted web-site.
Example:
Punycode: xn--e1awd7f.com when translated to regular ASCII it becomes: epic.com.
So, if a user visits xn--e1awd7f.com the browser address bar actually displays 'epic.com'
Environment
- PAN-OS 7.1 or higher
- Custom Spyware Signature
- ASCII compatible encoding (Punycode)
Procedure
- Go to the Objects tab > Custom Objects > Spyware > Click on (Add) at the bottom
- In the Configuration tab:
- Assign a Threat (TID in range 15000 - 18000)
- Name: Punycode Encoding
- Severity: (Select one)
- Direction: client2server
- Default Action: (Select one)
- In the Signatures tab:
- Signature Standard radio button: (Selected)
- Click on (Add).
- In the Standard window:
- Standard (Name): Punycode encoded URL
- Transaction radio button: (Selected)
- Ordered Condition Match: (Checked)
- Click (Add Or Condition)
- In the 'New And Condition - Or Condition' window:
- Operator: (Pull-down) Equal To
- Value: 1
- Context: (Pull-down) http-req-ascii-compatible-encoding-prefix-found
- (Click OK) > (Click OK) > (Click OK) and make sure that the Anti-Spyware profile processing your Security Policy rule is matching the severity of this custom signature to execute the desired blocking action. If the rule is not set to execute a blocking action, configure an Anti-Spyware Exception for the configured TID and set a blocking action for it. (i.e reset-client).
- Commit the configuration
Note 1: For SSL encrypted sites of the like of https://xn--, detection is dependent on the ability to read the HTTP Request message, therefore SSL Decryption in the firewall is necessary. |
Note 2: The reason why this is recommended as a Custom Anti-Spyware signature and not a Custom Vulnerability Protection Signature is that by using a Spyware signature, users can be presented with an Anti-spyware 'comfort' block page. |
Additional Information
Sample Custom signature attached to this article
As a shortcut, you can import the attached punycode_15400.xml file to your Custom Spyware signatures.
Make sure that TID 15400 is not defined for any other Custom Spyware signature in the configuration.
Reference websites with complementary information
https://www.wordfence.com/blog/2017/04/chrome-firefox-unicode-phishing/
http://fortune.com/2017/04/18/google-chrome-phishing-scam/
https://en.wikipedia.org/wiki/Internationalized_domain_name
A simple Puny <> regular text encoder/decoder:
https://www.punycoder.com/