
स्थानीय GeoServer/PostGIS लैब जो OGC Filter SQL injection (CVE-2023-25157/25158) को असुरक्षित, पैच किए गए, और शमित A/B परीक्षण मोड के साथ पुनरुत्पादित करती है।
यह लैब स्थानीय वातावरण में OGC Filter SQL injection का अध्ययन करने के लिए GeoServer/PostGIS का उपयोग करता है, जिसमें operator/setup mode और attacker mode स्पष्ट रूप से अलग किए गए हैं।
GeoServer 2.22.0 में vulnerable GeoTools embed है। GeoServer 2.22.2 में patched GeoTools embed है। लैब समान schema/request रखता है ताकि version, mitigation और privilege boundary का A/B test किया जा सके।
| Mode | Surface | उद्देश्य |
|---|
| Setup/operator REST | cve-operator internal container | REST setup, validation और backend log review |
| Single gateway | 127.0.0.1:8889 | UI operator और सभी OWS route के लिए एक ही port |
| Operator Web UI | 127.0.0.1:8889/geoserver/web/ | ऑपरेटर के लिए GeoServer UI; Basic Auth proxy के साथ |
| Attacker vulnerable | 127.0.0.1:8889/vuln/geoserver/ows | WFS/OWS vulnerable, DB error response में दिखता है |
| Attacker patched | 127.0.0.1:8889/patched/geoserver/ows | GeoServer 2.22.2 / GeoTools 28.2 |
| Attacker realistic | 127.0.0.1:8889/realistic/geoserver/ows | WFS/OWS vulnerable लेकिन gateway error detail strip करता है |
| Mitigation function | 127.0.0.1:8889/mit-functions/geoserver/ows | GeoServer 2.22.0, encode functions=false |
| Mitigation FeatureId | 127.0.0.1:8889/mit-featureid/geoserver/ows | GeoServer 2.22.0, preparedStatements=true |
PostgreSQL/PostGIS host पर port publish नहीं करता। GeoServer सीधे port 8080 host पर publish नहीं करता; host केवल 127.0.0.1:8889 पर cve-gateway देखता है। Container cve-attacker केवल attacker-net में है; इसका PostgreSQL या GeoServer internal service तक कोई route नहीं है। REST setup geoserver-net पर internal container cve-operator के माध्यम से जाता है।
ब्राउज़र में खोलें:
http://127.0.0.1:8889/geoserver/web/
2-स्तरीय लॉगिन:
operator / operator_labadmin / geoserverसब कुछ एक ही gateway 8889 से होकर जाता है, कई port याद रखने की आवश्यकता नहीं। Burp default proxy 127.0.0.1:8080 रख सकता है।
.\lab.ps1 reset all
.\lab.ps1 validate
powershell -ExecutionPolicy Bypass -File .\verify-lab.ps1
powershell -ExecutionPolicy Bypass -File .\negative-controls.ps1
powershell -ExecutionPolicy Bypass -File .\attack-chain.ps1
प्रबंधन कमांड:
.\lab.ps1 start vulnerable
.\lab.ps1 start patched
.\lab.ps1 start mitigated
.\lab.ps1 start worstcase
.\lab.ps1 reset all
.\lab.ps1 stop
.\lab.ps1 status
Seed tables:
cities: integer primary key, name text column, strStartsWith/strEndsWith के लिए उपयोग होता है।sensors_text: text primary key, FeatureId injection के लिए उपयोग होता है।sensors_int: integer primary key, FeatureId के लिए negative control।events: JSONB research layer।internal_assets: publish नहीं होता, प्रत्येक reset के बाद नया LAB-CANARY-<UUID> रखता है।local_points: shapefile non-JDBC negative control।Role:
geoserver_readonly: CONNECT, USAGE schema, केवल publish tables पर SELECT।geoserver_impact: internal_assets पर अतिरिक्त SELECT ताकि app DB user की अत्यधिक अनुमतियाँ दर्शाई जा सकें।geoserver_worstcase: अलग profile, pg_read_server_files के साथ fake canary file /lab/flag.txt पढ़ सकता है।attack-chain.ps1 निम्न कार्य करता है:
GetCapabilities recon।DescribeFeatureType schema enum।encode functions=false के साथ CVE-2023-25157 की पुष्टि।preparedStatements=true के साथ CVE-2023-25158 की पुष्टि।internal_assets को रोकता है, impact branch canary leak करता है, patched/realistic canary disclose नहीं करते।Evidence evidence/attack-chain-* में सहेजा जाता है। वर्तमान folder केवल नवीनतम pass evidence रखता है ताकि भ्रम से बचा जा सके।
यह profile मुख्य परिदृश्य में शामिल नहीं है:
.\lab.ps1 start worstcase
powershell -ExecutionPolicy Bypass -File .\worstcase-demo.ps1
यह केवल fake canary file /lab/flag.txt पढ़ता है, /etc/passwd नहीं पढ़ता, hash dump नहीं करता, password crack नहीं करता।