Ausnahme gefangen: SSL certificate problem: certificate is not yet valid ๐Ÿ“Œ Gadgetinspector - A Byte Code Analyzer For Finding Deserialization Gadget Chains In Java Applications

๐Ÿ  Team IT Security News

TSecurity.de ist eine Online-Plattform, die sich auf die Bereitstellung von Informationen,alle 15 Minuten neuste Nachrichten, Bildungsressourcen und Dienstleistungen rund um das Thema IT-Sicherheit spezialisiert hat.
Ob es sich um aktuelle Nachrichten, Fachartikel, Blogbeitrรคge, Webinare, Tutorials, oder Tipps & Tricks handelt, TSecurity.de bietet seinen Nutzern einen umfassenden รœberblick รผber die wichtigsten Aspekte der IT-Sicherheit in einer sich stรคndig verรคndernden digitalen Welt.

16.12.2023 - TIP: Wer den Cookie Consent Banner akzeptiert, kann z.B. von Englisch nach Deutsch รผbersetzen, erst Englisch auswรคhlen dann wieder Deutsch!

Google Android Playstore Download Button fรผr Team IT Security



๐Ÿ“š Gadgetinspector - A Byte Code Analyzer For Finding Deserialization Gadget Chains In Java Applications


๐Ÿ’ก Newskategorie: IT Security Nachrichten
๐Ÿ”— Quelle: feedproxy.google.com


This project inspects Java libraries and classpaths for gadget chains. Gadgets chains are used to construct exploits for deserialization vulnerabilities. By automatically discovering possible gadgets chains in an application's classpath penetration testers can quickly construct exploits and application security engineers can assess the impact of a deserialization vulnerability and prioritize its remediation.
This project was presented at Black Hat USA 2018. Learn more about it there! (Links pending)
DISCLAIMER: This project is alpha at best. It needs tests and documentation added. Feel free to help by adding either!

Building
Assuming you have a JDK installed on your system, you should be able to just run ./gradlew shadowJar. You can then run the application with java -jar build/libs/gadget-inspector-all.jar <args>.

How to Use
This application expects as argument(s) either a path to a war file (in which case the war will be exploded and all of its classes and libraries used as a classpath) or else any number of jars.
Note that the analysis can be memory intensive (and so far gadget inspector has not been optimized at all to be less memory greedy). For small libraries you probably want to allocate at least 2GB of heap size (i.e. with the -Xmx2G flag). For larger applications you will want to use as much memory as you can spare.
The toolkit will go through several stages of classpath inspection to build up datasets for use in later stages. These datasets are written to files with a .dat extension and can be discarded after your run (they are written mostly so that earlier stages can be skipped during development).
After the analysis has run the file gadget-chains.txt will be written.

