webdevRefinery Forum: Lols, I'm a wizard - webdevRefinery Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Rate Topic: -----

User is offline Daniel15 

  • dan.cx
  • Group: Moderators
  • Posts: 3415
  • Joined: 17-April 10
  • LocationMelbourne, Australia
  • Expertise:HTML,CSS,PHP,Java,Javascript,Node.js,SQL

Posted 09 October 2011 - 10:15 PM (#1)

Lols, I'm a wizard


Put this into your browser's address bar and press enter:

javascript:alert((''+[][[]])[!+[]+!+[]]+(![]+[])[+!+[]]+(''+!+[]/[])[+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(''+!![])[+!+[]+!![]+!![]]+(![]+[])[!+[]+!+[]]+(+!+[])+(!+[]+!+[]+!+[]+!+[]+!+[]))


Fiddle: http://jsfiddle.net/Daniel15/Z6FBf/2/
:P
Daniel15! :D
Posted Image

Repeat after me: jQuery is not JavaScript. It is not the answer to every JavaScript-related question. When you have to write some JavaScript, do not instantly react with "Oh, I'll do that with jQuery!"

Spoiler
0


User is offline ianonavy 

  • Group: Members
  • Posts: 685
  • Joined: 14-April 10
  • Expertise:HTML,CSS,Java,Javascript,Python

Posted 09 October 2011 - 10:24 PM (#2)

Obfuscation madness!
reputation += 1 if post.is_helpful else 0
0


User is offline soulcyon 

  • 兄貴 シャンク
  • Group: Members
  • Posts: 1591
  • Joined: 14-April 10
  • LocationNew Brunswick, NJ
  • Expertise:HTML,CSS,PHP,Java,Javascript,Node.js,Graphics,MongoDB,CouchDB

Posted 09 October 2011 - 10:34 PM (#3)

xD where have I seen this before

edit:
ah, I got too curious and spoiled it for myself
Spoiler

This post has been edited by souless: 09 October 2011 - 10:50 PM

Posted Image
0


User is offline Daniel15 

  • dan.cx
  • Group: Moderators
  • Posts: 3415
  • Joined: 17-April 10
  • LocationMelbourne, Australia
  • Expertise:HTML,CSS,PHP,Java,Javascript,Node.js,SQL

Posted 09 October 2011 - 10:35 PM (#4)

Indeed :P

It's saying "naniel15" instead of "daniel15" in Internet Explorer. The output of Array.prototype.indexOf.toString() is slightly different in IE and I can't figure out any other relatively hidden ways to get a "d" :lol:
Daniel15! :D
Posted Image

Repeat after me: jQuery is not JavaScript. It is not the answer to every JavaScript-related question. When you have to write some JavaScript, do not instantly react with "Oh, I'll do that with jQuery!"

Spoiler
0


User is offline soulcyon 

  • 兄貴 シャンク
  • Group: Members
  • Posts: 1591
  • Joined: 14-April 10
  • LocationNew Brunswick, NJ
  • Expertise:HTML,CSS,PHP,Java,Javascript,Node.js,Graphics,MongoDB,CouchDB

Posted 09 October 2011 - 10:50 PM (#5)

View PostDaniel15, on 09 October 2011 - 10:35 PM, said:

Indeed :P

It's saying "naniel15" instead of "daniel15" in Internet Explorer. The output of Array.prototype.indexOf.toString() is slightly different in IE and I can't figure out any other relatively hidden ways to get a "d" :lol:


look at my spoiled code, use "undefined" string from

([![]]+[][[]])


Or use
"".indexOf
(strings are kind of like Arrays too)

This post has been edited by souless: 09 October 2011 - 10:51 PM

Posted Image
0


User is offline Daniel15 

  • dan.cx
  • Group: Moderators
  • Posts: 3415
  • Joined: 17-April 10
  • LocationMelbourne, Australia
  • Expertise:HTML,CSS,PHP,Java,Javascript,Node.js,SQL

Posted 09 October 2011 - 10:53 PM (#6)

Nice work unobfuscating the code, souless! Took me a while to write. I saw something similar on some blog a while back (forgot the link though) and thought I'd try something similar XD

Great idea to use undefined. I didn't think about that!

Hmm, I could change "k3" to
([]/[]) 
(NaN) instead :P
Daniel15! :D
Posted Image

Repeat after me: jQuery is not JavaScript. It is not the answer to every JavaScript-related question. When you have to write some JavaScript, do not instantly react with "Oh, I'll do that with jQuery!"

Spoiler
0


User is offline soulcyon 

  • 兄貴 シャンク
  • Group: Members
  • Posts: 1591
  • Joined: 14-April 10
  • LocationNew Brunswick, NJ
  • Expertise:HTML,CSS,PHP,Java,Javascript,Node.js,Graphics,MongoDB,CouchDB

Posted 09 October 2011 - 11:20 PM (#7)

View PostDaniel15, on 09 October 2011 - 10:53 PM, said:

Nice work unobfuscating the code, souless! Took me a while to write. I saw something similar on some blog a while back (forgot the link though) and thought I'd try something similar XD

Great idea to use undefined. I didn't think about that!

Hmm, I could change "k3" to
([]/[]) 
(NaN) instead :P

xD "daNiel" -> "daniel", I like the idea though.

You could also use
typeof !![] 
which is "boolean" for lowercase "n", but the typeof would give it away. Or this for jokes,
'' + "".toString
which return "function toString() { [native code] }" and take 23rd character.

Here's a fun way to write "15":
017
or
14 | 9
or
6^9
or
30 >> 1
or
0x1 | 0x2 | 0x4 | 0x8

Posted Image
0


User is offline Smarag 

  • Group: Members
  • Posts: 584
  • Joined: 08-March 10
  • Expertise:HTML,CSS,PHP

Posted 10 October 2011 - 05:50 AM (#8)

It doesn't work in Chrome 14 and Chrome Canary :3.
0


User is online Kyek 

  • Founder of wdR
  • Group: Administrators
  • Posts: 5078
  • Joined: 20-February 10
  • LocationPhiladelphia, PA, USA
  • Expertise:HTML,CSS,PHP,Java,Javascript,Node.js,SQL

Posted 10 October 2011 - 05:58 AM (#9)

View PostSmarag, on 10 October 2011 - 05:50 AM, said:

It doesn't work in Chrome 14 and Chrome Canary :3.

It will-- they just have a feature where the address bar eliminates the "javascript:" when you paste it in. So you have to go back and type it manually ;-).

This is nice, though, especially seeing that you put it together yourself :). There's a generator for these somewhere on the internet (I found one before... but am feeling strikingly lazy now ;-)) that lets you specify what characters you'll allow. Everything from "Only ()[]" to ()[]{}0-9+-|/ etc. It's seriously impressive, the amount of time people have put into this xD
0


User is offline Daniel15 

  • dan.cx
  • Group: Moderators
  • Posts: 3415
  • Joined: 17-April 10
  • LocationMelbourne, Australia
  • Expertise:HTML,CSS,PHP,Java,Javascript,Node.js,SQL

Posted 10 October 2011 - 06:14 AM (#10)

Oh really? I'll have to find a generator and see if I can learn any more tricks xD

I'd love to know how to make an uppercase D so I can make it say "Daniel15" instead of "daniel15" :P
Daniel15! :D
Posted Image

Repeat after me: jQuery is not JavaScript. It is not the answer to every JavaScript-related question. When you have to write some JavaScript, do not instantly react with "Oh, I'll do that with jQuery!"

Spoiler
0


User is offline soulcyon 

  • 兄貴 シャンク
  • Group: Members
  • Posts: 1591
  • Joined: 14-April 10
  • LocationNew Brunswick, NJ
  • Expertise:HTML,CSS,PHP,Java,Javascript,Node.js,Graphics,MongoDB,CouchDB

Posted 10 October 2011 - 08:32 AM (#11)

xD I doubt there's a generator for this, since it requires real creative skill. I could imagine a randomizing generator, but since not all letters are possible it would be very messy.

How about this for "Daniel15"?
var result = String['\u0066\u0072\u006f\u006d\u0043\u0068\u0061\u0072\u0043\u006f\u0064\u0065'](''+((!+[]+!+[]+!+[])<<1)+((!+[]+!+[])<<2),''+(((!+[]+!+[])<<2)+!+[])+(((!+[]+!+[]+!+[])<<1)+!+[]),+!![]+''+(+!![])+(+![]),+!![]+''+(+![])+((+!![]<<2)+!+[]),+!![]+''+(+![])+(+!![]),+!![]+''+(+![])+(+!![]+!![]<<2),((!+[]+!+[]+!+[])<<(!+[]<<+!+[]+!+[]))+!+[],''+((!+[]<<!+[]+!+[])+!+[])+(!+[]+!+[]+!+[]));

Posted Image
0


User is offline DarkCoder 

  • Group: Members
  • Posts: 1463
  • Joined: 08-March 10
  • LocationEngland, United Kingdom
  • Expertise:HTML,CSS,PHP,Javascript,SQL

Posted 10 October 2011 - 10:02 AM (#12)

Doesn't work in Chrome, should be this:
javascript:alert((''+[][[]])[!+[]+!+[]]+(![]+[])[+!+[]]+(''+!+[]/[])[+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(''+!![])[+!+[]+!![]+!![]]+(![]+[])[!+[]+!+[]]+(+!+[])+(!+[]+!+[]+!+[]+!+[]+!+[]))


Notice the javascript:, stops Chrome from opening a search page :P
0


User is offline NeilHanlon 

  • Group: Members
  • Posts: 884
  • Joined: 08-July 10
  • LocationRowley, Massachusetts
  • Expertise:HTML,CSS,PHP,Java,Graphics

Posted 10 October 2011 - 10:09 AM (#13)

Works fine for me in chrome... Chrome strips javascript: from urls (because of assholes on facebook)
Thanks,
兄ニール

Website | Blog | @NeilHanlon | About.Me | Facebook | LinkedIn
0


User is offline soulcyon 

  • 兄貴 シャンク
  • Group: Members
  • Posts: 1591
  • Joined: 14-April 10
  • LocationNew Brunswick, NJ
  • Expertise:HTML,CSS,PHP,Java,Javascript,Node.js,Graphics,MongoDB,CouchDB

Posted 10 October 2011 - 12:26 PM (#14)

Oh, we can do this, dur:

Click me for p33n!
edit: nvm, javascript: links dont work on wdr

This post has been edited by souless: 10 October 2011 - 12:27 PM

Posted Image
0


User is offline Daniel15 

  • dan.cx
  • Group: Moderators
  • Posts: 3415
  • Joined: 17-April 10
  • LocationMelbourne, Australia
  • Expertise:HTML,CSS,PHP,Java,Javascript,Node.js,SQL

Posted 12 November 2011 - 09:35 AM (#15)

I just remembered this again while looking at my signature. For fun, I tried putting the code into Google's Closure Compiler and... it came back with broken code :lol:
alert((""+[][[]])[2]+(false+[])[1]+(""+1/0)[1]+([false]+[][[]])[1+[0]]+"true"[3]­+(false+[])[2]+1+5);


YUI was smart enough to not try and optimise it :P
Daniel15! :D
Posted Image

Repeat after me: jQuery is not JavaScript. It is not the answer to every JavaScript-related question. When you have to write some JavaScript, do not instantly react with "Oh, I'll do that with jQuery!"

Spoiler
0


User is offline soulcyon 

  • 兄貴 シャンク
  • Group: Members
  • Posts: 1591
  • Joined: 14-April 10
  • LocationNew Brunswick, NJ
  • Expertise:HTML,CSS,PHP,Java,Javascript,Node.js,Graphics,MongoDB,CouchDB

Posted 12 November 2011 - 04:16 PM (#16)

Google Closure destroys any other compressor, imo. I think you copied/pasted it wrong, not sure. Copy/paste mine block of code, it works fine.

Your original code compressed to (101 bytes) Simple optimization:
alert((""+[][[]])[2]+(false+[])[1]+(""+1/0)[1]+([false]+[][[]])[1+[0]]+"true"[3]+(false+[])[2]+1+5);


I had to change the code slightly for advanced optimization:
(function(a,B){b[a]((''+[][[]])[!+[]+!+[]]+(![]+[])[+!+[]]+(''+!+[]/[])[+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(''+!![])[+!+[]+!![]+!![]]+(![]+[])[!+[]+!+[]]+(+!+[])+(!+[]+!+[]+!+[]+!+[]+!+[]))})('alert', this);


compressed to EXACT SAME CODE (101 bytes):
alert((""+[][[]])[2]+(false+[])[1]+(""+1/0)[1]+([false]+[][[]])[1+[0]]+"true"[3]+(false+[])[2]+1+5);


YUI is not smart enough to optimize it!
Posted Image
0


User is offline callumacrae 

  • {{ post.author }}
  • Group: Members
  • Posts: 2862
  • Joined: 20-January 11
  • LocationWarwickshire, England
  • Expertise:HTML,CSS,PHP,Javascript,Node.js,SQL

Posted 12 November 2011 - 05:18 PM (#17)

Surely optimised it would be this?

javascript:alert("Daniel15")

Front-end developer and writer
Twitter | GitHub | phpBB Contributor and Website Team Member | lynxphp
1


User is offline soulcyon 

  • 兄貴 シャンク
  • Group: Members
  • Posts: 1591
  • Joined: 14-April 10
  • LocationNew Brunswick, NJ
  • Expertise:HTML,CSS,PHP,Java,Javascript,Node.js,Graphics,MongoDB,CouchDB

Posted 12 November 2011 - 05:35 PM (#18)

View Postcallumacrae, on 12 November 2011 - 05:18 PM, said:

Surely optimised it would be this?

javascript:alert("Daniel15")



But you can only assume so much, because if you change a few of the parameters, the result could be a Number instead of a String (numbers also use + operator).
Posted Image
0


User is offline callumacrae 

  • {{ post.author }}
  • Group: Members
  • Posts: 2862
  • Joined: 20-January 11
  • LocationWarwickshire, England
  • Expertise:HTML,CSS,PHP,Javascript,Node.js,SQL

Posted 12 May 2012 - 11:45 AM (#19)

I made a dumb generator: http://jsfiddle.net/r8HFE/

I worked out all the values by hand, by the way (some are missing, it'll just put the letters in. Other letters are hacky).

It only works in Safari, because they turn functions into strings differently.
Front-end developer and writer
Twitter | GitHub | phpBB Contributor and Website Team Member | lynxphp
1


Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

2 User(s) are reading this topic
0 members, 2 guests, 0 anonymous users


Enter your sign in name and password


Sign in options
  Or sign in with these services