# Stored XSS - Mutillidae

\<script>alert(document.cookie)\</script>

<div align="left"><img src="https://990422818-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LWGXF4oLcghA1GLq0CM%2F-LoVHc2NvSuMsH1Hsx9w%2F-LoTlNovXz7Wq4sCd9mV%2Fimage.png?alt=media&#x26;token=e9cc8065-994d-4876-b691-85b540c5e3ab" alt=""></div>

When user using this blog and load database records contains the script code, the malicious code will be execute on browser.



## Stored XSS - DVNA

**Step 1:** Login to the application and navigate to `http://192.168.31.112:9090/app/products`

**Step 2:** Click "Add Product" and fill the product details. Click "submit" and intercept the request using Burp.

**Step 3:** Modify the "description" parameter in the POST request body to `<script>alert(document.domain)</script>`. Forward the request

![](https://990422818-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LWGXF4oLcghA1GLq0CM%2F-LWqCAmGZ1zWuiRGZQ9H%2F-LWqCREwO06FKRRzO62i%2Fimage.png?alt=media\&token=f3d10f8e-f741-40ea-96c3-12f1b8606889)

**Step 3:** In the response, notice that `<script>alert(document.domain)</script>` is part of the HTML in the products page. Navigate to `http://localhost:9090/app/products` and you'll see an alert

![](https://990422818-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LWGXF4oLcghA1GLq0CM%2F-LWqCAmGZ1zWuiRGZQ9H%2F-LWqCDY0HVshcjX0XS6X%2Fimage.png?alt=media\&token=6052270f-9979-4533-ae26-d26c2dff5926)

![](https://990422818-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LWGXF4oLcghA1GLq0CM%2F-LWqCAmGZ1zWuiRGZQ9H%2F-LWqCMahJ6Wj3e262Ne8%2Fimage.png?alt=media\&token=304407b9-c391-4722-baa8-c74365f0594e)