Example
The following is an example from running against commons-collections-3.2.1.jar, e.g. with
wget http://central.maven.org/maven2/commons-collections/commons-collections/3.2.1/commons-collections-3.2.1.jar
java -Xmx2G -jar build/libs/gadget-inspector-all.jar commons-collections-3.2.1.jar
In gadget-chains.txt there is the following chain:
com/sun/corba/se/spi/orbutil/proxy/CompositeInvocationHandlerImpl.invoke(Ljava/lang/Object;Ljava/lang/reflect/Method;[Ljava/lang/Object;)Ljava/lang/Object; (-1)
com/sun/corba/se/spi/orbutil/proxy/CompositeInvocationHandlerImpl.invoke(Ljava/lang/Object;Ljava/lang/reflect/Method;[Ljava/lang/Object;)Ljava/lang/Object; (0)
org/apache/commons/collections/map/DefaultedMap.get(Ljava/lang/Object;)Ljava/lang/Object; (0)
org/apache/commons/collections/functors/InvokerTransformer.transform(Ljava/lang/Object;)Ljava/lang/Object; (0)
java/lang/reflect/Method.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object; (0)
The entry point of this chain is an implementation of the JDK InvocationHandler class. Using the same trick as in the original commons-collections gadget chain, any serializable implementation of this class is reachable in a gadget chain, so the discovered chain starts here. This method invokes classToInvocationHandler.get(). The discovered gadget chain indicates that the classToInvocationHandler can be serialized as a DefaultedMap so that the this invocation jumps to DefaultedMap.get(). The next step in the chain invokes value.transform() from this method. The parameter value in this class can be serialized as a InvokerTransformer. Inside this class's transform method we see that we call cls.getMethodName(iMethodName, ...).invoke(...). Gadget inspector determined that iMethodName is attacker controllable as a serialized member, and thus an attacker can execute an arbitrary method on the class.
This gadget chain is the building block of the full commons-collections gadget chain discovered by Frohoff. In the above case, the gadget inspector happened to discovery entry through CompositeInvocationHandlerImpl and DefaultedMap instead of AnnotationInvocationHandler and LazyMap, but is largely the same.

Other Examples
If you're looking for more examples of what kind of chains this tool can find, the following libraries also have some interesting results:
Don't forget that you can also point gadget inspector at a complete application (packaged as a JAR or WAR). For example, when analyzing the war for the Zksample2 application we get the following gadget chain:
net/sf/jasperreports/charts/design/JRDesignPieDataset.readObject(Ljava/io/ObjectInputStream;)V (1)
org/apache/commons/collections/FastArrayList.add(Ljava/lang/Object;)Z (0)
java/util/ArrayList.clone()Ljava/lang/Object; (0)
org/jfree/data/KeyToGroupMap.clone()Ljava/lang/Object; (0)
org/jfree/data/KeyToGroupMap.clone(Ljava/lang/Object;)Ljava/lang/Object; (0)
java/lang/reflect/Method.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object; (0)
As you can see, this utilizes several different libraries contained in the application in order to build up the chain.

FAQ
Q: If gadget inspector finds a gadget chain, can an exploit be built from it?
A: Not always. The analysis uses some simplifying assumptions and can report false positives (gadget chains that don't actually exist). As a simple example, it doesn't try to solve for the satisfiability of branch conditions. Thus it will report the following as a gadget chain:
public class MySerializableClass implements Serializable {
public void readObject(ObjectInputStream ois) {
if (false) System.exit(0);
ois.defaultReadObject();
}
}
Furthermore, gadget inspector has pretty broad conditions on those functions it considers interesting. For example, it treats reflection as interesting (i.e. calls to Method.invoke() where an attacker can control the method), but often times overlooked assertions mean that an attacker can influence the method invoked but does not have complete control. For example, an attacker may be able to invoke the "getError()" method in any class, but not any other method name.
Q: If no gadget chains were found, does that mean my application is safe from exploitation?
A: No! For one, the gadget inspector has a very narrow set of "sink" functions which it considers to have "interesting" side effects. This certainly doesn't mean there aren't other interesting or dangerous behaviors not in the list.
Furthermore, there are a number of limitations to static analysis that mean the gadget inspector will always have blindspots. As an example, gadget inspector would presently miss this because it doesn't follow reflection calls.
public class MySerializableClass implements Serializable {
public void readObject(ObjectInputStream ois) {
System.class.getMethod("exit", int.class).invoke(null, 0);
}
}


...



๐Ÿ“Œ Gadgetinspector - A Byte Code Analyzer For Finding Deserialization Gadget Chains In Java Applications


๐Ÿ“ˆ 139.87 Punkte

๐Ÿ“Œ ODDFuzz: Hunting Java Deserialization Gadget Chains via Structure-Aware Directed Greybox Fuzzing


๐Ÿ“ˆ 46.29 Punkte

๐Ÿ“Œ ODDFuzz: Hunting Java Deserialization Gadget Chains via Structure-Aware Directed Greybox Fuzzing


๐Ÿ“ˆ 46.29 Punkte

๐Ÿ“Œ Black Hat USA 2018 Automated Discovery of Deserialization Gadget Chains


๐Ÿ“ˆ 39.79 Punkte

๐Ÿ“Œ How I Reverse Engineered Byte and Created My Own Byte Web App


๐Ÿ“ˆ 32.5 Punkte

๐Ÿ“Œ Medium CVE-2021-28033: Byte struct project Byte struct


๐Ÿ“ˆ 32.5 Punkte

๐Ÿ“Œ CVE-2019-11936 | HHVM up to 4.28.1 APC NULL Byte poison null byte


๐Ÿ“ˆ 32.5 Punkte

๐Ÿ“Œ CVE-2019-17137 | Netgear AC1200 R6220 1.1.0.86 Path String NULL Byte poison null byte


๐Ÿ“ˆ 32.5 Punkte

๐Ÿ“Œ Major Hotel Chainsโ€™ Security Systems Exposed In Pyramid Hotel Group Data Leak (Marriott, Plaza, other chains may be impacted)


๐Ÿ“ˆ 31.89 Punkte

๐Ÿ“Œ Static code analyzer for C being leveraged for finding vulnerabilities in Binary Ninja


๐Ÿ“ˆ 29.47 Punkte

๐Ÿ“Œ IBM QRadar SIEM 7.3/7.4 Java Deserialization deserialization


๐Ÿ“ˆ 27.49 Punkte

๐Ÿ“Œ CVE-2019-18580 | Dell EMC Storage Monitoring/Reporting 4.3.1 Java RMI Deserialization RMI Request deserialization (DSA-2019-176)


๐Ÿ“ˆ 27.49 Punkte

๐Ÿ“Œ CVE-2019-18956 | Divisa Proxia Suite/SparkSpace/Proxia PHR Java Deserialization Request deserialization


๐Ÿ“ˆ 27.49 Punkte

๐Ÿ“Œ CVE-2020-5327 | Dell Security Management Server up to 10.2.9 Java RMI Deserialization RMI Request deserialization


๐Ÿ“ˆ 27.49 Punkte

๐Ÿ“Œ Apache Dubbo up to 2.6.8/2.7.7 Byte Preamble Flag deserialization


๐Ÿ“ˆ 26.75 Punkte

๐Ÿ“Œ Angry Gadget: Find the one gadget RCE in libc using angr


๐Ÿ“ˆ 26.7 Punkte

๐Ÿ“Œ Unverzichtbares Gadget fรผr Autofahrer: Wenn nichts mehr geht, hilft dieses Aldi-Gadget


๐Ÿ“ˆ 26.7 Punkte

๐Ÿ“Œ GitHub - astrelsky/Ghidra-Cpp-Class-Analyzer: Ghidra C++ Class and Run Time Type Information Analyzer


๐Ÿ“ˆ 25.84 Punkte

๐Ÿ“Œ Webshell-Analyzer - Web Shell Scanner And Analyzer


๐Ÿ“ˆ 25.84 Punkte

๐Ÿ“Œ How To Install Wireshark Network Analyzer In Ubuntu โ€“ A Best Network Traffic Analyzer For Linux


๐Ÿ“ˆ 25.84 Punkte

๐Ÿ“Œ Androwarn - Yet Another Static Code Analyzer For Malicious Android Applications


๐Ÿ“ˆ 25.68 Punkte

๐Ÿ“Œ Androwarn- Static Code Analyzer For Malicious Android Applications


๐Ÿ“ˆ 25.68 Punkte

๐Ÿ“Œ Debugging Your Code: Tips and Tools for Finding and Fixing Bugs in Your Web Applications


๐Ÿ“ˆ 25.44 Punkte

๐Ÿ“Œ Deserialization Vulnerability Remediation with Automated Gadget Chain Discovery - Ian Haken


๐Ÿ“ˆ 23.84 Punkte

๐Ÿ“Œ Deserialization Vulnerability Remediation with Automated Gadget Chain Discovery - Ian Haken


๐Ÿ“ˆ 23.84 Punkte

๐Ÿ“Œ Cisco Security Manager Java Deserialization Serialized Java Object privilege escalation


๐Ÿ“ˆ 23.49 Punkte

๐Ÿ“Œ Finding Deserialization Bugs in the SolarWinds Platform


๐Ÿ“ˆ 23.17 Punkte

๐Ÿ“Œ How to Use Byte Keyword in Java


๐Ÿ“ˆ 22.75 Punkte

๐Ÿ“Œ GitHub Security Lab: [Java] CWE-489: Query to detect main() method in Java EE applications


๐Ÿ“ˆ 21.88 Punkte

๐Ÿ“Œ GitHub Security Lab: [Java]: CWE-552 Add sources and sinks to detect unsafe getResource calls in Java EE applications


๐Ÿ“ˆ 21.88 Punkte

๐Ÿ“Œ GitHub Security Lab: CodeQL query for finding CSRF vulnerabilities in Spring applications


๐Ÿ“ˆ 21.56 Punkte

๐Ÿ“Œ Finding furlough freedom with software applications


๐Ÿ“ˆ 21.56 Punkte

๐Ÿ“Œ Patching Loopholes: Finding Backdoors in Applications


๐Ÿ“ˆ 21.56 Punkte











matomo