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

there is a File upload attack vulnerability #8

Open
984231098 opened this issue Aug 15, 2019 · 0 comments
Open

there is a File upload attack vulnerability #8

984231098 opened this issue Aug 15, 2019 · 0 comments

Comments

@984231098
Copy link

there is a File upload attack vulnerability,It can lead to arbitrary uploading of PHP script files.
The location of the vulnerability is in http://ip/public/admin,where the content editing function is.
图片
Let's see the code:
图片
There are two problems:

  1. The uploaded file detection is not strict, only the content-type is detected, and even the file suffix is not detected, which causes us to modify the content-type when uploading to bypass the upload php file.
  2. File processing logic vulnerabilities, although there is a file abbreviated processing, but when uploading a sentence Trojan with a jpg file header, the server will not return the address, but the file is already stored on the server, so the file upload can be achieved.

In addition, although the CMS detects and filters uploaded files, it will be automatically commented out if it matches <?php .
such as:
图片
but We can bypass with short tags,such as:

  1. Use <?= instead of <?php
  2. Use <script language='php'></script> to bypass

My exploit is as follows:
图片
Let's test it out.
图片
as we can see,The PHP Trojan has been successfully uploaded and validated.

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