metasploitable3/chef/cookbooks/metasploitable/test/windows/enable_rdp.rb
2017-07-06 08:55:40 +05:30

18 lines
777 B
Ruby

control "enable-rdp" do
title "Enable RDP"
desc "Enables RDP by modifying Registry and adding a Firewall rule. Configuration script available at /scripts/configs/enable-rdp.bat"
describe command('netsh advfirewall firewall show rule name="Open Port 3389"') do
its('stdout') { should match ("Enabled: Yes") }
end
describe command('reg query "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections') do
its('stdout') { should match ("fDenyTSConnections REG_DWORD 0x0") }
end
# As port('3389') doesnt work on windows, we use netstat command to know if the port is listening
describe command('netstat -aob | findstr :3389') do
its('stdout') { should match ("LISTENING") }
end
end