Hướng dẫn simple php photo gallery v0.8 exploit github - thư viện ảnh php đơn giản v0.8 khai thác github

[START]

###################################################################################################################################
[0x01] Informations:

Script         : Php Photo Album 0.8 BETA
Download       : http://sourceforge.net/project/downloading.php?group_id=151573&use_mirror=kent&filename=PHPPA_.9_BETA.zip&37834145
Vulnerability  : Local File Inclusion
Author         : Osirys
Contact        : osirys[at]live[dot]it
Website        : http://osirys.org
Notes          : Proud to be Italian


###################################################################################################################################
[0x02] Bug: [Local File Inclusion]
######

Bugged file is: /[path]/index.php

[CODE]

$skin_temp = $_GET['preview'];
if(isset($_GET['preview']) && file_exists("./skin/$skin_temp/config.php")){
	$skin = $_GET['preview'];
	}
else{
	$skin = vari("skin");
	}
require("./skin/$skin/config.php");

[/CODE]

If 'preview' from GET is provided, we can include it just bypassing a stupid cheek.
file_exists("./skin/$skin_temp/config.php) <-- this cheek is stupid, becouse when
we set a value to $skin_temp , if we set a local file with a directory trasversal
it's obvious that the file exists, so it will be included.

[!] FIX: Use another filter instead of file_exists("./skin/$skin_temp/config.php)
         Just filter $skin_temp before include it. A fix could be to declare $skin
         with a standard or local value, or just put the allowed values in an array,
         and cheek then if the skin provided is allowed. See is_in_array() function


[!] EXPLOIT: /[path]/index.php?preview=[local_file]%00
                                       ../../../../../../../../../../../../etc/passwd%00

###################################################################################################################################

[/END]

# milw0rm.com [2009-01-14]
            

# Title: SimplePHPGal 0.7 - Remote File Inclusion 
# Author: h4shur
# date:2020-05-05
# Vendor Homepage: https://johncaruso.ca
# Software Link: https://johncaruso.ca/phpGallery/
# Software Link: https://sourceforge.net/projects/simplephpgal/
# Tested on: Windows 10 & Google Chrome
# Category : Web Application Bugs
# Dork : intext:"Created with Simple PHP Photo Gallery"
         intext:"Created by John Caruso"


### Note:

* Another web application bug is the RFI bug, which can be very dangerous
And stands for Remote File Inclusion, which directly executes loose scripts on the server
Also, this security hole is created by programmer errors
And you must be fluent in programming language to secure and prevent this bug
And you have to control the inputs of the application and use powerful firewalls

* This bug is one of the most dangerous bugs and the access that the intruder can gain using this bug is the implementation of Shell script
In fact, by running Shell script, it will have relatively complete access to the Target site server
If we want to explain it in text, the hacker will execute the shell by giving a link from Shell script in txt format to the input of the vulnerable site.

* what's the solution ?
Check the file entered by the user from a list and enter it if the file was in the list. Example :

* If you are a server administrator, turn off allow_url_fopen from the file.

* Or do it with the ini_set command. Only for (RFI)


* We can use the strpos command to check that if the address is: // http, the file will not be enclosed (it can only block RFI)


* Using str_replace we can give the given address from two characters "/", "." Let's clean up.



### Poc  :  

[+]   site.com/image.php?img= [ PAYLOAD ]
            

Tên đã được sử dụng

Một thẻ đã tồn tại với tên chi nhánh được cung cấp. Nhiều lệnh GIT chấp nhận cả tên thẻ và tên chi nhánh, vì vậy việc tạo nhánh này có thể gây ra hành vi bất ngờ. Bạn có chắc là bạn muốn tạo chi nhánh này?

1branch0tags branch 0 tags

Mã số

  • Sử dụng Git hoặc thanh toán với SVN bằng URL Web.

  • Mở bằng máy tính để bàn GitHub
  • Tải xuống Zip

Cam kết mới nhất

Các tập tin

Permalink

Không tải thông tin cam kết mới nhất.

Loại hình

Tên

Tin nhắn cam kết mới nhất

Cam kết thời gian

Thư viện ảnh PHP đơn giản

Thư viện ảnh PHP đơn giản - PHP, jQuery, Ajax Photo Thư viện không có cơ sở dữ liệu

Dựa trên foliogallery. Đó là một bộ sưu tập đơn giản và nhẹ không yêu cầu cơ sở dữ liệu để chạy.

  • Miễn phí cho sử dụng cá nhân và thương mại.
  • Hiển thị nhiều album và/hoặc bộ sưu tập đầy đủ trong một trang.
  • Giao diện đáp ứng.
  • Tự động tạo hình thu nhỏ.
  • Xuất hiện tùy chỉnh thông qua CSS.

Sự khác biệt so với phiên bản gốc:

  • Đã thêm hỗ trợ cho các thư mục con.
  • Hình ảnh tự động dựa trên thông tin EXIF.
  • Hình ảnh thay đổi kích thước bay. Bạn có thể sử dụng kho lưu trữ ảnh gốc của bạn mà không cần đặt trước nó để xem web.
  • Tải trang tốc độ cho bộ sưu tập hình ảnh lớn.
  • Di chuyển ngón tay cái sang một thư mục riêng. Bộ sưu tập không yêu cầu quyền viết cho các thư mục album.
  • Sử dụng thư viện Php-Magician Php cho việc tạo ngón tay cái và hình ảnh khi thay đổi kích thước bay.

Yêu cầu

  • Một máy chủ chạy PHP 5+.
  • Thư viện PHP GD (để tạo hình thu nhỏ tự động và thay đổi kích thước hình ảnh bay).

Cấu hình

  • Cập nhật $ MainFolder với thư mục cho album ảnh của bạn.$mainFolder with the folder for your photo albums.
  • Cập nhật $ ngón tay cái với thư mục cho ngón tay cái. Thư mục nên có quyền ghi cho người dùng máy chủ web của bạn (thường là www-data).$thumbFolder with the folder for thumbs. The folder should have write permissions for your webserver user (usually www-data).

Trong folio-gallery.php:

$mainFolder    = 'albums';   // folder where your albums are located - relative to root
$thumbsFolder  = 'thumbs';   // folder where your thumbs are located - relative to root