index.html 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. <html>
  2. <head>
  3. <title>JSFuck - Write any JavaScript with 6 Characters: []()!+</title>
  4. <meta name="description" content="JSFuck is an esoteric and educational programming style based on the atomic parts of JavaScript. It uses only six different characters execute code.">
  5. <meta property="og:image" content="http://www.jsfuck.com/preview.png" />
  6. <style>
  7. body {
  8. padding: 20px;
  9. max-width: 800px;
  10. }
  11. body, * {
  12. font-family: monospace;
  13. font-size: 14px;
  14. }
  15. h1 {
  16. font-size: 2em;
  17. }
  18. h3 {
  19. font-weight: bold;
  20. }
  21. textarea {
  22. display: block;
  23. width: 100%;
  24. height: 200px;
  25. margin: 1em 0;
  26. }
  27. .checkbox {
  28. display: inline-block;
  29. }
  30. </style>
  31. </head>
  32. <body>
  33. <h1>JSFuck []()!+</h1>
  34. <p>JSFuck is an esoteric and educational programming style based on the
  35. atomic parts of JavaScript. It uses only six different characters to
  36. write and execute code.</p>
  37. <p>It does not depend on a browser, so you can even run it on Node.js.</p>
  38. <input id="input" type="text" value="alert(1)"/>
  39. <button id="encode" type="text">Encode</button>
  40. <div class="checkbox">
  41. <input id="eval" type="checkbox" checked />
  42. <label for="eval">Eval Source</label>
  43. </div>
  44. <textarea id="output"></textarea>
  45. <div id="stats"></div>
  46. <h3>Links</h3>
  47. <p>
  48. * View source on <a href="http://github.com/aemkei/jsfuck">GitHub</a> <br>
  49. * Follow <a href="http://twitter.com/aemkei">@aemkei</a> (Martin Kleppe) <br>
  50. * Original discussion at <a href="http://sla.ckers.org/forum/read.php?24,32930">Sla.ckers.org</a>
  51. </p>
  52. <h3>Basics</h3>
  53. <pre>
  54. * 'false' => ![]
  55. * 'true' => !![]
  56. * 'undefined' => [][[]]
  57. * 'NaN' => +[![]]
  58. * 'Array' => []
  59. * 'Number' => +[]
  60. * 'String' => []+[]
  61. * 'Boolean' => ![]
  62. * 'Function' => []["sort"]
  63. * eval => []["sort"]["constructor"]( CODE )()
  64. * window => []["sort"]["constructor"]("return this")()
  65. </pre>
  66. <p>See the full list <a href="https://github.com/aemkei/jsfuck/blob/master/jsfuck.js">here.</a></p>
  67. <script src="jsfuck.js"></script>
  68. <script>
  69. function $(id){
  70. return document.getElementById(id);
  71. }
  72. $("encode").onclick = function(){
  73. var output = JSFuck.encode($("input").value, $("eval").checked);
  74. $("output").value = output;
  75. $("stats").innerHTML = output.length + " chars";
  76. }
  77. $("encode").onclick();
  78. </script>
  79. <script type="text/javascript">
  80. var _gaq = _gaq || [];
  81. _gaq.push(['_setAccount', 'UA-57649-11']);
  82. _gaq.push(['_trackPageview']);
  83. (function() {
  84. var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
  85. ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
  86. var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  87. })();
  88. </script>
  89. </body>
  90. </html>