复制代码 代码如下:
@echo off
echo ----------------------------------
echo ----正在备份注册表 请稍后....----
echo ----------------------------------
reg export "HKEY_LOCAL_MACHINE" C:/reg_backup.reg
echo ----------------------
echo ----注册表备份完成----
echo ----------------------
ping 127.0.0.1 -n 3 >nul
echo -----------------------------------
echo ----安全配置正在改写 请稍候...----
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 ----禁用空连接设置完毕----
echo --------------------------
@ping 127.0.0.1 -n 3 >nul
echo ------------------------
echo ----正在删除默认共享----
echo ------------------------
reg add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\lanmanserver\parameters /v AutoShareServer /t reg_dword /d 0 /f
echo ----------------------------
echo ----删除默认共享设置完毕----
echo ----------------------------
@ping 127.0.0.1 -n 3 >nul
echo ------------------------------
echo ----正在修改TTL值请稍后...----
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洪水攻击设置完毕----
echo -------------------------------
@ping 127.0.0.1 -n 3 >nul
echo ------------------------------
echo ------------------------------
echo ---- 系统服务修改 ----
echo ------------------------------
echo ------------------------------
@ping 127.0.0.1 -n 3 >nul
echo --------------------
echo ----修改3389端口----
echo --------------------
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\Wds dpwd\Tds\tcp" /v PortNumber /t reg_dword /d 44454 /f
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentContro1Set\Control\Tenninal Server\WinStations\RDP\Tcp" /v PortNumber /t reg_dword /d 44454 /f
echo --------------------
echo ----修改PORT完毕----
echo --------------------
@ping 127.0.0.1 -n 3 >nul
echo -------------------------------------
echo ----正在开启系统防火墙 请稍后....----
echo -------------------------------------
sc config sharedaccess start= auto & net start sharedaccess
echo ------------------------
echo ----系统防火墙已开启----
echo ------------------------
@ping 127.0.0.1 -n 3 >nul
echo ----------------------------
echo ----正在关闭共享打印服务----
echo ----------------------------
@sc config Spooler start= disabled
sc config LanmanServer start= disabled
sc config LmHosts start= disabled
echo --------------------------
echo ----已关闭共享打印服务----
echo --------------------------
@ping 127.0.0.1 -n 3 >nul
echo ----------------------------
echo ----正在关闭远程协助服务----
echo ----------------------------
@sc config RDSessMgr start= disabled
echo --------------------------
echo ----已关闭远程协助服务----
echo --------------------------
@ping 127.0.0.1 -n 3 >nul
echo ------------------------------
echo ----正在关闭远程注册表服务----
echo ------------------------------
@sc config RemoteRegistry start= disabled
echo ----------------------------
echo ----已关闭远程注册表服务----
echo ----------------------------
@ping 127.0.0.1 -n 3 >nul
echo ----------------------------
echo ----关闭自动硬件播放通知----
echo ----------------------------
sc config ShellHWDetection start= disabled
echo -----------------------
echo ----自动播放通知关闭---
echo -----------------------
@ping 127.0.0.1 -n 3 >nul
echo ----------------------------------------
echo ----正在关闭替换凭据下的启动进程服务----
echo ----------------------------------------
sc config seclogon start= disabled
echo --------------------------
echo ----已关闭启动进程服务----
echo --------------------------
@ping 127.0.0.1 -n 3 >nul
echo ------------------------------------
echo ----IEEE 802.11 适配器的自动配置----
echo ------------------------------------
sc config WZCSVC start= disabled
echo ------------------
echo ----已关闭IEEE----
echo ------------------
@ping 127.0.0.1 -n 3 >nul
echo --------------------------
echo ----客户端跟踪服务关闭----
echo --------------------------
sc config TrkSvr start= disabled
sc config MSDTC start= disabled
echo ----------------------------
echo ----已关闭客户端跟踪服务----
echo ----------------------------
@ping 127.0.0.1 -n 3 >nul
echo --------------------
echo ----帮助中心关闭----
echo --------------------
sc config helpsvc start= disabled
echo --------------------------
echo ----已关闭帮助中心服务----
echo --------------------------
@ping 127.0.0.1 -n 3 >nul
echo --------------------------------
echo --------------------------------
echo ---- 系统权限加固 ----
echo --------------------------------
echo --------------------------------
echo -------------------------------------------------------
echo ----C盘(系统盘) (administrators,system完全控制权限)----
echo -------------------------------------------------------
cacls C:\ /t /c /g administrators:F system:F
echo -------------------------------------------
echo ----Common Files (everyone用户只读权限)----
echo -------------------------------------------
Cacls "C:\Program Files\Common Files" /t /e /c /g everyone:R
echo -------------------------------------------------------------
echo ----IIS Temporary Compressed Files (everyone用户更改权限)----
echo -------------------------------------------------------------
Cacls "C:\WINDOWS\IIS Temporary Compressed Files" /t /e /c /g everyone:C
echo --------------------------------------------
echo ----Microsoft.Net (everyone用户只读权限)----
echo --------------------------------------------
Cacls C:\WINDOWS\Microsoft.Net /t /e /c /g everyone:R
echo ------------------------------------------------------
echo ----Temporary ASP.NET Files (everyone用户更改权限)----
echo ------------------------------------------------------
Cacls "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files" /t /e /c /g everyone:C
echo ------------------------------------------------------
echo ----Temporary ASP.NET Files (everyone用户更改权限)----
echo ------------------------------------------------------
Cacls "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files" /t /e /c /g everyone:C
echo -------------------------------------------
echo ----Registration (everyone用户读取权限)----
echo -------------------------------------------
Cacls C:\WINDOWS\Registration /t /e /c /g everyone:R
echo -----------------------------------
echo ----Temp (everyone用户更改权限)----
echo -----------------------------------
Cacls C:\WINDOWS\Temp /t /e /c /g everyone:C
echo -------------------
@echo off
echo ----------------------------------
echo ----正在备份注册表 请稍后....----
echo ----------------------------------
reg export "HKEY_LOCAL_MACHINE" C:/reg_backup.reg
echo ----------------------
echo ----注册表备份完成----
echo ----------------------
ping 127.0.0.1 -n 3 >nul
echo -----------------------------------
echo ----安全配置正在改写 请稍候...----
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 ----禁用空连接设置完毕----
echo --------------------------
@ping 127.0.0.1 -n 3 >nul
echo ------------------------
echo ----正在删除默认共享----
echo ------------------------
reg add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\lanmanserver\parameters /v AutoShareServer /t reg_dword /d 0 /f
echo ----------------------------
echo ----删除默认共享设置完毕----
echo ----------------------------
@ping 127.0.0.1 -n 3 >nul
echo ------------------------------
echo ----正在修改TTL值请稍后...----
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洪水攻击设置完毕----
echo -------------------------------
@ping 127.0.0.1 -n 3 >nul
echo ------------------------------
echo ------------------------------
echo ---- 系统服务修改 ----
echo ------------------------------
echo ------------------------------
@ping 127.0.0.1 -n 3 >nul
echo --------------------
echo ----修改3389端口----
echo --------------------
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\Wds dpwd\Tds\tcp" /v PortNumber /t reg_dword /d 44454 /f
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentContro1Set\Control\Tenninal Server\WinStations\RDP\Tcp" /v PortNumber /t reg_dword /d 44454 /f
echo --------------------
echo ----修改PORT完毕----
echo --------------------
@ping 127.0.0.1 -n 3 >nul
echo -------------------------------------
echo ----正在开启系统防火墙 请稍后....----
echo -------------------------------------
sc config sharedaccess start= auto & net start sharedaccess
echo ------------------------
echo ----系统防火墙已开启----
echo ------------------------
@ping 127.0.0.1 -n 3 >nul
echo ----------------------------
echo ----正在关闭共享打印服务----
echo ----------------------------
@sc config Spooler start= disabled
sc config LanmanServer start= disabled
sc config LmHosts start= disabled
echo --------------------------
echo ----已关闭共享打印服务----
echo --------------------------
@ping 127.0.0.1 -n 3 >nul
echo ----------------------------
echo ----正在关闭远程协助服务----
echo ----------------------------
@sc config RDSessMgr start= disabled
echo --------------------------
echo ----已关闭远程协助服务----
echo --------------------------
@ping 127.0.0.1 -n 3 >nul
echo ------------------------------
echo ----正在关闭远程注册表服务----
echo ------------------------------
@sc config RemoteRegistry start= disabled
echo ----------------------------
echo ----已关闭远程注册表服务----
echo ----------------------------
@ping 127.0.0.1 -n 3 >nul
echo ----------------------------
echo ----关闭自动硬件播放通知----
echo ----------------------------
sc config ShellHWDetection start= disabled
echo -----------------------
echo ----自动播放通知关闭---
echo -----------------------
@ping 127.0.0.1 -n 3 >nul
echo ----------------------------------------
echo ----正在关闭替换凭据下的启动进程服务----
echo ----------------------------------------
sc config seclogon start= disabled
echo --------------------------
echo ----已关闭启动进程服务----
echo --------------------------
@ping 127.0.0.1 -n 3 >nul
echo ------------------------------------
echo ----IEEE 802.11 适配器的自动配置----
echo ------------------------------------
sc config WZCSVC start= disabled
echo ------------------
echo ----已关闭IEEE----
echo ------------------
@ping 127.0.0.1 -n 3 >nul
echo --------------------------
echo ----客户端跟踪服务关闭----
echo --------------------------
sc config TrkSvr start= disabled
sc config MSDTC start= disabled
echo ----------------------------
echo ----已关闭客户端跟踪服务----
echo ----------------------------
@ping 127.0.0.1 -n 3 >nul
echo --------------------
echo ----帮助中心关闭----
echo --------------------
sc config helpsvc start= disabled
echo --------------------------
echo ----已关闭帮助中心服务----
echo --------------------------
@ping 127.0.0.1 -n 3 >nul
echo --------------------------------
echo --------------------------------
echo ---- 系统权限加固 ----
echo --------------------------------
echo --------------------------------
echo -------------------------------------------------------
echo ----C盘(系统盘) (administrators,system完全控制权限)----
echo -------------------------------------------------------
cacls C:\ /t /c /g administrators:F system:F
echo -------------------------------------------
echo ----Common Files (everyone用户只读权限)----
echo -------------------------------------------
Cacls "C:\Program Files\Common Files" /t /e /c /g everyone:R
echo -------------------------------------------------------------
echo ----IIS Temporary Compressed Files (everyone用户更改权限)----
echo -------------------------------------------------------------
Cacls "C:\WINDOWS\IIS Temporary Compressed Files" /t /e /c /g everyone:C
echo --------------------------------------------
echo ----Microsoft.Net (everyone用户只读权限)----
echo --------------------------------------------
Cacls C:\WINDOWS\Microsoft.Net /t /e /c /g everyone:R
echo ------------------------------------------------------
echo ----Temporary ASP.NET Files (everyone用户更改权限)----
echo ------------------------------------------------------
Cacls "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files" /t /e /c /g everyone:C
echo ------------------------------------------------------
echo ----Temporary ASP.NET Files (everyone用户更改权限)----
echo ------------------------------------------------------
Cacls "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files" /t /e /c /g everyone:C
echo -------------------------------------------
echo ----Registration (everyone用户读取权限)----
echo -------------------------------------------
Cacls C:\WINDOWS\Registration /t /e /c /g everyone:R
echo -----------------------------------
echo ----Temp (everyone用户更改权限)----
echo -----------------------------------
Cacls C:\WINDOWS\Temp /t /e /c /g everyone:C
echo -------------------
echo ----assembly (everyone用户读取权限)----
echo ---------------------------------------
Cacls C:\WINDOWS\assembly /t /e /c /g everyone:R
echo -------------------------------------
echo ----WinSxS (everyone用户读取权限)----
echo -------------------------------------
Cacls C:\WINDOWS\WinSxS /t /e /c /g everyone:R
echo ------------------------------------
echo ----Fonts (everyone用户读取权限)----
echo ------------------------------------
Cacls C:\WINDOWS\Fonts /t /e /c /g everyone:R
echo ---------------------------------------
echo ----System32 (everyone用户读取权限)----
echo ---------------------------------------
Cacls C:\WINDOWS\System32 /t /e /c /g everyone:R
echo ------------------------------------------
echo ----msdtc (networkservice用户更改权限)----
echo ------------------------------------------
Cacls C:\windows\system32\msdtc /t /e /c /g networkservice:C
echo -----------------------------------------------------
echo ----ASP Compiled Templates (everyone用户更改权限)----
echo -----------------------------------------------------
Cacls "C:\WINDOWS\system32\inetsrv\ASP Compiled Templates" /t /e /c /g everyone:C
echo ------------------------------------
echo ----*.exe (去除everyone用户权限)----
echo ------------------------------------
Cacls C:\WINDOWS\System32\*.exe /e /c /r everyone
echo ------------------------------------
echo ----cmd.exe (去除system用户权限)----
echo ------------------------------------
Cacls C:\WINDOWS\System32\cmd.exe /e /c /r system
echo ------------------------------------
echo ----net.exe (去除system用户权限)----
echo ------------------------------------
Cacls C:\WINDOWS\System32 et.exe /e /c /r system
echo -------------------------------------
echo ----net1.exe (去除system用户权限)----
echo -------------------------------------
Cacls C:\WINDOWS\System32 et1.exe /e /c /r system
echo ----------------------------------------
echo ----msdtc.exe (everyone用户读取权限)----
echo ----------------------------------------
Cacls C:\WINDOWS\System32\msdtc.exe /e /c /g everyone:R
echo ------------------------------------------
echo ----dllhost.exe (everyone用户读取权限)----
echo ------------------------------------------
Cacls C:\WINDOWS\System32\dllhost.exe /e /c /g everyone:R
echo ------------------------------------------
echo ----svchost.exe (everyone用户读取权限)----
echo ------------------------------------------
Cacls C:\WINDOWS\System32\svchost.exe /e /c /g everyone:R
echo --------------------
echo --------------------
echo ----系统加固完毕----
echo --------------------
echo --------------------
@ping 127.0.0.1 -n 3 >nul
echo -----------------------------
echo ----安全设置完毕 欢迎使用----
echo -----------------------------
echo ------------------
echo ----重启服务器----
echo ------------------
@ping 127.0.0.1
shutdown -r
@pause
将上面的代码保存为1.cmd或1.bat,双击运行下即可。
@echo off
echo ----------------------------------
echo ----正在备份注册表 请稍后....----
echo ----------------------------------
reg export "HKEY_LOCAL_MACHINE" C:/reg_backup.reg
echo ----------------------
echo ----注册表备份完成----
echo ----------------------
ping 127.0.0.1 -n 3 >nul
echo -----------------------------------
echo ----安全配置正在改写 请稍候...----
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 ----禁用空连接设置完毕----
echo --------------------------
@ping 127.0.0.1 -n 3 >nul
echo ------------------------
echo ----正在删除默认共享----
echo ------------------------
reg add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\lanmanserver\parameters /v AutoShareServer /t reg_dword /d 0 /f
echo ----------------------------
echo ----删除默认共享设置完毕----
echo ----------------------------
@ping 127.0.0.1 -n 3 >nul
echo ------------------------------
echo ----正在修改TTL值请稍后...----
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洪水攻击设置完毕----
echo -------------------------------
@ping 127.0.0.1 -n 3 >nul
echo ------------------------------
echo ------------------------------
echo ---- 系统服务修改 ----
echo ------------------------------
echo ------------------------------
@ping 127.0.0.1 -n 3 >nul
echo --------------------
echo ----修改3389端口----
echo --------------------
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\Wds dpwd\Tds\tcp" /v PortNumber /t reg_dword /d 44454 /f
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentContro1Set\Control\Tenninal Server\WinStations\RDP\Tcp" /v PortNumber /t reg_dword /d 44454 /f
echo --------------------
echo ----修改PORT完毕----
echo --------------------
@ping 127.0.0.1 -n 3 >nul
echo -------------------------------------
echo ----正在开启系统防火墙 请稍后....----
echo -------------------------------------
sc config sharedaccess start= auto & net start sharedaccess
echo ------------------------
echo ----系统防火墙已开启----
echo ------------------------
@ping 127.0.0.1 -n 3 >nul
echo ----------------------------
echo ----正在关闭共享打印服务----
echo ----------------------------
@sc config Spooler start= disabled
sc config LanmanServer start= disabled
sc config LmHosts start= disabled
echo --------------------------
echo ----已关闭共享打印服务----
echo --------------------------
@ping 127.0.0.1 -n 3 >nul
echo ----------------------------
echo ----正在关闭远程协助服务----
echo ----------------------------
@sc config RDSessMgr start= disabled
echo --------------------------
echo ----已关闭远程协助服务----
echo --------------------------
@ping 127.0.0.1 -n 3 >nul
echo ------------------------------
echo ----正在关闭远程注册表服务----
echo ------------------------------
@sc config RemoteRegistry start= disabled
echo ----------------------------
echo ----已关闭远程注册表服务----
echo ----------------------------
@ping 127.0.0.1 -n 3 >nul
echo ----------------------------
echo ----关闭自动硬件播放通知----
echo ----------------------------
sc config ShellHWDetection start= disabled
echo -----------------------
echo ----自动播放通知关闭---
echo -----------------------
@ping 127.0.0.1 -n 3 >nul
echo ----------------------------------------
echo ----正在关闭替换凭据下的启动进程服务----
echo ----------------------------------------
sc config seclogon start= disabled
echo --------------------------
echo ----已关闭启动进程服务----
echo --------------------------
@ping 127.0.0.1 -n 3 >nul
echo ------------------------------------
echo ----IEEE 802.11 适配器的自动配置----
echo ------------------------------------
sc config WZCSVC start= disabled
echo ------------------
echo ----已关闭IEEE----
echo ------------------
@ping 127.0.0.1 -n 3 >nul
echo --------------------------
echo ----客户端跟踪服务关闭----
echo --------------------------
sc config TrkSvr start= disabled
sc config MSDTC start= disabled
echo ----------------------------
echo ----已关闭客户端跟踪服务----
echo ----------------------------
@ping 127.0.0.1 -n 3 >nul
echo --------------------
echo ----帮助中心关闭----
echo --------------------
sc config helpsvc start= disabled
echo --------------------------
echo ----已关闭帮助中心服务----
echo --------------------------
@ping 127.0.0.1 -n 3 >nul
echo --------------------------------
echo --------------------------------
echo ---- 系统权限加固 ----
echo --------------------------------
echo --------------------------------
echo -------------------------------------------------------
echo ----C盘(系统盘) (administrators,system完全控制权限)----
echo -------------------------------------------------------
cacls C:\ /t /c /g administrators:F system:F
echo -------------------------------------------
echo ----Common Files (everyone用户只读权限)----
echo -------------------------------------------
Cacls "C:\Program Files\Common Files" /t /e /c /g everyone:R
echo -------------------------------------------------------------
echo ----IIS Temporary Compressed Files (everyone用户更改权限)----
echo -------------------------------------------------------------
Cacls "C:\WINDOWS\IIS Temporary Compressed Files" /t /e /c /g everyone:C
echo --------------------------------------------
echo ----Microsoft.Net (everyone用户只读权限)----
echo --------------------------------------------
Cacls C:\WINDOWS\Microsoft.Net /t /e /c /g everyone:R
echo ------------------------------------------------------
echo ----Temporary ASP.NET Files (everyone用户更改权限)----
echo ------------------------------------------------------
Cacls "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files" /t /e /c /g everyone:C
echo ------------------------------------------------------
echo ----Temporary ASP.NET Files (everyone用户更改权限)----
echo ------------------------------------------------------
Cacls "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files" /t /e /c /g everyone:C
echo -------------------------------------------
echo ----Registration (everyone用户读取权限)----
echo -------------------------------------------
Cacls C:\WINDOWS\Registration /t /e /c /g everyone:R
echo -----------------------------------
echo ----Temp (everyone用户更改权限)----
echo -----------------------------------
Cacls C:\WINDOWS\Temp /t /e /c /g everyone:C
echo -------------------
@echo off
echo ----------------------------------
echo ----正在备份注册表 请稍后....----
echo ----------------------------------
reg export "HKEY_LOCAL_MACHINE" C:/reg_backup.reg
echo ----------------------
echo ----注册表备份完成----
echo ----------------------
ping 127.0.0.1 -n 3 >nul
echo -----------------------------------
echo ----安全配置正在改写 请稍候...----
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 ----禁用空连接设置完毕----
echo --------------------------
@ping 127.0.0.1 -n 3 >nul
echo ------------------------
echo ----正在删除默认共享----
echo ------------------------
reg add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\lanmanserver\parameters /v AutoShareServer /t reg_dword /d 0 /f
echo ----------------------------
echo ----删除默认共享设置完毕----
echo ----------------------------
@ping 127.0.0.1 -n 3 >nul
echo ------------------------------
echo ----正在修改TTL值请稍后...----
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洪水攻击设置完毕----
echo -------------------------------
@ping 127.0.0.1 -n 3 >nul
echo ------------------------------
echo ------------------------------
echo ---- 系统服务修改 ----
echo ------------------------------
echo ------------------------------
@ping 127.0.0.1 -n 3 >nul
echo --------------------
echo ----修改3389端口----
echo --------------------
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\Wds dpwd\Tds\tcp" /v PortNumber /t reg_dword /d 44454 /f
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentContro1Set\Control\Tenninal Server\WinStations\RDP\Tcp" /v PortNumber /t reg_dword /d 44454 /f
echo --------------------
echo ----修改PORT完毕----
echo --------------------
@ping 127.0.0.1 -n 3 >nul
echo -------------------------------------
echo ----正在开启系统防火墙 请稍后....----
echo -------------------------------------
sc config sharedaccess start= auto & net start sharedaccess
echo ------------------------
echo ----系统防火墙已开启----
echo ------------------------
@ping 127.0.0.1 -n 3 >nul
echo ----------------------------
echo ----正在关闭共享打印服务----
echo ----------------------------
@sc config Spooler start= disabled
sc config LanmanServer start= disabled
sc config LmHosts start= disabled
echo --------------------------
echo ----已关闭共享打印服务----
echo --------------------------
@ping 127.0.0.1 -n 3 >nul
echo ----------------------------
echo ----正在关闭远程协助服务----
echo ----------------------------
@sc config RDSessMgr start= disabled
echo --------------------------
echo ----已关闭远程协助服务----
echo --------------------------
@ping 127.0.0.1 -n 3 >nul
echo ------------------------------
echo ----正在关闭远程注册表服务----
echo ------------------------------
@sc config RemoteRegistry start= disabled
echo ----------------------------
echo ----已关闭远程注册表服务----
echo ----------------------------
@ping 127.0.0.1 -n 3 >nul
echo ----------------------------
echo ----关闭自动硬件播放通知----
echo ----------------------------
sc config ShellHWDetection start= disabled
echo -----------------------
echo ----自动播放通知关闭---
echo -----------------------
@ping 127.0.0.1 -n 3 >nul
echo ----------------------------------------
echo ----正在关闭替换凭据下的启动进程服务----
echo ----------------------------------------
sc config seclogon start= disabled
echo --------------------------
echo ----已关闭启动进程服务----
echo --------------------------
@ping 127.0.0.1 -n 3 >nul
echo ------------------------------------
echo ----IEEE 802.11 适配器的自动配置----
echo ------------------------------------
sc config WZCSVC start= disabled
echo ------------------
echo ----已关闭IEEE----
echo ------------------
@ping 127.0.0.1 -n 3 >nul
echo --------------------------
echo ----客户端跟踪服务关闭----
echo --------------------------
sc config TrkSvr start= disabled
sc config MSDTC start= disabled
echo ----------------------------
echo ----已关闭客户端跟踪服务----
echo ----------------------------
@ping 127.0.0.1 -n 3 >nul
echo --------------------
echo ----帮助中心关闭----
echo --------------------
sc config helpsvc start= disabled
echo --------------------------
echo ----已关闭帮助中心服务----
echo --------------------------
@ping 127.0.0.1 -n 3 >nul
echo --------------------------------
echo --------------------------------
echo ---- 系统权限加固 ----
echo --------------------------------
echo --------------------------------
echo -------------------------------------------------------
echo ----C盘(系统盘) (administrators,system完全控制权限)----
echo -------------------------------------------------------
cacls C:\ /t /c /g administrators:F system:F
echo -------------------------------------------
echo ----Common Files (everyone用户只读权限)----
echo -------------------------------------------
Cacls "C:\Program Files\Common Files" /t /e /c /g everyone:R
echo -------------------------------------------------------------
echo ----IIS Temporary Compressed Files (everyone用户更改权限)----
echo -------------------------------------------------------------
Cacls "C:\WINDOWS\IIS Temporary Compressed Files" /t /e /c /g everyone:C
echo --------------------------------------------
echo ----Microsoft.Net (everyone用户只读权限)----
echo --------------------------------------------
Cacls C:\WINDOWS\Microsoft.Net /t /e /c /g everyone:R
echo ------------------------------------------------------
echo ----Temporary ASP.NET Files (everyone用户更改权限)----
echo ------------------------------------------------------
Cacls "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files" /t /e /c /g everyone:C
echo ------------------------------------------------------
echo ----Temporary ASP.NET Files (everyone用户更改权限)----
echo ------------------------------------------------------
Cacls "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files" /t /e /c /g everyone:C
echo -------------------------------------------
echo ----Registration (everyone用户读取权限)----
echo -------------------------------------------
Cacls C:\WINDOWS\Registration /t /e /c /g everyone:R
echo -----------------------------------
echo ----Temp (everyone用户更改权限)----
echo -----------------------------------
Cacls C:\WINDOWS\Temp /t /e /c /g everyone:C
echo -------------------
echo ----assembly (everyone用户读取权限)----
echo ---------------------------------------
Cacls C:\WINDOWS\assembly /t /e /c /g everyone:R
echo -------------------------------------
echo ----WinSxS (everyone用户读取权限)----
echo -------------------------------------
Cacls C:\WINDOWS\WinSxS /t /e /c /g everyone:R
echo ------------------------------------
echo ----Fonts (everyone用户读取权限)----
echo ------------------------------------
Cacls C:\WINDOWS\Fonts /t /e /c /g everyone:R
echo ---------------------------------------
echo ----System32 (everyone用户读取权限)----
echo ---------------------------------------
Cacls C:\WINDOWS\System32 /t /e /c /g everyone:R
echo ------------------------------------------
echo ----msdtc (networkservice用户更改权限)----
echo ------------------------------------------
Cacls C:\windows\system32\msdtc /t /e /c /g networkservice:C
echo -----------------------------------------------------
echo ----ASP Compiled Templates (everyone用户更改权限)----
echo -----------------------------------------------------
Cacls "C:\WINDOWS\system32\inetsrv\ASP Compiled Templates" /t /e /c /g everyone:C
echo ------------------------------------
echo ----*.exe (去除everyone用户权限)----
echo ------------------------------------
Cacls C:\WINDOWS\System32\*.exe /e /c /r everyone
echo ------------------------------------
echo ----cmd.exe (去除system用户权限)----
echo ------------------------------------
Cacls C:\WINDOWS\System32\cmd.exe /e /c /r system
echo ------------------------------------
echo ----net.exe (去除system用户权限)----
echo ------------------------------------
Cacls C:\WINDOWS\System32 et.exe /e /c /r system
echo -------------------------------------
echo ----net1.exe (去除system用户权限)----
echo -------------------------------------
Cacls C:\WINDOWS\System32 et1.exe /e /c /r system
echo ----------------------------------------
echo ----msdtc.exe (everyone用户读取权限)----
echo ----------------------------------------
Cacls C:\WINDOWS\System32\msdtc.exe /e /c /g everyone:R
echo ------------------------------------------
echo ----dllhost.exe (everyone用户读取权限)----
echo ------------------------------------------
Cacls C:\WINDOWS\System32\dllhost.exe /e /c /g everyone:R
echo ------------------------------------------
echo ----svchost.exe (everyone用户读取权限)----
echo ------------------------------------------
Cacls C:\WINDOWS\System32\svchost.exe /e /c /g everyone:R
echo --------------------
echo --------------------
echo ----系统加固完毕----
echo --------------------
echo --------------------
@ping 127.0.0.1 -n 3 >nul
echo -----------------------------
echo ----安全设置完毕 欢迎使用----
echo -----------------------------
echo ------------------
echo ----重启服务器----
echo ------------------
@ping 127.0.0.1
shutdown -r
@pause
将上面的代码保存为1.cmd或1.bat,双击运行下即可。
标签:
系统安全,批处理
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件!
如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
暂无“Win2003环境下的一键系统安全批处理”评论...
RTX 5090要首发 性能要翻倍!三星展示GDDR7显存
三星在GTC上展示了专为下一代游戏GPU设计的GDDR7内存。
首次推出的GDDR7内存模块密度为16GB,每个模块容量为2GB。其速度预设为32 Gbps(PAM3),但也可以降至28 Gbps,以提高产量和初始阶段的整体性能和成本效益。
据三星表示,GDDR7内存的能效将提高20%,同时工作电压仅为1.1V,低于标准的1.2V。通过采用更新的封装材料和优化的电路设计,使得在高速运行时的发热量降低,GDDR7的热阻比GDDR6降低了70%。
更新动态
2024年11月23日
2024年11月23日
- 凤飞飞《我们的主题曲》飞跃制作[正版原抓WAV+CUE]
- 刘嘉亮《亮情歌2》[WAV+CUE][1G]
- 红馆40·谭咏麟《歌者恋歌浓情30年演唱会》3CD[低速原抓WAV+CUE][1.8G]
- 刘纬武《睡眠宝宝竖琴童谣 吉卜力工作室 白噪音安抚》[320K/MP3][193.25MB]
- 【轻音乐】曼托凡尼乐团《精选辑》2CD.1998[FLAC+CUE整轨]
- 邝美云《心中有爱》1989年香港DMIJP版1MTO东芝首版[WAV+CUE]
- 群星《情叹-发烧女声DSD》天籁女声发烧碟[WAV+CUE]
- 刘纬武《睡眠宝宝竖琴童谣 吉卜力工作室 白噪音安抚》[FLAC/分轨][748.03MB]
- 理想混蛋《Origin Sessions》[320K/MP3][37.47MB]
- 公馆青少年《我其实一点都不酷》[320K/MP3][78.78MB]
- 群星《情叹-发烧男声DSD》最值得珍藏的完美男声[WAV+CUE]
- 群星《国韵飘香·贵妃醉酒HQCD黑胶王》2CD[WAV]
- 卫兰《DAUGHTER》【低速原抓WAV+CUE】
- 公馆青少年《我其实一点都不酷》[FLAC/分轨][398.22MB]
- ZWEI《迟暮的花 (Explicit)》[320K/MP3][57.16MB]