标题: [原创]对一个黑客解密游戏的通关分析 [打印本页]
作者: 冰血封情 时间: 2004-2-7 18:20 标题: [原创]对一个黑客解密游戏的通关分析
注意:谨以此文章献给我的父亲和母亲,感谢他们对我多年来的养育之恩。
原创声明:
中国暗域网络技术资讯站原创文章,作者 冰血封情,转载劳烦著名出处。
拙笔正文:
有一天,在鹰派论坛上看见了一个朋友发的黑客游戏帖。游戏地址http://www.my1314.com/testit/index.htm。自己玩了一下觉得很有趣,就想把攻略详细写下来给大家做个参考。其实这类破解游戏都是很落后的了,只是给大家一个启发。好了,切入正题。
(1)1-2
来到第一关的页面,地址:http://www.my1314.com/testit/index.htm,直接通过[B]查看(&V)[/B],[B]源文件(&C)[/B]。可以看见如下的源代码:- <html>
- <head>
- <NOscript><IFRAME SRC=-.html></IFRAME></NOscript>
- <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
- <title>Mission 1</title>
- <script language="JavaScript">
- function CheckPassword()
- {
- [color=ff0000]if(document.all.password.value == www.xxiyy.net) [/color]
- window.open("test2.1207.htm","surveywin","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=610,height=400,status=yes,resizable=yes");
- else
- window.alert("密码错误哦!");
- }
- </script>
- </head>
- <body OnContextMenu ="return false">
- <p>第一关,请输入密码进入第二关</p>
- <p>密码:</p>
- <input name="password" type="password" id="password">
- <input type="button" name="Submit" value="确定" onClick="javascript :CheckPassword();">
- </body>
- </html>
复制代码 看见红色部分了么?密码就是www.xxiyy.net,输入后点确定到第二关!
(2)2-3
第二关是个跳出来的窗口,没地址怎么办?其实在上面的红色代码部分的下面我们很容易找到第二关的地址是test2.1207.htm,这样一来我们就可以用IE直接打开第二关的页面地址http://www.my1314.com/testit/test2.1207.htm,然后故伎重演使用[B]查看(&V)[/B],[B]源文件(&C)[/B]。可以看见如下的源代码:- <html>
- <head>
- <NOscript><IFRAME SRC=-.html></IFRAME></NOscript>
- <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
- <title>Mission 2</title>
- <script language="JavaScript">
- function CheckPassword()
- {
- [color=ff0000]if(document.all.password.value == "www.hackerbase.net")[/color]
- top.location = "test3.1153.htm";
- else
- window.alert("密码错误哦!");
- }
- </script>
- </head>
- <body OnContextMenu ="return false">
- <p>第二关,请输入密码进入第三关</p>
- <p>密码:</p>
- <input name="password" type="password" id="password">
- <input type="button" name="Submit" value="确定" onClick="javascript :CheckPassword();">
- </body>
- </html>
复制代码 方法和一到二关一样,很容易可以看到密码是www.hackerbase.net,页面地址是http://www.my1314.com/testit/test3.1153.htm。这样我们就顺利进入第3关了。怎么样?相当简单了吧,地球人都会。呵呵……
(3)3-4
来到第三关了,老办法查看源文件,看到如下代码:- <frameset rows='100%,*' frameborder='NO' border='0' framespacing='0'>
- <frame src='test3.1200.htm' name='mainFrame' frameborder='no' noresize>
- </frameset>
- <noframes>如果你看到这个的话……很可惜,你的浏览器不让你继续玩下去了。:(
- </noframes>
复制代码 是人都知道,连密码验证都没看见,叫什么页啊?一定是假的。不错!仔细看看代码,原来真正的web在这里test3.1200.htm,添入http://www.my1314.com/testit/test3.1200.htm回车,又回到http://www.my1314.com/testit/test3.1153.htm了,哈哈看来用了转向。
这样吧,请出老土命令。在地址栏写入view-source:http://www.my1314.com/testit/test3.1200.htm回车,跳出了http://www.my1314.com/testit/test3.1200.htm的源文件。内容如下:- <html>
- <head>
- <script language="JavaScript">
- if(self==top)
- {
- top.location="test3.1153.htm";
- }
- </script>
- <NOscript><IFRAME SRC=-.html></IFRAME></NOscript>
- <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
- <title>Mission 3</title>
- <script language="JavaScript">
- function CheckPassword()
- {
- if(document.all.password.value == "20030927")
- top.location = "test4.1131.htm";
- else
- window.alert("密码错误哦!");
- }
- </script>
- </head>
- <body OnContextMenu ="return false">
- <p>第三关,请输入密码进入第四关</p>
- <p>密码:</p>
- <input name="password" type="password" id="password">
- <input type="button" name="Submit" value="确定" onClick="javascript :CheckPassword();">
- </body>
- </html>
复制代码 哈哈哈哈……果然是很土!方法同一二关一样,不详细说了。现在来看第四关http://www.my1314.com/testit/test4.1131.htm。
(4)4-5
输入地址后回车,竟然跳出要输入密码的窗口。呵……真是土。以为跳出窗口就不方便查看源文件了?老方法用view-source:http://www.my1314.com/testit/test4.1131.htm轻而易举的查看源代码。如下:- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
- <title>Mission 4</title>
- </head>
- <body OnContextMenu ="return false">
- <script language="JavaScript">
- if(window.prompt("请输入密码进入第五关:","") == "12272003")
- top.location = "test5.1226.htm";
- else
- {
- window.alert("密码错误哦!");
- top.location = "error.htm";
- }
- </script>
- <p>第四关,请输入密码进入第五关</p>
- </body>
- </html>
复制代码 同样方法,也不再赘述。
(5)5-6
我们直接输入密码12272003来到第五关地址http://www.my1314.com/testit/test5.1226.htm!
靠,竟然还是要输入密码,那么老办法用view-source:http://www.my1314.com/testit/test5.1226.htm有点象万能的感觉。嘿嘿……
可是回车后出现的是:- <script>document.write(unescape("[color=ff0000]%3c%68%74%6d%6c%3e%0d%3c%68%65%61%64%3e%0d%3c%6d%65%74%61%20%68%74%74%70%2d%65%71%75%69%76%3d%22%43%6f%6e%74%65%6e%74%2d%54%79%70%65%22%20%63%6f%6e%74%65%6e%74%3d%22%74%65%78%74%2f%68%74%6d%6c%3b%20%63%68%61%72%73%65%74%3d%67%62%32%33%31%32%22%3e%0d%3c%74%69%74%6c%65%3e%4d%69%73%73%69%6f%6e%20%35%3c%2f%74%69%74%6c%65%3e%0d%3c%2f%68%65%61%64%3e%0d%3c%62%6f%64%79%20%20%4f%6e%43%6f%6e%74%65%78%74%4d%65%6e%75%20%3d%22%72%65%74%75%72%6e%20%66%61%6c%73%65%22%3e%0d%3c%70%3e%u7b2c%u4e94%u5173%uff0c%u8bf7%u8f93%u5165%u5bc6%u7801%u8fdb%u5165%u7b2c%u516d%u5173%3c%2f%70%3e%0d%3c%73%63%72%69%70%74%20%6c%61%6e%67%75%61%67%65%3d%22%4a%61%76%61%53%63%72%69%70%74%22%3e%0d%69%66%28%77%69%6e%64%6f%77%2e%70%72%6f%6d%70%74%28%22%u8bf7%u8f93%u5165%u5bc6%u7801%u8fdb%u5165%u7b2c%u516d%u5173%uff1a%22%2c%22%22%29%20%3d%3d%20%22%6d%69%6b%65%73%70%6f%6f%6b%22%29%0d%20%74%6f%70%2e%6c%6f%63%61%74%69%6f%6e%20%3d%20%22%74%65%73%74%36%2e%31%32%33%31%2e%68%74%6d%22%3b%0d%65%6c%73%65%0d%7b%0d%20%77%69%6e%64%6f%77%2e%61%6c%65%72%74%28%22%u5bc6%u7801%u9519%u8bef%u54e6%uff01%22%29%3b%0d%20%74%6f%70%2e%6c%6f%63%61%74%69%6f%6e%20%3d%20%22%65%72%72%6f%72%2e%68%74%6d%22%3b%0d%7d%0d%3c%2f%73%63%72%69%70%74%3e%0d%3c%2f%62%6f%64%79%3e%0d%3c%2f%68%74%6d%6c%3e%0d[/color]"));</script>
复制代码 诶呀妈呀?这可怎么办?其实大家不要担心,这只不过是一种加密的方式,具体是这样的,插入了什么东东呢?下来看看。
输入:http://www.my1314.com/testit/6.js下回来打开一看。内容如下:- function MyDecode(str)
- {
- var c="";
- var arrCodes = new Array("g","f","w","v","h","z","t","i","y","s","u","x","a","r","j","b","k","q","n","c","o","l","d","p","m","e","]","?","#","%","*","\n");
- var arrChars = new Array("a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","<",">","/","\"","@","!");
- for(i=0;i<str.length;i++)
- {
- bCode = false;
- for(j=0;j<32;j++)
- if(str.substr(i, 1)==arrCodes[j])
- {
- c = c + arrChars[j];
- bCode = true;
- break;
- }
- if(bCode==false)
- c = c + str.substr(i, 1);
- }
- return c;
- }
复制代码 原来是一个小小的算法,还好没相信ndyxx这个伪劣商品。
("g","f","w","v","h","z","t","i","y","s","u","x","a","r","j","b","k","q","n","c","o","l","d","p","m","e","]","?","#","%","*","\n");
var arrChars = new Array("a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","<",">","/","\"","@","!");
ndyxx
可以看出来:n相对应的是s d想对应的是w y想对应的是i x想对应的是l
那么最后以次类推得出来的是swill,把swill输入可以去下一关。把弹出来的窗口移开,可以看到第七关的地址是:http://www.my1314.com/testit/test7.2003.htm
(7)7-8
老方法view-source:看第7关的代码。得到如下内容:- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
- <title>Mission 7</title>
- </head>
- <body OnContextMenu ="return false">
- <p>第七关,请输入密码进入第八关</p>
- <script language="JScript.Encode">#@~^rwAAAA==@#@&kWvhbxNKhc2DK:2YvJ请输入密码进入第八关:ESrJ#,x',JAbL$kTKDsNEb@#@&7YK2R^W^CDkWU~{PEYdD% 8 l&R4YsEi@#@&nVk+@#@&P@#@&iAk NWS CVDD`E密码错误哦!JbI@#@&7YK2R^W^CDkWU~{PE+M.KD 4YsJi@#@&)@#@&jikAAA==^#~@</script>
- </body>
- </html>
复制代码 哇,什么乱七八糟的啊?看来又是加密了,这是个和上面那个不同的新加密方法。这个加密的方法我在我的另外一篇叫[原创]对一个网页木马的剖析文章中提起过,以上的这种代码是明显被微软的脚本编码器( SCRENC.EXE )加密过。解密工具我也已经放在中国暗域网络技术联盟下载系统了,大家可以自己下。解密后的明文如下:
[coed]
Mission 7
第七关,请输入密码进入第八关