安全篇 ━━ ITlearner ASP探针 V1.2

服务器探针:IT运维的性能监控与优化工具 服务器探针是运维人员的眼睛和耳朵,它负责对服务器的健康状况进行实时监控与报告。探针技术能够持续检测服务器的性能指标,如CPU、内存使用率,以及应用服务的运行状态等。它不仅能够发现并警告潜在的服务中断,还能够辅助进行故障诊断和性能调优。通过对探针数据的分析,运维团队能够更好地理解系统运行趋势,为做出精准的优化决策提供依据。简而言之,服务器探针是确保服务稳定性和可靠性的重要工具。ASPCheck探针是专为ASP环境设计的服务器探针工具,它在监控和维护ASP应用程序方面表现出色。 阅读详情

最近在整理老的代码,漏洞一大堆;发现了有良心的黑客,上传了不干净的东西,但并没有操作什么。-

警告提示如下:

在您的系统磁盘上发现了一个可疑文件,它可能代表了是黑客成功入侵网站后种植的,建议您先确认文件合法性并处理。总体上,Webshell检测是根据文件行为威胁程度进行打分的,这个文件具备了一定的危险功能,本身具有一定的危险特征,但并不完全保证一定是一个网站后门,也可能是一些包含可以代码的正常网站文件,如果管理员自己部署放置的,可以在前台选择忽略或者标记为误报按钮。同时,如果被告警的文件是一个.log网站日志文件,常常是因为网站将http日志直接明文保存在文件中,这样存在一定的安全风险。建议将http日志的保存路径放置到非web路径下。

代码如下:

<%@ Language="VBScript" CODEPAGE="936"%>
<% Option Explicit %>
<% 
Response.Buffer = True
'####################################
'#                                  #
'#      ITlearner ASP探针 V1.2      #
'#                                  #
'#     http://www.itlearner.com     #
'#                                  #
'#    转载本程序时请保留这些信息    #
'#                                  #
'####################################
Dim startime
	 startime=timer()
Dim hx
Set hx = New Cls_AspCheck

class Cls_AspCheck

Public FileName,WebName,WebUrl,SysName,SysNameE,SysVersion

'检查组件是否被支持
Public Function IsObjInstalled(strClassString)
	On Error Resume Next
	Dim xTestObj
	Set xTestObj = Server.CreateObject(strClassString)
	If Err Then
		IsObjInstalled = False
	else	
		IsObjInstalled = True
	end if
	Set xTestObj = Nothing
End Function

'检查组件版本
Public Function getver(Classstr)
	On Error Resume Next
	Dim xTestObj
	Set xTestObj = Server.CreateObject(Classstr)
	If Err Then
		getver=""
	else	
	 	getver=xTestObj.version
	end if
	Set xTestObj = Nothing
End Function

Public Function GetObjInfo(startnum,endnum)
	dim i,Outstr
	for i=startnum to endnum
      	Outstr = Outstr & "<tr bgcolor=#FFFFFF align=center height=18><TD align=left>&nbsp;" & theTestObj(i,0) & ""
      	Outstr = Outstr & "<font color=#888888>&nbsp;"&theTestObj(i,1)&"</font>"
      	Outstr = Outstr & "</td>"
    	If Not IsObjInstalled(theTestObj(i,0)) Then 
      	Outstr = Outstr & "<td align=left>&nbsp;<font color=red><b>×</b></font></td>"
    	Else
      	Outstr = Outstr & "<td align=left>&nbsp;<font color=green><b>√</b></font> " & getver(theTestObj(i,0)) & "</td>"
		End If
      	Outstr = Outstr & "</tr>" & vbCrLf
	next
	Response.Write(Outstr)
End Function

Public Function cdrivetype(tnum)
    Select Case tnum
        Case 0: cdrivetype = "未知"
        Case 1: cdrivetype = "可移动磁盘"
        Case 2: cdrivetype = "本地硬盘"
        Case 3: cdrivetype = "网络磁盘"
        Case 4: cdrivetype = "CD-ROM"
        Case 5: cdrivetype = "RAM 磁盘"
    End Select
end function

Private Sub Class_Initialize()
	WebName="IT学习者"
	WebUrl="http://www.itlearner.com"
	SysName="ASP探针"		
	SysNameE="AspCheck"
	SysVersion="V1.2"
	FileName=Request.ServerVariables("SCRIPT_NAME")
End Sub

Public Function dtype(num)
    Select Case num
        Case 0: dtype = "未知"
        Case 1: dtype = "可移动磁盘"
        Case 2: dtype = "本地硬盘"
        Case 3: dtype = "网络磁盘"
        Case 4: dtype = "CD-ROM"
        Case 5: dtype = "RAM 磁盘"
    End Select
End Function

Public Function formatdsize(dsize)
    if dsize>=1073741824 then
		formatdsize=Formatnumber(dsize/1073741824,2) & " GB"
    elseif dsize>=1048576 then
    	formatdsize=Formatnumber(dsize/1048576,2) & " MB"
    elseif dsize>=1024 then
		formatdsize=Formatnumber(dsize/1024,2) & " KB"
	else
		formatdsize=dsize & "B"
	end if
End Function

Public Function formatvariables(str)
on error resume next
str = cstr(server.htmlencode(str))
formatvariables=replace(str,chr(10),"<br>")
End Function

Public Sub ShowFooter()
	dim Endtime,Runtime,OutStr
	Endtime=timer()
	OutStr = "<table border=0 cellpadding=0 cellspacing=1 class=tableBorder><tr><td align=center>"
	OutStr = OutStr & "<br><p>此程序是<a href=http://www.itlearner.com target=_blank>ITlearner</a>以<a href=http://www.ajiang.net target=_blank>Ajiang</a>和<a href=http://www.ccopus.com/ target=_blank>COCOON</a>的ASP探针的代码为原型,结合部分自已原创的代码精心编写而成。</p>"
	OutStr = OutStr & "<p>欢迎访问<a href=http://www.itlearner.com title=IT学习者之家 target=_blank>★IT学习者★</a>,<a href=http://www.itlearner.com/aspcheck/ target=_blank>下载最新版程序</a><br>" & vbcrlf
 	Runtime=FormatNumber((endtime-startime)*1000,2) 
	if Runtime>0 then
		if Runtime>1000 then
		  	OutStr = OutStr & "页面执行时间:约"& FormatNumber(runtime/1000,2) & "秒"
		else
			OutStr = OutStr & "页面执行时间:约"& Runtime & "毫秒"
		end if	
	end if
	OutStr = OutStr & "&nbsp;&nbsp;"
	OutStr = OutStr & "<a href='http://www.it" + "learner.com/aspcheck/' target='_blank'>ITlearner AspCheck " & SysVersion & "</a>"								
	OutStr = OutStr & "</p></td></tr></table>"
	Response.Write(OutStr)
