Last active
July 1, 2017 23:28
-
-
Save Lomanic/abd88537b4c61654750a5ff9c74a792d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
net session >nul 2>&1 | |
if %ERRORLEVEL% NEQ 0 ( echo Run this script with administrator privileges & exit /B 1 ) | |
:: https://gist.github.com/Albirew/613cbf63595647ff26b269d5271871a0 | |
echo +------------------------------------------------------------------+ | |
echo ^| SMBv1 patch against malwares like WannaCry ou notPetya / Petwrap ^| | |
echo +------------------------------------------------------------------+ | |
echo. | |
:: deactivate SMBv1 on SMB server | |
reg add "HKLM\SYSTEM\CurrentControlSet\services\LanmanServer\Parameters" /v SMB1 /t REG_DWORD /d 0 /f | |
:: deactivate SMBv1 on SMB client | |
sc config lanmanworkstation depend= bowser/mrxsmb20/nsi | |
sc config mrxsmb10 start= disabled | |
reg add "HKLM\SYSTEM\CurrentControlSet\services\mrxsmb10" /v Start /t REG_DWORD /d 4 /f | |
reg add "HKLM\SYSTEM\CurrentControlSet\Services\LanmanWorkstation" /f /v DependOnService /t REG_MULTI_SZ /d Bowser\0MRxSmb20\0NSI | |
echo. | |
echo Done. Please check above lines if no error occured. | |
pause |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment