Hacking (and securing) JBoss AS



Similar documents
Pentests: Exposing real world attacks

Bridging the Gap between the Enterprise and You. Who s the JBoss now?

Bridging the Gap between the Enterprise and You or Who s the JBoss now?

JBoss security: penetration, protection and patching. David Jorm

HERVÉ SCHAUER CONSULTANTS Cabinet de Consultants en Sécurité Informatique depuis 1989 Spécialisé sur Unix, Windows, TCP/IP et Internet

How to Enable Remote JMX Access to Quartz Schedulers. M a y 1 2,

JBS-102: Jboss Application Server Administration. Course Length: 4 days

JBoss AS Administration Console User Guide. by Shelly McGowan and Ian Springer

This training is targeted at System Administrators and developers wanting to understand more about administering a WebLogic instance.

Pre-authentication XXE vulnerability in the Services Drupal module

CHAPTER 1 - JAVA EE OVERVIEW FOR ADMINISTRATORS

A Sample OFBiz application implementing remote access via RMI and SOAP Table of contents

Tomcat 5 New Features

CA Process Automation

Oracle WebLogic Server 11g Administration

OSGi Service Platform in Integrated Management Environments Telefonica I+D, DIT-UPM, Telvent. copyright 2004 by OSGi Alliance All rights reserved.

Penetration Testing Scope Factors

OnCommand Performance Manager 1.1

Securing your Apache Tomcat installation. Tim Funk November 2009

Enterprise Content Management System Monitor. How to deploy the JMX monitor application in WebSphere ND clustered environments. Revision 1.

Metasploit The Elixir of Network Security

WebLogic Server 11g Administration Handbook

TIBCO Spotfire Statistics Services Installation and Administration Guide. Software Release 5.0 November 2012

WebSphere Training Outline

Information Security Certifications

Discovering passwords in the memory

WEBLOGIC ADMINISTRATION

Abusing JBoss. Christian Papathanasiou. April 1 st, 2010

24x7 Scheduler Multi-platform Edition 5.2

Desktop Central Managing Windows Computers in WAN

Configuring BEA WebLogic Server for Web Authentication with SAS 9.2 Web Applications

Oracle WebLogic Foundation of Oracle Fusion Middleware. Lawrence Manickam Toyork Systems Inc

WebSphere Server Administration Course

IBM WebSphere Server Administration

eeye Digital Security Product Training

OPAS Prerequisites. Prepared By: This document contains the prerequisites and requirements for setting up OPAS.

Mobile Application Hacking for Android and iphone. 4-Day Hands-On Course. Syllabus

WebLogic Server Administration

ELIXIR LOAD BALANCER 2

Course Description. Course Audience. Course Outline. Course Page - Page 1 of 5

Oracle Enterprise Data Quality. 1 JMX Binding. 1.1 Examples. Java Management Extensions Configuration Release 11g R1 ( )

Systemmanagement with RHQ and Jopr. Heiko W. Rupp Red Hat 6920

GigaSpaces XAP 10.0 Administration Training ADMINISTRATION, MONITORING AND TROUBLESHOOTING GIGASPACES XAP DISTRIBUTED SYSTEMS

MagDiSoft Web Solutions Office No. 102, Bramha Majestic, NIBM Road Kondhwa, Pune Tel: /

Penetration: from Application down to OS

Still Aren't Doing. Frank Kim

BlackBerry Enterprise Service 10. Version: Configuration Guide

Managing Qualys Scanners

WebObjects Deployment Guide Using JavaMonitor. (Legacy)

Socket = an interface connection between two (dissimilar) pipes. OS provides this API to connect applications to networks. home.comcast.

SIEMENS. Teamcenter Web Application Deployment PLM

Secure Messaging Server Console... 2

Java Web Application Security

Members of the UK cyber security forum. Soteria Health Check. A Cyber Security Health Check for SAP systems

Operations and Monitoring with Spring

Working with WebSphere 4.0

Web Application Report

1 hours, 30 minutes, 38 seconds Heavy scan. All scanned network resources. Copyright 2001, FTP access obtained

Robert Honeyman

AmbrosiaMQ-MuleSource ESB Integration

Learn Ethical Hacking, Become a Pentester

Sandy. The Malicious Exploit Analysis. Static Analysis and Dynamic exploit analysis. Garage4Hackers

IBM Security QRadar SIEM Version MR1. Vulnerability Assessment Configuration Guide

A Roadmap for Securing IIS 5.0

SECURITY TRENDS & VULNERABILITIES REVIEW 2015

The course will be run on a Linux platform, but it is suitable for all UNIX based deployments.