End Sub
End class

Dim theTestObj(25,1)

	theTestObj(0,0) = "MSWC.AdRotator"
	theTestObj(1,0) = "MSWC.BrowserType"
	theTestObj(2,0) = "MSWC.NextLink"
	theTestObj(3,0) = "MSWC.Tools"
	theTestObj(4,0) = "MSWC.Status"
	theTestObj(5,0) = "MSWC.Counters"
	theTestObj(6,0) = "MSWC.PermissionChecker"
	theTestObj(7,0) = "WScript.Shell"
	theTestObj(8,0) = "Microsoft.XMLHTTP"
	theTestObj(9,0) = "Scripting.FileSystemObject"
	theTestObj(9,1) = "(FSO 文本文件读写)"
	theTestObj(10,0) = "ADODB.Connection"
	theTestObj(10,1) = "(ADO 数据对象)"
    
	theTestObj(11,0) = "SoftArtisans.FileUp"
	theTestObj(11,1) = "(SA-FileUp 文件上传)"
	theTestObj(12,0) = "SoftArtisans.FileManager"
	theTestObj(12,1) = "(SoftArtisans 文件管理)"
	theTestObj(13,0) = "LyfUpload.UploadFile"
	theTestObj(13,1) = "(刘云峰的文件上传组件)"
	theTestObj(14,0) = "Persits.Upload"
	theTestObj(14,1) = "(ASPUpload 文件上传)"
	theTestObj(15,0) = "w3.upload"
	theTestObj(15,1) = "(Dimac 文件上传)"

	theTestObj(16,0) = "JMail.SmtpMail"
	theTestObj(16,1) = "(Dimac JMail 邮件收发)</a>"
	theTestObj(17,0) = "CDONTS.NewMail"
	theTestObj(17,1) = "(虚拟 SMTP 发信)"
	theTestObj(18,0) = "Persits.MailSender"
	theTestObj(18,1) = "(ASPemail 发信)"
	theTestObj(19,0) = "SMTPsvg.Mailer"
	theTestObj(19,1) = "(ASPmail 发信)"
	theTestObj(20,0) = "DkQmail.Qmail"
	theTestObj(20,1) = "(dkQmail 发信)"
	theTestObj(21,0) = "Geocel.Mailer"
	theTestObj(21,1) = "(Geocel 发信)"
	theTestObj(22,0) = "IISmail.Iismail.1"
	theTestObj(22,1) = "(IISmail 发信)"
	theTestObj(23,0) = "SmtpMail.SmtpMail.1"
	theTestObj(23,1) = "(SmtpMail 发信)"
	theTestObj(24,0) = "SoftArtisans.ImageGen"
	theTestObj(24,1) = "(SA 的图像读写组件)"
	theTestObj(25,0) = "W3Image.Image"
	theTestObj(25,1) = "(Dimac 的图像读写组件)"


