# Ontology for Cross-Site-Scripting (XSS) Attack in Cybersecurity
## 2 Different Types of XSS and Procedures to Detect If a Web Application Is Vulnerable to This Attack
### Steps to Discover the XSS Vulnerabilities in Web Application  
We have to be aware that XSS attacks are a very serious and complicated topic. Detection of XSS vulnerabilities in a website requires a lot of penetration tests, based on the difficulty that one may find in each page of that website. The difficulty relies mostly on how the particular web application is using proper measures to fight against the attack. Therefore, analysis of the reflected codes of payloads in a Document Object Model (DOM) is necessary. Using the steps below (Figure 2) to check if a web application is vulnerable to XSS attack, (according to the author [PERSON]) could be a good way to start. * Open up your web browser and access a particular website to test. In that web application, look for parts which require input, like search fields, comments, etc. * Now, enter any string into these spaces and press \"enter\" to submit that string to the web application server. * Now, we can read carefully to check if the first condition holds. The first condition states that \"test the HTTP response web page of the server for the exact string which was submitted by the visitor (user)\". Consequently, if that HTTP response includes the same string, then the web application can be exploited by XSS attacks. Else, if that HTTP response does not include any user-input string, then check for the next condition. * The following condition states \"just enter any JavaScript string, and send it to the web server by pressing 'enter' \". e.g., _<script>alert(123)</script>_
* After sending that string to the server, if the server replies with the same string in a pop-up window, then the website is exposed to XSS attacks. If there is no such reply, then go for the next condition. * The final condition is to, after pressing \"enter\" in the step right-above, view the source code of that website and search if something looks similar to the JavaScript payload entered. If any ingredient of that string is found, then the web application is exposed to XSS attacks. There is also a \"Blind XSS\". It is a subset of stored XSS, where an attacker blindly deploys malicious payloads in web pages that are stored persistently on the target servers. Most of the XSS detection techniques used to detect this vulnerability are inadequate to detect blind XSS attacks. A machine learning based approach can be fully used to detect blind XSS attacks. Testing results help to identify malicious payloads that are likely to get stored in databases through web applications. Analysis Techniques Used for Detection of XSS on the Client-Side and on the Server-Side  
The detection approaches can be: (a) Static Analysis, (b) Dynamic Analysis, (c) Hybrid Analysis, (d) Data-driven Analysis. The settlement of a defense mechanism on the client side can be established either on the client's browser as filters or plug-in, or even on a proxy server. (a) Static Analysis  
According to [PERSON] and [PERSON], the static analysis method mainly focuses on the website's source codes. It scrutinizes the codes for potential detection vulnerabilities. It is obvious that code analysis is a must, since XSS attacks occur in web applications and the whole article is about cybersecurity. However, what we have to differentiate is the fact that the static analysis does not aim at penetration testing to inject payloads. XSS filters are examples of static tools. The idea is that in the Reflected XSS attack, the script dwells in both HTTP Request and Response which are exchanged between the client and the server. [PERSON] [11] introduces another XSS filter known as NoScript. It works as add-on. They are widely available for Firefox and Seamonkey browsers. It allows the execution of Flash, Java, JavaScript and other plug-ins only if they are from an acceptable, trusted source selected by the user [12]. For more information about static XSS detectors, please see [13,14]. [PERSON] et al. 2016 proposes the XBuster filter which was used as an extension to the Firefox browser. It essentially employs a substring matching algorithm.