Virtually Pwned Pentesting VMware. Claudio

TIBCO Spotfire Statistics Services Installation and Administration Guide

Basic TCP/IP networking knowledge of client/server concepts Basic Linux commands and desktop navigation (if don't know we will cover it )

Apache Jakarta Tomcat

JBoss SOAP Web Services User Guide. Version: M5

simplify monitoring Environment Prerequisites for Installation Simplify Monitoring 11.4 (v11.4) Document Date: January

ANNEXURE-1 TO THE TENDER ENQUIRY NO.: DPS/AMPU/MIC/1896. Network Security Software Nessus- Technical Details

Configuring IBM WebSphere Application Server 6.1 to Support SAS 9.2 Web Applications

TIBCO Spotfire Statistics Services Installation and Administration

RHEV 2.2: REST API INSTALLATION

EMC Documentum Content Management Interoperability Services

How to hack VMware vcenter server in 60 seconds

Security Testing in Critical Systems

Oracle WebLogic Server 11g: Administration Essentials

TIBCO Spotfire Statistics Services Installation and Administration. Release 5.5 May 2013

MESSAGING SECURITY USING GLASSFISH AND OPEN MESSAGE QUEUE

BEAWebLogic. Server. Configuring and Managing WebLogic Server

FREQUENTLY ASKED QUESTIONS

OpenSSO Monitoring Euro User Groups Winter 2010

JMETER - MONITOR TEST PLAN

3. Broken Account and Session Management. 4. Cross-Site Scripting (XSS) Flaws. Web browsers execute code sent from websites. Account Management

UFTP AUTHENTICATION SERVICE

OSGi Remote Management

Welcome to the JReport Server Monitor User's Guide

Common Criteria Web Application Security Scoring CCWAPSS

Moving beyond hardware

ModSecurity as Universal Cross-platform Web Protection Tool

Step by Step Guide for Migrate SharePoint s SQL Server to another SQL Server December 2013

Thick Client Application Security

An Oracle White Paper September Oracle WebLogic Server 12c on Microsoft Windows Azure

5 Days Course on Oracle WebLogic Server 11g: Administration Essentials

Transcription:

HERVÉ SCHAUER CONSULTANTS Cabinet de Consultants en Sécurité Informatique depuis 1989 Spécialisé sur Unix, Windows, TCP/IP et Internet Hacking (and securing) JBoss AS Renaud Dubourguais Renaud Dubourguais <renaud.dubourguais@hsc.fr>

Hervé Schauer Consultants IT security company founded in 1989 Fully independent intellectual expertise services Free of any distribution, integration, outsourcing, staff delegation or outside investors pressure Services: consulting, studies, audits, pentests, training Fields of expertise OS Security : Windows, Unix,Linux and embedded components Application security Network security Organizational security Certifications CISSP, ISO 20000-1 Lead Auditor, ISO 27001 Lead Auditor, ISO 27001 Lead Implementor, ISO 27005 Risk Manager, ITIL, ProCSSI, GIAC GCFA 2/30

Too few studies Why JBoss AS? RedTeam at Hack.lu 2008 Very interesting but only about JBoss 4 RedTeam in 2010 Paper about the DeploymentFileRepository vulnerability Trustwave at Black Hat Europe 2010 PoC Autopwn JBoss 5/6 more and more common Some interesting features have been removed (remote HTTP and BSH deployment, ) Several vulnerabilities have been patched JBoss 7 is now available! 3/30

JBoss AS architecture 4/30

JMX implementation (1/2) 5/30

JMX implementation (2/2) 6/30

JBoss AS vs. security 7/30

JBoss AS vs. security JBossSX: authorization management using the JAAS API Available in the default configuration but not enabled. Too many XML files Just in case... try admin/admin Java 2 security: sandboxing Really complex Very hard to ensure its efficiency You have edit the startup script to enable it! JBoss is really hard to secure efficiently 8/30

Tips for pentesters 9/30

Useful MBeans (1/3) Application deployment (WAR, SAR, EAR, JAR ) jboss.system:service=maindeployer.deploy(string URL) Remote or local deployment Remotely : HTTP requests from JBoss must be allowed 10/30

Useful MBeans (2/3) Remote application deployment (WAR, SAR, EAR, JAR ) jboss.admin:service=deploymentfilerepository.store( String war_name, String file_name, String file_extension, String file_content, true) Works for JBoss 4 and 5 (not 6 and 7) 11/30

Useful MBeans (3/3) Another way to deploy application We can use BeanShell scripts jboss.deployer:service=bshdeployer.createscriptdeployment(string file_content, String file_name) import java.io.fileoutputstream; import sun.misc.base64decoder; String webshell = "UesDBAoAAAAAAEZQijsAAAA" + [...] "2xhc3NQSwUGAAAAAAoACgDw"; BASE64Decoder decoder = new BASE64Decoder(); byte[] byteval = decoder.decodebuffer(webshell); FileOutputStream fs = new FileOutputStream("/tmp/webshell.sar"); fs.write(byteval); fs.close(); Remote arbitrary Java code execution 12/30

HTTP is only GET and POST? (1/2) Authentication is defined with XML files Not enabled by default But, if it's enabled, the default configuration is the following: <security constraint> <web resource collection> <web resource name>htmladaptor</web resource name> <url pattern>/*</url pattern> <http method>get</http method> <http method>post</http method> </web resource collection> [...] </security constraint> 13/30

HTTP is only GET and POST? (2/2) Only GET and POST are authenticated We can perform administration operations with the HEAD verb :) Not patched into the default configuration 14/30

