Cross-Site Scripting Attack Detection Method Based on Transformer
Bitao Peng, Xiyi Xiao, Juan Wang · 2022
This work conducts a systematic research on the collection method of XSS datasets, and use various rules of XSS code to automatically generate new XSS attack codes to enrich the datasets. To distinguish whether a Web user is entering an XSS attack statement according to whether XSS code features are extracted from the URL, this work combines URLs containing XSS attack statements and normal URLs into a URL dataset. Then it studies the preprocessing method for datasets. After that, this work designs a comparative experiment to select the feature representation method. At last, this work conduct experiments to use the three models of LSTM, Transformer and GRU to train and classify the URL datasets. The results show that the Transformer model can improve the accuracy of XSS attack detection more effectively, get a better classification effect and better protect users' personal information.