服务器 安全设置 批处理

第一个比较全,推荐使用第一个


代码如下:

@ECHO OFF
CLS
TITLE SERVER SAFE SETUP PRO
COLOR 0A
echo y|cacls.exe C:\ /p Administrators:f system:f "network service":r
echo y|cacls.exe D:\ /p Administrators:f system:f servU:f "network service":r
echo y|cacls.exe E:\ /p Administrators:f system:f servU:f "network service":r
echo y|cacls.exe "C:\Program Files" /t /p Administrators:f system:f everyone:r
echo y|cacls.exe "C:\Program Files\Common Files" /t /g Administrators:f system:f everyone:r
echo y|cacls.exe c:\windows /p Administrators:f system:f
echo y|cacls.exe c:\windows\system32 /p Administrators:f system:f
echo y|cacls.exe C:\WINDOWS\system32\inetsrv /p Administrators:f system:f everyone:r
echo y|cacls.exe "C:\Documents and Settings" /p Administrators:f system:f
echo y|cacls.exe "C:\Documents and Settings\All Users" /t /p Administrator:f system:f everyone:r
echo y|cacls.exe c:\windows\temp /p everyone:f
echo y|cacls.exe %systemroot%\system32\shell32.dll /p Administrators:f
echo y|cacls.exe %systemroot%\system32\wshom.ocx /p Administrators:f
echo y|cacls.exe c:\windows\system32\*.exe /p Administrators:f system:f
echo y|cacls.exe "c:\Documents and Settings\All Users" /e /g everyone:r
echo y|cacls.exe %systemroot%\system32\svchost.exe /e /g "network service":r
echo y|cacls.exe %systemroot%\system32\msdtc.exe /e /g "network service":r
echo y|cacls.exe %windir%\system32\mtxex.dll /e /g everyone:r
echo y|cacls.exe c:\windows\system32\cmd.exe /p Administrator:f
echo y|cacls.exe c:\windows\system32\net.exe /p Administrator:f
echo y|cacls.exe c:\windows\system32\net1.exe /p Administrator:f
echo y|cacls.exe c:\windows\system32\sc.exe /p Administrator:f
echo y|cacls.exe c:\windows\system32\at.exe /p Administrator:f
echo y|cacls.exe %windir%\system32\dllhost.exe /e /g everyone:r
echo y|cacls.exe c:\windows\system32\netsh.exe /p Administrator:f
echo y|cacls.exe c:\windows\system32\net.exe /p Administrator:f
echo y|cacls.exe c:\windows\system32\cacls.exe /p Administrator:f
echo y|cacls.exe c:\windows\system32\cmdkey.exe /p Administrator:f
echo y|cacls.exe c:\windows\system32\ftp.exe /p Administrator:f
echo y|cacls.exe c:\windows\system32\tftp.exe /p Administrator:f
echo y|cacls.exe c:\windows\system32\reg.exe /p Administrator:f
echo y|cacls.exe c:\windows\system32\regedt32.exe /p Administrator:f
echo y|cacls.exe c:\windows\system32\regini.exe /p Administrator:f
echo y|cacls.exe %windir%\assembly /e /t /g "network service":r
echo y|cacls.exe %windir%\Microsoft.NET /e /t /g everyone:r
echo y|cacls.exe "%windir%\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files" /e /t /g everyone:f
echo y|cacls.exe %windir%\system32\mscoree.dll /e /g everyone:r
echo y|cacls.exe %windir%\system32\ws03res.dll /e /g everyone:r
echo y|cacls.exe %windir%\system32\msxml*.dll /e /g everyone:r
echo y|cacls.exe C:\WINDOWS\system32\urlmon.dll /e /g everyone:r
echo y|cacls.exe C:\WINDOWS\system32\mlang.dll /e /g everyone:r
echo y|cacls.exe C:\WINDOWS\system32\TAPI32.dll /e /g everyone:r
echo y|cacls.exe C:\WINDOWS\system32\WININET.dll /e /g everyone:r
cacls c:\windows\assembly /e /t /p "network service":r
cacls c:\windows\Microsoft.NET /e /t /p "network service":r
cacls "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files" /e /t /p "network service":f
cacls C:\WINDOWS\system32\mscoree.dll /e /g everyone:r
cacls C:\WINDOWS\system32\ws03res.dll /e /g everyone:r
cacls c:\WINDOWS /e /g "network service":r
if exist c:\windows cacls c:\windows /e /g "network service":r
cacls c:\windows\Microsoft.NET /e /t /p "network service":r
cacls "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files" /e /t /p "network service":f
cacls "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files" /e /t /p "network service":f
cacls c:\windows\system32 /e /g "network service":r
cacls c:\windows\system32\rasapi32.dll /e /g "network service":r
echo y|cacls.exe C:\WINDOWS\system32\inetsrv\adsiis.dll /p Administrators:f autosystem:f
echo y|cacls.exe C:\WINDOWS\system32\inetsrv\iisadmpwd /p Administrators:f autosystem:f
echo y|cacls.exe C:\WINDOWS\system32\inetsrv\MetaBack /p Administrators:f autosystem:f
cacls C":\Program Files\Serv-U" /e /g "servu":f
cacls d:\wwwroot /e /g servU:f
echo 以上设置服务器目录权限