%>
<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<TITLE>IT学习者ASP探针(ITlearner AspCheck) <%=hx.SysVersion%>-www.ITlearner.com</TITLE>
<style>
<!--
A       { COLOR: #000000; TEXT-DECORATION: none}
A:hover { COLOR: green}
body,td,span { font-size: 9pt}
.input  { BACKGROUND-COLOR: #ffffff;BORDER:#0099CF 1px solid;FONT-SIZE: 9pt}
.backc  { BACKGROUND-COLOR: #0099CF;BORDER:#0099CF 1px solid;FONT-SIZE: 9pt;color:white}
.PicBar { background-color: #0099CF; border: 1px solid #000000; height: 12px;}
.tableBorder {BORDER-RIGHT: #183789 1px solid; BORDER-TOP: #183789 1px solid; BORDER-LEFT: #183789 1px solid; BORDER-BOTTOM: #183789 1px solid; BACKGROUND-COLOR: #ffffff; WIDTH: 600;}
.divcenter {position:absolute;height:30px;z-index:1000;}
-->
</STYLE>
<SCRIPT language="JavaScript" runat="server">
	function getEngVerJs(){
		try{
			return ScriptEngineMajorVersion() +"."+ScriptEngineMinorVersion()+"."+ ScriptEngineBuildVersion() + " ";
		}catch(e){
			return "服务器不支持此项检测";
		}
		
	}
</SCRIPT>
<SCRIPT language="VBScript" runat="server">
	Function getEngVerVBS()
		getEngVerVBS=ScriptEngineMajorVersion() &"."&ScriptEngineMinorVersion() &"." & ScriptEngineBuildVersion() & " "
	End Function
</SCRIPT>
<script language="javascript">
<!--
function Checksearchbox()
{
if(form1.classname.value == "")
{
	alert("请输入你要检测的组件名!");
	form1.classname.focus();
	return false;
}
}
function showsubmenu(sid)
{
whichEl = eval("submenu" + sid);
if (whichEl.style.display == "none")
{
eval("submenu" + sid + ".style.display=\"\";");
eval("txt" + sid + ".innerHTML=\"<a href='#' title='关闭此项'><font face='Wingdings' color=#FFFFFF>x</font></a>\";");
}
else
{
eval("submenu" + sid + ".style.display=\"none\";");
eval("txt" + sid + ".innerHTML=\"<a href='#' title='打开此项'><font face='Wingdings' color=#FFFFFF>y</font></a>\";");
}
}
-->
</SCRIPT>
</HEAD>
<BODY leftmargin="50">
<a name=top></a>
<table width="600" border="0" cellpadding="0" cellspacing="0">
  <tr> 
    <td align="center"><p><font size="6"><strong><a href="http://www.itlearner.com/aspcheck/" target="_blank">ASP 
        探针</a></strong></font> - <%=hx.SysVersion%>(<a href="http://www.itlearner.com" target="_blank">ITlearner</a>)</p>
      </td>
  </tr>
</table>
<br>
<%
dim action
action=request("action")
if action="testzujian" then
call ObjTest2
end if

Call menu
Call SystemTest
Call ObjTest
Call CalculateTest
Call DriveTest
Call SpeedTest
hx.ShowFooter
Set hx= nothing

%>
<%Sub menu%>
选项:<a href="#SystemTest">服务器有关参数</a> | <a href="#ObjTest">服务器组件情况</a> | <a href="#CalcuateTest">服务器运算能力</a> 
| <a href="#DriveTest">服务器磁盘信息</a> | <a href="#SpeedTest">服务器连接速度</a> 
<%End Sub%>
<%Sub smenu(i)%>
<a href="#top" title="返回顶部"><font face='Webdings' color=#FFFFFF>5</font></a> <span id=txt<%=i%> name=txt<%=i%>><a href='#' title='关闭此项'><font face='Wingdings' color=#FFFFFF>x</font></a></span> 
<%End Sub%>
<%Sub SystemTest
on error resume next
%>
<a name="SystemTest"></a> 
<table border="0" cellpadding="0" cellspacing="1" class="tableBorder">
  <tr> 
    <td height="25" align="center" bgcolor="#0099CF" onclick="showsubmenu(0)"><font color=#FFFFFF><strong>服务器有关参数</strong></font> 
      <%Call smenu(0)%></td>
  </tr>
  <tr> 
    <td style="display" id='submenu0'><table border=0 width=100% cellspacing=1 cellpadding=3 bgcolor="#0099CF">
        <tr bgcolor="#FFFFFF" height=18> 
          <td width="130">&nbsp;服务器名</td>
          <td width="170" height="18">&nbsp;<%=Request.ServerVariables("SERVER_NAME")%></td>
          <td width="130" height="18">&nbsp;服务器操作系统</td>
          <td width="170" height="18">&nbsp;<%=Request.ServerVariables("OS")%></td>
        </tr>
        <tr bgcolor="#FFFFFF" height=18> 
          <td>&nbsp;服务器IP</td>
          <td>&nbsp;<%=Request.ServerVariables("LOCAL_ADDR")%></td>
          <td>&nbsp;服务器端口</td>
          <td>&nbsp;<%=Request.ServerVariables("SERVER_PORT")%></td>
        </tr>
        <tr bgcolor="#FFFFFF" height=18> 
          <td>&nbsp;服务器时间</td>
          <td>&nbsp;<%=now%></td>
          <td>&nbsp;服务器CPU数量</td>
          <td>&nbsp;<%=Request.ServerVariables("NUMBER_OF_PROCESSORS")%> 
            个</td>
        </tr>
        <tr bgcolor="#FFFFFF" height=18> 
          <td>&nbsp;IIS版本</td>
          <td height="18">&nbsp;<%=Request.ServerVariables("SERVER_SOFTWARE")%></td>
          <td height="18">&nbsp;脚本超时时间</td>
          <td height="18">&nbsp;<%=Server.ScriptTimeout%> 秒</td>
        </tr>
        <tr bgcolor="#FFFFFF" height=18> 
          <td>&nbsp;Application变量</td>
          <td height="18">&nbsp;<%Response.Write(Application.Contents.Count & "个 ")
		  if Application.Contents.count>0 then Response.Write("[<a href=""?action=showapp"">遍历Application变量</a>]")%>
          </td>
          <td height="18">&nbsp;Session变量<br> </td>
          <td height="18">&nbsp;<%Response.Write(Session.Contents.Count&"个 ")
		  if Session.Contents.count>0 then Response.Write("[<a href=""?action=showsession"">遍历Session变量</a>]")%>
          </td>
        </tr>
        <tr bgcolor="#FFFFFF" height=18> 
          <td height="18">&nbsp;<a href="?action=showvariables">所有服务器参数</a></td>
          <td height="18">&nbsp;<%Response.Write(Request.ServerVariables.Count&"个 ")
		  if Request.ServerVariables.Count>0 then Response.Write("[<a href=""?action=showvariables"">遍历服务器参数</a>]")%>
          </td>
          <td height="18">&nbsp;服务器环境变量</td>
          <td height="18">&nbsp;<%
			dim WshShell,WshSysEnv
			Set WshShell = server.CreateObject("WScript.Shell")
			Set WshSysEnv = WshShell.Environment
			if err then
				Response.Write("服务器不支持WScript.Shell组件")
				err.clear
			else
				Response.Write(WshSysEnv.count &"个 ")
				if WshSysEnv.count>0 then Response.Write("[<a href=""?action=showwsh"">遍历环境变量</a>]") 
		 	end if
		  %>		  
		  </td>
        </tr>
        <tr bgcolor="#FFFFFF" height=18> 
          <td align=left>&nbsp;服务器解译引擎</td>
          <td height="18" colspan="3">&nbsp;JScript: <%= getEngVerJs() %> | VBScript: <%=getEngVerVBS()%></td>
        </tr>
        <tr bgcolor="#FFFFFF" height=18> 
          <td align=left bgcolor="#FFFFFF">&nbsp;本文件实际路径</td>
          <td height="8" colspan="3" bgcolor="#FFFFFF">&nbsp;<%=server.mappath(Request.ServerVariables("SCRIPT_NAME"))%></td>
        </tr>
      </table>
      <%
if action="showapp" or action="showsession" or action="showvariables" or action="showwsh" then
	showvariable(action)
end if
%>
    </td>
  </tr>
</table>
<br>
<%
End Sub

Sub showvariable(action)
%>
<table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#0099CC">
  <tr bgcolor="#99CCFF"> 
    <td colspan="2"> &nbsp;&nbsp;
      <%
	on error resume next
	dim Item,xTestObj,outstr
	if action="showapp" then
		Response.Write("<font face='Webdings'>4</font> 遍历Application变量")
		set xTestObj=Application.Contents
	elseif action="showsession" then
		Response.Write("<font face='Webdings'>4</font> 遍历Session变量")
		set xTestObj=Session.Contents
	elseif action="showvariables" then
		Response.Write("<font face='Webdings'>4</font> 遍历服务器参数")
		set xTestObj=Request.ServerVariables
	elseif action="showwsh" then
		Response.Write("<font face='Webdings'>4</font> 遍历环境变量")
		dim WshShell
		Set WshShell = server.CreateObject("WScript.Shell")
		set xTestObj=WshShell.Environment
	end if
		Response.Write "(<a href="&hx.FileName&">关闭</a>)"
	%>
    </td>
  </tr>
  <tr bgcolor="#FFFFFF"> 
    <td width="130">变量名</td>
    <td width="470">值</td>
  </tr>
  <%
	if err then
		outstr = "<tr bgcolor=#FFFFFF><td colspan=2>没有符合条件的变量</td></tr>"
		err.clear
	else
		dim w
		if action="showwsh" then
			for each Item in xTestObj
				w=split(Item,"=")
				outstr = outstr & "<tr bgcolor=#FFFFFF>"
				outstr = outstr & "<td>" & w(0) & "</td>" 
				outstr = outstr & "<td>" & w(1) & "</td>" 
				outstr = outstr & "</tr>" 		
			next
		else
			dim i
			for each Item in xTestObj
				outstr = outstr & "<tr bgcolor=#FFFFFF>"
				outstr = outstr & "<td>" & Item & "</td>" 				
				outstr = outstr & "<td>"
				if IsArray(xTestObj(Item)) then		
					for i=0 to ubound(xTestObj(Item))-1
					outstr = outstr & hx.formatvariables(xTestObj(Item)(i)) & "<br>"
					next
				else
					outstr = outstr & hx.formatvariables(xTestObj(Item))
				end if			
				outstr = outstr & "</td>"
				outstr = outstr & "</tr>" 
			next
		end if
	end if
		Response.Write(outstr)	
		set xTestObj=nothing
		%>
</table>
<%End Sub%>
<%Sub ObjTest%>
<a name="ObjTest"></a>
<table border="0" cellpadding="0" cellspacing="1" class="tableBorder">
  <tr> 
    <td height="25" align="center" bgcolor="#0099CF" onclick="showsubmenu(1)"><strong><font color="#FFFFFF">服务器</font></strong><font color=#FFFFFF><strong>组件情况</strong></font> 
      <%Call smenu(1)%></td>
  </tr>
  <tr> 
    <td style="display" id='submenu1'><table border=0 width=100% cellspacing=1 cellpadding=3 bgcolor="#0099CF">
        <tr bgcolor="#99CCFF" height=18> 
          <td colspan="2">&nbsp;&nbsp;<font face='Webdings'>4</font> IIS自带的ASP组件</td>
        </tr>
        <tr bgcolor="#FFFFFF" height=18> 
          <td width=450 align="center">组 件 名 称</td>
          <td width=150 align="center">支持及版本</td>
        </tr>
        <%hx.GetObjInfo 0,10%>
      </table>
      <table border=0 width=100% cellspacing=1 cellpadding=3 bgcolor="#0099CF">
        <tr bgcolor="#99CCFF" height=18> 
          <td colspan="2">&nbsp;&nbsp;<font face='Webdings'>4</font> 常见的文件上传和管理组件 </td>
        </tr>
        <tr bgcolor="#FFFFFF" height=18> 
          <td width=450 align="center">组 件 名 称</td>
          <td width=150 align="center">支持及版本</td>
        </tr>
        <%hx.GetObjInfo 11,15%>
      </table>
      <table border=0 width=100% cellspacing=1 cellpadding=3 bgcolor="#0099CF">
        <tr bgcolor="#99CCFF" height=18> 
          <td colspan="2">&nbsp;&nbsp;<font face='Webdings'>4</font> 常见的收发邮件组件</td>
        </tr>
        <tr bgcolor="#FFFFFF" height=18> 
          <td width=450 align="center">组 件 名 称</td>
          <td width=150 align="center">支持及版本</td>
        </tr>
        <%hx.GetObjInfo 16,23%>
      </table>
      <table border=0 width=100% cellspacing=1 cellpadding=3 bgcolor="#0099CF">
        <tr bgcolor="#99CCFF" height=18> 
          <td colspan="2">&nbsp;&nbsp;<font face='Webdings'>4</font> 图像处理组件</td>
        </tr>
        <tr bgcolor="#FFFFFF" height=18> 
          <td width=450 align="center">组 件 名 称</td>
          <td width=150 align="center">支持及版本</td>
        </tr>
        <%hx.GetObjInfo 24,25%>
      </table>
      <table border=0 width=100% cellspacing=1 cellpadding=3  bgcolor="#0099CF">
        <tr> 
          <td bgcolor="#99CCFF">&nbsp;&nbsp;<font face='Webdings'>4</font> 其他组件支持情况检测 </td>
        </tr>
        <FORM action=?action=testzujian method=post id=form1 name=form1 onSubmit="JavaScript:return Checksearchbox();">
          <tr> 
            <td height=30 bgcolor="#FFFFFF">输入你要检测的组件的ProgId或ClassId 
              <input class=input type=text value="" name="classname" size=40> 
              <INPUT type=submit value="确定" class=backc id=submit1 name=submit1> 
            </td>
          </tr>
        </FORM>
      </table></td>
  </tr>
</table>
<br>
<%
End Sub
Sub ObjTest2
	Dim strClass
    strClass = Trim(Request.Form("classname"))
    If strClass <> "" then
	
    Response.Write "<br>您指定的组件的检查结果:"
      If Not hx.IsObjInstalled(strClass) then 
        Response.Write "<br><font color=red>很遗憾,该服务器不支持" & strclass & "组件!</font>"
      Else
        Response.Write "<br><font color=green>"
		Response.Write " 恭喜!该服务器支持" & strclass & "组件。"
		If hx.getver(strclass)<>"" then
		Response.Write " 该组件版本是:" & hx.getver(strclass)
		End if
		Response.Write "</font>"
      End If
      Response.Write "<br>"
    end if
	
	Response.Write "<p><a href="&hx.FileName&">返回</a></p>"
	Response.End
End Sub
Sub CalculateTest
%><a name="CalcuateTest"></a>
<table border="0" cellpadding="0" cellspacing="1" class="tableBorder">
  <tr> 
    <td height="25" align="center" bgcolor="#0099CF" onclick="showsubmenu(2)"><font color="#FFFFFF"><strong>服务器运算能力</strong></font> 
      <%Call smenu(2)%></td>
  </tr>
  <tr> 
    <td style="display" id='submenu2'> <table border=0 width=100% cellspacing=1 cellpadding=3 bgcolor="#0099CF">
        <tr bgcolor="#99CCFF" height=18> 
          <td colspan="3">&nbsp;&nbsp;<font face='Webdings'>4</font> 让服务器执行50万次加法(<font color="#000000">整数运算</font>)和20万次开方(<font color="#000000">浮点运算</font>),记录其所使用的时间。 
          </td>
        </tr>
        <tr height=18> 
          <td width="400" align=center bgcolor="#FFFFFF"><font color="#000000">可 
            供 参 考 的 服 务 器 列 表</font></td>
          <td width="100"  align=center bgcolor="#FFFFFF"><font color="#000000">整数运算</font> 
          </td>
          <td width="100" align=center bgcolor="#FFFFFF"><font color="#000000">浮点运算</font></td>
        </tr>
        <tr bgcolor="#FFFFFF" height=18> 
          <td align=left>&nbsp;ITlearner公司的电脑&nbsp;(CPU:Athlon1.6G&nbsp; 内存:512M)</td>
          <td> &nbsp;269.53 毫秒</td>
          <td> &nbsp;328.13 毫秒 </td>
        </tr>
        <tr bgcolor="#FFFFFF" height=18> 
          <td align=left>&nbsp;ITlearner家里的电脑&nbsp;(CPU:Celeron 2G&nbsp; 内存:512M)</td>
          <td>&nbsp;250.00 毫秒 </td>
          <td>&nbsp;296.88 毫秒</td>
        </tr>
        <tr bgcolor="#FFFFFF" height=18> 
          <td align=left>&nbsp;公司的网站服务器&nbsp; (CPU:XEON2.4G 内存:2G)</td>
          <td>&nbsp;281.25 毫秒 </td>
          <td>&nbsp;234.38 毫秒</td>
        </tr>
        <tr bgcolor="#FFFFFF" height=18> 
          <td align=left>&nbsp;中国频道虚拟主机&nbsp; [2004/6/18 9:10]</td>
          <td>&nbsp;375.00 毫秒</td>
          <td>&nbsp;328.13 毫秒</td>
        </tr>
        <%
	dim i,t1,t2,tempvalue,runtime1,runtime2
	'开始计算50万次加法所需时间
	t1=timer()
	for i=1 to 500000
		tempvalue= 1 + 1
	next
	t2=timer()
	runtime1=formatnumber((t2-t1)*1000,2)
	
	'开始计算20万次开方所需时间
	t1=timer()
	for i=1 to 200000
		tempvalue= 2^0.5
	next
	t2=timer()
	runtime2=formatnumber((t2-t1)*1000,2)
%>
        <tr bgcolor="#FFFFFF" height=25> 
          <td align=left>&nbsp;<font color=red>您正在使用的这台服务器</font>&nbsp; <INPUT name="button" type="button" class=backc onclick="document.location.href='<%=hx.FileName%>'" value="重新测试"> 
          </td>
          <td>&nbsp;<font color=red><%=runtime1%> 毫秒</font></td>
          <td>&nbsp;<font color=red><%=runtime2%> 毫秒</font></td>
        </tr>
      </table></td>
  </tr>
</table>
<br>
<%
End Sub
Sub DriveTest
	On Error Resume Next
	Dim fo,d,xTestObj
	set fo=Server.Createobject("Scripting.FileSystemObject")
	set xTestObj=fo.Drives
%>
<a name="DriveTest"></a>
<table border="0" cellpadding="0" cellspacing="1" class="tableBorder">
  <tr>
    <td height="25" align="center" bgcolor="#0099CF" onclick="showsubmenu(4)"><font color="#FFFFFF"><strong>服务器磁盘信息 
      </strong></font> 
      <%Call smenu(4)%></td>
  </tr>
  <tr>
    <td style="display" id='submenu4'> 
		<%if hx.IsObjInstalled("Scripting.FileSystemObject") then%>
      <table border=0 width=100% cellspacing=1 cellpadding=3 bgcolor="#0099CF">
        <tr bgcolor="#99CCFF" height=18> 
          <td colspan="7">&nbsp;&nbsp;<font face='Webdings'>4</font> 服务器磁盘信息</td>
        </tr>
        <tr height=18 bgcolor="#FFFFFF" align=center> 
		  <td width="90">磁盘类型</td>
          <td width="40">盘符</td>
          <td width="30">可用</td>
          <td width="100">卷标</td>
          <td width="80">文件系统</td>
          <td width="130">可用空间</td>
		  <td width="130">总空间</td>
        </tr>
		<%
	for each d in xTestObj
		Response.write "<tr height=18 bgcolor=#FFFFFF>"
		Response.write "<td>&nbsp;"&hx.dtype(d.DriveType)&"</td>"
		Response.write "<td>&nbsp;"&d.DriveLetter&"</td>"		
		if d.DriveLetter = "A" then
		Response.Write "<td colspan=6>&nbsp;为防止影响服务器,不检查软驱</td>"
		else
		Response.write "<td align=center> "
		if d.isready then
			Response.Write "√"
			Response.write "</td>"
			Response.write "<td>&nbsp;"&d.VolumeName&"</td>"
			Response.write "</td>"		
			Response.write "<td>&nbsp;"&d.FileSystem&"</td>"	
			Response.write "<td>&nbsp;"&hx.formatdsize(d.FreeSpace)&"</td>"
			Response.write "<td>&nbsp;"&hx.formatdsize(d.TotalSize)&"</td>"
		else
			Response.Write "×"
			Response.Write "<td colspan=4>&nbsp;可能是磁盘有问题,或者程序没有读取权限</td>"			
		end if			 
		end if		 
	next%>
      </table>
	  <%
	Dim filePath,fileDir,fileDrive
	filePath = server.MapPath(".")
	set fileDir = fo.GetFolder(filePath)
	set fileDrive = fo.GetDrive(fileDir.Drive)
	  %>
      <table border=0 width=100% cellspacing=1 cellpadding=3 bgcolor="#0099CF">
        <tr bgcolor="#99CCFF" height=18> 
          <td colspan="6">&nbsp;&nbsp;<font face='Webdings'>4</font> 当前文件夹信息 (<%=filePath%>)</td>
        </tr>
        <tr height=18 bgcolor="#FFFFFF" align=center> 
          <td width="100">已用空间</td>
          <td width="100">可用空间</td>
          <td width="70">文件夹数</td>
          <td width="70">文件数</td>
          <td width="130">创建时间</td>
          <td width="130">修改时间</td>
        </tr>
        <%
		Response.write "<tr height=18 bgcolor=#FFFFFF align=center>"
		Response.write "<td>"&hx.formatdsize(fileDir.Size)&"</td>"
		Response.write "<td>"
		Response.write hx.formatdsize(fileDrive.AvailableSpace)
		if err then
		Response.write "没有权限读取"
		error.clear
		end if
		Response.write "</td>"
		Response.write "<td>"&fileDir.SubFolders.Count&"</td>"
		Response.write "<td>"&fileDir.Files.Count&"</td>"						
		Response.write "<td>"&fileDir.DateCreated&"</td> "
		Response.write "<td>"&fileDir.DateLastModified&"</td> "
	
	Dim i,t1,t2,runtime,TestFileName
	Dim tempfo
	t1= timer()
	TestFileName=server.mappath("ITlearner_Test.txt")
	for i=1 to 30
	set tempfo=fo.CreateTextFile(TestFileName,true)
		tempfo.WriteLine "It's a test file."
	set tempfo=nothing
	set tempfo=fo.OpenTextFile(TestFileName,8,0)
		tempfo.WriteLine "It's a test file."
	set tempfo=nothing
	set tempfo=fo.GetFile(TestFileName)
		tempfo.delete True
	set tempfo=nothing	
	next
	t2=	timer()
	runtime=formatnumber((t2-t1)*1000,2)		 
%>
      </table>
      <table border=0 width=100% cellspacing=1 cellpadding=3 bgcolor="#0099CF">
        <tr bgcolor="#99CCFF" height=18> 
          <td colspan="2">&nbsp;&nbsp;<font face='Webdings'>4</font> 磁盘文件操作速度测试 (重复创建、写入、追加和删除文本文件30次,记录其所使用的时间)</td>
        </tr>
        <tr height=18> 
          <td width="400" align=center bgcolor="#FFFFFF"><font color="#000000">可 
            供 参 考 的 服 务 器 列 表</font></td>
          <td width="200"  align=center bgcolor="#FFFFFF"><font color="#000000">完成时间</font></td>
        </tr>
        <tr bgcolor="#FFFFFF" height=18> 
          <td align=left>&nbsp;ITlearner公司的电脑&nbsp;(CPU:Athlon1.6G&nbsp; 内存:512M)</td>
          <td>&nbsp;218.75 ~ 269.53 毫秒 </td>
        </tr>
        <tr bgcolor="#FFFFFF" height=18> 
          <td align=left> &nbsp;ITlearner家里的电脑&nbsp;(CPU:Celeron 2G&nbsp; 内存:512M)</td>
          <td>&nbsp;203.13 ~ 250.00 毫秒</td>
        </tr>
        <tr bgcolor="#FFFFFF" height=18> 
          <td align=left>&nbsp;公司的网站服务器&nbsp; (CPU:XEON2.4G 内存:2G)</td>
          <td>&nbsp;187.50 ~ 234.38 毫秒</td>
        </tr>
        <tr bgcolor="#FFFFFF" height=18> 
          <td align=left>&nbsp;中国频道虚拟主机&nbsp; [2004/6/18 9:10]</td>
          <td>&nbsp;656.25 ~ 718.75 毫秒</td>
        </tr>
        <tr bgcolor="#FFFFFF" height=25> 
          <td align=left>&nbsp;<font color=red>您正在使用的这台服务器</font>&nbsp; <INPUT name="button2" type="button" class=backc onclick="document.location.href='<%=hx.FileName%>'" value="重新测试"> 
          </td>
          <td>&nbsp;<font color=red><%=runtime%> 毫秒</font></td>
        </tr>
      </table>
      <%
	  	else
		Response.write "&nbsp;您的服务器或租用的空间不支持FSO组件,无法进行此项测试!"
	end if%>
	  </td>
  </tr>
</table>
<br>
<%
End Sub
Sub SpeedTest
Response.Flush()
%>
<a name="SpeedTest"></a>
<%	if action="SpeedTest" then%>
<div id="testspeed"> 
  <table width="200" border="0" cellspacing="0" cellpadding="0" class="divcenter">
    <tr> 
      <td height="30" align=center><p><font color="#000000"><span id=txt1>网速测试中,请稍候...</span></font></p></td>
    </tr>
  </table>
</div>
<%	end if%>
<table border="0" cellpadding="0" cellspacing="1" bgcolor="#0099CF" class="tableBorder">
  <tr> 
    <td height="25" align="center" bgcolor="#0099CF" onclick="showsubmenu(3)"><font color="#FFFFFF"><strong>服务器连接速度</strong></font> 
      <%smenu(3)%>
    </td>
  </tr>
  <tr> 
    <td bgcolor="#F8F9FC" style="display" id='submenu3'> <table width="100%" border="0" cellspacing=1 cellpadding=3 bgcolor="#0099CF">
        <tr bgcolor="#FFFFFF"> 
          <td width="80">接入设备</td>
          <td width="420">&nbsp;连接速度(理想值)</td>
          <td width="100">下载速度(理想值)</td>
        </tr>
<tr bgcolor="#FFFFFF"> 
          <td>56k Modem</td>
          <td><img align=absmiddle class=PicBar width='1%'> 56 Kbps</td><td>&nbsp;7.0 k/s</td>
        </tr>
        <tr bgcolor="#FFFFFF"> 
          <td>64k ISDN</td>
          <td><img align=absmiddle class=PicBar width='1%'> 64 Kbps</td><td>&nbsp;8.0 k/s</td>
        </tr>
        <tr bgcolor="#FFFFFF"> 
          <td>512k ADSL</td>
          <td><img align=absmiddle class=PicBar width='5%'> 512 Kbps</td><td>&nbsp;64.0 k/s</td>
        </tr>
        <tr bgcolor="#FFFFFF"> 
          <td height="19">1.5M Cable</td>
          <td><img align=absmiddle class=PicBar width='15%'> 1500 Kbps</td><td>&nbsp;187.5 k/s</td>
        </tr>
        <tr bgcolor="#FFFFFF"> 
          <td>5M FTTP</td>
          <td><img align=absmiddle class=PicBar width='50%'> 5000 Kbps</td><td>&nbsp;625.0 k/s</td>
        </tr>
        <tr bgcolor="#FFFFFF"> 
          <td>当前连接速度</td>
          <%
	if action="SpeedTest" then
		dim i
		Response.Write("<script language=""JavaScript"">var tSpeedStart=new Date();</script>")	
		Response.Write("<!--") & chr(13) & chr(10)
		for i=1 to 1000
		Response.Write("####################################################################################################") & chr(13) & chr(10)
		next
		Response.Write("-->") & chr(13) & chr(10)
		Response.Write("<script language=""JavaScript"">var tSpeedEnd=new Date();</script>") & chr(13) & chr(10)		
		Response.Write("<script language=""JavaScript"">")
		Response.Write("var iSpeedTime=0;iSpeedTime=(tSpeedEnd - tSpeedStart) / 1000;")
		Response.Write("if(iSpeedTime>0) iKbps=Math.round(Math.round(100 * 8 / iSpeedTime * 10.5) / 10); else iKbps=10000 ;")
		Response.Write("var iShowPer=Math.round(iKbps / 100);")		
		Response.Write("if(iShowPer<1) iShowPer=1;  else if(iShowPer>82)   iShowPer=82;")
		Response.Write("</script>") & chr(13) & chr(10)		
		Response.Write("<script language=""JavaScript"">") 
		Response.Write("document.write('<td><img align=absmiddle class=PicBar width=""' + iShowPer + '%""> ' + iKbps + ' Kbps');")
		Response.Write("</script>") & chr(13) & chr(10)
		Response.Write("</td><td>&nbsp;<a href='?action=SpeedTest' title=测试连接速度><u>")
		Response.Write("<script language=""JavaScript"">")
		Response.Write("document.write(Math.round(iKbps/8*10)/10+ ' k/s');")		
		Response.Write("</script>") & chr(13) & chr(10)				
		Response.Write 	"</u></a></td>"
%>
<script>
txt1.innerHTML="网速测试完毕!"
testspeed.style.visibility="hidden"
</script>
<%
	else
		Response.Write "<td></td><td>&nbsp;<a href='?action=SpeedTest' title=测试连接速度><u>开始测试</u></a></td>"
	end if
%>
        </tr>
      </table></td>
  </tr>
</table>
<%End Sub%>
</BODY>
</HTML>

全面探针工具集合:从asp到aspx的服务器兼容性检测 脚本语言是一种编程语言,用于编写一系列指令以自动化完成特定任务。与编译型语言不同,脚本语言通常不需要编译过程,可以在解释器的辅助下直接执行。它们的特点包括简洁性、易用性和快速开发能力,这些特点使得脚本语言在自动化脚本、网页开发和服务器管理等方面广泛应用。脚本语言的主要优势在于其开发速度快、可移植性强和对初学者友好。它的劣势通常体现在运行效率和性能上,通常脚本语言的运行速度要低于编译型语言,尤其是在处理大量数据或复杂算法时。 阅读详情

相关推荐

ASP探针

ASP探针,查看服务器配置情况

asp探针,用来检测Web服务器相关特性

下面代码是Asp探针aspCheck.asp%@ Language="VBScript" CODEPAGE="936"%>% Option Explicit %>% Response.Buffer = TrueDim startime     startime=timer()Dim hxSet hx = New Cls_AspCheckclass Cls_AspCheckPublic 

yanick技术博客 3777

asp.net探针程序

为达到最佳效果,推荐使用九网互联的ASP.net空间,支持ASP.net版本1.1和2.0在线切换、在线脚本映射、ASP.net具体错误信息在线查看。一个好用的.net探针程序,希望大家能够喜欢!

asp服务器探针

方法一://////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////#####################################                               

flynetcn的专栏 4332

阿江ASP探针 V 1.93.zip

阿江ASP探针 V 1.93.zip阿江ASP探针 V 1.93.zip阿江ASP探针 V 1.93.zip阿江ASP探针 V 1.93.zip

asp探针 PHP探针

aspcheck.asp…………asp探针 iProber.php…………PHP探针

asp探针

<%不使用输出缓冲区,直接将运行结果显示在客户端Response.Buffer = False声明待检测数组Dim ObjTotest(26,4)ObjTotest(0,0) = "MSWC.AdRotator"ObjTotest(1,0) = "MSWC.BrowserType"ObjTotest(2,0) = "MSWC.NextLink"ObjTo

Sunny 1572

阿江asp探针(aspcheck.asp)

- 主要功能 服务器概况、组件支持情况、内存变量、环境参数检测 连接速度测试、磁盘信息和速度测试、脚本运算能力测试 服务器安全评价

WEB攻防-ASP中间件IIS 短文件名探针安全漏洞

IIS短文件名探针安全漏洞是一个与IIS(Internet Information Services)服务相关的安全问题。该漏洞主要是由于HTTP请求中使用了旧DOS 8.3名称约定(SFN)的代字符(〜)波浪号,这使得远程攻击者有可能在Web根目录下得到文件和文件夹名称,即使这些名称本不应该被访问。Windows 支持以 8.3 格式生成与 MS-DOS 兼容的(短)文件名,以允许基于 MS-DOS 或 16 位 Windows的程序访问这些文件。利用工具:iis_shortname_Scan.py。

weixin_45534587的博客 713

阿江asp服务器探针

主要功能 服务器概况、组件支持情况、内存变量、环境参数检测 连接速度测试、磁盘信息和速度测试、脚本运算能力测试 服务器安全评价

阿江ASP探针 v1.93

v1.9 的新特性: 以积木式的设计思路重新编写代码,功能增加但是结构并不臃肿 改用三维数组保存待检测组件,增加了一些常见的组件,包括国产的Ironsoft和呆呆系列组件 增加组件

Effective Visual Basic (Visual Basic高效编程)(一)

http://lingobuddy.51.net/larry/index.php/2004/12/effective-visual-basic/Effective Visual Basic: How to Improve Your VB/COM+ Applicationsby Joe Hummel, Ted Pattison, Justin Gehtland, Doug Turnure, Br

不经历风雨怎么见彩虹 1516

ASP探针-V1.71

ASP探针-V1.71

VB之Collection---Collection集合类

由于要对一些数据进行处理,比较麻烦,实现某个算法要处理大量不同的不同类型的数据。 所以考虑到一些因素,又在使用VB6(可惜微软不支持VB6了,改为DotNet框架了 ),所以使用 VB6 自带的 Collection集合(类) 最好。 其实Collection 也是有Key 和 Value一一对应的关系的。而且 还有 ID 顺序。 现在不是流行 key-value的数据库么,collecti...

weixin_34061555的博客 960

从零拆解快手Web端__NS_hxfalcon:JS逆向签名参数定位与复现

在JS逆向与前端反爬攻防中,签名参数总是绕不开的核心环节。无论是接口加密还是请求签名,其本质都是通过在客户端收集环境信息、时间戳与业务参数,经特定算法计算后生成用于服务端校验的动态令牌。理解这类参数的生成原理,不仅能提升逆向分析效率,也能帮助前端开发者更好地设计自身接口防护方案。在实际工程中,面对经Webpack打包且高度混淆的代码,直接全局搜索参数名往往难以奏效,需要结合请求抓包、调用栈跟踪、环境适配等方法逐步定位。此类签名参数广泛存在于现代Web应用的GraphQL或REST接口中,是接口数据安全的重要

weixin_29474431的博客 349

【ISP图像处理】Demosaic去马赛克技术演进与边缘优化策略

本文深入解析了ISP图像处理中的Demosaic(去马赛克)技术。从Bayer阵列原理出发,梳理了从双线性插值、Hamilton-Adams边缘导向算法到利用通道相关性与自相似性的技术演进历程,并重点探讨了针对边缘与纹理伪影的优化策略,为工程实践中的算法选型与硬件协同设计提供了专业指导。

weixin_29091445的博客 408

用VB实现循环队列算法收藏

    在日常代码编制时,许多人会忽略一些最基本的算法,导致代码冗余,思路不清楚。我曾经至少两次在CSDN里遇到这类问题:我想在页面的右边显示一个列表,列表长度为20,新加入一个用户后,显示在列表开头,再加入的用户,显示在这个用户的下边,当用户数量超过20后,挤掉最前面的那一位,第二位加入的用户成了第一位,依次循环,保证列表最多显示20位用户。当然,实际问题可能与此有些出入,比如Coder是想显示

迷茫的小莱 1731

Bochs源码分析 - 4: 使用ida来调试bochs

前言 bochs内部提供了一个调试器,但是这个命令行调试器相当难用,想找一个gui的debugger。第一次是在百度百科的bochs词条中介绍的peter-bochs-debugger调试器(java编写),但是后来发现ida也有一个bochs调试器,因为对ida比较熟悉,就选用此作为bochs调试器。 在配置过程中参考博客 https://blog.csdn.net/cssxn/article/details/90738498 中的配置,但是这是直接发布版本,拿源码编译...

WriteAnything_的博客 2768

Engine-Collection-Class,一种用来建立可重用企业组件的设计模式

简介 本文详细说明用来设计可重用企业组件的一种方法。重点讨论一种已被证实的设计模式,该设计模式已由多个项目和客户实现,并进行了改进。Engine-Collection-Class (ECC) 设计模式是一种为分布式/分层应用程序创建可重用企业组件的灵活模型,这类应用程序既可与传统的“胖”客户机一起工作,也可与日益流行的脚本客户机一起工 作。由于它有简化的接口和直观的编码样式,ECC 设计模

summersnowgieno的专栏 1617

Windows Server 2012 R2虚拟机安装全攻略:从镜像选择到网络配置一步到位

本文提供Windows Server 2012 R2虚拟机安装全攻略,涵盖从镜像选择到网络配置的完整流程。详细讲解在Oracle VM VirtualBox中的安装步骤、TCP/IP网络设置、系统优化及常见问题解决方案,帮助用户快速搭建可立即投入使用的服务器环境。特别适合IT初学者和系统管理员学习传统服务器应用的部署与配置。

weixin_28363123的博客 548

2025年人形机器人产业研究

人形机器人是一种模仿人类外形、动作和行为的机器人,旨在替代或辅助人类完成各种任务。其显著特征包括人类外形、动作模仿和智能交互能力。根据形态和功能,人形机器人可分为小型、中型、大型以及服务型、工业型、救援型和娱乐型等类别。发展历程经历了初始阶段、高度集成系统阶段和突破性进展阶段,技术不断进步。关键技术包括执行系统、控制系统和感知与交互系统,涉及机械结构、运动控制、平衡控制、任务执行控制以及感知与交互能力。主要研究方向包括外部仿人化和内部仿生,前者关注外观设计、动作控制和任务执行能力,后者致力于模拟人类核心机制

一名80后IT人的成长记录,记录自己在工作、学习中的点点滴滴,在成长的喜悦与忧心的故事里,铭记反脆弱的勇气。 1583
上一篇: PHP开发日志 ━━ PHP验证码程序:session生成图片
下一篇: 安全篇 ━━ 整理几条黑客留下的礼物
暂时先用这个名字
博客等级 码龄17年 6万+粉丝 256原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值