Regarding software system vulnerabilities, the most common one is the cross-site scripting vulnerability. There are a lot of related information on the Internet.
How can I convert the written attack code into unicode encoding to launch an attack? Plaintext attacks are easy to intercept, but the probability of successful escape is relatively high.
However, the information on the Internet is about the attack principles. There are few examples of how to convert the attack code to unicode encoding. The following is a small method written by colleagues for you to write the Interception Function, for testing.
We do not recommend that you use this code for illegal activities! At your own risk.
Package com;/*** convert character to unicode encoding (UTF-16) */public class unicodeutil {public static void main (string [] ARGs) {string STR = "<SCRIPT> "; char [] chars = Str. tochararray (); string ret = ""; for (INT I = 0; I <chars. length; I ++) {RET + = "%"; RET + = transferstr2utf16 (string. valueof (chars [I]);} system. out. println (RET);} Private Static string transferstr2utf16 (string ARGs) {char [] chars = "0123456789 abcdef ". tochararray (); stringbuilder sb = new stringbuilder (""); byte [] BS = args. getbytes (); int bit; For (INT I = 0; I <BS. length; I ++) {bit = (BS [I] & 0x0f0)> 4; sb. append (chars [bit]); bit = BS [I] & 0x0f; sb. append (chars [bit]); sb. append ('');} return sb. tostring (). trim ();}}
Small Method for converting characters into unicode encoding