Exploit database

GH-c2fc84cac7dc95cafeface2a430b9c2b

al1ex/cve-2020-2883

GitHubNot listedPoC
Download repository ZIP

Sources for CVE-2020-2883

20 sources

Preferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source

Repository files4
al1ex/cve-2020-2883Revision 126614508a08

Files from this repository share one source choice. Supporting files may cover other vulnerabilities.

src/com/supeream/serial/Reflections.java

Java · 1,142 bytes
package com.supeream.serial;

import java.lang.reflect.Constructor;
import java.lang.reflect.Field;

public class Reflections {

    public static Field getField(final Class<?> clazz, final String fieldName) throws Exception {
        Field field = clazz.getDeclaredField(fieldName);
        if (field == null && clazz.getSuperclass() != null) {
            field = getField(clazz.getSuperclass(), fieldName);
        }
        field.setAccessible(true);
        return field;
    }

    public static void setFieldValue(final Object obj, final String fieldName, final Object value) throws Exception {
        final Field field = getField(obj.getClass(), fieldName);
        field.set(obj, value);
    }

    public static Object getFieldValue(final Object obj, final String fieldName) throws Exception {
        final Field field = getField(obj.getClass(), fieldName);
        return field.get(obj);
    }

    public static Constructor<?> getFirstCtor(final String name) throws Exception {
        final Constructor<?> ctor = Class.forName(name).getDeclaredConstructors()[0];
        ctor.setAccessible(true);
        return ctor;
    }

}