XSS - Question

J [ColdIV]
12 years ago

0

First of all I want to say that I’m new to XSS, just read something about it and want to try it the easy way.

I found a site where this works:
<!--[if gte IE 4]><SCRIPT>alert(document.domain);</SCRIPT><![endif]-->
But only when entered directly in the search box. If I use this:
http://www.[site].com/index.php?search=%3C%21--%5Bif+gte+IE+4%5D%3E%3CSCRIPT%3Ealert%28document.domain%29%3B%3C%2FSCRIPT%3E%3C%21%5Bendif%5D--%3E
IE says that the site has changed to block the script.
Now I wonder whether it is possible to avoid that and if I can do something similar in Chrome / Firefox.

( Won’t post the link to the page here )

12replies
4voices
218views
daMage
12 years ago

0

Is the search done with GET or POST? I’m guessing GET, but just to be sure…

J [ColdIV]
12 years ago | edited 12 years ago

0

Yes, it’s GET.

EDIT:
If my input is this:
'';!--"<XSS>=&{()}
The output is:
\'\';!--\"<XSS>=&{()}
(In source code)
and:
\'\';!--\"=&{()}
(On the page)

So I can for example have this in the source code:
<script>alert(document.domain);</script>
But nothing will happen.

daMage
12 years ago

0

Is that the only parameter in the form?

J [ColdIV]
12 years ago

0

Yes it’s the only parameter

daMage
12 years ago

0

So the problem is that nothing happens? Can you still paste more about the context where the injected code is? maybe 1-2 lines around it, or even the whole line it is on?

J [ColdIV]
12 years ago | edited 12 years ago

0

If my input is:
<script>alert(document.domain);</script>
The source code looks like this:
```

(text)

(text) ""(text)

(text)

```
(German site)

If my input is this:
\'\';!--\"<script>alert(document.domain);</script>
The site actually finds something and I got the script twice in the source code:
```

(text)

(text)"\'\';!--\""(text)


alert(document.domain);“>(text)


```

EDIT: Removed text because daMage told me that someone might find the site with it. Thanks!

daMage
12 years ago

0

You aren’t trying it on chrome, are you?
If you are, check that the javascript console doesn’t give you the following error:
“Refused to execute a JavaScript script. Source code of script found within request”

J [ColdIV]
12 years ago

0

Ah, thank you very much. I did it on chrome but didn’t check the console once..
So you’re right I get the error.

With IE it ‘works’ but just when putting it directly in the search box not with the link.
Is there a way to avoid that IE blocks it?

Peter [verath]
12 years ago

0

Chrome has since version 11 been using something called “XSSAuditor” (I think this feature is in the webkit engine, so it should also be used by Safari) that basically prevents javascript that is in the request (as in passed in the url for example) to run. IE has actually had an xss-filter since version 8, which is quite surprising imo.

The webkit filter is not designed to catch everything, they have said this themselves, and currently it only filters individual parameters. So if you managed to find two un-escaped variables it shouldn’t be too much of a problem to get past. That would probably be one way to get around the IE filter as well. Other than that you could try googleing for ways, this article seems quite interesting.

J [ColdIV]
12 years ago

0

Thank you very much, will take a look at it, sounds interesting.
Might help a lot..

Keeper
12 years ago

0

ColdIV you can disable it from cmd

Disable it on windows.

  1. Run Command Prompt(Windows vista and 7 click Start and type cmd.exe hit enter for Windows XP click Start go to Run and type cmd.exe hit enter.)

  2. enter the following command and then press enter. :

C:\Users\your comp username here\AppData\Local\Google\Chrome\Application\chrome.exe –args –disable-xss-auditor

  1. Google Chrome will open. Go to a XSS vulnerable website, type your xss vector and execute your xss. It should now pop up your vector.
J [ColdIV]
12 years ago

0

Well yeah that’s good to know but won’t work if I want to send the script to someone else I guess, because he would have to do the same too.
Thanks anyway for telling me! Nice for testing.

You must be logged in to reply to this discussion. Login
1 of 13

This site only uses cookies that are essential for the functionality of this website. Cookies are not used for tracking or marketing purposes.

By using our site, you acknowledge that you have read and understand our Privacy Policy, and Terms of Service.

Dismiss