{"id":41,"date":"2013-11-29T23:12:35","date_gmt":"2013-11-29T15:12:35","guid":{"rendered":"http:\/\/www.yptk.cn\/index.php\/2013\/11\/29\/%e5%a6%82%e4%bd%95%e8%bf%98%e5%8e%9feval%e5%8a%a0%e5%af%86%e7%9a%84js%e7%a8%8b%e5%ba%8f\/"},"modified":"2013-11-29T23:12:35","modified_gmt":"2013-11-29T15:12:35","slug":"%e5%a6%82%e4%bd%95%e8%bf%98%e5%8e%9feval%e5%8a%a0%e5%af%86%e7%9a%84js%e7%a8%8b%e5%ba%8f","status":"publish","type":"post","link":"http:\/\/yptk.cn\/index.php\/2013\/11\/29\/%e5%a6%82%e4%bd%95%e8%bf%98%e5%8e%9feval%e5%8a%a0%e5%af%86%e7%9a%84js%e7%a8%8b%e5%ba%8f\/","title":{"rendered":"\u5982\u4f55\u8fd8\u539feval\u52a0\u5bc6\u7684JS\u7a0b\u5e8f"},"content":{"rendered":"<p>\n\tJS\u5199\u7684EVAL\u5728\u7ebf\u52a0\u5bc6\u89e3\u5bc6\u5de5\u5177\uff0c\u53ef\u4ee5\u4e3a\u4ee3\u7801\u52a0\u5bc6\u89e3\u5bc6\u9690\u85cf\u4ee3\u7801\uff1b\u80fd\u591f\u5feb\u901f\u7834\u89e3\u7f51\u7ad9EVAL\u52a0\u5bc6\u7684\u811a\u672c\uff0c\u5728\u81ea\u5df1\u7684\u7f51\u7ad9\/\u535a\u5ba2\u4f5c\u4e3a\u4e00\u4e2a\u6b3e\u5728\u7ebf\u5de5\u5177\uff0c\u65b9\u4fbf\u81ea\u5df1\u4ee5\u53ca\u65b9\u4fbf\u5176\u4ed6\u9700\u8981\u7684\u7f51\u53cb\uff0c\u8fd9\u4e2a\u672c\u8eab\u5c31\u662f\u7528JS\u6765\u5199\u7684\uff0c\u6c34\u5e73\u9ad8\u7684\u8bf7\u81ea\u884c\u4fee\u6b63\u3002\u518d\u4ecb\u7ecd\u4e00\u79cdbase64\u52a0\u5bc6\u7684\u3002\u7b97\u4e86\uff0c\u8fd9\u4e2a\u6ca1\u4ec0\u4e48\u53ef\u8bf4\u7684\u3002\u4f60\u627e\u4e0d\u5230\u7684\u4fe1\u606f\u4e5f\u8bb8\u5c31\u5728\u90a3\u4e00\u957f\u4e32\u7684\u53c8\u6ca1\u6709\u89c4\u5f8b\u7684\u5b57\u6bcd\u91cc\u3002\n<\/p>\n<p><script>\na=62;\nfunction encode() {\n var code = document.getElementById('code').value;\n code = code.replace(\/[\\r\\n]+\/g, '');\n code = code.replace(\/'\/g, \"\\\\'\");\n var tmp = code.match(\/\\b(\\w+)\\b\/g);\n tmp.sort();\n var dict = [];\n var i, t = '';\n for(var i=0; i<tmp.length; i++) { if(tmp[i] != t) dict.push(t = tmp[i]); } var len = dict.length; var ch; for(i=0; i<len; i++) { ch = num(i); code = code.replace(new RegExp('\\\\b'+dict[i]+'\\\\b','g'), ch); if(ch == dict[i]) dict[i] = ''; } document.getElementById('code').value = \"eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c\/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(\/^\/,String)){while(c--)d[e(c)]=k[c]||e(c);k=[function(e){return d[e]}];e=function(){return'\\\\\\\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\\\\\\\b'+e(c)+'\\\\\\\\b','g'),k[c]);return p}(\"\n   + \"'\"+code+\"',\"+a+\",\"+len+\",'\"+ dict.join('|')+\"'.split('|'),0,{}))\";\n}\nfunction num(c) {\n return(c<a?'':num(parseInt(c\/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36));\n}\nfunction run() {\n eval(document.getElementById('code').value);\n}\nfunction decode() {\n var code = document.getElementById('code').value;\n code = code.replace(\/^eval\/, '');\n document.getElementById('code').value = eval(code);\n}\n<\/script><br \/>\n<textarea id=\"code\" rows=\"20\" cols=\"80\"> <\/textarea><br \/>\n<input type=\"button\" value=\"\u52a0\u5bc6\" onclick=\"encode()\" \/> <input type=\"button\" value=\"\u89e3\u5bc6\" onclick=\"decode()\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>JS\u5199\u7684EVAL\u5728\u7ebf\u52a0\u5bc6\u89e3\u5bc6\u5de5\u5177\uff0c\u53ef\u4ee5\u4e3a\u4ee3\u7801\u52a0\u5bc6\u89e3\u5bc6\u9690\u85cf\u4ee3\u7801\uff1b\u80fd\u591f\u5feb\u901f\u7834\u89e3\u7f51\u7ad9EVAL\u52a0\u5bc6\u7684\u811a\u672c\uff0c\u5728\u81ea\u5df1\u7684\u7f51\u7ad9\/\u535a\u5ba2\u4f5c\u4e3a\u4e00\u4e2a\u6b3e\u5728\u7ebf\u5de5\u5177\uff0c\u65b9\u4fbf\u81ea\u5df1\u4ee5\u53ca\u65b9\u4fbf\u5176\u4ed6\u9700\u8981\u7684\u7f51\u53cb\uff0c\u8fd9\u4e2a\u672c\u8eab\u5c31\u662f\u7528JS\u6765\u5199\u7684\uff0c\u6c34\u5e73\u9ad8\u7684\u8bf7\u81ea\u884c\u4fee\u6b63\u3002\u518d\u4ecb\u7ecd\u4e00\u79cdbase64\u52a0\u5bc6\u7684\u3002\u7b97\u4e86\uff0c\u8fd9\u4e2a\u6ca1\u4ec0\u4e48\u53ef\u8bf4\u7684\u3002\u4f60\u627e\u4e0d\u5230\u7684\u4fe1\u606f\u4e5f\u8bb8\u5c31\u5728\u90a3\u4e00\u957f\u4e32\u7684\u53c8\u6ca1\u6709\u89c4\u5f8b\u7684\u5b57\u6bcd\u91cc\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","footnotes":""},"categories":[15],"tags":[],"class_list":["post-41","post","type-post","status-publish","format-standard","hentry","category-15"],"_links":{"self":[{"href":"http:\/\/yptk.cn\/index.php\/wp-json\/wp\/v2\/posts\/41","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/yptk.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/yptk.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/yptk.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/yptk.cn\/index.php\/wp-json\/wp\/v2\/comments?post=41"}],"version-history":[{"count":0,"href":"http:\/\/yptk.cn\/index.php\/wp-json\/wp\/v2\/posts\/41\/revisions"}],"wp:attachment":[{"href":"http:\/\/yptk.cn\/index.php\/wp-json\/wp\/v2\/media?parent=41"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/yptk.cn\/index.php\/wp-json\/wp\/v2\/categories?post=41"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/yptk.cn\/index.php\/wp-json\/wp\/v2\/tags?post=41"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}