diff --git a/atomics/T1021.001/T1021.001.yaml b/atomics/T1021.001/T1021.001.yaml index eb4f021a..f2204721 100644 --- a/atomics/T1021.001/T1021.001.yaml +++ b/atomics/T1021.001/T1021.001.yaml @@ -74,3 +74,25 @@ atomic_tests: $p=Tasklist /svc /fi "IMAGENAME eq mstsc.exe" /fo csv | convertfrom-csv if(-not ([string]::IsNullOrEmpty($p.PID))) { Stop-Process -Id $p.PID } name: powershell +- name: Changing RDP Port to Non Standard Port + description: | + Changing RDP Port to Non Standard Port via Remote Desktop Application over Powershell + supported_platforms: + - windows + input_arguments: + OLD_Remote_Port: + description: Default RDP Listening Port + type: String + default: "3389" + NEW_Remote_Port: + description: New RDP Listening Port + type: String + default: "4489" + executor: + command: | + Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp' -name "PortNumber" -Value #{NEW_Remote_Port} + New-NetFirewallRule -DisplayName 'RDPPORTLatest-TCP-In' -Profile 'Public' -Direction Inbound -Action Allow -Protocol TCP -LocalPort #{NEW_Remote_Port} + cleanup_command: | + Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp' -name "PortNumber" -Value #{OLD_Remote_Port} + Remove-NetFirewallRule -DisplayName "RDPPORTLatest-TCP-In" + name: powershell \ No newline at end of file