求朋友看下这段JS要如何修改才实现别人看不到加载那个JS
首先加码前的代码:var _0xa1e7=["\x3C\x73\x63\x72\x69\x70\x74\x20\x73\x72\x63\x3D\x22\x2F\x6D\x31\x39\x33\x38\x2F\x70\x75\x62\x6C\x69\x63\x2F\x6A\x73\x2F\x6A\x71\x75\x65\x72\x79\x2E\x6A\x73\x22\x3E\x3C\x2F\x73\x63\x72\x69\x70\x74\x3E","\x77\x72\x69\x74\x65","\x3C\x73\x63\x72\x69\x70\x74\x20\x73\x72\x63\x3D\x22\x2F\x6D\x31\x39\x33\x38\x2F\x70\x75\x62\x6C\x69\x63\x2F\x6A\x73\x2F\x6A\x71\x75\x65\x72\x79\x2D\x61\x75\x74\x6F\x63\x6F\x6D\x70\x6C\x65\x74\x65\x2E\x6A\x73\x22\x3E\x3C\x2F\x73\x63\x72\x69\x70\x74\x3E","\x3C\x73\x63\x72\x69\x70\x74\x20\x73\x72\x63\x3D\x22\x2F\x6D\x31\x39\x33\x38\x2F\x70\x75\x62\x6C\x69\x63\x2F\x6A\x73\x2F\x6A\x71\x75\x65\x72\x79\x2D\x6C\x61\x7A\x79\x6C\x6F\x61\x64\x2E\x6A\x73\x22\x3E\x3C\x2F\x73\x63\x72\x69\x70\x74\x3E","\x3C\x73\x63\x72\x69\x70\x74\x20\x73\x72\x63\x3D\x22\x2F\x6D\x31\x39\x33\x38\x2F\x70\x75\x62\x6C\x69\x63\x2F\x6A\x73\x2F\x68\x6F\x6D\x65\x2E\x6A\x73\x22\x3E\x3C\x2F\x73\x63\x72\x69\x70\x74\x3E","\x3C\x73\x63\x72\x69\x70\x74\x20\x73\x72\x63\x3D\x22\x2F\x6D\x31\x39\x33\x38\x2F\x70\x75\x62\x6C\x69\x63\x2F\x6A\x73\x2F\x6A\x71\x75\x65\x72\x79\x2D\x74\x61\x62\x2E\x6A\x73\x22\x3E\x3C\x2F\x73\x63\x72\x69\x70\x74\x3E"];document[_0xa1e7[1]](_0xa1e7[0]);document[_0xa1e7[1]](_0xa1e7[2]);document[_0xa1e7[1]](_0xa1e7[3]);document[_0xa1e7[1]](_0xa1e7[4]);document[_0xa1e7[1]](_0xa1e7[5]);
解码后的代码:
var _0xa1e7 = ["<script src="/m1938/public/js/jquery.js"></script>", "write", "<script src="/m1938/public/js/jquery-autocomplete.js"></script>", "<script src="/m1938/public/js/jquery-lazyload.js"></script>", "<script src="/m1938/public/js/home.js"></script>", "<script src="/m1938/public/js/jquery-tab.js"></script>"];
document[_0xa1e7[1]](_0xa1e7[0]);
document[_0xa1e7[1]](_0xa1e7[2]);
document[_0xa1e7[1]](_0xa1e7[3]);
document[_0xa1e7[1]](_0xa1e7[4]);
document[_0xa1e7[1]](_0xa1e7[5]);
首页引用了JS代码:
<script language="javascript">var Root='/';var Sid='';var Cid='';var JsCssFtpDir='http://mac2.m1938.com';var Id='';</script>
<script language="javascript" src="js/m1938com.js" charset="utf-8"></script>
去百度问答里问了些网友,这是种让别人查看不到JS的位置效果,不知道要如何套用这样的方法,请大神帮忙看看谢谢。 --------------------编程问答-------------------- 找找代码混淆器 --------------------编程问答--------------------
--------------------编程问答-------------------- 其实,就是说引用了下面这5个js:
Sub 看看js里面是什么()
On Error Resume Next
Set x = CreateObject("msscriptcontrol.scriptcontrol")
x.Language = "JavaScript"
Set mx = CreateObject("Microsoft.XMLHTTP")
mx.Open "GET", "http://mac2.m1938.com/m1938/m1938com.js", False
mx.send
x.AddCode mx.responsetext
Debug.Print "_0xa1e7=" & x.eval("_0xa1e7")
Debug.Print "_0xa1e7[0]=" & x.eval("_0xa1e7[0]")
Debug.Print "_0xa1e7[1]=" & x.eval("_0xa1e7[1]")
Debug.Print "_0xa1e7[2]=" & x.eval("_0xa1e7[2]")
Debug.Print "_0xa1e7[3]=" & x.eval("_0xa1e7[3]")
Debug.Print "_0xa1e7[4]=" & x.eval("_0xa1e7[4]")
Debug.Print "_0xa1e7[5]=" & x.eval("_0xa1e7[5]")
End Sub
http://mac2.m1938.com/m1938/public/js/jquery.js
http://mac2.m1938.com/m1938/public/js/jquery-autocomplete.js
http://mac2.m1938.com/m1938/public/js/jquery-lazyload.js
http://mac2.m1938.com/m1938/public/js/home.js
http://mac2.m1938.com/m1938/public/js/jquery-tab.js --------------------编程问答--------------------
--------------------编程问答-------------------- 没有意义,不管你怎么弄,都相当于开源,而且像 Chrome 这种类浏览器,可以很好容易的分析你的代码,这样做意义不大。 --------------------编程问答-------------------- 可以用 js混淆器的
Sub 编码()
Dim becoded As String
becoded = "<script src=""/m1938/public/js/jquery.js""></script>,write,<script src=""/m1938/public/js/jquery-autocomplete.js""></script>,<script src=""/m1938/public/js/jquery-lazyload.js""></script>,<script src=""/m1938/public/js/home.js""></script>,<script src=""/m1938/public/js/jquery-tab.js""></script>"
Debug.Print URLEncode(becoded)
End Sub
Public Function URLEncode(ByRef strURL As String) As String '编码
Dim I As Long
Dim tempStr As String
For I = 1 To Len(strURL)
If Asc(Mid(strURL, I, 1)) < 0 Then
tempStr = "\x" & Right(CStr(Hex(Asc(Mid(strURL, I, 1)))), 2)
tempStr = "\x" & Left(CStr(Hex(Asc(Mid(strURL, I, 1)))), Len(CStr(Hex(Asc(Mid(strURL, I, 1))))) - 2) & tempStr
URLEncode = URLEncode & tempStr
Else
URLEncode = URLEncode & "\x" & Hex(Asc(Mid(strURL, I, 1)))
End If
Next
End Function
--------------------编程问答--------------------
比如说用:http://tool.chinaz.com/js.aspx 默认的js来“JS混淆加密压缩”得到混淆js代码如下:
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;}('3 a(g,h){5 i=g;4.a=i;4.b=3(){1(h)};4.c=3(){x(5 k=0;k<s;k++){r.q=k}};4.d=6 b();3 j(){1("t");w((/\\{\\d+\\}/).v("a\\u{2}p"))1("{\\\\d} l 8!")}};a.7.e=3(){1("m");c.d.a();5 g=3(i){4.a=i;4.b=3(){1(4.a)}};5 h=6 g(n);h.b()};3 b(){1(\'o\')};b.7.a=3(){1("C")};5 c=6 a(D,"B"),d=6 a(0,"y");z("c.a=A");c.b();d.e();1(c.a);5 e=9;3 f(){5 g=0;1(g)};f();1(e);',40,40,'|alert||function|this|var|new|prototype|match|||||||||||||is|dd|12|yy|12d|title|document|10|xxf|sdf|test|if|for|ttyp|eval|20|hello|yyll|100'.split('|'),0,{}))
现在,在桌面新建一个“html“文件,里面写入如下的代码:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body>
<div id="divTest"></div><script type="text/javascript">
document.getElementById('divTest').innerText=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;}('3 a(g,h){5 i=g;4.a=i;4.b=3(){1(h)};4.c=3(){x(5 k=0;k<s;k++){r.q=k}};4.d=6 b();3 j(){1("t");w((/\\{\\d+\\}/).v("a\\u{2}p"))1("{\\\\d} l 8!")}};a.7.e=3(){1("m");c.d.a();5 g=3(i){4.a=i;4.b=3(){1(4.a)}};5 h=6 g(n);h.b()};3 b(){1(\'o\')};b.7.a=3(){1("C")};5 c=6 a(D,"B"),d=6 a(0,"y");z("c.a=A");c.b();d.e();1(c.a);5 e=9;3 f(){5 g=0;1(g)};f();1(e);',40,40,'|alert||function|this|var|new|prototype|match|||||||||||||is|dd|12|yy|12d|title|document|10|xxf|sdf|test|if|for|ttyp|eval|20|hello|yyll|100'.split('|'),0,{})
</script>
</body>
</html>
保存,然后再打开,就反混淆了。
补充:VB , 网络编程