您好,登錄后才能下訂單哦!
::author vim ::QQ 82996821 ::filename Windows2008R2_safe_auto_set.bat :start @echo off color 0a @echo 請(qǐng)選擇要服務(wù)操作類型: @echo 1.更改遠(yuǎn)程端口,重啟后生效 @echo 2.目錄權(quán)限優(yōu)化 @echo 3.系統(tǒng)服務(wù)優(yōu)化 @echo 4.網(wǎng)絡(luò)安全優(yōu)化[修改注冊(cè)表] @echo 5.禁用所有IPV6組件,除IPV6環(huán)回接口 @echo 6.刪除系統(tǒng)默認(rèn)共享 @echo 7.卸載ASP漏洞wshom.ocx,shell32.dll組件 @echo 8.組策略優(yōu)化 @echo 9.關(guān)閉防火墻 @echo 0.退出 set/p a=請(qǐng)選擇服務(wù)操作類型: goto start%a% :start1 echo 請(qǐng)輸入要修改的遠(yuǎn)程端口號(hào): set /p var= echo 開始修改 reg delete "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\Wds\rdpwd\Tds\tcp" /v PortNumber /f reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\Wds\rdpwd\Tds\tcp" /v PortNumber /t REG_DWORD /d %var% /f reg delete "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" /v PortNumber /f reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" /v PortNumber /t REG_DWORD /d %var% /f echo 修改成功,下面是添加防火墻規(guī)則 netsh advfirewall firewall add rule name="remote_"%var% protocol=TCP dir=in localport=%var% action=allow @pause cls goto :start :start2 echo 目錄權(quán)限優(yōu)化 echo ========================================================== ::echo 降低C盤權(quán)限 ::cacls C:\ /e /r "CREATOR OWNER" "Users" >>log.log echo windows系統(tǒng)文件夾權(quán)限設(shè)置 takeown /F C:\Windows\System32 takeown /F C:\Windows\System32\config cacls C:\Windows\System32 /e /r "CREATOR OWNER">>log.log cacls C:\Windows\System32\config /e /r "CREATOR OWNER">>log.log echo 程序文件權(quán)限設(shè)置 takeown /F "C:\Program Files\Windows NT\Accessories" takeown /F "C:\Program Files\Internet Explorer\iexplore.exe" takeown /F "C:\Program Files\Common Files" cacls "C:\Program Files\Windows NT\Accessories" /e /r "CREATOR OWNER" "Users" >>log.log cacls "C:\Program Files\Internet Explorer\iexplore.exe" /e /r system users >>log.log cacls "C:\Program Files\Common Files" /e /r "CREATOR OWNER" "Users" >>log.log echo 用戶配置信息的文件夾權(quán)限設(shè)置 takeown /F "C:\ProgramData\Documents" takeown /F "C:\ProgramData\Application Data\Microsoft" takeown /F "C:\ProgramData\Application Data" takeown /F "C:\ProgramData\「開始」菜單" takeown /F "C:\Documents and Settings" cacls "C:\ProgramData\Documents" /e /r everyone >>log.log cacls "C:\ProgramData\Application Data\Microsoft" /e /r everyone >>log.log cacls "C:\ProgramData\Application Data" /e /r everyone >>log.log cacls "C:\ProgramData\「開始」菜單" /e /r everyone >>log.log cacls "C:\Documents and Settings" /e /r everyone >>log.log echo iis下的ASP,ASPX網(wǎng)站相關(guān)的EXE和DLL takeown /F C:\Windows\System32\wscript.exe takeown /F C:\Windows\System32\wshom.ocx cacls C:\Windows\System32\wscript.exe /e /r users >>log.log cacls C:\Windows\System32\wshom.ocx /e /r users >>log.log echo windows系統(tǒng)文件夾下的關(guān)鍵二進(jìn)制文件 takeown /f C:\Windows\System32\zipfldr.dll takeown /f C:\Windows\System32\xcopy.exe takeown /f C:\Windows\System32\wshext.dll takeown /f C:\Windows\System32\where.exe takeown /f C:\Windows\System32\tracert.exe takeown /f C:\Windows\System32\syskey.exe takeown /f C:\Windows\System32\shutdown.exe takeown /f C:\Windows\System32\shadow.exe takeown /f C:\Windows\System32\setx.exe takeown /f C:\Windows\System32\sethc.exe takeown /f C:\Windows\System32\secedit.exe takeown /f C:\Windows\System32\sc.exe takeown /f C:\Windows\System32\runonce.exe takeown /f C:\Windows\System32\runas.exe takeown /f C:\Windows\System32\route.exe takeown /f C:\Windows\System32\replace.exe takeown /f C:\Windows\System32\regsvr32.exe takeown /f C:\Windows\System32\regedt32.exe takeown /f C:\Windows\System32\reg.exe takeown /f C:\Windows\System32\print.exe takeown /f C:\Windows\System32\powercfg.exe takeown /f C:\Windows\System32\ping.exe takeown /f C:\Windows\System32\nslookup.exe takeown /f C:\Windows\System32\notepad.exe takeown /f C:\Windows\System32\netstat.exe takeown /f C:\Windows\System32\netsh.exe takeown /f C:\Windows\System32\net1.exe takeown /f C:\Windows\System32\net.exe takeown /f C:\Windows\System32\mstsc.exe takeown /f C:\Windows\System32\mshta.exe takeown /f C:\Windows\System32\mountvol.exe takeown /f C:\Windows\System32\logoff.exe takeown /f C:\Windows\System32\ipconfig.exe takeown /f C:\Windows\System32\help.exe takeown /f C:\Windows\System32\gpupdate.exe takeown /f C:\Windows\System32\ftp.exe takeown /f C:\Windows\System32\format.com takeown /f C:\Windows\System32\finger.exe takeown /f C:\Windows\System32\find.exe takeown /f C:\Windows\System32\doskey.exe takeown /f C:\Windows\System32\cscript.exe takeown /f C:\Windows\System32\cmd.exe takeown /f C:\Windows\System32\cacls.exe takeown /f C:\Windows\System32\attrib.exe takeown /f C:\Windows\System32\at.exe takeown /f C:\Windows\System32\arp.exe cacls C:\Windows\System32\zipfldr.dll /e /r users >>log.log cacls C:\Windows\System32\xcopy.exe /e /r users >>log.log cacls C:\Windows\System32\wshext.dll /e /r users >>log.log cacls C:\Windows\System32\where.exe /e /r users >>log.log cacls C:\Windows\System32\tracert.exe /e /r users >>log.log cacls C:\Windows\System32\syskey.exe /e /r users >>log.log cacls C:\Windows\System32\shutdown.exe /e /r users >>log.log cacls C:\Windows\System32\shadow.exe /e /r users >>log.log cacls C:\Windows\System32\setx.exe /e /r users >>log.log cacls C:\Windows\System32\sethc.exe /e /r users >>log.log cacls C:\Windows\System32\secedit.exe /e /r users >>log.log cacls C:\Windows\System32\sc.exe /e /r users >>log.log cacls C:\Windows\System32\runonce.exe /e /r users >>log.log cacls C:\Windows\System32\runas.exe /e /r users >>log.log cacls C:\Windows\System32\route.exe /e /r users >>log.log cacls C:\Windows\System32\replace.exe /e /r users >>log.log cacls C:\Windows\System32\regsvr32.exe /e /r users >>log.log cacls C:\Windows\System32\regedt32.exe /e /r users >>log.log cacls C:\Windows\System32\reg.exe /e /r users >>log.log cacls C:\Windows\System32\print.exe /e /r users >>log.log cacls C:\Windows\System32\powercfg.exe /e /r users >>log.log cacls C:\Windows\System32\ping.exe /e /r users >>log.log cacls C:\Windows\System32\nslookup.exe /e /r users >>log.log cacls C:\Windows\System32\notepad.exe /e /r users >>log.log cacls C:\Windows\System32\netstat.exe /e /r users >>log.log cacls C:\Windows\System32\netsh.exe /e /r users >>log.log cacls C:\Windows\System32\net1.exe /e /r users >>log.log cacls C:\Windows\System32\net.exe /e /r users >>log.log cacls C:\Windows\System32\mstsc.exe /e /r users >>log.log cacls C:\Windows\System32\mshta.exe /e /r users >>log.log cacls C:\Windows\System32\mountvol.exe /e /r users >>log.log cacls C:\Windows\System32\logoff.exe /e /r users >>log.log cacls C:\Windows\System32\ipconfig.exe /e /r users >>log.log cacls C:\Windows\System32\help.exe /e /r users >>log.log cacls C:\Windows\System32\gpupdate.exe /e /r users >>log.log cacls C:\Windows\System32\ftp.exe /e /r users >>log.log cacls C:\Windows\System32\format.com /e /r users >>log.log cacls C:\Windows\System32\finger.exe /e /r users >>log.log cacls C:\Windows\System32\find.exe /e /r users >>log.log cacls C:\Windows\System32\doskey.exe /e /r users >>log.log cacls C:\Windows\System32\cscript.exe /e /r users >>log.log cacls C:\Windows\System32\cmd.exe /e /r users >>log.log cacls C:\Windows\System32\cacls.exe /e /r users >>log.log cacls C:\Windows\System32\attrib.exe /e /r users >>log.log cacls C:\Windows\System32\at.exe /e /r users >>log.log cacls C:\Windows\System32\arp.exe /e /r users >>log.log @pause cls goto :start :start3 echo 系統(tǒng)服務(wù)優(yōu)化 echo ========================================================== echo Background Intelligent Transfer Service 使用空閑網(wǎng)絡(luò)帶寬在后臺(tái)傳送文件。 sc config BITS start= disabled >>log.log echo 關(guān)閉TCP/IP NetBIOS Helper 提供 TCP/IP (NetBT) 服務(wù)上的 NetBIOS 和網(wǎng)絡(luò)上客戶端的 NetBIOS 名稱解析的支持 sc config lmhosts start= disabled >>log.log echo 關(guān)閉Network Location Awareness網(wǎng)絡(luò)訪問(wèn)保護(hù)(NAP)代理服務(wù) sc config NlaSvc start= disabled >>log.log echo 關(guān)閉Remote Registry 遠(yuǎn)程修改注冊(cè)表 sc config RemoteRegistry start= disabled >>log.log echo 關(guān)閉Print Spooler 將文件加載到內(nèi)存供稍后打印 sc config Spooler start= disabled >>log.log echo 關(guān)閉Distributed Link linktracking client 用于局域網(wǎng)更新連接信息 sc config TrkWks start= disabled >>log.log echo 關(guān)閉Shell Hardware Detection 為自動(dòng)播放硬件事件提供通知。 sc config ShellHWDetection start= disabled >>log.log echo 關(guān)閉Windows Update 啟用檢測(cè)、下載和安裝 Windows 和其他程序的更新。 sc config wuauserv start= disabled >>log.log echo 關(guān)閉支持此計(jì)算機(jī)通過(guò)網(wǎng)絡(luò)的文件、打印、和命名管道共享。 sc config LanmanServer start= disabled >>log.log @pause cls goto :start :start4 echo 網(wǎng)絡(luò)安全優(yōu)化[修改注冊(cè)表] echo ==============備份注冊(cè)表在當(dāng)前目錄===================== reg export hklm hklm.reg reg export hkcu hkcu.reg reg export hkcr hkcr.reg reg export hku hku.reg reg export hkcc hkcc.reg echo ===================優(yōu)化注冊(cè)表========================= echo 135端口主要用于使用遠(yuǎn)程過(guò)程調(diào)用,服務(wù)器上一般不建議開啟 reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Ole" /v EnableDCOM /t REG_SZ /d N /f reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Rpc" /v "DCOM Protocols" /t REG_MULTI_SZ /f reg add "HKEY_CURRENT_USER\Control Panel\Accessibility\StickyKeys" /v Flags /t REG_SZ /d 506 /f echo 445端口控制在局域網(wǎng)中輕松訪問(wèn)各種共享文件夾或共享打印機(jī),服務(wù)器上一般不建議開啟 reg add "HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\services\NetBT\Parameters" /v SMBDeviceEnabled /t REG_DWORD /d 0 /f reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\NetBT\Parameters" /v SMBDeviceEnabled /t REG_DWORD /d 0 /f echo IPC空連接可以使連接者與目標(biāo)主機(jī)建立一個(gè)空的連接而無(wú)需用戶名與密碼,存在風(fēng)險(xiǎn)建議關(guān)閉 reg add "HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Lsa" /v restrictanonymous /t REG_DWORD /d 1 /f reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa" /v restrictanonymous /t REG_DWORD /d 1 /f echo 配置Backlog,提高網(wǎng)絡(luò)并發(fā)性及網(wǎng)絡(luò)的處理能力 reg add "HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\services\AFD\Parameters" /v EnableDynamicBacklog /t REG_DWORD /d 1 /f reg add "HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\services\AFD\Parameters" /v MinimumDynamicBacklog /t REG_DWORD /d 20 /f reg add "HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\services\AFD\Parameters" /v MaximumDynamicBacklog /t REG_DWORD /d 20000 /f reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\AFD\Parameters" /v EnableDynamicBacklog /t REG_DWORD /d 1 /f reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\AFD\Parameters" /v MinimumDynamicBacklog /t REG_DWORD /d 20 /f reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\AFD\Parameters" /v MaximumDynamicBacklog /t REG_DWORD /d 20000 /f echo 通過(guò)優(yōu)化該選項(xiàng)可提高系統(tǒng)防御SYN***的能力,建議優(yōu)化 reg add "HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\services" /v SynAttackProtect /t REG_DWORD /d 1 /f reg add "HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\services" /v EnableDeadGWDetect /t REG_DWORD /d 0 /f reg add "HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\services\Tcpip\Parameters" /v SynAttackProtect /t REG_DWORD /d 2 /f reg add "HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\services\Tcpip\Parameters" /v TCPMaxPortsExhausted /t REG_DWORD /d 5 /f 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 TCPMaxPortsExhausted /t REG_DWORD /d 5 /f echo 通過(guò)優(yōu)化設(shè)置SYN-ACK等待時(shí)間,可提高系統(tǒng)的網(wǎng)絡(luò)性能 reg add "HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\services\Tcpip\Parameters" /v TcpMaxConnectResponseRetransmissions /t REG_DWORD /d 2 /f reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Tcpip\Parameters" /v TcpMaxConnectResponseRetransmissions /t REG_DWORD /d 2 /f echo 抵御SNMP***,檢查無(wú)效網(wǎng)關(guān),以便優(yōu)化網(wǎng)絡(luò) reg add "HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\services\Tcpip\Parameters" /v EnableDeadGWDetect /t REG_DWORD /d 0 /f reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Tcpip\Parameters" /v EnableDeadGWDetect /t REG_DWORD /d 0 /f echo 抵御ICMP***,檢查有可能用以***的ICMP重定向報(bào)文 reg add "HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\services\Tcpip\Parameters" /v EnableICMPRedirects /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 檢查TCPIP協(xié)議棧IGMP堆棧溢出本地拒絕服務(wù)*** reg add "HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\services\Tcpip\Parameters" /v IGMPLevel /t REG_DWORD /d 0 /f reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Tcpip\Parameters" /v IGMPLevel /t REG_DWORD /d 0 /f echo 檢查是否禁止IP源路由,建議丟棄所有接受的源路由包 reg add "HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\services\Tcpip\Parameters" /v DisableIPSourceRouting /t REG_DWORD /d 2 /f reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Tcpip\Parameters" /v DisableIPSourceRouting /t REG_DWORD /d 2 /f echo 禁止路由發(fā)現(xiàn)功能,ICMP路由通告報(bào)文可以被用來(lái)增加路由表紀(jì)錄,可以導(dǎo)致*** reg add "HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\services\Tcpip\Parameters" /v PerformRouterDiscovery /t REG_DWORD /d 0 /f reg add "HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\services\Tcpip\Parameters\Interfaces" /v PerformRouterDiscovery /t REG_DWORD /d 0 /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\Interfaces" /v PerformRouterDiscovery /t REG_DWORD /d 0 /f echo 更改ping命令返回的默認(rèn)TTL值。***可通過(guò)些值判斷操作系統(tǒng)類型 reg add "HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\services\Tcpip\Parameters" /v DefaultTTL /t REG_DWORD /d 240 /f reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Tcpip\Parameters\Interfaces" /v DefaultTTL /t REG_DWORD /d 240 /f echo 優(yōu)化計(jì)算機(jī)在收到名稱釋放請(qǐng)求時(shí)是否釋放其NETBIOS名稱,使計(jì)算機(jī)受惡意的名稱釋放*** reg add "HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\services\NetBT\Parameters" /v NoNameReleaseOnDemand /t REG_DWORD /d 1 /f reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\NetBT\Parameters" /v NoNameReleaseOnDemand /t REG_DWORD /d 1 /f echo 優(yōu)化TCP閑置鏈接檢查時(shí)間,提升網(wǎng)絡(luò)性能 reg add "HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\services\Tcpip\Parameters" /v KeepAliveTime /t REG_DWORD /d 300000 /f reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Tcpip\Parameters" /v KeepAliveTime /t REG_DWORD /d 300000 /f echo 禁止進(jìn)行最大包長(zhǎng)度路徑檢測(cè)。如開啟該功能,***者可能將數(shù)據(jù)包強(qiáng)制分段,這公使堆棧不堪重負(fù) reg add "HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\services\Tcpip\Parameters" /v EnablePMTUDiscovery /t REG_DWORD /d 0 /f reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Tcpip\Parameters" /v EnablePMTUDiscovery /t REG_DWORD /d 0 /f echo 優(yōu)化TCP半連接相關(guān)參數(shù)值,提升網(wǎng)絡(luò)性能 reg add "HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\services\Tcpip\Parameters" /v TcpMaxHalfOpen /t REG_DWORD /d 500 /f reg add "HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\services\Tcpip\Parameters" /v TcpMaxHalfOpenRetried /t REG_DWORD /d 400 /f reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Tcpip\Parameters" /v TcpMaxHalfOpen /t REG_DWORD /d 500 /f reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Tcpip\Parameters" /v TcpMaxHalfOpenRetried /t REG_DWORD /d 400 /f echo 設(shè)置TCP重傳單個(gè)數(shù)據(jù)段的次數(shù)。缺少項(xiàng)值為5,缺省這一過(guò)程消耗時(shí)間240秒。微軟站點(diǎn)安全推薦為3 reg add "HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\services\Tcpip\Parameters" /v TcpMaxDataRetransmissions /t REG_DWORD /d 2 /f reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Tcpip\Parameters" /v TcpMaxDataRetransmissions /t REG_DWORD /d 2 /f echo 禁止轉(zhuǎn)發(fā)IP多播數(shù)據(jù)包。多播數(shù)據(jù)包可能被多臺(tái)主機(jī)響應(yīng),從而導(dǎo)致響應(yīng)淹沒(méi)網(wǎng)絡(luò) reg add "HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\services\Tcpip\Parameters" /v EnableMulticastForwarding /t REG_DWORD /d 0 /f reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Tcpip\Parameters" /v EnableMulticastForwarding /t REG_DWORD /d 0 /f echo 屏蔽網(wǎng)絡(luò)拓?fù)浣Y(jié)構(gòu)細(xì)節(jié),防止***者利用主機(jī)響應(yīng)來(lái)了解內(nèi)部網(wǎng)絡(luò)情況 reg add "HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\services\Tcpip\Parameters" /v EnableAddrMaskReply /t REG_DWORD /d 0 /f reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Tcpip\Parameters" /v EnableAddrMaskReply /t REG_DWORD /d 0 /f @pause cls goto :start :start5 echo 禁用所有IPV6組件,除IPV6環(huán)回接口 reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters" /v DisabledComponents /t REG_DWORD /d 0xffffffff /f echo 禁用所有IPV6組件,除IPV6環(huán)回接口完畢 @pause cls goto :start :start6 echo 刪除系統(tǒng)默認(rèn)共享 reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Lanmanserver\parameters" /v AutoShareServer /t REG_DWORD /d 0 /f reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Lanmanserver\parameters" /v AutoShareWks /t REG_DWORD /d 0 /f reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa" /v RestrictAnonymous /t REG_DWORD /d 1 /f echo 刪除系統(tǒng)默認(rèn)共享完畢 @pause cls goto :start :start7 echo 卸載ASP漏洞wshom.ocx,shell32.dll組件 regsvr32/u wshom.ocx >>log.log regsvr32 /u shell32.dll >>log.log echo 卸載ASP漏洞wshom.ocx,shell32.dll組件完畢 @pause cls goto :start :start8 echo 組策略優(yōu)化 echo ================備份組策略到當(dāng)前目錄==================== secedit /export /cfg ./gpedit_bak.inf echo ================恢復(fù)組策略優(yōu)化后文件==================== secedit /configure /db temp.sdb /cfg ./gpedit_setup.inf @pause cls goto :start :start9 echo 關(guān)閉防火墻 netsh advfirewall set allprofiles state off @pause cls goto :start :start0 goto end :end
##########windows_2008_R2_優(yōu)化內(nèi)容詳細(xì)#################
echo 目錄權(quán)限優(yōu)化
echo ==========================================================
echo windows系統(tǒng)文件夾權(quán)限設(shè)置
C:\Windows\System32
C:\Windows\System32\config
echo 程序文件權(quán)限設(shè)置
"C:\Program Files\Windows NT\Accessories"
"C:\Program Files\Internet Explorer\iexplore.exe"
"C:\Program Files\Common Files"
echo 用戶配置信息的文件夾權(quán)限設(shè)置
"C:\ProgramData\Documents"
"C:\ProgramData\Application Data\Microsoft"
"C:\ProgramData\Application Data"
"C:\ProgramData\「開始」菜單"
"C:\Documents and Settings"
echo iis下的ASP,ASPX網(wǎng)站相關(guān)的EXE和DLL
C:\Windows\System32\wscript.exe
C:\Windows\System32\wshom.ocx
echo windows系統(tǒng)文件夾下的關(guān)鍵二進(jìn)制文件
C:\Windows\System32\zipfldr.dll
C:\Windows\System32\xcopy.exe
C:\Windows\System32\wshext.dll
C:\Windows\System32\where.exe
C:\Windows\System32\tracert.exe
C:\Windows\System32\syskey.exe
C:\Windows\System32\shutdown.exe
C:\Windows\System32\shadow.exe
C:\Windows\System32\setx.exe
C:\Windows\System32\sethc.exe
C:\Windows\System32\secedit.exe
C:\Windows\System32\sc.exe
C:\Windows\System32\runonce.exe
C:\Windows\System32\runas.exe
C:\Windows\System32\route.exe
C:\Windows\System32\replace.exe
C:\Windows\System32\regsvr32.exe
C:\Windows\System32\regedt32.exe
C:\Windows\System32\reg.exe
C:\Windows\System32\print.exe
C:\Windows\System32\powercfg.exe
C:\Windows\System32\ping.exe
C:\Windows\System32\nslookup.exe
C:\Windows\System32\notepad.exe
C:\Windows\System32\netstat.exe
C:\Windows\System32\netsh.exe
C:\Windows\System32\net1.exe
C:\Windows\System32\net.exe
C:\Windows\System32\mstsc.exe
C:\Windows\System32\mshta.exe
C:\Windows\System32\mountvol.exe
C:\Windows\System32\logoff.exe
C:\Windows\System32\ipconfig.exe
C:\Windows\System32\help.exe
C:\Windows\System32\gpupdate.exe
C:\Windows\System32\ftp.exe
C:\Windows\System32\format.com
C:\Windows\System32\finger.exe
C:\Windows\System32\find.exe
C:\Windows\System32\doskey.exe
C:\Windows\System32\cscript.exe
C:\Windows\System32\cmd.exe
C:\Windows\System32\cacls.exe
C:\Windows\System32\attrib.exe
C:\Windows\System32\at.exe
C:\Windows\System32\arp.exe
########################################################################################
echo 系統(tǒng)服務(wù)優(yōu)化
echo ==========================================================
echo Background Intelligent Transfer Service 使用空閑網(wǎng)絡(luò)帶寬在后臺(tái)傳送文件。
echo 關(guān)閉TCP/IP NetBIOS Helper 提供 TCP/IP (NetBT) 服務(wù)上的 NetBIOS 和網(wǎng)絡(luò)上客戶端的 NetBIOS 名稱解析的支持
echo 關(guān)閉Network Location Awareness網(wǎng)絡(luò)訪問(wèn)保護(hù)(NAP)代理服務(wù)
echo 關(guān)閉Remote Registry 遠(yuǎn)程修改注冊(cè)表
echo 關(guān)閉Print Spooler 將文件加載到內(nèi)存供稍后打印
echo 關(guān)閉Distributed Link linktracking client 用于局域網(wǎng)更新連接信息
echo 關(guān)閉Shell Hardware Detection 為自動(dòng)播放硬件事件提供通知。
echo 關(guān)閉Windows Update 啟用檢測(cè)、下載和安裝 Windows 和其他程序的更新。
########################################################################################
echo 網(wǎng)絡(luò)安全優(yōu)化[修改注冊(cè)表]
#網(wǎng)絡(luò)安全優(yōu)化[修改注冊(cè)表]
135端口主要用于使用遠(yuǎn)程過(guò)程調(diào)用,服務(wù)器上一般不建議開啟
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Ole]
"EnableDCOM"="Y"
"EnableDCOM"="N"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Rpc]
"DCOM Protocols"=hex(7):6e,00,63,00,61,00,63,00,6e,00,5f,00,69,00,70,00,5f,00,\
74,00,63,00,70,00,00,00,00,00
"DCOM Protocols"=hex(7):
[HKEY_CURRENT_USER\Control Panel\Accessibility\StickyKeys]
"Flags"="510"
"Flags"="506"
445端口控制在局域網(wǎng)中輕松訪問(wèn)各種共享文件夾或共享打印機(jī),服務(wù)器上一般不建議開啟
[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\services\NetBT\Parameters]
"SMBDeviceEnabled"=dword:00000000
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\NetBT\Parameters]
"SMBDeviceEnabled"=dword:00000000
IPC空連接可以使連接者與目標(biāo)主機(jī)建立一個(gè)空的連接而無(wú)需用戶名與密碼,存在風(fēng)險(xiǎn)建議關(guān)閉
[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Lsa]
"restrictanonymous"=dword:00000000
"restrictanonymous"=dword:00000001
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa]
"restrictanonymous"=dword:00000000
"restrictanonymous"=dword:00000001
配置Backlog,提高網(wǎng)絡(luò)并發(fā)性及網(wǎng)絡(luò)的處理能力
[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\services\AFD\Parameters]
"EnableDynamicBacklog"=dword:00000001
"MinimumDynamicBacklog"=dword:00000014
"MaximumDynamicBacklog"=dword:00004e20
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\AFD\Parameters]
"EnableDynamicBacklog"=dword:00000001
"MinimumDynamicBacklog"=dword:00000014
"MaximumDynamicBacklog"=dword:00004e20
通過(guò)優(yōu)化該選項(xiàng)可提高系統(tǒng)防御SYN***的能力,建議優(yōu)化
[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\services]
"SynAttackProtect"=dword:00000001
"EnableDeadGWDetect"=dword:00000000
[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\services\Tcpip\Parameters]
"SynAttackProtect"=dword:00000002
"TCPMaxPortsExhausted"=dword:00000005
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services]
"SynAttackProtect"=dword:00000001
"EnableDeadGWDetect"=dword:00000000
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Tcpip\Parameters]
"SynAttackProtect"=dword:00000002
"TCPMaxPortsExhausted"=dword:00000005
通過(guò)優(yōu)化設(shè)置SYN-ACK等待時(shí)間,可提高系統(tǒng)的網(wǎng)絡(luò)性能
[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\services\Tcpip\Parameters]
"TcpMaxConnectResponseRetransmissions"=dword:00000002
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Tcpip\Parameters]
"TcpMaxConnectResponseRetransmissions"=dword:00000002
抵御SNMP***,檢查無(wú)效網(wǎng)關(guān),以便優(yōu)化網(wǎng)絡(luò)
[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\services\Tcpip\Parameters]
"EnableDeadGWDetect"=dword:00000000
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Tcpip\Parameters]
"EnableDeadGWDetect"=dword:00000000
抵御ICMP***,檢查有可能用以***的ICMP重定向報(bào)文
[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\services\Tcpip\Parameters]
"EnableICMPRedirects"=dword:00000000
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Tcpip\Parameters]
"EnableICMPRedirects"=dword:00000000
檢查TCPIP協(xié)議棧IGMP堆棧溢出本地拒絕服務(wù)***
[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\services\Tcpip\Parameters]
"IGMPLevel"=dword:00000000
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Tcpip\Parameters]
"IGMPLevel"=dword:00000000
檢查是否禁止IP源路由,建議丟棄所有接受的源路由包
[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\services\Tcpip\Parameters]
"DisableIPSourceRouting"=dword:00000002
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Tcpip\Parameters]
"DisableIPSourceRouting"=dword:00000002
禁止路由發(fā)現(xiàn)功能,ICMP路由通告報(bào)文可以被用來(lái)增加路由表紀(jì)錄,可以導(dǎo)致***
[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\services\Tcpip\Parameters]
"PerformRouterDiscovery"=dword:00000000
[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\services\Tcpip\Parameters\Interfaces]
"PerformRouterDiscovery"=dword:00000000
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Tcpip\Parameters]
"PerformRouterDiscovery"=dword:00000000
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Tcpip\Parameters\Interfaces]
"PerformRouterDiscovery"=dword:00000000
更改ping命令返回的默認(rèn)TTL值。***可通過(guò)些值判斷操作系統(tǒng)類型
[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\services\Tcpip\Parameters]
"DefaultTTL"=dword:000000f0
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Tcpip\Parameters]
"DefaultTTL"=dword:000000f0
優(yōu)化計(jì)算機(jī)在收到名稱釋放請(qǐng)求時(shí)是否釋放其NETBIOS名稱,使計(jì)算機(jī)受惡意的名稱釋放***
[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\services\NetBT\Parameters]
"NoNameReleaseOnDemand"=dword:00000001
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\NetBT\Parameters]
"NoNameReleaseOnDemand"=dword:00000001
優(yōu)化TCP閑置鏈接檢查時(shí)間,提升網(wǎng)絡(luò)性能
[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\services\Tcpip\Parameters]
"KeepAliveTime"=dword:000493e0
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Tcpip\Parameters]
"KeepAliveTime"=dword:000493e0
禁止進(jìn)行最大包長(zhǎng)度路徑檢測(cè)。如開啟該功能,***者可能將數(shù)據(jù)包強(qiáng)制分段,這公使堆棧不堪重負(fù)
[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\services\Tcpip\Parameters]
"EnablePMTUDiscovery"=dword:00000000
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Tcpip\Parameters]
"EnablePMTUDiscovery"=dword:00000000
優(yōu)化TCP半連接相關(guān)參數(shù)值,提升網(wǎng)絡(luò)性能
[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\services\Tcpip\Parameters]
"TcpMaxHalfOpen"=dword:000001f4
"TcpMaxHalfOpenRetried"=dword:00000190
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Tcpip\Parameters]
"TcpMaxHalfOpen"=dword:000001f4
"TcpMaxHalfOpenRetried"=dword:00000190
設(shè)置TCP重傳單個(gè)數(shù)據(jù)段的次數(shù)。缺少項(xiàng)值為5,缺省這一過(guò)程消耗時(shí)間240秒。微軟站點(diǎn)安全推薦為3
[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\services\Tcpip\Parameters]
"TcpMaxDataRetransmissions"=dword:00000002
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Tcpip\Parameters]
"TcpMaxDataRetransmissions"=dword:00000002
禁止轉(zhuǎn)發(fā)IP多播數(shù)據(jù)包。多播數(shù)據(jù)包可能被多臺(tái)主機(jī)響應(yīng),從而導(dǎo)致響應(yīng)淹沒(méi)網(wǎng)絡(luò)
[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\services\Tcpip\Parameters]
"EnableMulticastForwarding"=dword:00000000
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Tcpip\Parameters]
"EnableMulticastForwarding"=dword:00000000
屏蔽網(wǎng)絡(luò)拓?fù)浣Y(jié)構(gòu)細(xì)節(jié),防止***者利用主機(jī)響應(yīng)來(lái)了解內(nèi)部網(wǎng)絡(luò)情況
[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\services\Tcpip\Parameters]
"EnableAddrMaskReply"=dword:00000000
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Tcpip\Parameters]
"EnableAddrMaskReply"=dword:00000000
########################################################################################
echo 禁用所有IPV6組件,除IPV6環(huán)回接口
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters" /v DisabledComponents /t REG_DWORD /d 0xffffffff /f
########################################################################################
echo 刪除系統(tǒng)默認(rèn)共享
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Lanmanserver\parameters" /v AutoShareServer /t REG_DWORD /d 0 /f
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Lanmanserver\parameters" /v AutoShareWks /t REG_DWORD /d 0 /f
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa" /v RestrictAnonymous /t REG_DWORD /d 1 /f
########################################################################################
echo 卸載regsvr32.dll組件
regsvr32 /u shell32.dll >>log.log
echo 卸載regsvr32.dll組件完畢
########################################################################################
echo 組策略優(yōu)化
echo ================備份組策略到當(dāng)前目錄====================
secedit /export /cfg ./gpedit_bak.inf
echo ================恢復(fù)組策略優(yōu)化后文件====================
secedit /configure /db temp.sdb /cfg ./gpedit_setup.inf
########################################################################################
echo 關(guān)閉防火墻
netsh advfirewall set allprofiles state off
#########################################################################################
echo 組策略優(yōu)化內(nèi)容
本地策略——>安全選項(xiàng)
計(jì)算機(jī)配置-->Windows設(shè)置-->安全設(shè)置-->本地策略-->安全選項(xiàng)
交互式登陸:不顯示最后的用戶名 啟用
網(wǎng)絡(luò)訪問(wèn):不允許SAM帳戶的匿名枚舉 啟用 已經(jīng)啟用
網(wǎng)絡(luò)訪問(wèn):不允許SAM帳戶和共享的匿名枚舉 啟用
網(wǎng)絡(luò)訪問(wèn):不允許儲(chǔ)存網(wǎng)絡(luò)身份驗(yàn)證的憑據(jù) 啟用
網(wǎng)絡(luò)訪問(wèn):可匿名訪問(wèn)的共享 內(nèi)容全部刪除
網(wǎng)絡(luò)訪問(wèn):可匿名訪問(wèn)的命名管道 內(nèi)容全部刪除
網(wǎng)絡(luò)訪問(wèn):可遠(yuǎn)程訪問(wèn)的注冊(cè)表路徑 內(nèi)容全部刪除
網(wǎng)絡(luò)訪問(wèn):可遠(yuǎn)程訪問(wèn)的注冊(cè)表路徑和子路徑 內(nèi)容全部刪除
帳戶:重命名來(lái)賓帳戶 這里可以更改guest帳號(hào)
帳戶:重命名系統(tǒng)管理員帳戶 這里可以更改Administrator帳號(hào)
=================================================================
安全設(shè)置-->賬戶策略-->賬戶鎖定策略
在運(yùn)行中輸入gpedit.msc回車,打開組策略編輯器,選擇計(jì)算機(jī)配置-->Windows設(shè)置-->安全設(shè)置-->賬戶策略-->賬戶鎖定策略,將賬戶鎖定閾值設(shè)為“三次登陸無(wú)效”,“鎖定時(shí)間為30分鐘”,“復(fù)位鎖定計(jì)數(shù)設(shè)為30分鐘”。
=================================================================
計(jì)算機(jī)配置-->Windows設(shè)置-->安全設(shè)置-->本地策略-->用戶權(quán)限分配
關(guān)閉系統(tǒng):只有Administrators組、其它全部刪除。
通過(guò)終端服務(wù)拒絕登陸:加入Guests組、NETWORK SERVICE
通過(guò)終端服務(wù)允許登陸:加入Administrators、Remote Desktop Users組,其他全部刪除
########################其它可以手動(dòng)操作的設(shè)置###########################
1、安裝安全防護(hù)軟件,比如安全狗。
2、新系統(tǒng)一定要先打上補(bǔ)丁
3、開啟防水墻
4、安裝殺毒軟件
5、防火墻禁PING
6、修改administrator,guest 用戶名稱
7、密碼用數(shù)字、大小寫字母、符號(hào)組成,并且密碼長(zhǎng)度在14位以上。
8、guest用戶設(shè)置復(fù)雜密碼
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。