Detection: PostScript or EPS Upload with Image or PDF Extension

Description

This analytic identifies files uploaded over HTTP where Zeek reports PostScript content but the filename uses a common image or PDF extension. This content and filename mismatch can precede server-side document rendering. It does not establish exploitation; review nearby renderer and process activity.

 1`zeek_files`
 2is_orig=true
 3mime_type IN (
 4    "application/eps",
 5    "application/postscript",
 6    "application/x-eps",
 7    "image/x-eps"
 8)
 9filename IN (
10    "*.gif",
11    "*.jpeg",
12    "*.jpg",
13    "*.pdf",
14    "*.png",
15    "*.webp"
16)
17
18
19| eval src=coalesce(src,src_ip,'id.orig_h'),
20       dest=coalesce(dest,dest_ip,'id.resp_h'),
21       dest_port=coalesce(dest_port,'id.resp_p')
22
23
24| where isnotnull(uid) AND isnotnull(src) AND isnotnull(dest)
25
26
27| stats min(_time) as firstTime
28        max(_time) as lastTime
29        values(filename) as filename
30        values(mime_type) as mime_type
31        values(fuid) as fuid
32  by uid src dest dest_port
33
34
35| `security_content_ctime(firstTime)`
36
37| `security_content_ctime(lastTime)`
38
39| `postscript_or_eps_upload_with_image_or_pdf_extension_filter`

Data Source

Name Platform Sourcetype Source
Bro files Other 'bro:files:json' 'bro:files:json'

Macros Used

Name Value
zeek_files sourcetype="bro:files:json"
postscript_or_eps_upload_with_image_or_pdf_extension_filter search *
postscript_or_eps_upload_with_image_or_pdf_extension_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 TA for Zeek and ingest files.log from sensors that analyze HTTP uploads. Configure the zeek_files macro for the local index and sourcetype. Confirm that filename, mime_type, is_orig, fuid, uid, id.orig_h, id.resp_h, and id.resp_p are extracted. The sensor must see plaintext HTTP and have file analysis enabled. Tune extensions and MIME types for the file types accepted by your applications.

Known False Positives

A legitimate PostScript or EPS document can be uploaded with a PDF or image filename for conversion, preview, or compatibility. Review the application workflow, file metadata, and nearby renderer and process activity before escalation.

Associated Analytic Story

Intermediate Findings

Message Entity Field Entity Type Risk Score
PostScript file content uploaded as an image or PDF from [$src$] to [$dest$] (file: [$filename$]). dest system 20

Threat Objects

Field Type
src ip_address

References

Detection Testing

Test Type Status Dataset Source Sourcetype
Validation ✅ Passing N/A N/A N/A
Unit ✅ Passing Dataset not_applicable bro:files:json
Integration ✅ Passing Dataset not_applicable bro:files: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