312-49 · Question #646
%3cscript%3ealert("XXXXXXXX")%3c/script%3e is a script obtained from a Cross-Site Scripting attack. What type of encoding has the attacker employed?
The correct answer is B. Hex encoding. This is URL percent-encoding, a form of hex encoding. Each encoded character is represented as a percent sign (%) followed by two hexadecimal digits. In this example, %3c decodes to '<' (hex 3C = decimal 60 = '<') and %3e decodes to '>' (hex 3E = decimal 62 = '>'). The decoded…
Question
%3cscript%3ealert("XXXXXXXX")%3c/script%3e is a script obtained from a Cross-Site Scripting attack. What type of encoding has the attacker employed?
Options
- ADouble encoding
- BHex encoding
- CUnicode
- DBase64
How the community answered
(55 responses)- A2% (1)
- B89% (49)
- C4% (2)
- D5% (3)
Explanation
This is URL percent-encoding, a form of hex encoding. Each encoded character is represented as a percent sign (%) followed by two hexadecimal digits. In this example, %3c decodes to '<' (hex 3C = decimal 60 = '<') and %3e decodes to '>' (hex 3E = decimal 62 = '>'). The decoded string is <script>alert("XXXXXXXX")</script>, a classic XSS payload. Attackers use this technique to bypass input filters that block literal angle-bracket characters. This is not Base64 (which uses alphanumeric characters), Unicode (which uses %uXXXX format), or double encoding (which would encode the % sign itself).
Topics
Community Discussion
No community discussion yet for this question.