分类

学习笔记 [17]
渗透测试 [4]
一些杂文 [14]
coding [16]
漏洞信息 [17]
技术文章 [15]
开发文档 [8]
个人作品 [5]
PS:个人作品在各种下载栏目均有下载

站内搜索

日历

«  June 2010  »
Su Mo Tu We Th Fr Sa
  12345
6789101112
13141516171819
20212223242526
27282930

访问统计(起于2010/10/2)

访问统计
PortWatcher's Blog
Monday, 2025-06-30, 8:51 AM
Welcome Guest
Main | Registration | Login | RSS

Blog

Main » 2010 » June » 14
转自幻泉的搜狐BLOG


方法一:setuid的方法,其实8是很隐蔽。看看过程:

[root@localdomain lib]# ls -l |grep ld-linux
lrwxrwxrwx 1 root root       9 2008-06-07 17:32 ld-linux.so.2 -> ld-2.7.so
lrwxrwxrwx 1 root root      13 2008-06-07 17:47 ld-lsb.so.3 -> ld-linux.so.2
[root@localdomain lib]# chmod +s ld-linux.so.2
[root@localdomain lib]# ls -l |grep ld-2.7.so
-rwsr-sr-x 1 root root 128952 2007-10-18 04:49 ld-2.7.so
lrwxrwxrwx 1 root root       9 2008-06-07 17:32 ld-linux.so.2 -> ld-2.7.so
[root@localdomain lib]#
我们这里给/lib/ld-linux.so.2这个文件(在FC8里,它指向ld-2.7.so这个文件)加了setuid属性。然后我们看怎么利用 它。

普通用户登录,测试下权限:

[xiaoyu@localdomain ~]$ whoami
xiaoyu
[xiaoyu@localdomain ~]$ /lib/ld-linux.so.2 `which whoami`
root
... Read more »
Category: 技术文章 | Views: 697 | Added by: Jury | Date: 2010-06-14 | Comments (0)

作者 Canberk BOLAT <hc0de.blogspot.com> 
翻译 幻泉  (不算翻译 都是根据幻泉自己理解写的。) 

0x01  信息 
写出这篇文章很重要一点是因为mysql_close()函数的原因。这个函数会关闭mysql连接的session。而当mysql_close()函数没被应用到conn等包含文件中时出现远程文件包含我们就可以利用远程包含程序来实现劫持数据库链接实现查询我们所需要的信息了。 

mysql_close() 函数: 
  mysql_close(link_identifier)函数关闭非持久的mysql连接。 
其中link_identifier的作用是指定打开的连接,如果没有找到该连接,函数会尝试调用mysql_connect()建立连接并使用它。如果发生意外并且没有找到连接或无法建立连接则会返回E_WARNING级别警告信息。 

一般情况mysql_close()函数是没有必要的,因为当程序建立mysql连接会自动关闭其连接,并释放。 
但是在释放会在程序执行完成后发生,这一点是很重要的。 

0x02 攻击 

我认为这是php的错误,因为如果我们能注入我们的代码到这个脚本并且能够执行任意sql查询则有可能会产生SQL查询劫持效果。 

像test.php这样的文件,我们可以看到他并没有执行mysql_close()函数,并且在最下面出现了远程文件包含漏洞。 

test.php 
      < ... Read more »
Category: 技术文章 | Views: 760 | Added by: Jury | Date: 2010-06-14 | Comments (0)