Ketam

Untitled

Jul 23rd, 2018
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 6.97 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>JS Safe - the leading localStorage based safe solution with advanced obfuscation technology</title>
  6. <!--
  7. Advertisement:
  8. Looking for a hand-crafted, browser based virtual safe to store your most
  9. interesting secrets? Look no further, you have found it. You can order your own
  10. by sending a mail to [email protected]. When ordering, please specify the
  11. password you'd like to use to open and close the safe and the content you'd
  12. like to store. We'll hand craft a unique safe just for you, that only works
  13. with your password of choice and contains your secret. (We promise we won't
  14. peek when handling your data.)
  15. -->
  16. <style>
  17. body {
  18.   text-align: center;
  19. }
  20. input {
  21.   font-size: 200%;
  22.   margin-top: 5em;
  23.   text-align: center;
  24.   width: 26em;
  25. }
  26. #result {
  27.   margin-top: 8em;
  28.   font-size: 300%;
  29.   font-family: monospace;
  30.   font-weight: bold;
  31. }
  32. body.granted>#result::before {
  33.   content: "Access Granted";
  34.   color: green;
  35. }
  36. body.denied>#result::before {
  37.   content: "Access Denied";
  38.   color: red;
  39. }
  40. #content {
  41.   display: none;
  42. }
  43. body.granted #content {
  44.   display: initial;
  45. }
  46. .wrap {
  47.   display: inline-block;
  48.   margin-top: 50px;
  49.   perspective: 800px;
  50.   perspective-origin: 50% 100px;
  51. }
  52. .cube {
  53.   position: relative;
  54.   width: 200px;
  55.   transform-style: preserve-3d;
  56. }
  57. .back {
  58.   transform: translateZ(-100px) rotateY(180deg);
  59. }
  60. .right {
  61.   transform: rotateY(-270deg) translateX(100px);
  62.   transform-origin: top right;
  63. }
  64. .left {
  65.   transform: rotateY(270deg) translateX(-100px);
  66.   transform-origin: center left;
  67. }
  68. .top {
  69.   transform: rotateX(-90deg) translateY(-100px);
  70.   transform-origin: top center;
  71. }
  72. .bottom {
  73.   transform: rotateX(90deg) translateY(100px);
  74.   transform-origin: bottom center;
  75. }
  76. .front {
  77.   transform: translateZ(100px);
  78. }
  79. @keyframes spin {
  80.   from { transform: rotateY(0); }
  81.   to { transform: rotateY(360deg); }
  82. }
  83. .cube {
  84.   animation: spin 20s infinite linear;
  85. }
  86. .cube div {
  87.   position: absolute;
  88.   width: 200px;
  89.   height: 200px;
  90.   background: rgba(0, 0, 0, 0.51);
  91.   box-shadow: inset 0 0 60px white;
  92.   font-size: 20px;
  93.   text-align: center;
  94.   line-height: 200px;
  95.   color: rgba(0,0,0,0.5);
  96.   font-family: sans-serif;
  97.   text-transform: uppercase;
  98. }
  99. </style>
  100. <script>
  101. async function x(password) {
  102.     // TODO: check if they can just use Google to get the password once they understand how this works.
  103.     var code = 'icffjcifkciilckfmckincmfockkpcofqcoircqfscoktcsfucsivcufwcooxcwfycwiAcyfBcwkCcBfDcBiEcDfFcwoGcFfHcFiIcHfJcFkKcJfLcJiMcLfNcwwOcNNPcOOQcPORcQNScRkTcSiUcONVcUoWcOwXcWkYcVkЀcYiЁcЀfЂcQoЃcЂkЄcЃfЅcPNІcЅwЇcІoЈcЇiЉcЈfЊcPkЋcЊiЌcІiЍcЌfЎcWoЏcЎkАcЏiБcІkВcБfГcNkДcГfЕcЇkЖcЕiЗcЖfИcRwЙcИoКcЙkЛcUkМcЛiНcМfОcИkПcОiРcПfСcUwТcСiУcQkФcУiХcЃiЦcQwЧcЦoШcЧkЩcШiЪcЩfЫcRiЬcЫfЭcКiЮcЭfЯcСoаcЯiбcГiвcЙiгcRoдcгkеcдiжdТaзcЛfиdзaжcжийcСkкdйaжcжклcйfмdлaжcжмнdТaжcжноdЀaжcжопdNaжcжпрcUiсcрfтdсaуdЁaтcтутcтофcТfхdфaтcтхтcтктcтнтcтмцdсaтcтцтcтктcтутcтнчaaтшdЯaщcйiъcщfыdъaьcжыэcVfюdэaьcьюьcьояdЛaьcьяьcьуьcьыѐчшьёѐшшђcOfѓdђaѓcѓнѓcѓнєcUfѕdєaѓcѓѕіcЯfїdіaѓcѓїјaёѓљaaтњcжшћcЎiќcћfѝdќaњcњѝњcњeўcЏfџdўaњcњџѠdАaњcњѠњcњшњcњѝњcњfњcњџѡљшњѢaaтѣcжшѣcѣѝѣcѣeѣcѣџѤcЯkѥdѤaѣcѣѥѣcѣшѣcѣѝѣcѣfѣcѣџѦѢшѣѧcцнѧcѧїѨdСaѧcѧѨѧcѧкѧcѧуѩaёѧѪcхмѫdрaѪcѪѫѪcѪкѬdYaѪcѪѬѪcѪиѭaѩѪѮcяюѯdНaѮcѮѯѮcѮиѮcѮхѮcѮкѰaѭѮѱdVaѲcхѱѲcѲѕѳcNoѴcѳkѵcѴfѶdѵaѲcѲѶѲcѲiѲcѲlѲcѲmѷјѲgѸјѭѷѹbѰѸѺcXfѻdѺaѻcѻюѻcѻоѻcѻкѻcѻoѼdђaѻcѻѼѻcѻнѻcѻнѻcѻѕѻcѻїѽaёѻѾѽѹшѿceeҀceeҁcee҂ceeѿaѾeҀјѿT҂ѡҀшҁјh҂hѦҁшѿaѾfҀјѿV҂ѡҀшҁјh҂hѦҁшѿaѾiҀјѿU҂ѡҀшҁјh҂hѦҁшѿaѾjҀјѿX҂ѡҀшҁјh҂hѦҁшѿaѾkҀјѿЁ҂ѡҀшҁјh҂hѦҁшѿaѾlҀјѿF҂ѡҀшҁјh҂hѦҁшѿaѾmҀјѿЄ҂ѡҀшҁјh҂hѦҁшѿaѾnҀјѿЉ҂ѡҀшҁјh҂hѦҁшѿaѾoҀјѿЄ҂ѡҀшҁјh҂hѦҁшѿaѾpҀјѿЋ҂ѡҀшҁјh҂hѦҁшѿaѾqҀјѿЍ҂ѡҀшҁјh҂hѦҁшѿaѾrҀјѿА҂ѡҀшҁјh҂hѦҁшѿaѾsҀјѿF҂ѡҀшҁјh҂hѦҁшѿaѾtҀјѿВ҂ѡҀшҁјh҂hѦҁшѿaѾuҀјѿД҂ѡҀшҁјh҂hѦҁшѿaѾvҀјѿЗ҂ѡҀшҁјh҂hѦҁшѿaѾwҀјѿК҂ѡҀшҁјh҂hѦҁшѿaѾxҀјѿН҂ѡҀшҁјh҂hѦҁшѿaѾyҀјѿР҂ѡҀшҁјh҂hѦҁшѿaѾAҀјѿТ҂ѡҀшҁјh҂hѦҁшѿaѾBҀјѿФ҂ѡҀшҁјh҂hѦҁшѿaѾCҀјѿW҂ѡҀшҁјh҂hѦҁшѿaѾDҀјѿХ҂ѡҀшҁјh҂hѦҁшѿaѾEҀјѿЪ҂ѡҀшҁјh҂hѦҁшѿaѾFҀјѿЬ҂ѡҀшҁјh҂hѦҁшѿaѾGҀјѿЮ҂ѡҀшҁјh҂hѦҁшѿaѾHҀјѿа҂ѡҀшҁјh҂hѦҁшѿaѾIҀјѿe҂ѡҀшҁјh҂hѦҁшѿaѾJҀјѿб҂ѡҀшҁјh҂hѦҁшѿaѾKҀјѿв҂ѡҀшҁјh҂hѦҁшѿaѾLҀјѿK҂ѡҀшҁјh҂hѦҁшѿaѾMҀјѿе҂ѡҀшҁјh҂hѦҁшѐceeёceeѓceeјceeљceeњceeѡceeѢceeѣceeѦceeѧceeѩceeѪceeѭceeѮceeѰceeѲceeѷceeѸceeѹceeѻceeѽceeѾceeҀceeҁceeжceeтceeчceeьcee'
  104.     var env = {
  105.         a: (x,y) => x[y],
  106.         b: (x,y) => Function.constructor.apply.apply(x, y),
  107.         c: (x,y) => x+y,
  108.         d: (x) => String.fromCharCode(x),
  109.         e: 0,
  110.         f: 1,
  111.         g: new TextEncoder().encode(password),
  112.         h: 0,
  113.     };
  114.     for (var i = 0; i < code.length; i += 4) {
  115.        var [lhs, fn, arg1, arg2] = code.substr(i, 4);
  116.        try {
  117.            env[lhs] = env[fn](env[arg1], env[arg2]);
  118.        } catch(e) {
  119.            env[lhs] = new env[fn](env[arg1], env[arg2]);
  120.        }
  121.        if (env[lhs] instanceof Promise) env[lhs] = await env[lhs];
  122.    }
  123.    return !env.h;
  124. }
  125. </script>
  126. <script>
  127. const alg = { name: 'AES-CBC', iv: Uint8Array.from([211,42,178,197,55,212,108,85,255,21,132,210,209,137,37,24])};
  128. const secret = Uint8Array.from([26,151,171,117,143,168,228,24,197,212,192,15,242,175,113,59,102,57,120,172,50,64,201,73,39,92,100,64,172,223,46,189,65,120,223,15,34,96,132,7,53,63,227,157,15,37,126,106]);
  129. async function open_safe() {
  130.   keyhole.disabled = true;
  131.   password = /^CTF{([0-9a-zA-Z_@!?-]+)}$/.exec(keyhole.value);
  132.   if (!password || !(await x(password[1]))) return document.body.className = 'denied';
  133.   document.body.className = 'granted';
  134.   const pwHash = await crypto.subtle.digest('SHA-256', new TextEncoder().encode(password[1]));
  135.   const key = await crypto.subtle.importKey('raw', pwHash, alg, false, ['decrypt']);
  136.   content.value = new TextDecoder("utf-8").decode(await crypto.subtle.decrypt(alg, key, secret))
  137. }
  138. </script>
  139. </head>
  140. <body>
  141. <div>
  142.   <input id="keyhole" autofocus onchange="open_safe()" placeholder="🔑">
  143. </div>
  144. <div class="wrap">
  145.   <div class="cube">
  146.     <div class="front"></div>
  147.     <div class="back"></div>
  148.     <div class="top"></div>
  149.     <div class="bottom"></div>
  150.     <div class="left"></div>
  151.     <div class="right"></div>
  152.   </div>
  153. </div>
  154. <div id="result">
  155. </div>
  156. <div>
  157.   <input id="content">
  158. </div>
  159. </body>
  160. </html>
Advertisement
Add Comment
Please, Sign In to add comment