(ROT-13解密)Flare-On4: Challenge1 login.html
说是FlareOn的逆向 倒不如说是crypto.......
题目不难 F12看源码:
document.getElementById("prompt").onclick = function () { var flag = document.getElementById("flag").value; var rotFlag = flag.replace(/[a-zA-Z]/g, function(c){return String.fromCharCode((c <= "Z" ? 90 : 122) >= (c = c.charCodeAt(0) + 13) ? c : c - 26);}); if ("PyvragFvqrYbtvafNerRnfl@syner-ba.pbz" == rotFlag) { alert("Correct flag!"); } else { alert("Incorrect flag, rot again"); } }
很明显是个ROT-13加密
然后照着他的js代码改了一个rot13解密的py脚本(Python弱如狗的我踩了很多坑),妈妈再也不用担心我的rot13解密:
rotflag = 'PyvragFvqrYbtvafNerRnfl@syner-ba.pbz' flag='' n=0 s=0 for i in rotflag: if (i<='Z' and i>='A') or (i<='z' and i>='a'): i=(ord(i)+13) if ((90 if(i <= 'Z') else 122) >= (ord(rotflag[n]) + 13) ) else (ord(i) - 13) flag+=chr(i) else: flag+=i n+=1 print(flag)