Guest User

Untitled

a guest
Feb 18th, 2018
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.70 KB | None | 0 0
  1. function Disable-TLS10
  2. {
  3. [cmdletbinding()]
  4. param
  5. (
  6. )
  7.  
  8. begin
  9. {
  10. $protocol = "TLS 1.0"
  11. }
  12. process
  13. {
  14. if(-not $(Get-Item -Path "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\$protocol" -EA SilentlyContinue))
  15. {
  16. New-Item -Path "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\$protocol" | Out-Null
  17. }
  18.  
  19. if(-not $(Get-Item -Path "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\$protocol\Client" -EA SilentlyContinue))
  20. {
  21. New-Item -Path "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\$protocol\Client" | Out-Null
  22. }
  23.  
  24. if(-not $(Get-Item -Path "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\$protocol\Server" -EA SilentlyContinue))
  25. {
  26. New-Item -Path "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\$protocol\Server" | Out-Null
  27. }
  28.  
  29. New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\$protocol\Client" -Name DisabledByDefault -Value 1 -PropertyType DWORD -Force | Out-Null
  30. New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\$protocol\Client" -Name Enabled -Value 0 -PropertyType DWORD -Force | Out-Null
  31.  
  32. New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\$protocol\Server" -Name DisabledByDefault -Value 1 -PropertyType DWORD -Force | Out-Null
  33. New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\$protocol\Server" -Name Enabled -Value 0 -PropertyType DWORD -Force | Out-Null
  34. }
  35. end
  36. {
  37. }
  38. }
  39.  
  40. function Disable-TLS11
  41. {
  42. [cmdletbinding()]
  43. param
  44. (
  45. )
  46.  
  47. begin
  48. {
  49. $protocol = "TLS 1.1"
  50. }
  51. process
  52. {
  53. if(-not $(Get-Item -Path "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\$protocol" -EA SilentlyContinue))
  54. {
  55. New-Item -Path "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\$protocol" | Out-Null
  56. }
  57.  
  58. if(-not $(Get-Item -Path "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\$protocol\Client" -EA SilentlyContinue))
  59. {
  60. New-Item -Path "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\$protocol\Client" | Out-Null
  61. }
  62.  
  63. if(-not $(Get-Item -Path "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\$protocol\Server" -EA SilentlyContinue))
  64. {
  65. New-Item -Path "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\$protocol\Server" | Out-Null
  66. }
  67.  
  68. New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\$protocol\Client" -Name DisabledByDefault -Value 1 -PropertyType DWORD -Force | Out-Null
  69. New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\$protocol\Client" -Name Enabled -Value 0 -PropertyType DWORD -Force | Out-Null
  70.  
  71. New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\$protocol\Server" -Name DisabledByDefault -Value 1 -PropertyType DWORD -Force | Out-Null
  72. New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\$protocol\Server" -Name Enabled -Value 0 -PropertyType DWORD -Force | Out-Null
  73. }
  74. end
  75. {
  76. }
  77. }
  78.  
  79.  
  80. # Disable-TLS10
  81. # Disable-TLS11
Add Comment
Please, Sign In to add comment