PHP SOAP Malformed Array Dimensions
Description
This analytic looks for a SOAP arraySize value that is empty, contains only spaces, or is not a valid numeric dimension list or asterisk. Such requests may be probing the SOAP parser. Review the target's SOAP configuration and nearby process activity.
Query · spl
`zeek_http_post_body`
method="POST"
truncated=false
body="*arraySize*"
| where match(body,"(?i)<[^>]*Envelope")
| rex field=body max_match=0 "(?is)(?:[A-Za-z_][A-Za-z0-9_.-]*:)?arraySize\s*=\s*(?<array_quote>[\"'])(?<array_dimensions>.*?)\k<array_quote>"
| eval normalized_dimensions=replace(array_dimensions,"(?i)&#x(?:20|9);|&#(?:32|9);","")
| eval normalized_dimensions=trim(normalized_dimensions)
| where isnotnull(array_dimensions)
AND (
normalized_dimensions=""
OR NOT match(normalized_dimensions,"^(?:\*|[0-9]+(?:\s+[0-9]+)*)$")
)
| eval src=coalesce(src,'id.orig_h'),
dest=coalesce(dest,'id.resp_h'),
dest_port=coalesce(dest_port,'id.resp_p')
| stats min(_time) as firstTime
max(_time) as lastTime
values(uri) as url
values(array_dimensions) as array_dimensions
by uid src dest dest_port
| `security_content_ctime(firstTime)`
| `security_content_ctime(lastTime)`
| `php_soap_malformed_array_dimensions_filter`
Implementation guide
Install the custom Zeek HTTP POST Body script from https://gist.github.com/nasbench/4cd18a938056cbfbc8a9832edb26f4c4 and forward http_post_body.log. This script is not included with ESCU or the TA for Zeek. Set KV_MODE=json for the custom sourcetype on the search head and configure zeek_http_post_body for its index and sourcetype. Confirm that body, truncated, uid, method, and the connection IP and port fields are extracted. The sensor must see plaintext HTTP traffic. Capture enough of each body to include the SOAP arraySize value, and use only truncated=false events.
Known false positives
- Non-PHP SOAP services or custom parsers may accept values outside the numeric dimension form. Confirm the target service and expected SOAP schema.
Analyst notes
Known false positives: Non-PHP SOAP services or custom parsers may accept values outside the numeric dimension form. Confirm the target service and expected SOAP schema.