Top Banner
Glassfish from (In)Secure admin to RCE
15

admin to RCE Glassfish from (In)Secure - 2018.pass … · Pass The Salt 2018: Glassfish from (IN)Secure admin to RCE Lets try to access administration interfaces •BUT that means

Sep 13, 2018

Download

Documents

lyque
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: admin to RCE Glassfish from (In)Secure - 2018.pass … · Pass The Salt 2018: Glassfish from (IN)Secure admin to RCE Lets try to access administration interfaces •BUT that means

Glassfish from (In)Secure admin to RCE

Page 2: admin to RCE Glassfish from (In)Secure - 2018.pass … · Pass The Salt 2018: Glassfish from (IN)Secure admin to RCE Lets try to access administration interfaces •BUT that means

Pass The Salt 2018: Glassfish from (IN)Secure admin to RCE

Who am I ?

• Jeremy Mousset

• Rum Addict

• Pentester & IT Security engineer at vente-privee

• @BlueRabbit09

Page 3: admin to RCE Glassfish from (In)Secure - 2018.pass … · Pass The Salt 2018: Glassfish from (IN)Secure admin to RCE Lets try to access administration interfaces •BUT that means

Pass The Salt 2018: Glassfish from (IN)Secure admin to RCE

What is Glassfish?

• JAVA EE Application server

• https://javaee.github.io/glassfish/download

• 2 versions:• Web Profile

• Full Platform

Page 4: admin to RCE Glassfish from (In)Secure - 2018.pass … · Pass The Salt 2018: Glassfish from (IN)Secure admin to RCE Lets try to access administration interfaces •BUT that means

Pass The Salt 2018: Glassfish from (IN)Secure admin to RCE

Lets try to access administration interfaces

• Administration interface http://glassfish.passthesalt.net:4848/

This interface is only accessible from localhost when secure admin is disabled

Page 5: admin to RCE Glassfish from (In)Secure - 2018.pass … · Pass The Salt 2018: Glassfish from (IN)Secure admin to RCE Lets try to access administration interfaces •BUT that means

Pass The Salt 2018: Glassfish from (IN)Secure admin to RCE

Lets try to access administration interfaces

• REST API http://glassfish.passthesalt.net:4848/management/domain

• Asadmin tool (sends commands to http://glassfish.passthesalt.net:4848/commands )

Page 6: admin to RCE Glassfish from (In)Secure - 2018.pass … · Pass The Salt 2018: Glassfish from (IN)Secure admin to RCE Lets try to access administration interfaces •BUT that means

Pass The Salt 2018: Glassfish from (IN)Secure admin to RCE

Lets try to access administration interfaces

• BUT that means the default administration password (blank) has probably not been changed…

Page 7: admin to RCE Glassfish from (In)Secure - 2018.pass … · Pass The Salt 2018: Glassfish from (IN)Secure admin to RCE Lets try to access administration interfaces •BUT that means

Pass The Salt 2018: Glassfish from (IN)Secure admin to RCE

Discovering service

Page 8: admin to RCE Glassfish from (In)Secure - 2018.pass … · Pass The Salt 2018: Glassfish from (IN)Secure admin to RCE Lets try to access administration interfaces •BUT that means

Pass The Salt 2018: Glassfish from (IN)Secure admin to RCE

Java Message Service ???

• From https://docs.oracle.com/cd/E19226-01/821-0027/aeodm/index.html

• Trying to communicate with it :

Page 9: admin to RCE Glassfish from (In)Secure - 2018.pass … · Pass The Salt 2018: Glassfish from (IN)Secure admin to RCE Lets try to access administration interfaces •BUT that means

Discovering service

Pass The Salt 2018: Glassfish from (IN)Secure admin to RCE

Page 10: admin to RCE Glassfish from (In)Secure - 2018.pass … · Pass The Salt 2018: Glassfish from (IN)Secure admin to RCE Lets try to access administration interfaces •BUT that means

Pass The Salt 2018: Glassfish from (IN)Secure admin to RCE

JAVA Remote Methode Invocation !!!

One TOOL

2 Accessservice:jmx:rmi://glassfish.passthesalt.net:8686/jndi/rmi://glassfish.passthesalt.net:8686/jmxrmi

Login : emptyPassword: empty

service:jmx:rmi://glassfish.passthesalt.net/jndi/rmi://glassfish.passthesalt.net:8686/glassfish.passthesalt.net/7676/jmxrmi

Login : adminPassword: admin

Page 11: admin to RCE Glassfish from (In)Secure - 2018.pass … · Pass The Salt 2018: Glassfish from (IN)Secure admin to RCE Lets try to access administration interfaces •BUT that means

Pass The Salt 2018: Glassfish from (IN)Secure admin to RCE

Then…

You just have to change the « enabled » attribute…

Page 12: admin to RCE Glassfish from (In)Secure - 2018.pass … · Pass The Salt 2018: Glassfish from (IN)Secure admin to RCE Lets try to access administration interfaces •BUT that means

Pass The Salt 2018: Glassfish from (IN)Secure admin to RCE

AND…

Page 13: admin to RCE Glassfish from (In)Secure - 2018.pass … · Pass The Salt 2018: Glassfish from (IN)Secure admin to RCE Lets try to access administration interfaces •BUT that means

Pass The Salt 2018: Glassfish from (IN)Secure admin to RCE

BUT…

Page 14: admin to RCE Glassfish from (In)Secure - 2018.pass … · Pass The Salt 2018: Glassfish from (IN)Secure admin to RCE Lets try to access administration interfaces •BUT that means

Pass The Salt 2018: Glassfish from (IN)Secure admin to RCE

What else ?

• If the defaults credentials were changed => create new admin

• Activate JDWP => Code execution

• Need lot of debug….

Page 15: admin to RCE Glassfish from (In)Secure - 2018.pass … · Pass The Salt 2018: Glassfish from (IN)Secure admin to RCE Lets try to access administration interfaces •BUT that means

Questions ?

Pass The Salt 2018: Glassfish from (IN)Secure admin to RCE

POC: https://github.com/Jm0uss3t/gl4ssFish