net stop Browser
sc config Browser start= disabled
net stop lanmanserver
sc config lanmanserver start= disabled
net share c$ /delete
net share d$ /delete
net share e$ /delete
net share f$ /delete
net share admin$ /delete
net share ipc$ /delete
echo 以上删除默认共享,设置服务项
echo .. delshare.reg .......
echo Windows Registry Editor Version 5.00> c:\delshare.reg
echo [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\lanmanserver\parameters]>> c:\delshare.reg
echo "AutoShareWks"=dword:00000000>> c:\delshare.reg
echo "AutoShareServer"=dword:00000000>> c:\delshare.reg
echo .. delshare.reg .....
regedit /s c:\delshare.reg
echo .. delshare.reg ....
del c:\delshare.reg
echo .
echo ........
echo .
echo =========================================================
echo .
echo .....................dos....
echo .
echo .........
echo Windows Registry Editor Version 5.00> c:\dosforwin.reg
echo [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters]>> c:\dosforwin.reg
echo "EnableICMPRedirect"=dword:00000000>> c:\dosforwin.reg
echo "DeadGWDetectDefault"=dword:00000001>> c:\dosforwin.reg
echo "DontAddDefaultGatewayDefault"=dword:00000000>> c:\dosforwin.reg
echo "EnableSecurityFilters"=dword:00000000">> c:\dosforwin.reg
echo "AllowUnqualifiedQuery"=dword:00000000>> c:\dosforwin.reg
echo "PrioritizeRecordData"=dword:00000001>> c:\dosforwin.reg
echo "ReservedPorts"=hex(7):31,00,34,00,33,00,33,00,2d,00,31,00,34,00,33,00,34,00,\>> c:\dosforwin.reg
echo 00,00,00,00>> c:\dosforwin.reg
echo "SynAttackProtect"=dword:00000002>> c:\dosforwin.reg
echo "EnablePMTUDiscovery"=dword:00000000>> c:\dosforwin.reg
echo "NoNameReleaseOnDemand"=dword:00000001>> c:\dosforwin.reg
echo "EnableDeadGWDetect"=dword:00000000>> c:\dosforwin.reg
echo "KeepAliveTime"=dword:00300000>> c:\dosforwin.reg
echo "PerformRouterDiscovery"=dword:00000000>> c:\dosforwin.reg
echo "EnableICMPRedirects"=dword:00000000>> c:\dosforwin.reg
echo .
echo ==========================================================
echo .. dosforwin.reg .....
regedit /s c:\dosforwin.reg
echo .. dosforwin.reg ....
del c:\dosforwin.reg
echo ==============================================================
echo .
echo ===============================================================
echo ..Remote Registry Service...........
echo .........
echo .
echo Windows Registry Editor Version 5.00> c:\regedit.reg
echo [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\RemoteRegistry]>> c:\regedit.reg
echo "Start"=dword:00000004>> c:\regedit.reg
echo .
echo .. regedit.reg .....
regedit /s c:\regedit.reg
echo .
echo ......
del c:\regedit.reg
echo ===============================================================
echo ..Messenger.......
echo .........
echo Windows Registry Editor Version 5.00> c:\message.reg
echo [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Messenger]>> c:\message.reg
echo "Start"=dword:00000004>> c:\message.reg
echo .
echo .. message.reg .....
regedit /s c:\message.reg
echo .
echo .. message.reg
del c:\message.reg
echo ===============================================================

