Detection: 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.

 1`zeek_http_post_body`
 2method="POST"
 3truncated=false
 4body="*arraySize*"
 5
 6
 7| where match(body,"(?i)<[^>]*Envelope")
 8
 9
10| rex field=body max_match=0 "(?is)(?:[A-Za-z_][A-Za-z0-9_.-]*:)?arraySize\s*=\s*(?<array_quote>[\"'])(?<array_dimensions>.*?)\k<array_quote>"
11
12
13| eval normalized_dimensions=replace(array_dimensions,"(?i)&#x(?:20
14|9);
15|&#(?:32
16|9);","")
17
18| eval normalized_dimensions=trim(normalized_dimensions)
19
20
21| where isnotnull(array_dimensions)
22    AND (
23        normalized_dimensions=""
24        OR NOT match(normalized_dimensions,"^(?:\*
25|[0-9]+(?:\s+[0-9]+)*)$")
26    )
27
28
29| eval src=coalesce(src,'id.orig_h'),
30       dest=coalesce(dest,'id.resp_h'),
31       dest_port=coalesce(dest_port,'id.resp_p')
32
33
34| stats min(_time) as firstTime
35        max(_time) as lastTime
36        values(uri) as url
37        values(array_dimensions) as array_dimensions
38        by uid src dest dest_port
39
40
41| `security_content_ctime(firstTime)`
42
43| `security_content_ctime(lastTime)`
44
45| `php_soap_malformed_array_dimensions_filter`

Data Source

Name Platform Sourcetype Source
Zeek HTTP POST Body Web 'zeek:http_post_body:json' 'http_post_body.log'

Macros Used

Name Value
security_content_ctime convert timeformat="%Y-%m-%dT%H:%M:%S" ctime($field$)
php_soap_malformed_array_dimensions_filter search *
php_soap_malformed_array_dimensions_filter is an empty macro by default. It allows the user to filter out any results (false positives) without editing the SPL.

Annotations

CVE

Default Configuration

This detection is configured by default in Splunk Enterprise Security to run with the following settings:

Setting Value
Disabled true
Cron Schedule 0 * * * *
Earliest Time -70m@m
Latest Time -10m@m
Schedule Window auto
Creates Finding (Notable) No
Creates Intermediate Finding (Risk Event) Yes
Anomaly detections generate Intermediate Findings (Risk Events). They do not generate a Finding (Notable) directly.

Implementation

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.

Associated Analytic Story

Intermediate Findings

Message Entity Field Entity Type Risk Score
Malformed SOAP array dimensions sent from [$src$] to [$dest$]. dest system 10

References

Detection Testing

Test Type Status Dataset Source Sourcetype
Validation ✅ Passing N/A N/A N/A
Unit ✅ Passing Dataset not_applicable zeek:http_post_body:json
Integration ✅ Passing Dataset not_applicable zeek:http_post_body:json

Replay any dataset to Splunk Enterprise by using our replay.py tool or the UI. Alternatively you can replay a dataset into a Splunk Attack Range


Source: GitHub |

Version: 1