Pentesting JBoss AS 3 and 4 15/30

JMX Console MBean management console : The most famous entry point Not authenticated by default Just in case try admin/admin 16/30

Web Console (1/2) Monitoring interface : Most often exposed without authentication (or admin/admin) Use an Invoker to retreive JBoss information : Mapped to http://server/web-console/invoker Allows all JMX commands 17/30

Web Console (1/2) Monitoring interface : Most often exposed without authentication (or admin/admin) Use an Invoker to retreive JBoss information : Mapped to http://server/web-console/invoker Allows all JMX commands 18/30

Web Console (2/2) How to talk to this Invoker? We must send a serialized java object into a HTTP POST request Not really easy :( The JBoss API is our friend: org.jboss.console.remote.util : public static Object invoke(url externalurl, RemoteMBeanInvocation mi) throws Exception public static Object getattribute(url externalurl, RemoteMBeanAttributeInvocation mi) throws Exception 19/30

RMI over JRMP We can reach the MBean Server with RMI over JRMP: Ports 1098 and 1099 JNDI resolutions Port 4444 RMI calls Never filtered in internal networks Twiddle : an RMI over JRMP tool provided by JBoss Provided by every JBoss AS versions <JBOSS_HOME>/bin/twiddle.sh 20/30

RMI over HTTP RMI/HTTP invokers: JMXInvokerServlet and EJBInvokerServlet Provided by invoker.war Mapped to http://server/invoker/ Disabled in the configuration but still reachable via HTTP The configuration is checked only during a "normal" call Can be bypass with a customized request 21/30

DeploymentFileRepository Feature discovered in 2010 We must have access at least to one of the entry points quoted previously Allow arbitrary file write Can be used to deploy new application in JBoss 4 and 5 Really stable exploitation 22/30

Pentesting JBoss AS 5 and 6 23/30

Since JBoss 5 : Pentesting JBoss AS 5 and 6 jboss.system:service=maindeployer Doesn't support HTTP anymore createscriptdeployment() has been removed bye bye remote BSH Since JBoss 6.0.0-M3 : But : Web Console has been removed JMXInvokerServlet seems to be patched (but it's not sure) New feature : JMX Connector New administration application : Admin Console DeploymentFileRepository is not patched for JBoss 5 24/30

JMX Connector Listening on TCP port 1090 Several tools are available : JConsole Twiddle (provided with JBoss 6.0.0-M3) 25/30

Admin Console (1/2) Authenticated with admin/admin by default If the default account has been changed But : We can override the current authentication policy With XMLLoginConfig We don't need a valid account! We must have access at least to one of the entry points quoted previously HTTP requests from JBoss to the hacker computer must be allowed 26/30

Admin Console (2/2) Based on the SEAM framework Remote code execution vulnerability (CVE-2010-1871) The authentification form is vulnerable Anonymous remote code execution Concerns JBoss 5.1 to 6.1.0.Final 27/30

Pentesting JBoss AS 7 28/30

Since JBoss 7 : Pentesting JBoss AS 7 (1/2) JMX Console has been removed Admin Console has been removed Just one administration console listening on TCP port 9990 About this console No authentication by default Can be used to deploy new applications Administration is possible on TCP port 9999 No authentification by default $JBOSS_HOME/bin/jboss-admin.sh Can be used to deploy local applications 29/30

JBoss 7 is young But : Pentesting JBoss AS 7 (2/2) New architecture New administration system A lot of things to discover :) Seems more secured Administration components are not exposed on the Internet anymore 30/30

Questions? The original paper in french : http://www.hsc.fr/ressources/presentations/sstic10_jboss/sstic10_jboss_article.pdf 31/30