CVE-2019-3394:[Confluence]敏感信息泄露漏洞

这次没咋分析:
https://mp.weixin.qq.com/s/puRrvfqWFVKvQ0hOoVs8lQ
写了一个poc:
https://github.com/5/Poc/tree/master/Confluence
CVE-2019-3394:[Confluence]敏感信息泄露漏洞_第1张图片
,需要修改:
url、用户名、密码、你自己的空间名
CVE-2019-3394:[Confluence]敏感信息泄露漏洞_第2张图片
然后切换payload,改一下数字就行了。
CVE-2019-3394:[Confluence]敏感信息泄露漏洞_第3张图片

最后confluence是加了一个过滤函数,判断用户输入的payload的文件路径经过路径穿越之后是否是/WEB-INF/packages的子目录,这里不知道咋绕了。

import java.io.File;
import java.io.IOException;

public class Main{
    public static boolean isChildOf(File dir, File child) {
        try {
            File dirCanonical = dir.getCanonicalFile();
            File targetCanonical = child.getCanonicalFile();
            System.out.println(targetCanonical);
            for(File parent = targetCanonical.getParentFile(); parent != null; parent = parent.getParentFile()) {
                if (dirCanonical.equals(parent)) {
                    return true;
                }
            }
        } catch (IOException var5) {
            System.out.println(var5);
        }

        return false;
    }

public static void main(String[] args) {

    File a_dir = new File("/WEB-INF/packages");
    File a_child = new File("/WEB-INF/packages/../../../../../../web.xml");
    System.out.println(isChildOf(a_dir, a_child));
}


}

另外后面的限定了路径穿越的路径的代码还没有跟。

你可能感兴趣的:(java,安全,Web)