Javascript vbscript challenge
Sunday, 9 November 2008
Whilst hacking away in javascript I was experimenting with various things and I thought of a problem which would make a good challenge.
The idea was to produce some vbscript which executed the msgbox function without using parenthesis but the trick was not to raise a syntax error in javascript when parsing the code. I found a cool solution to this but lets see what you can come up with. Here are the main rules:-
Rules
1. No parenthesis may be used.
2. The vbscript version must execute msgbox with a argument of 1.
3. No syntax errors in either vbscript or jscript.
4. Errors can’t be turned off, using window.onerror for example is not allowed.
5. Both code samples must work in IE7.
6. The javascript and vbscript code should be identical.
In order to win the challenge you must provide the correct code which executes within the following tags:-
No. 1 — November 10th, 2008 at 12:59 am
”
MsgBox 1′
No. 2 — November 10th, 2008 at 1:00 am
Any way to preserve formatting and JS comments? Let’s try this way…
<pre>
”
MsgBox 1′
</pre>
No. 3 — November 10th, 2008 at 1:04 am
OK,
unescape(
“%27%27%0AMsgBox%201%27”
)
No. 4 — November 10th, 2008 at 10:11 am
Sorry Giorgio my bad commenting in my blog, nice one! It was a sub challenge hehe 🙂
No. 5 — November 10th, 2008 at 2:54 pm
Hmmmm tried it in IE7 and it causes syntax errors. Close but not correct.
You can submit entries here:-
http://sla.ckers.org/forum/read.php?2,25291
No. 6 — November 10th, 2008 at 4:25 pm
Gareth, did you decode it correctly?
Here’s the code above live, tested in IE8 both in standard and compatibility mode:
http://evil.hackademix.net/test/vbjs.html
No. 7 — November 10th, 2008 at 4:28 pm
OK, I tried to unescape my code above: your *ckying SpamBam elided the JS c-style comments once more, even if they were url-escaped 😡
No. 8 — November 10th, 2008 at 4:47 pm
Ah-ha sorry again, that is a correct answer 🙂
No. 9 — November 10th, 2008 at 6:37 pm
Will this one pass through SpamBam?
‘\
MsgBox 1’