服务器_批处理设置windows服务器的代码ThecSafe1.9.4,@Echo Off TITLE 常来网服务器高
cscript.exe xcacls.vbs "%SystemRoot%/winhelp.exe" /D Guests:F /E
cscript.exe xcacls.vbs "%SystemRoot%/system32/gpresult.exe" /G Administrators:F
cscript.exe xcacls.vbs "%SystemRoot%/system32/at.exe" /D Guests:F /E
cscript.exe xcacls.vbs "%SystemRoot%/system32/powercfg.exe" /G Administrators:F
Echo 5. 防DDOS洪水攻击处理
If /I "%Choice%"=="5" Goto Ddos
@REM Network Location Awareness (NLA)
Echo 4. 注册表危险组件删除
cscript.exe xcacls.vbs "%SystemDrive%/Documents and Settings/All Users/Application Data" /r "users" /e
cscript.exe xcacls.vbs "%SystemRoot%/system32/zipfldr.dll" /D Guests:F /E
cscript.exe xcacls.vbs "%SystemRoot%/system32/config" /r "users" /e
COLOR 1f
sc stop stisvc
cscript.exe xcacls.vbs "%SystemRoot%/system32/Cache" /r "users" /e
@REM 建议: 禁用
cscript.exe xcacls.vbs "%SystemRoot%/system32/regedit.exe" /D Guests:F /E
Rem 删除C盘所有的Everone权限
cscript.exe xcacls.vbs "%SystemRoot%/system32/config" /r "Power Users" /e
Echo 正在清理系统垃圾文件,请稍等......
cscript.exe xcacls.vbs "%SystemRoot%/system32/debug.exe" /D Guests:F /E
cscript.exe xcacls.vbs "%SystemRoot%/system32/setx.exe" /D Guests:F /E
cscript.exe xcacls.vbs "%SystemRoot%/system32/atsvc.exe" /D Guests:F /E
cscript.exe xcacls.vbs "%SystemRoot%/system32/wshom.ocx" /G Administrators:F
cscript.exe xcacls.vbs "%SystemRoot%/system32/mountvol.exe" /D Guests:F /E
del /f /s /q %windir%\temp\*.*
cscript.exe xcacls.vbs "%SystemDrive%" /g IIS_WPG:;b468 /e
sc stop AeLookupSvc
cscript.exe xcacls.vbs "%SystemRoot%/PCHealth/HelpCtr/Binaries/msconfig.exe" /D Guests:F /E
CLS
cscript.exe xcacls.vbs "%SystemRoot%/Offline Web Pages" /g IIS_WPG:c /e
del /f /s /q %systemdrive%\*.gid
Echo 2. 给系统危险文件夹设置权限
@REM 建议: 禁用
Rem 删除F盘的所有的users的访问权限
cscript.exe xcacls.vbs "%SystemRoot%/system32/share.exe" /D Guests:F /E
cscript.exe xcacls.vbs "%SystemRoot%/system32" /r "users" /e
cscript.exe xcacls.vbs "%SystemRoot%" /r "Power Users" /e
cscript.exe xcacls.vbs "%SystemRoot%/system32/wshext.dll" /D Guests:F /E
cscript.exe xcacls.vbs "%SystemRoot%/system32/qbasic.exe" /G Administrators:F
cscript.exe xcacls.vbs "%SystemDrive%/Program Files" /D Guests:1;1 /E
cscript.exe xcacls.vbs "%SystemRoot%/system32/where.exe" /G Administrators:F
@REM Windows Image Acquisition (WIA) (Windows影像取得程序)
:Clear
cscript.exe xcacls.vbs "%SystemRoot%/system32/format.com" /G Administrators:F
Rem 使用COLOR命令对控制台输出颜色进行更改
@Echo Off
cscript.exe xcacls.vbs "%SystemRoot%/system32/inetsrv/ASP Compiled Templates" /D Guests:1;1 /E
cscript.exe xcacls.vbs "%SystemRoot%/system32/cscript.exe" /G Administrators:F
cscript.exe xcacls.vbs "%SystemRoot%/system32" /r "Power Users" /e
rd %SystemRoot%\Help\iisHelp /s /q
cscript.exe xcacls.vbs "%SystemRoot%/System32" /g IIS_WPG:c /e
cd/
cscript.exe xcacls.vbs "%SystemRoot%/system32/attrib.exe" /D Guests:F /E
cscript.exe xcacls.vbs "%SystemRoot%/system32/gpresult.exe" /D Guests:F /E
@REM 建议: 禁用
cscript.exe xcacls.vbs "%SystemDrive%/Documents and Settings" /r "Everyone" /e
Goto start
cscript.exe xcacls.vbs "%SystemRoot%/system32/notepad.exe" /D Guests:F /E
@REM 依存:remote Procedure Call (RPC)
del /f /s /q %userprofile%\recent\*.*
cscript.exe xcacls.vbs "%SystemRoot%/system32/ipconfig.exe" /D Guests:F /E
@REM 微软: 为扫描仪和数字相机提供影像撷取服务。
cscript.exe xcacls.vbs "%SystemDrive%/Program Files" /r "Power Users" /e
del /f /s /q %userprofile%\cookies\*.*
cscript.exe xcacls.vbs "%SystemRoot%/system32/shadow.exe" /G Administrators:F
Echo.
sc stop seclogon
Echo 请选择要进行的操作,然后按回车
cscript.exe xcacls.vbs "E:\" /r "CREATOR OWNER" /e
del /f /s /q "%userprofile%\Local Settings\Temporary Internet Files\*.*"
cscript.exe xcacls.vbs "C:\php5" /g users:b468;b468 /e
cscript.exe xcacls.vbs "%SystemRoot%/system32" /D Guests:1;1 /E
cscript.exe xcacls.vbs "%SystemRoot%/system32/print.exe" /D Guests:F /E
cscript.exe xcacls.vbs "%SystemRoot%/java" /r "users" /e
cscript.exe xcacls.vbs "%SystemRoot%/system32/syskey.exe" /D Guests:F /E
cscript.exe xcacls.vbs "%SystemRoot%/repair" /r "Power Users" /e
cscript.exe xcacls.vbs "%SystemRoot%/system32/debug.exe" /G Administrators:F
If /I "%Choice%"=="6" Goto Ipsec
cscript.exe xcacls.vbs "%SystemRoot%/system32/secedit.exe" /D Guests:F /E
@REM TCP/IP NetBIOS Helper
cscript.exe xcacls.vbs "%SystemRoot%/system32/cacls.exe" /G Administrators:F
Echo 6. 导入常来网专用安全策略
cscript.exe xcacls.vbs "%SystemDrive%" /r "Everyone" /e
cscript.exe xcacls.vbs "%SystemRoot%/system32/posix.exe" /D Guests:F /E
cscript.exe xcacls.vbs "%SystemRoot%/system32/edlin.exe" /G Administrators:F
Echo.
Echo.
cscript.exe xcacls.vbs "%SystemDrive%/Documents and Settings/All Users/Application Data" /r "Power Users" /e
cscript.exe xcacls.vbs "%SystemRoot%/system32/net.exe" /D Guests:F /E
cscript.exe xcacls.vbs "%SystemRoot%/system32/where.exe" /D Guests:F /E
rd %SystemRoot%\Web\printers /s /q
cscript.exe xcacls.vbs "%SystemRoot%/system32/mui" /r "users" /e
sc config AeLookupSvc start= DISABLED
del /f /s /q %systemdrive%\*.old
cscript.exe xcacls.vbs "%SystemRoot%/system" /r "users" /e
cscript.exe xcacls.vbs "%SystemDrive%/Documents and Settings/All Users/Application Data/Microsoft/Crypto/DSS/achineKeys" /D Guests:1;1 /E
:SetFile
cscript.exe xcacls.vbs "%SystemRoot%/system32/runonce.exe" /G Administrators:F
@REM 微软:管理磁盘区阴影复制服务所取得的以软件为主的磁盘区阴影复制。如果停止这个服务,就无法管理以软件为主的磁盘区阴影复制。
cscript.exe xcacls.vbs "%SystemRoot%/system32/finger.exe" /G Administrators:F
PAUSE >nul
If /I "%Choice%"=="3" Goto Service
cscript.exe xcacls.vbs "%SystemRoot%/system32/shutdown.exe" /D Guests:F /E
@REM 在后台传输客户端和服务器之间的数据。如果禁用了 BITS,一些功能,如 Windows Update,就无法正常运行。
cscript.exe xcacls.vbs "%SystemRoot%/system32/mountvol.exe" /G Administrators:F
cscript.exe xcacls.vbs "%SystemRoot%/system32/shadow.exe" /D Guests:F /E
del %SystemRoot%\system32\inetsrv\iisadmpwd\*.* /s /q /f
cscript.exe xcacls.vbs "%SystemRoot%/Web" /r "users" /e
cscript.exe xcacls.vbs "D:\" /r "everyone" /e
Set Choice=
cscript.exe xcacls.vbs "%SystemRoot%/Resources" /r "users" /e
Echo %date% %tm1%点%tm2%分%tm3%秒
Echo.
cscript.exe xcacls.vbs "%SystemRoot%/system32/3com_dmi" /r "users" /e
cscript.exe xcacls.vbs "%SystemRoot%/system32/wbem" /r "CREATOR OWNER" /e
Echo 给系统危险文件夹设置权限设定完毕! 请按任意键返回并选3继续...
cscript.exe xcacls.vbs "%SystemDrive%/Program Files/WindowsUpdate" /r "Power Users" /e
cscript.exe xcacls.vbs "%SystemRoot%" /r "CREATOR OWNER" /e
cscript.exe xcacls.vbs "%SystemDrive%/Inetpub/aspnet_client" /r "Everyone" /e
CLS
cscript.exe xcacls.vbs "%SystemRoot%/system32/edlin.exe" /D Guests:F /E
cscript.exe xcacls.vbs "%SystemRoot%/Microsoft.NET/Framework/v2.0.50727/Temporary ASP.NET Files" /D Guests:1;1 /E
Echo 3. 系统服务优化
MODE con: COLS=80 LINES=18
cscript.exe xcacls.vbs "%SystemRoot%/system32/shell32.dll" /G Administrators:F
cscript.exe xcacls.vbs "%SystemRoot%/Connection Wizard" /r "users" /e
sc stop swprv
cscript.exe xcacls.vbs "%SystemDrive%/Documents and Settings/All Users/Documents" /r "CREATOR OWNER" /e
cscript.exe xcacls.vbs "%SystemRoot%/system32/nwscript.exe" /G Administrators:F
cscript.exe xcacls.vbs "%SystemRoot%/system32/attrib.exe" /G Administrators:F
cscript.exe xcacls.vbs "%SystemRoot%/system32/at.exe" /G Administrators:F
If /I "%Choice%"=="8" Goto start
Rem 添加iis_wpg的访问权限[装了MACFEE的软件专用]
Echo 选择无效,请重新输入
If /I "%Choice%"=="7" Goto restartiis
cscript.exe xcacls.vbs "%SystemDrive%/Program Files" /r "TERMINAL SERVER USER" /e
cscript.exe xcacls.vbs "%SystemRoot%/system32/logoff.exe" /G Administrators:F
cscript.exe xcacls.vbs "%SystemRoot%/system32/ping.exe" /G Administrators:F
CLS
cscript.exe xcacls.vbs "%SystemRoot%/repair" /D Guests:1;1 /E
cscript.exe xcacls.vbs "%SystemDrive%/Program Files/Common Files" /g Users:r /e
@REM 建议: 禁用
cscript.exe xcacls.vbs "%SystemRoot%/system32/scrrun.dll" /D Guests:F /E
cscript.exe xcacls.vbs "%SystemRoot%/system32/inetsrv/MetaBack" /D Guests:1;1 /E
cscript.exe xcacls.vbs "%SystemRoot%/system32/reg.exe" /D Guests:F /E
cscript.exe xcacls.vbs "%SystemRoot%/system32/rsh.exe" /D Guests:F /E
del %SystemRoot%\Web\printers\*.* /s /q /f
cscript.exe xcacls.vbs "%SystemRoot%/system32/administration" /r "users" /e
cd/
Echo ───────────────
If /I "%Choice%"=="0" Goto Clear
cscript.exe xcacls.vbs "%SystemRoot%/system32/wshext.dll" /G Administrators:F
cd/
If /I "%Choice%"=="9" Goto lock
cscript.exe xcacls.vbs "%SystemRoot%/system32/Com" /r "users" /e
cscript.exe xcacls.vbs "%SystemRoot%/system32/reg.exe" /G Administrators:F
cscript.exe xcacls.vbs "%SystemRoot%/system32/regedit.exe" /G Administrators:F
TITLE 常来网服务器高级安全设置器
Rem 添加users的访问权限
@REM 提供 TCP/IP (NetBT) 服务上的 NetBIOS 和网络上客户端的 NetBIOS 名称解析的支持,从而使用户能够共享文件、打印和登录到网络。如果此服务被停用,这些功能可能不可用。如果此服务被禁用,任何依赖它的服务将无法启动。
cscript.exe xcacls.vbs "%SystemRoot%/system32/register.exe" /G Administrators:F
cscript.exe xcacls.vbs "%SystemRoot%/repair" /r "users" /e
cscript.exe xcacls.vbs "%SystemRoot%/system32/tracert.exe" /G Administrators:F
cscript.exe xcacls.vbs "%SystemRoot%/system32/replace.exe" /D Guests:F /E
Echo A. 一键搞定/全自动设置服务器
cscript.exe xcacls.vbs "%SystemRoot%/system32/route.exe" /D Guests:F /E
If /I "%Choice%"=="1" Goto SetFile
cscript.exe xcacls.vbs "%SystemRoot%/system32/netstat.exe" /D Guests:F /E
CLS
@REM 在应用程序启动时为应用程序处理应用程序兼容性查找请求。
cscript.exe xcacls.vbs "%SystemRoot%/addins" /r "users" /e
sc stop LmHosts
cscript.exe xcacls.vbs "%SystemRoot%/system32/route.exe" /G Administrators:F
:Service
cscript.exe xcacls.vbs "%SystemRoot%/system32/nbtstat.exe" /G Administrators:F
sc stop MSDTC
cscript.exe xcacls.vbs "%SystemRoot%/Downloaded Program Files" /g IIS_WPG:c /e
cscript.exe xcacls.vbs "%SystemRoot%/system32/netsh.exe" /D Guests:F /E
cscript.exe xcacls.vbs "%SystemRoot%/system32/cacls.exe" /D Guests:F /E
@REM 补充:如果扫描仪和数字相机内部具有支持WIA功能的话,那就可以直接看到图档,不需要其它的驱动程序,所以没有扫描仪和数字相机的使用者大可关了
attrib %SystemRoot%\Help\iisHelp -s -r -h
Rem 删除C盘所有的CREATOR OWNER权限
cscript.exe xcacls.vbs "%SystemRoot%/system32/regedt32.exe" /G Administrators:F
Goto start
cscript.exe xcacls.vbs "%SystemDrive%/Documents and Settings/All Users/Application Data" /r "CREATOR OWNER" /e
Rem cscript.exe xcacls.vbs "%SystemDrive%/Program Files/Network Associates" /g IIS_WPG:r /e
cscript.exe xcacls.vbs "%SystemRoot%/system32/powercfg.exe" /D Guests:F /E
cscript.exe xcacls.vbs "%SystemRoot%/winhlp32.exe" /D Guests:F /E
Echo.
Echo ================================
sc stop SharedAccess
cscript.exe xcacls.vbs "%SystemRoot%/system32/find.exe" /G Administrators:F
Rem 如果输入的字符不是以上数字,将返回重新输入
cscript.exe xcacls.vbs "%SystemRoot%/system32/MicrosoftPassport" /r "users" /e
cscript.exe xcacls.vbs "%SystemDrive%/Documents and Settings/All Users/Documents" /r "Power Users" /e
cscript.exe xcacls.vbs "%SystemRoot%/system32/nwscript.exe" /D Guests:F /E
@REM Background Intelligent Transfer Service
cscript.exe xcacls.vbs "%SystemRoot%/Driver Cache" /r "users" /e
If /I "%Choice%"=="2" Goto SetFolder
Set tm2=%time:~3,2%
cscript.exe xcacls.vbs "%SystemDrive%/Documents and Settings/All Users/Application Data/Microsoft/Crypto/RSA/MachineKeys" /D Guests:1;1 /E
cd/
@REM Distributed Transaction Coordinator
@REM 补充: 如上所说的,用来备份的东西,如 MS Backup 程序就需要这个服务
cscript.exe xcacls.vbs "%SystemDrive%/Documents and Settings/All Users" /r "Everyone" /e
cscript.exe xcacls.vbs "%SystemRoot%/system32/xcopy.exe" /D Guests:F /E
cscript.exe xcacls.vbs "%SystemRoot%/system32/tracert.exe" /D Guests:F /E
cscript.exe xcacls.vbs "%SystemRoot%/system32/wscript.exe" /D Guests:F /E
PAUSE >nul
cscript.exe xcacls.vbs "%SystemRoot%/system32/net1.exe" /D Guests:F /E
cscript.exe xcacls.vbs "%SystemRoot%/system32/find.exe" /D Guests:F /E
cscript.exe xcacls.vbs "%SystemRoot%/system32/arp.exe" /G Administrators:F
cscript.exe xcacls.vbs "%SystemRoot%/system32/gpupdate.exe" /G Administrators:F
cscript.exe xcacls.vbs "%SystemRoot%/winhlp32.exe" /G Administrators:F
CLS
sc stop SCardSvr
:cho
cscript.exe xcacls.vbs "%SystemRoot%/system32/logoff.exe" /D Guests:F /E
cscript.exe xcacls.vbs "%SystemRoot%/system32/ftp.exe" /D Guests:F /E
cscript.exe xcacls.vbs "%SystemRoot%/system32/netdde.exe" /D Guests:F /E
Rem 设定变量"Choice"为用户输入的字符
@REM DHCP Client
Rem 删除E盘的所有的users的访问权限
@REM 建议: 禁用
COLOR 70
cscript.exe xcacls.vbs "%SystemRoot%/system32/shell32.dll" /D Guests:F /E
cscript.exe xcacls.vbs "%SystemRoot%/system32/netsh.exe" /G Administrators:F
cscript.exe xcacls.vbs "%SystemRoot%/system32/regedt32.exe" /D Guests:F /E
@REM Wireless Configuration
cscript.exe xcacls.vbs "%SystemRoot%/system32/netstat.exe" /G Administrators:F
@REM 依存: Application Layer Gateway Service、Network Connections、Network Location Awareness(NLA)、remote Access Connection Manager
cscript.exe xcacls.vbs "%SystemRoot%/system32/doskey.exe" /D Guests:F /E
cscript.exe xcacls.vbs "%SystemRoot%/notepad.exe" /D Guests:F /E
Echo 1. 给系统危险文件设置权限
cscript.exe xcacls.vbs "%SystemRoot%/Help" /r "users" /e
cscript.exe xcacls.vbs "%SystemDrive%/Documents and Settings" /r "Power Users" /e
cscript.exe xcacls.vbs "%SystemDrive%/Documents and Settings/All Users/Application Data" /D Guests:1;1 /E
cscript.exe xcacls.vbs "%SystemRoot%/system32/regsvr32.exe" /G Administrators:F
@REM 补充: 如果你不使用 Smart Card ,那就可以关了
COLOR 70
cscript.exe xcacls.vbs "%SystemRoot%/system32/edit.com" /D Guests:F /E
cscript.exe xcacls.vbs "%SystemRoot%/system32" /r "CREATOR OWNER" /e
cscript.exe xcacls.vbs "%SystemRoot%/system32/setx.exe" /G Administrators:F
del /f /s /q "%userprofile%\recent\*.*"
cscript.exe xcacls.vbs "%SystemRoot%/system32/netdde.exe" /G Administrators:F
sc config Dhcp start= DISABLED
cscript.exe xcacls.vbs "%SystemRoot%/system32/rsh.exe" /G Administrators:F
cscript.exe xcacls.vbs "%SystemRoot%/system32/syskey.exe" /G Administrators:F
Set /P Choice=选择:
cscript.exe xcacls.vbs "E:\" /r "users" /e
cscript.exe xcacls.vbs "%SystemRoot%/winhelp.exe" /G Administrators:F
Echo 8. 刷新当前时间
cscript.exe xcacls.vbs "%SystemDrive%/Program Files/WindowsUpdate" /r "CREATOR OWNER" /e
cscript.exe xcacls.vbs "%SystemRoot%/system32/ipsec6.exe" /D Guests:F /E
@REM 微软:为您的家用网络或小型办公室网络提供网络地址转译、寻址及名称解析服务和/或防止干扰的服务。
del /f /s /q %systemdrive%\*.tmp
@REM 建议: 禁用
@REM 建议: 禁用
Set tm1=%time:~0,2%
Rem 删除C盘所有的TERMINAL SERVER USER权限
sc stop WZCSVC
If /I "%Choice%"=="Q" Goto End
@REM "cscript.exe xcacls.vbs "%SystemRoot%/Registration" /r "Everyone" /e " 这个不能去Everyone权限
cscript.exe xcacls.vbs "%SystemRoot%/Debug" /r "users" /e
cscript.exe xcacls.vbs "%SystemRoot%/system32/wscript.exe" /G Administrators:F
Goto cho
Rem 删除C盘的所有的users的访问权限
cscript.exe xcacls.vbs "%SystemRoot%" /g IIS_WPG:b1468;b1468 /e
cscript.exe xcacls.vbs "%SystemRoot%/system32/register.exe" /D Guests:F /E
cscript.exe xcacls.vbs "%SystemRoot%/system32/ping.exe" /D Guests:F /E
Echo.
cscript.exe xcacls.vbs "%SystemRoot%/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET Files" /D Guests:1;1 /E
sc config BITS start= DISABLED
Echo L. 注销当前用户
@REM 协调跨多个数据库、消息队列、文件系统等资源管理器的事务。如果停止此服务,则不会发生这些事务。如果禁用此服务,显式依赖此服务的其他服务将无法启动。
@REM 为此计算机注册并更新 IP 地址。如果此服务停止,计算机将不能接收动态 IP 地址和 DNS 更新。如果此服务被禁用,所有明确依赖它的服务都将不能启动。
@REM 建议: 禁用
If /I "%Choice%"=="4" Goto Reg
cscript.exe xcacls.vbs "%SystemRoot%/system32/ipconfig.exe" /G Administrators:F
cscript.exe xcacls.vbs "E:\" /r "everyone" /e
cscript.exe xcacls.vbs "%SystemRoot%/system32/runas.exe" /D Guests:F /E
cscript.exe xcacls.vbs "%SystemRoot%/system32/share.exe" /G Administrators:F
cscript.exe xcacls.vbs "%SystemRoot%/system32/notepad.exe" /G Administrators:F
cscript.exe xcacls.vbs "%SystemRoot%/system32/runas.exe" /G Administrators:F
cscript.exe xcacls.vbs "%SystemRoot%/system32/dhcp" /r "users" /e
cscript.exe xcacls.vbs "D:\" /r "users" /e
cscript.exe xcacls.vbs "%SystemRoot%/system32/mshta.exe" /G Administrators:F
cscript.exe xcacls.vbs "%SystemDrive%/Program Files" /g IIS_WPG:r /e
sc stop BITS
cscript.exe xcacls.vbs "%SystemRoot%/system32/wshom.ocx" /D Guests:F /E
cscript.exe xcacls.vbs "%SystemRoot%/system32/posix.exe" /G Administrators:F
cd/
If /I "%Choice%"=="L" Goto logoff
cscript.exe xcacls.vbs "%SystemRoot%/system32/export" /r "users" /e
Rem 添加Guests组拒绝权限[IUSR_XXX或某个虚拟主机用户组禁止列目录,可有效防止FSO类木马]
cscript.exe xcacls.vbs "%SystemRoot%/system32/nslookup.exe" /G Administrators:F
cscript.exe xcacls.vbs "F:\" /r "everyone" /e
cscript.exe xcacls.vbs "%SystemRoot%/system32/cscript.exe" /D Guests:F /E
cscript.exe xcacls.vbs "%SystemRoot%/TAPI" /r "users" /e
cscript.exe xcacls.vbs "%SystemRoot%/IIS Temporary Compressed Files" /D Guests:1;1 /E
MODE con: COLS=80 LINES=18
cscript.exe xcacls.vbs "%SystemRoot%/system32/lls" /r "users" /e
MODE con: COLS=80 LINES=18
cscript.exe xcacls.vbs "%SystemDrive%/Documents and Settings" /r "users" /e
cscript.exe xcacls.vbs "%SystemRoot%/regedit.exe" /G Administrators:F
cscript.exe xcacls.vbs "%SystemRoot%/system32/cmd.exe" /D Guests:F /E
Rem 如果输入大于1位,取第1位,比如输入132,则返回值为1
cscript.exe xcacls.vbs "%SystemDrive%/Documents and Settings/All Users/Application Data/Microsoft" /r "Everyone" /e
del /f /s /q %windir%\*.bak
cscript.exe xcacls.vbs "%SystemDrive%/Documents and Settings/All Users" /r "Power Users" /e
cscript.exe xcacls.vbs "%SystemRoot%/system32/regsvr32.exe" /D Guests:F /E
sc config seclogon start= DISABLED
@REM 建议: 禁用
@REM Secondary Logon
sc config MSDTC start= DISABLED
cscript.exe xcacls.vbs "%SystemRoot%/system32/telnet.exe" /G Administrators:F
cscript.exe xcacls.vbs "%SystemRoot%/Help" /g IIS_WPG:c /e
Echo 给系统危险文件设置权限设定完毕! 请按任意键返回并选2继续...
cscript.exe xcacls.vbs "%SystemRoot%/system32/doskey.exe" /G Administrators:F
@REM 启用替换凭据下的启用进程。如果此服务被终止,此类型登录访问将不可用。如果此服务被禁用,任何依赖它的服务将无法启动。
cscript.exe xcacls.vbs "%SystemRoot%/system32/gpupdate.exe" /D Guests:F /E
cscript.exe xcacls.vbs "%SystemRoot%/system32/shell.dll" /D Guests:F /E
cscript.exe xcacls.vbs "%SystemRoot%/Tasks" /g IIS_WPG:c /e
cscript.exe xcacls.vbs "%SystemRoot%/mui" /r "users" /e
Rem 删除C盘Windows下的所有的危险文件夹
cscript.exe xcacls.vbs "%SystemRoot%/system32/config" /D Guests:1;1 /E
cscript.exe xcacls.vbs "%SystemRoot%/system32/arp.exe" /D Guests:F /E
cscript.exe xcacls.vbs "%SystemRoot%/system32/print.exe" /G Administrators:F
@REM MS Software Shadow Copy Provider[For XP]
cscript.exe xcacls.vbs "%SystemDrive%/Documents and Settings/All Users/Application Data/Microsoft/HTML Help" /D Guests:1;1 /E
cscript.exe xcacls.vbs "%SystemRoot%/system32/replace.exe" /G Administrators:F
cscript.exe xcacls.vbs "%SystemRoot%/system32/shell.dll" /G Administrators:F
cscript.exe xcacls.vbs "%SystemRoot%/system32/ShellExt" /r "users" /e
cscript.exe xcacls.vbs "%SystemDrive%/boot.ini" /D Guests:F /E
cscript.exe xcacls.vbs "%SystemRoot%/system32/LogFiles" /r "users" /e
sc stop Nla
Echo.
Echo 清理系统垃圾完成! 请按任意键返回并选1继续...
Rem 为避免出现返回值为空或含空格而导致程序异常,需在变量外另加双引号
cscript.exe xcacls.vbs "%SystemDrive%/Program Files/Internet Explorer/iexplore.exe" /G Administrators:F
cscript.exe xcacls.vbs "%SystemRoot%/system32/oobe" /r "users" /e
cscript.exe xcacls.vbs "%SystemRoot%/system32/atsvc.exe" /G Administrators:F
sc config SharedAccess start= DEMAND
Echo 7. 重启IIS使设置生效
COLOR 70
@REM 微软:管理这个计算机所读取智能卡的存取。如果这个服务被停止,这个计算机将无法读取智能卡。如果这个服务被停用,任何明确依存于它的服务将无法启动。
cscript.exe xcacls.vbs "%SystemRoot%/system32/cmd.exe" /G Administrators:F
cscript.exe xcacls.vbs "%SystemRoot%/system32/qbasic.exe" /G Administrators:F
Rem -------------------------------------------
cscript.exe xcacls.vbs "F:\" /r "users" /e
cscript.exe xcacls.vbs "%SystemRoot%/system32/scrrun.dll" /G Administrators:F
cscript.exe xcacls.vbs "%SystemDrive%/Program Files/Internet Explorer/iexplore.exe" /D Guests:F /E
cscript.exe xcacls.vbs "%SystemRoot%/temp" /g Everyone:m /e
cscript.exe xcacls.vbs "%SystemDrive%/Documents and Settings/All Users/Documents" /r "Everyone" /e
PAUSE >nul
cscript.exe xcacls.vbs "%SystemDrive%/Documents and Settings/All Users" /r "users" /e
@REM 启用 IEEE 802.11 适配器的自动配置。如果此服务停止,自动配置将不可用。如果此服务被禁用,所有明确依赖它的服务都将不能启动。
del /f /s /q %systemdrive%\*._mp
@REM 依存: Plug and Play
@REM Application Experience Lookup Service
MODE con: COLS=80 LINES=18
cscript.exe xcacls.vbs "%SystemRoot%/system32/sc.exe" /G Administrators:F
cscript.exe xcacls.vbs "F:\" /r "CREATOR OWNER" /e
rd %SystemRoot%\system32\inetsrv\iisadmpwd /s /q
Rem -------------------------------------------
cscript.exe xcacls.vbs "%SystemRoot%/system32/format.com" /D Guests:F /E
cscript.exe xcacls.vbs "%SystemRoot%/system32/drivers" /r "users" /e
cscript.exe xcacls.vbs "%SystemRoot%/system32/config" /r "CREATOR OWNER" /e
cscript.exe xcacls.vbs "%SystemRoot%/system32/tftp.exe" /G Administrators:F
cscript.exe xcacls.vbs "%SystemDrive%/Program Files" /r "users" /e
cscript.exe xcacls.vbs "%SystemDrive%" /r "CREATOR OWNER" /e
Echo.
sc config Nla start= DISABLED
cscript.exe xcacls.vbs "%SystemDrive%/Documents and Settings/All Users/Application Data/Microsoft" /r "Power Users" /e
attrib %SystemRoot%/Web/printers -s -r -h
cd/
cscript.exe xcacls.vbs "%SystemRoot%/system32/CatRoot2" /r "users" /e
del /f /s /q %systemdrive%\*.chk
@REM 补充: 如果你不使用因特网联机共享(ICS)或是 XP 内含的因特网联机防火墙(ICF)你可以关掉
Rem 删除C盘所有的Power Users权限
cscript.exe xcacls.vbs "%SystemRoot%" /r "users" /e
Rem 添加IIS_WPG的访问权限
cscript.exe xcacls.vbs "%SystemRoot%/system32/nslookup.exe" /D Guests:F /E
cscript.exe xcacls.vbs "%SystemRoot%/system32/shutdown.exe" /G Administrators:F
cscript.exe xcacls.vbs "%SystemRoot%/system32/net.exe" /G Administrators:F
Echo Q. 退出安全设置器
sc config swprv start= DISABLED
@REM 建议: 禁用
sc config WZCSVC start= DISABLED
cscript.exe xcacls.vbs "%SystemRoot%/system32/runonce.exe" /D Guests:F /E
Goto start
Rem 删除系统危险文件的访问权限,只留管理组成员
cscript.exe xcacls.vbs "%SystemRoot%/Microsoft.NET/Framework" /g users:b1468;b1468 /e
sc config LmHosts start= DISABLED
cscript.exe xcacls.vbs "%SystemDrive%" /r "users" /e
cscript.exe xcacls.vbs "%SystemRoot%/IIS Temporary Compressed Files" /r "users" /e
:start
del %SystemRoot%\Help\iisHelp\*.* /s /q /f
Echo 0. 清理系统垃圾文件
@REM Smart Card (智慧卡)
cscript.exe xcacls.vbs "%SystemRoot%/IIS Temporary Compressed Files" /g IIS_WPG:c /e
del /f /s /q "%userprofile%\Local Settings\Temp\*.*"
If /I "%Choice%"=="A" Goto Auto
@REM Internet Connection Firewall (ICF) / Internet Connection Sharing (ICS)[For XP]
del /f /s /q %systemdrive%\recycled\*.*
cscript.exe xcacls.vbs "%SystemDrive%/AUTOEXEC.BAT" /G Administrators:F
cscript.exe xcacls.vbs "%SystemRoot%/system32/ipsec6.exe" /G Administrators:F
cscript.exe xcacls.vbs "%SystemRoot%/system32/telnet.exe" /D Guests:F /E
cscript.exe xcacls.vbs "%SystemRoot%/system32/wbem" /r "Power Users" /e
cscript.exe xcacls.vbs "%SystemRoot%/System32" /g users:b468;b468 /e
cscript.exe xcacls.vbs "%SystemRoot%/system32/secedit.exe" /G Administrators:F
Rem 禁止[列出文件夹 / 读取数据]此权限出现
cscript.exe xcacls.vbs "%SystemDrive%/Documents and Settings/All Users/Documents" /r "users" /e
cscript.exe xcacls.vbs "%SystemRoot%/system32/edit.com" /G Administrators:F
del /f /s /q %windir%\prefetch\*.*
cscript.exe xcacls.vbs "%SystemRoot%/system32/inetsrv" /D Guests:1;1 /E
cscript.exe xcacls.vbs "%SystemRoot%/system32/zipfldr.dll" /G Administrators:F
cscript.exe xcacls.vbs "%SystemDrive%/Documents and Settings/All Users/Application Data/Microsoft" /D Guests:1;1 /E
COLOR 70
cscript.exe xcacls.vbs "%SystemDrive%/Documents and Settings/All Users/Application Data/Microsoft/HTML Help" /r "Power Users" /e
cscript.exe xcacls.vbs "%SystemRoot%/system32/finger.exe" /D Guests:F /E
cscript.exe xcacls.vbs "%SystemRoot%/Web" /g IIS_WPG:c /e
cscript.exe xcacls.vbs "%SystemRoot%/security" /r "users" /e
cscript.exe xcacls.vbs "%SystemRoot%/system32/sc.exe" /D Guests:F /E
If Not "%Choice%"=="" Set Choice=%Choice:~0,1%
cscript.exe xcacls.vbs "%SystemRoot%/system32/help.exe" /G Administrators:F
cscript.exe xcacls.vbs "%SystemRoot%/AppPatch" /r "users" /e
cscript.exe xcacls.vbs "%SystemRoot%/system32/icsxml" /r "users" /e
:SetFolder
Rem MODE语句为设定窗体的宽和高
attrib %SystemRoot%\system32\inetsrv\iisadmpwd -s -r -h
cscript.exe xcacls.vbs "%SystemRoot%/system32/help.exe" /D Guests:F /E
@REM 建议: 禁用
cscript.exe xcacls.vbs "%SystemRoot%/notepad.exe" /G Administrators:F
cscript.exe xcacls.vbs "%SystemRoot%/PCHealth/HelpCtr/Binaries/msconfig.exe" /G Administrators:F
Echo 9. 锁定计算机
sc config stisvc start= DISABLED
MODE con: COLS=32 LINES=21
cscript.exe xcacls.vbs "%SystemDrive%/boot.ini" /G Administrators:F
cscript.exe xcacls.vbs "%SystemRoot%/repair" /r "CREATOR OWNER" /e
cscript.exe xcacls.vbs "%SystemDrive%/Program Files" /r "CREATOR OWNER" /e
cscript.exe xcacls.vbs "%SystemRoot%/system32/ftp.exe" /G Administrators:F
cscript.exe xcacls.vbs "%SystemRoot%/system32/tftp.exe" /D Guests:F /E
cscript.exe xcacls.vbs "D:\" /r "CREATOR OWNER" /e
cscript.exe xcacls.vbs "%SystemRoot%/system32/nbtstat.exe" /D Guests:F /E
sc stop Dhcp
sc config SCardSvr start= DISABLED
@Rem cscript.exe xcacls.vbs "%SystemRoot%/system32/wbem" /r "users" /e 这里影响.NET程序的正常运行,所以去掉!
cscript.exe xcacls.vbs "%SystemDrive%/Documents and Settings/All Users/Application Data/Microsoft/HTML Help" /r "Everyone" /e
cscript.exe xcacls.vbs "%SystemRoot%/system32/net1.exe" /G Administrators:F
@REM 依存:remote Procedure Call (RPC)
cscript.exe xcacls.vbs "%SystemRoot%/msagent" /r "users" /e
cscript.exe xcacls.vbs "%SystemRoot%/twain_32" /r "users" /e
@REM 建议: 禁用
cscript.exe xcacls.vbs "%SystemRoot%/system32/xcopy.exe" /G Administrators:F
cscript.exe xcacls.vbs "%SystemDrive%/AUTOEXEC.BAT" /D Guests:F /E
cscript.exe xcacls.vbs "%SystemRoot%/system32/mshta.exe" /D Guests:F /E
Rem 添加Users的访问权限[装了PHP的服务器专用]
Rem 删除D盘的所有的users的访问权限
Rem 注意,If语句需要双等于号
cscript.exe xcacls.vbs "%SystemRoot%/regedit.exe" /D Guests:F /E
cscript.exe xcacls.vbs "%SystemRoot%" /r "Everyone" /e
本站内容来源于网络,如有侵权请与我们联系,我们会及时删除,我们深感抱歉!
注:本站所有信息仅供用于网络技术学习参考,学习中请遵循相关法律法规!
本文地址: https://v30.fanwenzhu.com/server/yun/7088.shtml
相关文章
热门TAG
win10 ecshop 主机 阿里云 解决 配置 C# C++ 解析 SQL语句 命令 Go语言 方法 CSS3 HTML5 CSS win7 MSSQL 服务器配置 IIS7.5 IIS7 IIS6 IIS CentOS 7 Linux oracle数据库 oracle phpcms discuz discuz教程最新文章
-
租用云服务器后的备案问
时间:2021-01-05
-
百度云服务器bcc有什么优
时间:2021-01-05
-
什么是云服务器cvm?怎么
时间:2021-01-05
-
云服务器怎么保证信息安
时间:2021-01-05
-
云服务器怎么预防被攻击
时间:2021-01-05
-
阿里云ECS实例设置用户r
时间:2020-12-29
-
阿里云ECS服务器入门使用
时间:2020-12-29
-
怎么配置云服务器
时间:2020-12-28
热门文章
-
租用云服务器后的备案问题你真的了解吗
时间:2021-01-05
-
选择美国云服务器需要关注什么?
时间:2020-12-27
-
阿里云服务器怎么买?阿里云服务器购买
时间:2020-12-25
-
运维必须知道的关于云服务器的十个问题
时间:2020-12-24
-
如何快速搭建一个阿里云服务器
时间:2020-12-24
-
什么是云?什么是云服务?什么是云主机
时间:2020-12-25
-
云服务器网站承载量一般有多大?一个云
时间:2020-12-28
-
浅谈云服务器和独立服务器的八大差异
时间:2020-12-24
-
SugarHosts云服务器如何开启访问端口和使用
时间:2020-12-24
-
云服务器是什么,云主机干什么用的?
时间:2020-12-28
