Win2003環(huán)境下的一鍵系統(tǒng)安全批處理
2024-09-10 16:49:23
供稿:網(wǎng)友
只要將下面的代碼保存為1.bat運(yùn)行一下即可自動(dòng)設(shè)置win2003的安全,完成后自動(dòng)重啟,需要的朋友可以參考下。 復(fù)制代碼 代碼如下:
@echo off
echo ----------------------------------
echo ----正在備份注冊(cè)表 請(qǐng)稍后....----
echo ----------------------------------
reg export "HKEY_LOCAL_MACHINE" C:/reg_backup.reg
echo ----------------------
echo ----注冊(cè)表備份完成----
echo ----------------------
ping 127.0.0.1 -n 3 >nul
echo -----------------------------------
echo ----安全配置正在改寫 請(qǐng)稍候...----
echo -----------------------------------
@ping 127.0.0.1 -n 3 >nul
echo ----------------------
echo ----正在禁用空連接----
echo ----------------------
reg add HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Control/Lsa /v restrictanonymous /t reg_dword /d 1 /f
echo --------------------------
echo ----禁用空連接設(shè)置完畢----
echo --------------------------
@ping 127.0.0.1 -n 3 >nul
echo ------------------------
echo ----正在刪除默認(rèn)共享----
echo ------------------------
reg add HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/lanmanserver/parameters /v AutoShareServer /t reg_dword /d 0 /f
echo ----------------------------
echo ----刪除默認(rèn)共享設(shè)置完畢----
echo ----------------------------
@ping 127.0.0.1 -n 3 >nul
echo ------------------------------
echo ----正在修改TTL值請(qǐng)稍后...----
echo ------------------------------
reg add HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/Tcpip/Parameters /v DefaultTTL /t reg_dword /d 53 /f
echo -------------------
echo ----TTL修改完畢----
echo -------------------
@ping 127.0.0.1 -n 3 >nul
echo -----------------------
echo ----防止syn洪水攻擊----
echo -----------------------
reg add HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/Tcpip/Parameters /v SynAttackProtect /t reg_dword /d 2 /f
reg add HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/Tcpip/Parameters /v EnablePMTUDiscovery /t reg_dword /d 0 /f
reg add HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/Tcpip/Parameters /v NoNameReleaseOnDemand /t reg_dword /d 1 /f
reg add HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/Tcpip/Parameters /v EnableDeadGWDetect /t reg_dword /d 0 /f
reg add HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/Tcpip/Parameters /v KeepAliveTime /t reg_dword /d 300000 /f
reg add HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/Tcpip/Parameters /v PerformRouterDiscovery /t reg_dword /d 0 /f
reg add HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/Tcpip/Parameters /v EnableICMPRedirects /t reg_dword /d 0 /f
echo -------------------------------
echo ----防止syn洪水攻擊設(shè)置完畢----
echo -------------------------------
@ping 127.0.0.1 -n 3 >nul
echo ------------------------------
echo ------------------------------
echo ---- 系統(tǒng)服務(wù)修改 ----