#cs ----------------------------------------------------------------------------
AutoIt Version: 3.3.0.0
Author: pangchangjiang
Script Function:
Template AutoIt script.
#ce ----------------------------------------------------------------------------
; Script Start - Add your code below here
#Include <WinAPI.au3>
ProgressOn("处理中,请稍候...BY:pangchangjiang", "", "", -1, -1, 2 + 16)
ProgressSet(0, "已完成 0%", "正在设置允许空白密码的用户远程登录")
sleep(300)
RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Lsa", "limitblankpassworduse", "REG_DWORD", "00000000")
RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa", "limitblankpassworduse", "REG_DWORD", "00000000")
If Not WinActive("处理中,请稍候", "") Then WinActivate("处理中,请稍候", "")
ProgressSet(10, "已完成 10%", "正在启动远程相关服务")
sleep(300)
RunWait(@ComSpec & " /c sc config RDSessMgr start= auto", "", @SW_HIDE)
RunWait(@ComSpec & " /c net start RDSessMgr", "", @SW_HIDE)
RunWait(@ComSpec & " /c sc config NtLmSsp start= auto", "", @SW_HIDE)
RunWait(@ComSpec & " /c net start NtLmSsp", "", @SW_HIDE)
RunWait(@ComSpec & " /c sc config TlntSvr start= auto", "", @SW_HIDE)
RunWait(@ComSpec & " /c net start TlntSvr", "", @SW_HIDE)
RunWait(@ComSpec & " /c sc config RasAuto start= auto", "", @SW_HIDE)
RunWait(@ComSpec & " /c net start RasAuto", "", @SW_HIDE)
RunWait(@ComSpec & " /c sc config RasMan start= auto", "", @SW_HIDE)
RunWait(@ComSpec & " /c net start RasMan", "", @SW_HIDE)
RunWait(@ComSpec & " /c sc config RemoteRegistry start= auto", "", @SW_HIDE)
RunWait(@ComSpec & " /c net start RemoteRegistry", "", @SW_HIDE)
If Not WinActive("处理中,请稍候", "") Then WinActivate("处理中,请稍候", "")
ProgressSet(20, "已完成 20%", "正在设置允许用户远程连接到此计算机")
sleep(300)
RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server", "fAllowToGetHelp", "REG_DWORD", "00000001")
RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server", "fDenyTSConnections", "REG_DWORD", "00000000")
RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Terminal Server", "fAllowToGetHelp", "REG_DWORD", "00000001")
RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Terminal Server", "fDenyTSConnections", "REG_DWORD", "00000000")
If Not WinActive("处理中,请稍候", "") Then WinActivate("处理中,请稍候", "")
ProgressSet(40, "已完成 40%", "正在设置远程端口")
sleep(300)
RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\SharedAccess\Parameters\FirewallPolicy\DomainProfile\GloballyOpenPorts\List", "3389:TCP", "REG_SZ", "3389:TCP:*:Enabled:@xpsp2res.dll,-22009")
RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\DomainProfile\GloballyOpenPorts\List", "3389:TCP", "REG_SZ", "3389:TCP:*:Enabled:@xpsp2res.dll,-22009")
If Not WinActive("处理中,请稍候", "") Then WinActivate("处理中,请稍候", "")
ProgressSet(60, "已完成 60%", "正在关闭防火墙")
sleep(300)
RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\StandardProfile", "EnableFirewall", "REG_DWORD", "00000000")
RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\SharedAccess\Parameters\FirewallPolicy\StandardProfile\GloballyOpenPorts\List", "3389:TCP", "REG_SZ", "3389:TCP:*:Enabled:@xpsp2res.dll,-22009")
RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\StandardProfile\GloballyOpenPorts\List", "3389:TCP", "REG_SZ", "3389:TCP:*:Enabled:@xpsp2res.dll,-22009")
If Not WinActive("处理中,请稍候", "") Then WinActivate("处理中,请稍候", "")
ProgressSet(80, "已完成 80%", "正在设置ghost重定向")
sleep(300)
$iscfgpath="HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Enum\Root\RDPDR\0000 [1 7 17]"
FileDelete(@TempDir&"\regini.ini")
$urlfile=FileOpen(@TempDir&"\regini.ini",1)
FileWrite($urlfile,$iscfgpath)
FileClose($urlfile)
RunWait(@ComSpec & " /c " & "regini "&@TempDir&"\regini.ini","",@SW_HIDE)
FileDelete(@TempDir&"\regini.ini")
;RegDelete("HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Enum\Root\RDPDR\0000")
RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Enum\Root\RDPDR\0000")
RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Enum\Root\RDPDR\0000", "ClassGUID", "REG_SZ", "{4D36E97D-E325-11CE-BFC1-08002BE10318}")
RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Enum\Root\RDPDR\0000", "Class", "REG_SZ", "System")
RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Enum\Root\RDPDR\0000", "HardwareID", "REG_MULTI_SZ", "ROOT\RDPDR")
RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Enum\Root\RDPDR\0000", "Driver", "REG_SZ", "{4D36E97D-E325-11CE-BFC1-08002BE10318}\0030")
RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Enum\Root\RDPDR\0000", "Mfg", "REG_SZ", "(标准系统设备)")
RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Enum\Root\RDPDR\0000", "Service", "REG_SZ", "rdpdr")
RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Enum\Root\RDPDR\0000", "DeviceDesc", "REG_SZ", "终端服务器设备重定向器")
RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Enum\Root\RDPDR\0000", "ConfigFlags", "REG_DWORD", "00000000")
RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Enum\Root\RDPDR\0000", "Capabilities", "REG_DWORD", "00000000")
If Not WinActive("处理中,请稍候", "") Then WinActivate("处理中,请稍候", "")
ProgressSet(100, "已完成 100%", "已经完成")
sleep(500)
ProgressOff() |