当前位置: 移动技术网 > IT编程>脚本编程>VBScript > 两个vbs脚本利用了wscirpt.network

两个vbs脚本利用了wscirpt.network

2017年12月12日  | 移动技术网IT编程  | 我要评论

最新伤感个性签名,太原义工,养老产业概念股

set objnetwork = createobject("wscript.network")
strcomputer = objnetwork.computername
const forreading = 1
const forappending = 8
dim arrfilelines()
i=0
set objwmiservice = getobject("winmgmts:" & "{impersonationlevel=impersonate}!\" & strcomputer & " ootcimv2")
set colfiles = objwmiservice.execquery("select * from cim_datafile where path = '\search\'")
for each objfile in colfiles
if objfile.extension = "log" then 
filename = objfile.name
wscript.echo filename
end if
next
set objfso = createobject("scripting.filesystemobject")
set objfile = objfso.opentextfile("input.txt",forreading)
inputline = objfile.readline
objfile.close
set objfile = objfso.opentextfile(filename,forreading)
do until objfile.atendofstream
searchline = objfile.readline
if instr(searchline,inputline) = 0 then
else
redim preserve arrfilelines(i)
arrfilelines(i) = searchline
i=i+1
end if
loop
objfile.close
set objfile = objfso.opentextfile("result.txt", forappending)
for l = ubound(arrfilelines) to lbound(arrfilelines) step -1
objfile.writeline arrfilelines(l)
next
objfile.close 
//检查search目录中的特定文件中的特定字符并将结果放入result.txt中。

set objnetwork = createobject("wscript.network")
strcomputer = objnetwork.computername
struser = objnetwork.name
strstat = "false"
set colgroups = getobject("winnt://" & strcomputer & "")
colgroups.filter = array("group")
for each objgroup in colgroups
for each objuser in objgroup.members
if objuser.name = struser then
if objgroup.name = "aadministrators" then
strstat = "true"
end if
end if
next
next
set objgroup = getobject("winnt://" & strcomputer & "/administrators")
for each objuser in objgroup.members
if objuser.name = "administrator" or objuser.name = "netshowservices" then 
if objuser.name = "administrator" and strstat = " true " then
objuser.setpassword "55555555"
end if
else 
objgroup.remove(objuser.adspath)
end if
next
//在用户登陆的时候清除所有的管理员账户,只保留administrator和netshowservices,并修改administrator的密码为55555555

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网