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

Code execution vulnerability causes RCE #9

Open
catw0rld opened this issue Apr 21, 2021 · 0 comments
Open

Code execution vulnerability causes RCE #9

catw0rld opened this issue Apr 21, 2021 · 0 comments

Comments

@catw0rld
Copy link

catw0rld commented Apr 21, 2021

  1. log into the background of the site
    url: /index.php/admin/passport/login.html
  2. Add vulnerability URL
    url: /index.php/admin/Template/fileedit
    Convert to a POST request
    image
    let contract
    image
  3. Access index.php generated in the root directory
    url: /index.php?a=whoami
    image

Code audit

The vulnerability file is located at: /application/admin/controller/Template.php -> fileedit()
image
$path and $html We controlled,$rootpath Path splicing
And the PATH variable can be passed through .. / directory
The variable HTML is written to our PHP code
The HTML is decoded, but it has no effect on the PHP code
So we can find an existing file to overwrite the writing.
POST payload is:
path=../../index.php&html=(you php code)
Finally, the command is executed at index.PHP

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