<!DOCTYPE html> <html> <head> <title>Welcome to Earth</title> <scriptsrc="/static/js/open_sesame.js"></script> </head> <body> <h1>YOU FOUND THE DOOR!</h1> <p>How do you open it?</p> <imgsrc="/static/img/door.jpg"alt="door"style="width:60vw;" /> <script> open(0); </script> </body> </html>
<!DOCTYPE html> <html> <head> <title>Welcome to Earth</title> <scriptsrc="/static/js/fight.js"></script> </head> <body> <h1>AN ALIEN!</h1> <p>What do you do?</p> <img src="/static/img/alien.png" alt="door" style="width:60vw;" /> </br> <inputtype="text"id="action"> <buttononClick="check_action()">Fight!</button> </body> </html>
又调用函数,那还是js文件呗
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
// Run to scramble original flag //console.log(scramble(flag, action)); functionscramble(flag, key) { for (var i = 0; i < key.length; i++) { let n = key.charCodeAt(i) % flag.length; let temp = flag[i]; flag[i] = flag[n]; flag[n] = temp; } return flag; }
functioncheck_action() { var action = document.getElementById("action").value; var flag = ["{hey", "_boy", "aaaa", "s_im", "ck!}", "_baa", "aaaa", "pctf"];