Skip to content

Instantly share code, notes, and snippets.

@Lomanic
Forked from Albirew/wannaPatch.bat
Last active July 1, 2017 23:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Lomanic/abd88537b4c61654750a5ff9c74a792d to your computer and use it in GitHub Desktop.
Save Lomanic/abd88537b4c61654750a5ff9c74a792d to your computer and use it in GitHub Desktop.
@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