PHP Serialized Object in POST Body
Description
This analytic finds a PHP serialized object marker in an HTTP POST body. Such input can reach unsafe deserialization paths, including session upload progress when applications share session storage but use different serializers. Review the target's session settings and subsequent process activity.
Query · spl
`zeek_http_post_body`
method="POST"
truncated=false
body="*|O:*"
| where match(body,"\\|O:[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
max(body_bytes) as body_bytes
by uid src dest dest_port
| `security_content_ctime(firstTime)`
| `security_content_ctime(lastTime)`
| `php_serialized_object_in_post_body_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, uri, body_bytes, id.orig_h, id.resp_h, and id.resp_p are extracted. The sensor must see plaintext HTTP traffic. Capture enough of each POST body to include the serialized object marker. Review the captured data policy because bodies may contain sensitive values. Confirm whether the target uses session upload progress and whether applications sharing a session store use different serializers. Check nearby process events before treating a match as command execution.
Known false positives
- Authorized security testing and applications that legitimately transfer serialized PHP objects can match. Confirm that the target deserializes the input before escalating.
Analyst notes
Known false positives: Authorized security testing and applications that legitimately transfer serialized PHP objects can match. Confirm that the target deserializes the input before escalating.