在bat中查看系统中有没有隐藏的服务程序!
Kernel SC v1.3 By zzzEVAzzz
Usage : knlsc13.exe -f | -l | -c ServiceName
-f : Find hidden services.
-l : List specified services.
-c : Config service start type.
s w : Select System or Win32 service type. Default is all.
a m d : Select Automatic, Manual or Disabled start type. Default is all.
Example:
>knlsc13.exe -f : Find hidden services.
>knlsc13.exe -law : List Automatic Win32 services.
>knlsc13.exe -cd BITS : Config BITS service start type to Disabled.
一、介绍:
一个查找隐藏服务的小程序。可以显示被hxdef100和ntrootkit122等rootkit隐藏的服务。发现隐藏的服务后,可以使用本程序禁用它。
二、用法:
1,查找隐藏的服务
C:\path>knlsc13.exe -f
2,列出指定类型的服务的属性
C:\path>knlsc13.exe -l
s和w参数分别代表"System"和"Win32"服务类型。
a、m和d参数分别代表"自动"、"手动"和"禁用"启动方式。
各个参数可以组合使用。
3,配置指定服务的启动方式
C:\path>knlsc13.exe -c ServiceName
a、m和d参数的意义同上。
三个参数单独使用,不使用参数则显示ServiceName当前的属性。
三、显示格式:
每个服务的属性按照以下格式显示。
>服务名
服务显示名
服务程序全路径
服务Dll全路径(共享进程的服务才有此项)
注:时间戳表示服务属性最后一次被改变的时间。用本程序改的除外。
四、举例:
C:\path>knlsc13.exe -law (显示自启动的Win32服务)
Dumping Services Info...OK!
>AudioSrv
Windows Audio
%SystemRoot%\System32\svchost.exe -k netsvcs
%SystemRoot%\System32\audiosrv.dll
>Eventlog
Event Log
%SystemRoot%\system32\services.exe
>PlugPlay
Plug and Play
%SystemRoot%\system32\services.exe
>RpcSs
Remote Procedure Call (RPC)
%SystemRoot%\system32\svchost -k rpcss
%SystemRoot%\system32\rpcss.dll
>SamSs
Security Accounts Manager
%SystemRoot%\system32\lsass.exe
>Serv-U
Serv-U FTP 服务器
E:\Program Files\Serv-U\ServUDaemon.exe
>Themes
Themes
%SystemRoot%\System32\svchost.exe -k netsvcs
%SystemRoot%\System32\shsvcs.dll
7 service(s) has been listed.
C:\path>knlsc13.exe -f (查找隐藏的服务)
Dumping Services Info...OK!
>hxdefdrv
\??\C:\Windows\system32\hxdefdrv.sys
>hxdefsvc
Hacker Defender 100
C:\Windows\system32\hxdefsvc.exe
2 hidden service(s) has been found.
C:\path>knlsc13.exe -cd hxdefdrv (禁用隐藏的服务hxdefdrv)
Dumping Services Info...OK!
The "hxdefdrv" service start type is set to Disabled.
C:\path>knlsc13.exe -cd hxdefsvc (禁用隐藏的服务hxdefsvc)
Dumping Services Info...OK!
The "hxdefsvc" service start type is set to Disabled.
C:\path>knlsc13.exe -c hxdefsvc (查看hxdefsvc服务当前的属性)
Dumping Services Info...OK!
>hxdefsvc
Hacker Defender 100
(已经被禁用)
C:\Windows\system32\hxdefsvc.exe
C:\path>shutdown -r (重启系统后,hxdef就失效了)
C:\path>knlsc13.exe -f
Dumping Services Info...OK!
It has not found hidden service. (没有隐藏的服务)
五、运行环境:
本程序支持Win2k/XP/2003系统,已在Win2k sp4、WinXP sp1/sp2和Win2003上测试通过。
六、其他:
1,knlsc运行时,将临时生成一个随机命名的sys文件,并增加一个同名的系统服务。如果运行时发生意外,导致服务没有被自动删除,请用SC手动删除。
C:\>sc GetServiceKeyName "Kernel SC"
GetServiceKeyName SUCCESS Name = odritwuylp
C:\>sc delete odritwuylp
DeleteService SUCCESS
2,knlsc查找隐藏服务的原理是,直接解读注册表文件(%SystemRoot%\System32\config\system),历遍全部Service Key,与RegEnumKeyEx()的结果对比。注意,只有同时具有Type,Start和ImagePath三个键值的Service Key才被认为是个服务,否则即使被隐藏也不会显示。
3,你可以自由传播knlsc,但请附带本说明文件,谢谢。如果你发现Bug或有什么建议,请与我联系。
Email:
zzzevazzz@126.com
HomePage:
http://www.ph4nt0m.org
七、更新记录
v1.3 修正在远程shell中不能回显的Bug。感谢WinEggDrop的测试。
v1.2 修正不能正常返回命令行的Bug。感谢天道虚空的测试。
v1.1 在XP sp2上测试通过,修正时间戳和usage显示Bug。
v1.0 终于完成了 ^0^