尝试在 Ubuntu 上编译 Java 文件但未成功(CVE-2020-2555.java)

尝试在 Ubuntu 上编译 Java 文件但未成功(CVE-2020-2555.java)

我正在尝试编译以下文件https://github.com/wsfengfan/CVE-2020-2555/blob/master/supeream/CVE_2020_2555.java在我的 Ubuntu 服务器上,但没有成功。我尝试了“javac CVE_2020_2555.java”,但返回了超过 17 个错误:

javac CVE_2020_2555.java
CVE_2020_2555.java:5: error: package com.supeream.serial does not exist
import com.supeream.serial.Serializables;
                          ^
CVE_2020_2555.java:6: error: package com.supeream.weblogic does not exist
import com.supeream.weblogic.T3ProtocolOperation;
                            ^
CVE_2020_2555.java:7: error: package com.tangosol.util.extractor does not exist
import com.tangosol.util.extractor.ChainedExtractor;
                                  ^
CVE_2020_2555.java:8: error: package com.tangosol.util.extractor does not exist
import com.tangosol.util.extractor.ReflectionExtractor;
                                  ^
CVE_2020_2555.java:9: error: package com.tangosol.util.filter does not exist
import com.tangosol.util.filter.LimitFilter;
                               ^
CVE_2020_2555.java:38: error: cannot find symbol
        ReflectionExtractor extractor1 = new ReflectionExtractor(
        ^
  symbol:   class ReflectionExtractor
  location: class CVE_2020_2555
CVE_2020_2555.java:38: error: cannot find symbol
        ReflectionExtractor extractor1 = new ReflectionExtractor(
                                             ^
  symbol:   class ReflectionExtractor
  location: class CVE_2020_2555
CVE_2020_2555.java:45: error: cannot find symbol
        ReflectionExtractor extractor2 = new ReflectionExtractor(
        ^
  symbol:   class ReflectionExtractor
  location: class CVE_2020_2555
CVE_2020_2555.java:45: error: cannot find symbol
        ReflectionExtractor extractor2 = new ReflectionExtractor(
                                             ^
  symbol:   class ReflectionExtractor
  location: class CVE_2020_2555
CVE_2020_2555.java:52: error: cannot find symbol
        ReflectionExtractor extractor3 = new ReflectionExtractor(
        ^
  symbol:   class ReflectionExtractor
  location: class CVE_2020_2555
CVE_2020_2555.java:52: error: cannot find symbol
        ReflectionExtractor extractor3 = new ReflectionExtractor(
                                             ^
  symbol:   class ReflectionExtractor
  location: class CVE_2020_2555
CVE_2020_2555.java:58: error: cannot find symbol
        ReflectionExtractor[] extractors = {
        ^
  symbol:   class ReflectionExtractor
  location: class CVE_2020_2555
CVE_2020_2555.java:64: error: cannot find symbol
        ChainedExtractor chainedExtractor = new ChainedExtractor(extractors);
        ^
  symbol:   class ChainedExtractor
  location: class CVE_2020_2555
CVE_2020_2555.java:64: error: cannot find symbol
        ChainedExtractor chainedExtractor = new ChainedExtractor(extractors);
                                                ^
  symbol:   class ChainedExtractor
  location: class CVE_2020_2555
CVE_2020_2555.java:65: error: cannot find symbol
        LimitFilter limitFilter = new LimitFilter();
        ^
  symbol:   class LimitFilter
  location: class CVE_2020_2555
CVE_2020_2555.java:65: error: cannot find symbol
        LimitFilter limitFilter = new LimitFilter();
                                      ^
  symbol:   class LimitFilter
  location: class CVE_2020_2555
CVE_2020_2555.java:87: error: cannot find symbol
        byte[] payload = Serializables.serialize(badAttributeValueExpException);
                         ^
  symbol:   variable Serializables
  location: class CVE_2020_2555
17 errors

如能使用以下 Java 代码构建序列化对象 (test.ser),我们将不胜感激。

谢谢

答案1

这个问题可以关闭。用 JetBrains IDEA 社区版编译即可解决。

答案2

要使用javac命令运行它,您需要指定 CLASSPATH:

javac -cp /home/user/com/supeream:. /home/user/com/supeream/Main.java

我之前将CVE_2020_2555文件夹重命名为com

脚步:

  1. cd ~/
  2. git clone https://github.com/wsfengfan/CVE-2020-2555.git
  3. mv CVE-2020-2555 com
  4. javac -cp /home/user/com/supeream:. /home/user/com/supeream/CVE_2020_2555.java 或者
    javac -cp com/supeream:. com/supeream/CVE_2020_2555.java

位于/home/user目录内很重要。但是,它需要更多依赖项。所以你是对的。最好使用 IDE,它会为你下载所需的依赖项。

相关内容