Fiftysixer decided to try his hand at javascript! All was going well
until he realized that he forgot to remove the unused code, which
resulted in a confusing mess. He didn't mind, in fact, he did his best
to make it even MORE confusing!
Find the password:
索引名 go go away .js,难度
Weird。主页面只留一段自相矛盾的误导脚本,真正的比较藏在外部文件
checkpass.js 里。
#!/usr/bin/env python3 """Recover the JavaScript Mission 6 password from the external script. index.php loads /missions/javascript/6/checkpass.js; the winning comparison there is pass == rawr+" "+moo with dairycow="moo", rawr="moo", moo="pwns". The inline check() (RawrRawr / "hack_this_site" / about:blank) is dead code; the form calls checkpassw() which forwards to the external checkpass(). The password is exactly "rawr + ' ' + moo" -- the single space included. """ import re import urllib.parse
defmain(): js = open("checkpass.js", encoding="utf-8", errors="replace").read() vals = dict(re.findall(r'(\w+)\s*=\s*"([^"]*)"', js)) missing = {name for name in ("rawr", "moo") if name notin vals} if missing: raise SystemExit("missing required assignment(s): " + ", ".join(sorted(missing))) password = "%s %s" % (vals["rawr"], vals["moo"]) print("rawr :", vals["rawr"]) print("moo :", vals["moo"]) print("password :", repr(password)) print("query : lvl_password=" + urllib.parse.quote(password))