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

Could not load the translet class 'Pwnr' error #41

Open
seeCURE opened this issue Jan 16, 2024 · 4 comments
Open

Could not load the translet class 'Pwnr' error #41

seeCURE opened this issue Jan 16, 2024 · 4 comments
Labels
fixed on dev for bugs fixed in the dev version

Comments

@seeCURE
Copy link

seeCURE commented Jan 16, 2024

Hello @qtc-de,

While executing java -jar beanshooter-4.1.0-jar-with-dependencies.jar standard <taget ip port> tonka I get the following error

[jarvis@Mac-mini target] % java -jar beanshooter-4.1.0-jar-with-dependencies.jar standard <taget ip port> tonka     
[+] Creating a TemplateImpl payload object to abuse StandardMBean
[+]
[+] 	Deplyoing MBean: StandardMBean
[+] 	MBean with object name de.qtc.beanshooter:standard=482288429917125 was successfully deployed.
[+]
[-] 	Caught unexpected javax.management.MBeanException during standard action.
[-] 	Please report this to improve beanshooter :)
[-] 	StackTrace:
javax.management.MBeanException: javax.xml.transform.TransformerConfigurationException: Could not load the translet class 'Pwnr'.
	at com.sun.jmx.mbeanserver.MBeanIntrospector.unwrapInvocationTargetException(MBeanIntrospector.java:313)
	at com.sun.jmx.mbeanserver.MBeanIntrospector.invokeM(MBeanIntrospector.java:239)
	at com.sun.jmx.mbeanserver.PerInterface.invoke(PerInterface.java:138)
	at com.sun.jmx.mbeanserver.MBeanSupport.invoke(MBeanSupport.java:252)
	at javax.management.StandardMBean.invoke(StandardMBean.java:405)
	at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
	at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
	at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1468)
	at javax.management.remote.rmi.RMIConnectionImpl.access$300(RMIConnectionImpl.java:76)
	at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1309)
	at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1401)
	at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:829)
	at sun.reflect.GeneratedMethodAccessor29.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:357)
	at sun.rmi.transport.Transport$1.run(Transport.java:200)
	at sun.rmi.transport.Transport$1.run(Transport.java:197)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.rmi.transport.Transport.serviceCall(Transport.java:196)
	at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:573)
	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:834)
	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:688)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:687)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
	at java.rmi/sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:303)
	at java.rmi/sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:279)
	at java.rmi/sun.rmi.server.UnicastRef.invoke(UnicastRef.java:164)
	at jdk.remoteref/jdk.jmx.remote.internal.rmi.PRef.invoke(Unknown Source)
	at java.management.rmi/javax.management.remote.rmi.RMIConnectionImpl_Stub.invoke(RMIConnectionImpl_Stub.java:416)
	at java.management.rmi/javax.management.remote.rmi.RMIConnector$RemoteMBeanServerConnection.invoke(RMIConnector.java:1021)
	at de.qtc.beanshooter.operation.MBeanServerClient.invoke(MBeanServerClient.java:308)
	at de.qtc.beanshooter.operation.Dispatcher.standard(Dispatcher.java:419)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:564)
	at de.qtc.beanshooter.operation.BeanshooterOperation.invoke(BeanshooterOperation.java:470)
	at de.qtc.beanshooter.Starter.main(Starter.java:22)
Caused by: javax.xml.transform.TransformerConfigurationException: Could not load the translet class 'Pwnr'.
	at com.sun.org.apache.xalan.internal.xsltc.trax.TemplatesImpl.defineTransletClasses(TemplatesImpl.java:433)
	at com.sun.org.apache.xalan.internal.xsltc.trax.TemplatesImpl.getTransletInstance(TemplatesImpl.java:451)
	at com.sun.org.apache.xalan.internal.xsltc.trax.TemplatesImpl.newTransformer(TemplatesImpl.java:486)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:71)
	at sun.reflect.GeneratedMethodAccessor30.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:275)
	at com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(StandardMBeanIntrospector.java:112)
	at com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(StandardMBeanIntrospector.java:46)
	at com.sun.jmx.mbeanserver.MBeanIntrospector.invokeM(MBeanIntrospector.java:237)
	at com.sun.jmx.mbeanserver.PerInterface.invoke(PerInterface.java:138)
	at com.sun.jmx.mbeanserver.MBeanSupport.invoke(MBeanSupport.java:252)
	at javax.management.StandardMBean.invoke(StandardMBean.java:405)
	at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
	at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
	at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1468)
	at javax.management.remote.rmi.RMIConnectionImpl.access$300(RMIConnectionImpl.java:76)
	at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1309)
	at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1401)
	at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:829)
	at sun.reflect.GeneratedMethodAccessor29.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:357)
	at sun.rmi.transport.Transport$1.run(Transport.java:200)
	at sun.rmi.transport.Transport$1.run(Transport.java:197)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.rmi.transport.Transport.serviceCall(Transport.java:196)
	at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:573)
	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:834)
	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:688)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:687)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
[+]
[+] 	Removing MBean with ObjectName de.qtc.beanshooter:standard=482288429917125 from the MBeanServer.
[+] 	MBean was successfully removed.

My knowledge related to java is very very limited therefore I would appreciate if you could guide me why this error occurs. I tried with couple of targets but unfortunately getting the same error.

Thanks for this amazing tool and I really appreciate your time!

Kind regards

@qtc-de
Copy link
Owner

qtc-de commented Jan 16, 2024

Hi @seeCURE 👋

I encountered the same error recently (well, already one month ago by now). Additional error handling was already added to the develop branch (fdd73a5).

During the standard action, beanshooter dynamically creates a Java class and the bytecode of this class is sent to the application server, which attempts to load it. If your local Java version is higher than the Java version of the application server, the server cannot load the bytecode and throws an exception. This should be the root cause for your exception.

To resolve the problem, it is probably sufficient to run the command with Java 8 again. The beanshooter container image is using Java 8 and is probably the easiest way to achieve the desired result, if you do not have a Java 8 installation ready 🙃

If this resolves your problem, keep the issue open, as it probably helps other users that encounter this problem. I will close it once fdd73a5 is merged to master.

If the problem persists, keep asking 😉

@qtc-de qtc-de added the fixed on dev for bugs fixed in the dev version label Jan 16, 2024
@seeCURE
Copy link
Author

seeCURE commented Jan 17, 2024

Thank you very much @qtc-de for the quick reply and yes your suggested solution worked like a charm!👌 Thank you!

I really appreciate your time in making this awesome tool!

Have a great day!
@seeCURE

@qtc-de
Copy link
Owner

qtc-de commented Jan 17, 2024

You're welcome 🙂 It is feedback like this that keeps me motivated 💪

Best regards
Tobias

@jazzbydaway
Copy link

─$ docker run -it ghcr.io/qtc-de/beanshooter/beanshooter:4.1.0 standard ip port tonka
[+] Creating a TemplateImpl payload object to abuse StandardMBean
[+]
[+] Deplyoing MBean: StandardMBean
[+] MBean with object name de.qtc.beanshooter:standard=270436833678837 was successfully deployed.
[+]
[-] Caught unexpected javax.management.MBeanException during standard action.
[-] Please report this to improve beanshooter :)
[-] StackTrace:
javax.management.MBeanException: javax.xml.transform.TransformerConfigurationException: Could not load the translet class 'Pwnr'.

Hi I am still getting this error.

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

No branches or pull requests

3 participants