打开之后弹了个窗
既然考js
f12 调试器里有两个文件
看index
<html>
<head><title>JS</title><script type="text/javascript">function dechiffre(pass_enc){var pass = "70,65,85,88,32,80,65,83,83,87,79,82,68,32,72,65,72,65";var tab = pass_enc.split(',');var tab2 = pass.split(',');var i,j,k,l=0,m,n,o,p = "";i = 0;j = tab.length;k = j + (l) + (n=0);n = tab2.length;for(i = (o=0); i < (k = j = n); i++ ){o = tab[i-l];p += String.fromCharCode((o = tab2[i]));if(i == 5)break;}for(i = (o=0); i < (k = j = n); i++ ){o = tab[i-l];if(i > 5 && i < k-1)p += String.fromCharCode((o = tab2[i]));}p += String.fromCharCode(tab2[17]);pass = p;return pass;}String["fromCharCode"](dechiffre("\x35\x35\x2c\x35\x36\x2c\x35\x34\x2c\x37\x39\x2c\x31\x31\x35\x2c\x36\x39\x2c\x31\x31\x34\x2c\x31\x31\x36\x2c\x31\x30\x37\x2c\x34\x39\x2c\x35\x30"));h = window.prompt('Enter password');alert( dechiffre(h) );</script>
</head></html>
看代码
他先封装了一个函数
然后把一串字符经过函数后的结果赋值给fromcharcode
然后弹窗让你输入h
但前面从头到尾没用到h所以你输啥都一样
再看函数
又发现个问题
那一大串字符串又没用上,从头到尾都是pass
所以把pass换成那串字符串执行函数?
不对
看第27行
直接fromcharcode得了
于是改造好后执行
加上flag格式成功
注:那串字符不一定一样
把下面那串字符换成你的然后执行即可
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<script>var n=("\x35\x35\x2c\x35\x36\x2c\x35\x34\x2c\x37\x39\x2c\x31\x31\x35\x2c\x36\x39\x2c\x31\x31\x34\x2c\x31\x31\x36\x2c\x31\x30\x37\x2c\x34\x39\x2c\x35\x30");var tab = n.split(',');for(i=0;i<=10;i++){var flag=String.fromCharCode(tab[i]);document.write(flag);}
</script>
</body>
</html>