# XSS Stored

## XSS - Stored - Second Order

Go to login page form [https://127.0.0.1/index.php?page=login.php](https://127.0.0.1/index.php?page=login.php)

and log in using login bypass or inserting password.

Go to a page vulnerable to XSS stored like as: [https://127.0.0.1/index.php?page=add-to-your-blog.php](https://127.0.0.1/index.php?page=add-to-your-blog.php)

<figure><img src="https://677614291-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrRWtuMw6xkkeDjZfkcWC%2Fuploads%2F3YPSKa6psiif4k05Oob3%2Fimage.png?alt=media&#x26;token=529d49f1-4c89-464f-b233-125b2d1cdf6b" alt=""><figcaption></figcaption></figure>

in this textarea (not sanitizated) we can add whatever we want, save it and it will be stored internally and display to users that will click on 'View Blogs'.

<figure><img src="https://677614291-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrRWtuMw6xkkeDjZfkcWC%2Fuploads%2FPFa1lOFiCzpltGcLS0bs%2Fimage.png?alt=media&#x26;token=b0160a14-ead3-4677-8c1b-ed700024ebfc" alt=""><figcaption></figcaption></figure>

injecting the javascript payload: `<script>alert(document.cookie)</script> the`command will be execute on the click of the page: [https://127.0.0.1/index.php?page=view-someones-blog.php](https://127.0.0.1/index.php?page=view-someones-blog.php) clicking on View Blog Entries:

<figure><img src="https://677614291-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrRWtuMw6xkkeDjZfkcWC%2Fuploads%2FS5Ov78jOoKGuxHBuJAbD%2Fimage.png?alt=media&#x26;token=6b213333-1ba8-4741-9643-b44949d91c8a" alt=""><figcaption></figcaption></figure>



