tis-disable-rdp

1.1-9
Disable Remote Desktop (RDP) on Windows, and closing suitable firewall rules
227 downloads
Download

  Description 

  • package : tis-disable-rdp
  • version : 1.1-9
  • architecture : all
  • categories : System and network,Security
  • maintainer : Tranquil IT
  • description : Disable Remote Desktop (RDP) on Windows, and closing suitable firewall rules
  • locale :
  • target_os : windows
  • min_os_version : 6.1
  • max_os_version :
  • min_wapt_version : 1.7
  • sources :
  • installed_size :
  • impacted_process :
  • description_fr : Désactive le Bureau à distance (RDP) sur Windows, et ferme les règles de pare-feu adéquates
  • description_pl :
  • description_de :
  • description_es :
  • description_pt :
  • description_it :
  • description_nl :
  • description_ru :
  • editor :
  • licence :
  • signature_date : 2020-11-23T16:36:56.653155
  • Conflicts :

  Setup.py 

# -*- coding: utf-8 -*-
from setuphelpers import *

uninstallkey = []


def install():
    # disable RDP
    print('Disabling RDP')
    registry_set(HKEY_LOCAL_MACHINE,r'SYSTEM\CurrentControlSet\Control\Terminal Server','fDenyTSConnections',1)
    registry_set(HKEY_LOCAL_MACHINE,r'SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp','UserAuthentication',1)
    registry_set(HKEY_LOCAL_MACHINE,r'SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp','SecurityLayer',1)

    # closing firewall for RDP
    print('Closing firewall for RDP')
    run('netsh firewall set service type=RemoteDesktop mode=disable profile=all')


def uninstall():
    # disable RDP
    print('Reverting RDP to default options')
    registry_delete(HKEY_LOCAL_MACHINE,r'SYSTEM\CurrentControlSet\Control\Terminal Server','fDenyTSConnections')
    registry_delete(HKEY_LOCAL_MACHINE,r'SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp','UserAuthentication')
    registry_delete(HKEY_LOCAL_MACHINE,r'SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp','SecurityLayer')


def audit():
    if service_is_running('TermService'):
        print('WARNING: RDP service is running, WAPT is going to stop RDP service')
        service_stop('TermService')
        return "WARNING"
    else:
        print('OK: RDP service is not running')
        return "OK"


def update_package():
    # Initializing variables
    version = control.version.split('-')[0]

    # Incrementing version of the package
    control.version = '%s-%s'%(version,int(control.version.split('-')[-1])+1)
    control.save_control_to_wapt()
    print('Changing package version to: %s in WAPT\\control' % control.version)
										

  Changelog 


No changelog
  manifest.sha256 
[["setup.py","c4dc17ced3eb4aaed709be44807d773399220139ea09345568e90c7826653279"],["WAPT/icon.png","2e567e7058c8bff31d451b9ccdd74df552803ff5acd65854cd767e43ae900a6f"],["WAPT/certificate.crt","a5a97261381e1d0ad46ee15916abec9c2631d0201f5cc50ceb0197a165a0bbbf"],["WAPT/control","e4b6f72384cd5c6003cc09daa07454d776afc3ece0490ea9130bfefd9217424f"]]