echo ===============================================================
echo ..lanmanserver.......
echo .........
echo Windows Registry Editor Version 5.00> c:\lanmanserver.reg
echo [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\lanmanserver]>> c:\lanmanserver.reg
echo "Start"=dword:00000004>> c:\lanmanserver.reg
echo .
echo .. lanmanserver.reg .....
regedit /s c:\lanmanserver.reg
echo .
echo .. lanmanserver.reg
del c:\lanmanserver.reg

echo ==============================================================
echo ...TCP/IP NetBIOS Helper Service
echo .........
echo Windows Registry Editor Version 5.00> c:\netbios.reg
echo [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LmHosts]>> c:\netbios.reg
echo "Start"=dword:00000004>> c:\netbios.reg
echo .
echo .. netbios.reg .....
regedit /s c:\netbios.reg
echo .
echo .. netbios.reg
del c:\netbios.reg
regedit /s forddos.reg

第二个


代码如下:

echo.
echo ------------------------------------------------------
echo.
echo ...........
echo.
net share c$ /delete
net share d$ /delete
net share e$ /delete
net share f$ /delete
net share admin$ /delete
net share ipc$ /delete
net stop Server
net start Server
echo.
echo ..........
echo.
echo ------------------------------------------------------
echo.
echo .................
echo.
echo .. delshare.reg .......
echo Windows Registry Editor Version 5.00> c:\delshare.reg
echo [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\lanmanserver\parameters]>> c:\delshare.reg
echo "AutoShareWks"=dword:00000000>> c:\delshare.reg
echo "AutoShareServer"=dword:00000000>> c:\delshare.reg
echo .. delshare.reg .....
regedit /s c:\delshare.reg
echo .. delshare.reg ....
del c:\delshare.reg
echo .
echo ........
echo .
echo =========================================================
echo .
echo .....................dos....
echo .
echo .........
echo Windows Registry Editor Version 5.00> c:\dosforwin.reg
echo [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters]>> c:\dosforwin.reg
echo "EnableICMPRedirect"=dword:00000000>> c:\dosforwin.reg
echo "DeadGWDetectDefault"=dword:00000001>> c:\dosforwin.reg
echo "DontAddDefaultGatewayDefault"=dword:00000000>> c:\dosforwin.reg
echo "EnableSecurityFilters"=dword:00000000">> c:\dosforwin.reg
echo "AllowUnqualifiedQuery"=dword:00000000>> c:\dosforwin.reg
echo "PrioritizeRecordData"=dword:00000001>> c:\dosforwin.reg
echo "ReservedPorts"=hex(7):31,00,34,00,33,00,33,00,2d,00,31,00,34,00,33,00,34,00,\>> c:\dosforwin.reg
echo 00,00,00,00>> c:\dosforwin.reg
echo "SynAttackProtect"=dword:00000002>> c:\dosforwin.reg
echo "EnablePMTUDiscovery"=dword:00000000>> c:\dosforwin.reg
echo "NoNameReleaseOnDemand"=dword:00000001>> c:\dosforwin.reg
echo "EnableDeadGWDetect"=dword:00000000>> c:\dosforwin.reg
echo "KeepAliveTime"=dword:00300000>> c:\dosforwin.reg
echo "PerformRouterDiscovery"=dword:00000000>> c:\dosforwin.reg
echo "EnableICMPRedirects"=dword:00000000>> c:\dosforwin.reg
echo .......
echo ==========================================================
echo .. dosforwin.reg .....
regedit /s c:\dosforwin.reg
echo .. dosforwin.reg ....
del c:\dosforwin.reg
echo ==============================================================
echo .
echo ..........(......................).
echo .
echo ..telnet,......telnet.
echo ..........
echo Windows Registry Editor Version 5.00> c:\telnet.reg
echo [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TlntSvr]>> c:\telnet.reg
echo "Start"=dword:00000004>> c:\telnet.reg
echo .
echo .. telnet.reg .....
regedit /s c:\telnet.reg
echo .
echo .. telnet.reg ....
del c:\telnet.reg
echo .
echo ===============================================================
echo ..Remote Registry Service...........
echo .........
echo .
echo Windows Registry Editor Version 5.00> c:\regedit.reg
echo [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\RemoteRegistry]>> c:\regedit.reg
echo "Start"=dword:00000004>> c:\regedit.reg
echo .
echo .. regedit.reg .....
regedit /s c:\regedit.reg
echo .
echo ......
del c:\regedit.reg
echo ===============================================================
echo ..Messenger.......
echo .........
echo Windows Registry Editor Version 5.00> c:\message.reg
echo [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Messenger]>> c:\message.reg
echo "Start"=dword:00000004>> c:\message.reg
echo .
echo .. message.reg .....
regedit /s c:\message.reg
echo .
echo .. message.reg
del c:\message.reg
===============================================================
echo ..Telephony......
echo ....
echo Windows Registry Editor Version 5.00> c:\Telephony.reg
echo [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TapiSrv]>> c:\Telephony.reg
echo "Start"=dword:00000004>> c:\Telephony.reg
echo .
echo .. Telephony.reg
regedit /s c:\Telephony.reg
del c:\Telephony.reg
echo ==============================================================
echo ...TCP/IP NetBIOS Helper Service
echo .........
echo Windows Registry Editor Version 5.00> c:\netbios.reg
echo [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LmHosts]>> c:\netbios.reg
echo "Start"=dword:00000004>> c:\netbios.reg
echo .
echo .. netbios.reg .....
regedit /s c:\netbios.reg
echo .
echo .. netbios.reg
del c:\netbios.reg
echo ===============================================================
echo ===============================================================
echo powered by 冬虫草
echo sleepboy82@hotmail.com
echo Jooline Services Set
goto :END

