Part 2 - PortSwigger - XSS Attack | Shahul Hameed
Lab 7: Reflected DOM XSS Description: Reflected DOM vulnerabilities occur when the server-side application processes data from a request and echoes the data in the response. Tool required: Burp Suite Step 1: UI View Step 2: In burp suite tool find a JSON file Step 3: We have a JSON file restricted with eval() function. Step 4: To bypass eval() function using payload \"-alert(1)}// Step 5: Result Lab 8: Stored DOM XSS Description: In an attempt to prevent XSS , the website uses the JavaScript replace() function to encode angle brackets. However, when the first argument is a string, the function only replaces the first occurrence. We exploit this vulnerability by simply including an extra set of angle brackets at the beginning of the comment. These angle brackets will be encoded, but any subsequent angle brackets will be unaffected, enabling us to effectively bypass the filter and inject HTML. Step 1: Inject payload <><img src=1 onerror=alert(1