Jirairya

开启RDP

2017-12-27
   

WMIC

该WMIC开启3389方法,适用于win2k8以上机器,需要管理员权限:

wmic /namespace:\\root\CIMV2\TerminalServices PATH Win32_TerminalServiceSetting WHERE (__CLASS !="") CALL SetAllowTSConnections 1


PowerShell

windows2012开启RDP:

  • 启用RDP访问
  • 启用入站防火墙规则
# 1. Enable Remote Desktop
(Get-WmiObject Win32_TerminalServiceSetting -Namespace root\cimv2\TerminalServices).SetAllowTsConnections(1,1) 
(Get-WmiObject -Class "Win32_TSGeneralSetting" -Namespace root\cimv2\TerminalServices -Filter "TerminalName='RDP-tcp'").SetUserAuthenticationRequired(0) 

# 2. Enable the firewall rule

Enable-NetFirewallRule -DisplayGroup "Remote Desktop"

windows2012,需要管理员权限:

# Enable RDP
set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server'-name "fDenyTSConnections" -Value 0

# Allow RDP in firewall
Set-NetFirewallRule -Name RemoteDesktop-UserMode-In-TCP -Enabled true

# Enable secure RDP authentication
set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp' -name "UserAuthentication" -Value 1   

Similar Posts

上一篇 域环境

下一篇 域渗透的整理

Comments