cltjs meetup - wtfjs

910 views

Published on

Slides for the CharlotteJS meetup. At this meetup we talked about crazy things you can do with JavaScript.

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
910
On SlideShare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
2
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

cltjs meetup - wtfjs

  1. 1. wtfjs<br />Garrett Johnson<br />
  2. 2. _=[][(![]+[])[-~-~-~+[]]+(({}+([])))[-~+[]]+(!![]+[])[-~+[]]+(!![]+[])[+[]]],_()[(![]+[])[-~+[]]+(![]+[])[-~-~+[]]+(![]+[])[-~-~-~-~[]]+(!![]+[])[-~[]]+(!![]+[])[+[]]](({}+([]))[-~-~-~+[]+-~-~+[]]+(![]+[])[-~-~+[]]+(!![]+[])[+[]]+(({}+([])))[-~-~+[]+-~+[]]+(![]+[])[-~-~-~+[]])<br />
  3. 3. ![]+[] == “false”<br />!![]+[] == “true”<br />+[] == 0<br />-~+[] == 1<br />({}+([])) == “[object Object]”<br />
  4. 4. “false”[1]<br />“false”[2]“false”[4]<br />“true”[0]<br />“alert”<br />
  5. 5. need to invoke “alert” somehow….<br />window[“alert”] will do…<br />we need a reference to the window…<br />
  6. 6. rumor is sort() will return the window when used out of context…<br />
  7. 7. same idea with window[“alert”], but we can assign the method to a variable prior to invoking it to make it out of context, which makes it return the window for whatever reason…<br />_=[][“sort”]<br />_() == “DOMWindow”<br />
  8. 8. getting close, we now have the sort which gives us a reference to the window, we also know how to invoke alert as a property like key, now we just need some text to alert….<br />
  9. 9. “[object Object]”[5]<br />“false”[2]<br />“true”[0]<br />“[object Object]”[3]<br />“false”[3]<br />“cltjs”<br />
  10. 10. _=[][‘sort’],_()[‘alert’](‘cltjs’)<br />is really just…<br />
  11. 11. _=[][(![]+[])[-~-~-~+[]]+(({}+([])))[-~+[]]+(!![]+[])[-~+[]]+(!![]+[])[+[]]],_()[(![]+[])[-~+[]]+(![]+[])[-~-~+[]]+(![]+[])[-~-~-~-~[]]+(!![]+[])[-~[]]+(!![]+[])[+[]]](({}+([]))[-~-~-~+[]+-~-~+[]]+(![]+[])[-~-~+[]]+(!![]+[])[+[]]+(({}+([])))[-~-~+[]+-~+[]]+(![]+[])[-~-~-~+[]])<br />
  12. 12. Thanks!<br />Resources<br />http://badassjs.com/post/2929065287/obfuscation<br />http://news.ycombinator.com/item?id=1154435<br />http://adamcecc.blogspot.com/2011/01/javascript.html<br />

×