Re:Google's XSS game
by johnadam on Thursday May 29, 2014 @06:25AM
(#7815551)
How do you solve lv4?
[ Parent
| on HN ]
' after the timer value, then proceed to construct a JS expression that will be evaluated before the call to setTimer ... Hint: '99'+moo() will evaluate nicely. Don't forgot the "open" the ' again.
Re:Google's XSS game
by rhubarbcustard on Thursday May 29, 2014 @09:16AM
(#7816042)
I can't figure how to close the quote after the '99 ? I realise that specifying ' on URL gets encoded to %27 but not sure how to turn that into the closing ' for startTime('99'); .....
Help!
Can you elaborate on this? I tried that and got "unexpected identifier" as a console error. Not sure how it works.
The point is to break out of the startTimer() function call, e.g.:
startTimer('');foo();//');
The remaining '); can be commented out in order to not create any syntax errors. SPOILER ALERT
I used this: 1'* alert()* '
(without the spaces needed for markdown here)
Re:Google's XSS game
by rhubarbcustard on Thursday May 29, 2014 @10:24AM
(#7816326)
Could you explain why the * works in there?
JS does automatic type conversion in this case, so it's syntactically correct to multiply a string with a number (or function result). We're just interested in the side-effects of alert(), so it doesn't really matter what kind of expression we use it in, as long as it parses correctly and causes alert() to be executed (evaluated).
Re:Google's XSS game
by mariocarvalho on Sunday June 01, 2014 @12:39PM
(#7829772)
Nice!
[deleted]
nope, OSX Safari
Re:Google's XSS game
by namanaggarwal on Thursday May 29, 2014 @09:20AM
(#7816057)
still not able to get :-(
Use the text input instead of the url.
You could use %2b instead of + on the URL and it'll work, or just * as mentioned above.
' + alert() + '
worked for me.
Re:Google's XSS game
by codeman123 on Thursday May 29, 2014 @09:31AM
(#7816098)
can't solve it either :-/
In the text input I put:
3') + alert('