最近看了一下“风讯网站内容管理系统V4.0SP3免费版”,发现它后台(sysinfo.asp)有个使用Ajax获取官方最新版本信息和最新消息,点击右键查看源文件,它获取的内容显示在<div id="Foosun_server_version"></div>里,查找跟踪ID为“Foosun_server_version”的内容,找到$('Foosun_server_version').innerHTML=Str_Info;,现在就看到这样一段Javascript代码:
<script language="JavaScript">
<!--
function Get_Foosun_Server(){
var Userid="";
GetInfo(String.fromCharCode(83,121,115,67,104,101,99,107,86,101,114,46,97,115,112),String.fromCharCode(65,99,116,61,86,101,114));
GetInfo(String.fromCharCode(83,121,115,67,104,101,99,107,86,101,114,46,97,115,112),String.fromCharCode(65,99,116,61,78,101,119,115));
}
function GetInfo(url,Action){
var myAjax = new Ajax.Request(
url,
{method:'post',
parameters:Action,
onComplete:GetInfo_Receive
}
);
}
function GetInfo_Receive(OriginalRequest){
var Info="";
var Str_Info="";
Info=OriginalRequest.responseText.split("||");
if (Info[0]=="True"){
Str_Info=Info[2];
}else{
Str_Info="";
}
if (Info[1]=="Ver"){
$('Foosun_server_version').innerHTML=Str_Info;
}else if (Info[1]=="News"){
$('Foosun_server_announce').innerHTML=Str_Info;
}
}
window.onload=Get_Foosun_Server;
//-->
这里就看到它是调用GetInfo()使用Ajax访问获取数据,然后显示出来。问题在这里了,它调用GetInfo()没有传递访问的地址,使用alert(String.fromCharCode(83,121,115,67,104,101,99,107,86,101,114,46,97,115,112));发现这个就是访问的页面SysCheckVer.asp,String.fromCharCode(65,99,116,61,86,101,114)是Act=Ver,String.fromCharCode(65,99,116,61,78,101,119,115)是Act=News,使用了ASCII码隐藏访问的页面和参数,一个检测版本,一个检测最新消息。
现在就要看SysCheckVer.asp这个文件了,打开一看,哗,一大堆代码,看到一个过程Function Replace_MF_default_Flag(f_File_Cont,f_NewsID,PageType),咋一看,就有疑问了,这个东西干嘛,而且一大堆的代码,好长的过程,然后我就不看了。但是想想又是通过它访问版本信息的,不可能啊,就拉了一下代码,发现在代码最后才有一段
Str_Act = Trim(Request.Form("Act"))
If Str_Act = "" Then Str_Act = "Ver"
Select Case Str_Act
Case "Ver"
StrInfo = Str_get(1)
Case "News"
StrInfo = Str_get(2)
Case Else
StrInfo = "||"
End Select
StrInfo = Split(StrInfo,"||")
If StrInfo(0)="True" Then
Response.Write "True||"&Str_Act&"||"&StrInfo(1)
ElseIf StrInfo(0)="False" Then
Response.Write "False||"&Str_Act&"||"
End If
哗靠,现在上面那么长的那个过程是没有用的,一大堆看不明白,放在上面是为了迷惑想看它代码的人,一大堆看不明白的就不看了,好在我拉到下面看了一下。现在分析ASP执行,主要是调用Str_get()返回的值给变量StrInfo,然后Response.Write写出来。查找Str_get()过程,在FS_InterFace\MF_Function.asp里找到
Function Str_get(Number)
On Error Resume Next
Str_UserID = Server.UrlEncode(Session("SessionCode"))
ThisIp = Server.UrlEncode(Request.ServerVariables("LOCAL_ADDR"))
ThisDomain = Server.UrlEncode(Request.ServerVariables("SERVER_NAME"))
ThisPort = Server.UrlEncode(Request.ServerVariables("SERVER_PORT"))
Str_Para = "?"&"VUsIp="&ThisIp&"&VUsDN="&ThisDomain&"&VUsPort="&ThisPort&"&UserID="&Str_UserID
If Number = 1 Then:Str_get = GetInfo(Recv(Session("SessionComm"))&Recv(Session("SessionComV"))&Str_Para):Else:Str_get = GetInfo(Recv(Session("SessionComm"))&Recv(Session("SessionComN"))&Str_Para):End If
End Function
这里就可以看到它会收集服务器的IP、服务器域名、服务器端口、序列号。然后调用GetInfo()过程,查找得知GetInfo()在FS_Inc\Function.asp里
Function GetInfo(GetPath)
Dim http,ErrContentLength,Report,ContentLength,ErrContent
ErrContent = ""
On Error Resume Next
Response.Clear
Set http=Server.CreateObject("Microsoft.XMLHTTP")
If Err Then
Err.Clear
Set http = Server.CreateObject("Msxml2.XMLHTTP")
If Err Then
ErrContent = "服务器不支持XML对象"
Err.Clear
End If
End If
If ErrContent<>"" Then
GetInfo = "False||"&ErrContent
Else
http.Open "GET",GetPath,False
http.Send
If http.readyState<>4 Then
GetInfo = "False||读取失败"
Else
GetInfo = "True||"&http.ResponseText
End If
End If
End Function
这个GetInfo(GetPath)就是使用XML通过GET方式访问,然后返回信息。参数GetPath就是要访问的地址,再往回看Str_get(Number)调用GetInfo()是这样的Str_get = GetInfo(Recv(a)&Recv(b)&Str_Para),再查找过程Recv(),也是在FS_Inc\Function.asp里
Function Recv(Str_Number)
Dim Arr_Number,Str_Return,Temp_i
Arr_Number = Split(Str_Number,chr(108))
Str_Return = ""
For Temp_i = LBound(Arr_Number) To UBound(Arr_Number)
Str_Return = Str_Return & Chr(Arr_Number(Temp_i)+31)
Next
Recv = Str_Return
End Function
Recv(Str_Number)就是还原字符串,通过ASCII码加31。现在主要就是要知道Str_get(Number)里的Session("SessionCode")、Session("SessionComm")、Session("SessionComV")、Session("SessionComN")里什么值了,使用Response.Write写出来,得到
Session("SessionCode")="111-1111111111111"
Session("SessionComm")="73l85l85l81l27l16l16l81l66l84l84l81l80l83l85l15l71l80l80l84l86l79l15l79l70l85l16"
Session("SessionComV")="87l70l83l15l66l84l81"
Session("SessionComN")="79l70l88l84l15l66l84l81"
这些值通过Recv(Str_Number)还原,得到
Recv(Session("SessionComm"))="http://passport.foosun.net/"
Recv( Session("SessionComV"))="ver.asp"
Recv( Session("SessionComN"))="news.asp"
到此,就都可以清楚它检测版本的过程了,检测版本地址是http://passport.foosun.net/ver.asp,包括搜集系统信息;获取最新信息地址是http://passport.foosun.net/news.asp
这个CMS为了隐藏检测和搜集版本、版权,做足了手脚,处处隐藏,还来个无用的代码迷惑……
<script language="JavaScript">
<!--
function Get_Foosun_Server(){
var Userid="";
GetInfo(String.fromCharCode(83,121,115,67,104,101,99,107,86,101,114,46,97,115,112),String.fromCharCode(65,99,116,61,86,101,114));
GetInfo(String.fromCharCode(83,121,115,67,104,101,99,107,86,101,114,46,97,115,112),String.fromCharCode(65,99,116,61,78,101,119,115));
}
function GetInfo(url,Action){
var myAjax = new Ajax.Request(
url,
{method:'post',
parameters:Action,
onComplete:GetInfo_Receive
}
);
}
function GetInfo_Receive(OriginalRequest){
var Info="";
var Str_Info="";
Info=OriginalRequest.responseText.split("||");
if (Info[0]=="True"){
Str_Info=Info[2];
}else{
Str_Info="";
}
if (Info[1]=="Ver"){
$('Foosun_server_version').innerHTML=Str_Info;
}else if (Info[1]=="News"){
$('Foosun_server_announce').innerHTML=Str_Info;
}
}
window.onload=Get_Foosun_Server;
//-->
这里就看到它是调用GetInfo()使用Ajax访问获取数据,然后显示出来。问题在这里了,它调用GetInfo()没有传递访问的地址,使用alert(String.fromCharCode(83,121,115,67,104,101,99,107,86,101,114,46,97,115,112));发现这个就是访问的页面SysCheckVer.asp,String.fromCharCode(65,99,116,61,86,101,114)是Act=Ver,String.fromCharCode(65,99,116,61,78,101,119,115)是Act=News,使用了ASCII码隐藏访问的页面和参数,一个检测版本,一个检测最新消息。
现在就要看SysCheckVer.asp这个文件了,打开一看,哗,一大堆代码,看到一个过程Function Replace_MF_default_Flag(f_File_Cont,f_NewsID,PageType),咋一看,就有疑问了,这个东西干嘛,而且一大堆的代码,好长的过程,然后我就不看了。但是想想又是通过它访问版本信息的,不可能啊,就拉了一下代码,发现在代码最后才有一段
Str_Act = Trim(Request.Form("Act"))
If Str_Act = "" Then Str_Act = "Ver"
Select Case Str_Act
Case "Ver"
StrInfo = Str_get(1)
Case "News"
StrInfo = Str_get(2)
Case Else
StrInfo = "||"
End Select
StrInfo = Split(StrInfo,"||")
If StrInfo(0)="True" Then
Response.Write "True||"&Str_Act&"||"&StrInfo(1)
ElseIf StrInfo(0)="False" Then
Response.Write "False||"&Str_Act&"||"
End If
哗靠,现在上面那么长的那个过程是没有用的,一大堆看不明白,放在上面是为了迷惑想看它代码的人,一大堆看不明白的就不看了,好在我拉到下面看了一下。现在分析ASP执行,主要是调用Str_get()返回的值给变量StrInfo,然后Response.Write写出来。查找Str_get()过程,在FS_InterFace\MF_Function.asp里找到
Function Str_get(Number)
On Error Resume Next
Str_UserID = Server.UrlEncode(Session("SessionCode"))
ThisIp = Server.UrlEncode(Request.ServerVariables("LOCAL_ADDR"))
ThisDomain = Server.UrlEncode(Request.ServerVariables("SERVER_NAME"))
ThisPort = Server.UrlEncode(Request.ServerVariables("SERVER_PORT"))
Str_Para = "?"&"VUsIp="&ThisIp&"&VUsDN="&ThisDomain&"&VUsPort="&ThisPort&"&UserID="&Str_UserID
If Number = 1 Then:Str_get = GetInfo(Recv(Session("SessionComm"))&Recv(Session("SessionComV"))&Str_Para):Else:Str_get = GetInfo(Recv(Session("SessionComm"))&Recv(Session("SessionComN"))&Str_Para):End If
End Function
这里就可以看到它会收集服务器的IP、服务器域名、服务器端口、序列号。然后调用GetInfo()过程,查找得知GetInfo()在FS_Inc\Function.asp里
Function GetInfo(GetPath)
Dim http,ErrContentLength,Report,ContentLength,ErrContent
ErrContent = ""
On Error Resume Next
Response.Clear
Set http=Server.CreateObject("Microsoft.XMLHTTP")
If Err Then
Err.Clear
Set http = Server.CreateObject("Msxml2.XMLHTTP")
If Err Then
ErrContent = "服务器不支持XML对象"
Err.Clear
End If
End If
If ErrContent<>"" Then
GetInfo = "False||"&ErrContent
Else
http.Open "GET",GetPath,False
http.Send
If http.readyState<>4 Then
GetInfo = "False||读取失败"
Else
GetInfo = "True||"&http.ResponseText
End If
End If
End Function
这个GetInfo(GetPath)就是使用XML通过GET方式访问,然后返回信息。参数GetPath就是要访问的地址,再往回看Str_get(Number)调用GetInfo()是这样的Str_get = GetInfo(Recv(a)&Recv(b)&Str_Para),再查找过程Recv(),也是在FS_Inc\Function.asp里
Function Recv(Str_Number)
Dim Arr_Number,Str_Return,Temp_i
Arr_Number = Split(Str_Number,chr(108))
Str_Return = ""
For Temp_i = LBound(Arr_Number) To UBound(Arr_Number)
Str_Return = Str_Return & Chr(Arr_Number(Temp_i)+31)
Next
Recv = Str_Return
End Function
Recv(Str_Number)就是还原字符串,通过ASCII码加31。现在主要就是要知道Str_get(Number)里的Session("SessionCode")、Session("SessionComm")、Session("SessionComV")、Session("SessionComN")里什么值了,使用Response.Write写出来,得到
Session("SessionCode")="111-1111111111111"
Session("SessionComm")="73l85l85l81l27l16l16l81l66l84l84l81l80l83l85l15l71l80l80l84l86l79l15l79l70l85l16"
Session("SessionComV")="87l70l83l15l66l84l81"
Session("SessionComN")="79l70l88l84l15l66l84l81"
这些值通过Recv(Str_Number)还原,得到
Recv(Session("SessionComm"))="http://passport.foosun.net/"
Recv( Session("SessionComV"))="ver.asp"
Recv( Session("SessionComN"))="news.asp"
到此,就都可以清楚它检测版本的过程了,检测版本地址是http://passport.foosun.net/ver.asp,包括搜集系统信息;获取最新信息地址是http://passport.foosun.net/news.asp
这个CMS为了隐藏检测和搜集版本、版权,做足了手脚,处处隐藏,还来个无用的代码迷惑……