服务器安全加固BAT

以下保存为bat文件,运行时还需xcacls.vbs,可以到网上下载。
 
:: 禁用WS命令行组件
regsvr32 /s wshom.ocx
 
:: 防止WINDOWS漏洞[粘滞键]的"变态入侵之有史以来最酷的Windows后门sethc.exe"
 
cscript.exe xcacls.vbs "%SystemRoot%/system32/sethc.exe" /D Everyone:M /E
cscript.exe xcacls.vbs "%SystemRoot%/ServicePackFiles/i386/sethc.exe" /D Everyone:M /E
 
 
:: 删除system32\npptools.dll,新建npptools.dll设为只读,权限上限制 可防止所有arp病毒
 
del %SystemRoot%\system32\npptools.dll /A/F/Q
dir %SystemRoot%\system32\com > %SystemRoot%\system32\npptools.dll
attrib +R +S +H %SystemRoot%\system32\npptools.dll
cscript.exe xcacls.vbs "%SystemRoot%/system32/npptools.dll" /D Everyone:M /E
 
:: 删除system32\packet.dll,新建packet.dll设为只读,权限上限制 可防止所有arp病毒
 
del %SystemRoot%\system32\packet.dll /A/F/Q
dir %SystemRoot%\system32\com > %SystemRoot%\system32\packet.dll
attrib +R +S +H %SystemRoot%\system32\packet.dll
cscript.exe xcacls.vbs "%SystemRoot%/system32/packet.dll" /D Everyone:M /E
 
:: 删除system32\pthreadVC.dll,新建pthreadVC.dll设为只读,权限上限制 可防止所有arp病毒
 
del %SystemRoot%\system32\pthreadVC.dll /A/F/Q
dir %SystemRoot%\system32\com > %SystemRoot%\system32\pthreadVC.dll
attrib +R +S +H %SystemRoot%\system32\pthreadVC.dll
cscript.exe xcacls.vbs "%SystemRoot%/system32/pthreadVC.dll" /D Everyone:M /E
 
:: 删除system32\wpcap.dll,新建wpcap.dll设为只读,权限上限制 可防止所有arp病毒
 
del %SystemRoot%\system32\wpcap.dll /A/F/Q
dir %SystemRoot%\system32\com > %SystemRoot%\system32\wpcap.dll
attrib +R +S +H %SystemRoot%\system32\wpcap.dll
cscript.exe xcacls.vbs "%SystemRoot%/system32/wpcap.dll" /D Everyone:M /E
 
:: 删除system32\npf.sys,新建npf.sys设为只读,权限上限制 可防止所有arp病毒
 
del %SystemRoot%\system32\drivers\npf.sys /A/F/Q
dir %SystemRoot%\system32\com > %SystemRoot%\system32\drivers\npf.sys
attrib +R +S +H %SystemRoot%\system32\npf.sys
cscript.exe xcacls.vbs "%SystemRoot%/system32/drivers/npf.sys" /D Everyone:M /E
 
Echo 禁用通过重启重命名方式加载启动项
 
:: 重启重命名的执行优先级比传统的自启动(一般指HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\ CurrentVersion\Run)要高, 启
 
动完成后又将自己删除或改名回去. 这种方式自启动极为隐蔽,现有的安全工具都无法检测的出来. 
:: 病毒通过重启重命名方式加载,位于注册表HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\ BackupRestore\KeysNotToRestore下
 
的Pending Rename Operations字串。
 
reg delete "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager" /v PendingFileRenameOperations /f
 
:: 关闭事件跟踪程序
REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Reliability" /v ShutdownReasonOn /t REG_DWORD /d 
 
"00000000" /f
 
:: 防止 Windows 运行您在这个设置中指定的程序。
:: 如果启用这个设置,用户则无法运行添加到不允许的应用程序列表的程序。
 
REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v DisallowRun /t REG_DWORD /d 
 
"00000001" /f
REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\DisallowRun" /v login.scr /t REG_SZ 
 
/d login.scr /f
REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\DisallowRun" /v xsiff.exe /t REG_SZ 
 
/d xsiff.exe /f
REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\DisallowRun" /v xsniff.exe /t 
 
REG_SZ /d xsniff.exe /f
REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\DisallowRun" /v sethc.exe /t REG_SZ 
 
/d sethc.exe /f
REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\DisallowRun" /v WinPcap.exe /t 
 
REG_SZ /d WinPcap.exe /f
REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\DisallowRun" /v nc.exe /t REG_SZ /d 
nc.exe /f
REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\DisallowRun" /v sql.exe /t REG_SZ 
 
/d sql.exe /f
REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\DisallowRun" /v su.exe /t REG_SZ /d 
 
su.exe /f
 
regsvr32 /s /u wshom.ocx
 
Echo 应用软件限制组策略,进一步加强服务器安全性能!
c:
cd\
cd "%SystemRoot%/system32/GroupPolicy/Machine"
copy Registry.pol Registry.old /y
copy Registry.pol "%SystemRoot%/system32/GroupPolicy/Machine" /y
gpupdate /force
Echo 应用软件限制组策略设置完毕,现在请按任意键返回并选其他操作继续...
PAUSE >nul
exit
 
总结,考虑的很周全,必须学习!
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值