XSS can be classified into three types: reflected, stored, and DOM-based. Reflected XSS occurs when the attacker sends a specially crafted URL or request to the web server, and the server reflects the malicious code back to the user's browser as part of the response. For example, the attacker can send an email or a message with a link that contains the malicious code as a parameter, and trick the user into clicking on it. Stored XSS occurs when the attacker stores the malicious code on the web server, such as in a database, a comment section, a forum post, or a profile page, and the server delivers the code to the user's browser when they visit the affected web page or application. For example, the attacker can post a comment with the malicious code on a blog or a social media platform, and anyone who views the comment will execute the code in their browser. DOM-based XSS occurs when the attacker manipulates the Document Object Model (DOM) of the web page or application using client-side JavaScript, and the browser executes the malicious code without sending it to the server. For example, the attacker can modify the URL or a form field with the malicious code, and the browser will parse and run the code when it updates the DOM.