上面的文件下载地址

(0)

相关推荐

  • 服务器 安全设置 批处理

    第一个比较全,推荐使用第一个 复制代码 代码如下: @ECHO OFF CLS TITLE SERVER SAFE SETUP PRO COLOR 0A echo y|cacls.exe C:\ /p Administrators:f system:f "network service":r echo y|cacls.exe D:\ /p Administrators:f system:f servU:f "network service":r echo y|cac

  • win2003 服务器安全设置图文教程

    Windows 2003 服务器安全设置 一.先关闭不需要的端口 我比较小心,先关了端口.只开了3389.21.80.1433,有些人一直说什么默认的3389不安全,对此我不否认,但是利用的途径也只能一个一个的穷举爆破,你把帐号改了密码设置为十五六位,我估计他要破上好几年,哈哈!办法:本地连接--属性--Internet协议(TCP/IP)--高级--选项--TCP/IP筛选--属性--把勾打上,然后添加你需要的端口即可.PS一句:设置完端口需要重新启动! 当然大家也可以更改远程连接端口方法:

  • 服务器安全设置之 系统服务篇

    WindowsServer2003 + IIS6.0 + ASP 服务器安全设置之--组件安全设置篇 A.卸载WScript.Shell 和 Shell.application 组件,将下面的代码保存为一个.BAT文件执行(分2000和2003系统)windows2000.bat 复制代码 代码如下: regsvr32/u C:/WINNT/System32/wshom.ocx del C:/WINNT/System32/wshom.ocx regsvr32/u C:/WINNT/system3

  • 青云服务器安全设置器2.3最新版版提供下载

    如以前设置过权限了请先看清楚批处理内容里都设了哪些地方,如果有你已经设置过的地方直接删除不用重复再设就可以了,一般重复设也没有问题的! 说明:regsvr32 /s /u wshext.dll以前已经用过此命令卸载掉此组件的服务器将不能正常设置文件及文 件夹权限,老版本儿的用户可以先打开开始菜单里的运行,依次输入以下命令注册下已经卸载掉的组件 regsvr32 wshom.ocx regsvr32 wshext.dll regsvr32 shell32.dll注册一下组件再运行服务器安全设置器.

  • win2008 r2 服务器安全设置之安全狗设置图文教程

    服务器安全狗,作为国内首款支持Windows全系列操作系统(Windows2003/Windows2008(32 位.64 位)/Windows2012)的基于内核级的服务器安全防护软件,采用 NDIS 中间层驱动模式,实现从驱动层直接屏蔽攻击,将针对服务器的攻击带来的损失降低到最小,最大程度地保护用户服务器的安全. 功能涵盖了服务器系统优化(包括服务器漏洞补丁修复等).服务器程序守护.远程桌面监控.文件目录守护.系统帐号监控.DDOS 防火墙.ARP 防火墙.Web 防火墙.安全策略设置以及邮

  • 阿里云服务器CentOS服务器初始化设置步骤

    CentOS服务器初始化设置其实不分阿里云或其它服务器了,操作配置过程与步骤也差不多,下面和小编一起来看看. 一.挂载硬盘 1.磁盘分区 fdisk -l #查看设备,一般可以看到设备名为/dev/xvdb fdisk /dev/xvdb #对磁盘进行分区 输入n #创建新分区 输入p #创建主分区 输入1 #创建第一个主分区 输入w #保存并执行以上命令,创建分区 待上面的命令执行完成之后,使用fdisk -l查看,会看到类似 /dev/xvdb1的分区 说明分区成功. 2.磁盘格式化 mkf

  • 服务器安全设置之 组件安全设置篇

    WindowsServer2003 + IIS6.0 + ASP 服务器安全设置之--组件安全设置篇 A.卸载WScript.Shell 和 Shell.application 组件,将下面的代码保存为一个.BAT文件执行(分2000和2003系统)windows2000.bat 复制代码 代码如下: regsvr32/u C:/WINNT/System32/wshom.ocx del C:/WINNT/System32/wshom.ocx regsvr32/u C:/WINNT/system3

  • win2003 服务器 安全设置 技术实例(比较安全的方法)

    1.服务器安全设置之--硬盘权限篇 这里着重谈需要的权限,也就是最终文件夹或硬盘需要的权限,可以防御各种木马入侵,提权攻击,跨站攻击等.本实例经过多次试验,安全性能很好,服务器基本没有被木马威胁的担忧了. 硬盘或文件夹: C:\ D:\ E:\ F:\ 类推 主要权限部分: 其他权限部分: Administrators 完全控制 无如果安装了其他运行环境,比如PHP等,则根据PHP的环境功能要求来设置硬盘权限,一般是安装目录加上users读取运行权限就足够了,比如c:\php的话,就在根目录权限

  • CentOS Linux服务器安全设置

    我们必须明白:最小的权限+最少的服务=最大的安全 所以,无论是配置任何服务器,我们都必须把不用的服务关闭.把系统权限设置到最小话,这样才能保证服务器最大的安全.下面是CentOS服务器安全设置,供大家参考. 一.注释掉系统不需要的用户和用户组 注意:不建议直接删除,当你需要某个用户时,自己重新添加会很麻烦. cp /etc/passwd /etc/passwdbak #修改之前先备份 vi /etc/passwd #编辑用户,在前面加上#注释掉此行 #adm:x:3:4:adm:/var/adm

  • 详解linux ntp服务器时间同步设置

    linux ntp服务器时间同步设置 时间同步这个需求在很多地方都有.比如安装cm和cdh的话,需要ntp时间同步,否则会出现红色警告 这里主要是设置一台服务器作为主服务器,让其他机器同步这台机器的时间,而且是配置的本地时间,没有同步internet时间,因为很多时候服务器不能联网 首先我们这里设置2台机器,主机器为192.168.5.102,另外一台为192.168.5.103 首先设置主机器 编辑/etc/ntp.conf文件 在里面加上 restrict 127.0.0.1 # 开启内部递

随机推荐