# OffSet7: Suspicious Appended Extension

> Design for the QRadar Rule Wizard. Not an importable rule and not tested in QRadar.

- Rule type: Event rule (Local), create disabled
- Log source types: EDR / Sysmon file rename events (Sysmon has no rename event; needs an EDR DSM)

## Building blocks

### BB:OffSet7:Suspicious Appended Extension:selection (match)
All test lines must match (AND).
- when **filename** ends with: `.doc`, `.docx`, `.jpeg`, `.jpg`, `.lnk`, `.pdf`, `.png`, `.pst`, `.rtf`, `.xls`, `.xlsx`
- when **Filename** contains: `.doc.`, `.docx.`, `.jpeg.`, `.jpg.`, `.lnk.`, `.pdf.`, `.png.`, `.pst.`, `.rtf.`, `.xls.`, `.xlsx.`

### BB:OffSet7:Suspicious Appended Extension:filter_main_generic (exclusion)
All test lines must match (AND).
- when **Filename** ends with: `.backup`, `.bak`, `.old`, `.orig`, `.temp`, `.tmp`

### BB:OffSet7:Suspicious Appended Extension:filter_optional_anaconda (exclusion)
All test lines must match (AND).
- when **Filename** contains: `:\ProgramData\Anaconda3\`
- when **Filename** ends with: `.c~`

## Main rule — option A (building blocks)

1. when the event(s) were detected by one or more of these log source types: `EDR / Sysmon file rename events (Sysmon has no rename event; needs an EDR DSM)`
2. when an event matches the condition built from these building blocks: `BB:OffSet7:Suspicious Appended Extension:selection AND NOT (ANY of [BB:OffSet7:Suspicious Appended Extension:filter_main_generic]) AND NOT (ANY of [BB:OffSet7:Suspicious Appended Extension:filter_optional_anaconda])`

## Main rule — option B (AQL filter test)

1. when the event matches this AQL filter query: `devicetype=12 AND ((LOWER(filename) LIKE '%.doc' OR LOWER(filename) LIKE '%.docx' OR LOWER(filename) LIKE '%.jpeg' OR LOWER(filename) LIKE '%.jpg' OR LOWER(filename) LIKE '%.lnk' OR LOWER(filename) LIKE '%.pdf' OR LOWER(filename) LIKE '%.png' OR LOWER(filename) LIKE '%.pst' OR LOWER(filename) LIKE '%.rtf' OR LOWER(filename) LIKE '%.xls' OR LOWER(filename) LIKE '%.xlsx') AND (LOWER(Filename) LIKE '%.doc.%' OR LOWER(Filename) LIKE '%.docx.%' OR LOWER(Filename) LIKE '%.jpeg.%' OR LOWER(Filename) LIKE '%.jpg.%' OR LOWER(Filename) LIKE '%.lnk.%' OR LOWER(Filename) LIKE '%.pdf.%' OR LOWER(Filename) LIKE '%.png.%' OR LOWER(Filename) LIKE '%.pst.%' OR LOWER(Filename) LIKE '%.rtf.%' OR LOWER(Filename) LIKE '%.xls.%' OR LOWER(Filename) LIKE '%.xlsx.%')) AND (NOT((LOWER(Filename) LIKE '%.backup' OR LOWER(Filename) LIKE '%.bak' OR LOWER(Filename) LIKE '%.old' OR LOWER(Filename) LIKE '%.orig' OR LOWER(Filename) LIKE '%.temp' OR LOWER(Filename) LIKE '%.tmp'))) AND (NOT((LOWER(Filename) LIKE '%:\programdata\anaconda3\%' AND LOWER(Filename) LIKE '%.c~')))`

## Rule response

- Severity 5, credibility 6, relevance 7
- Ensure the detected event is part of an offense; index offense on Log Source (host) and annotate with the rule title and OffSet7 rule id
- Respond no more than once per 30 minutes per Log Source (tune per environment)

## Limitations

- QRadar AQL LIKE / CRE string tests are case-sensitive unless the property is lower-cased; the AQL option uses LOWER() where the backend applied it.

Source rule: Suspicious Appended Extension (e3f673b3-65d1-4d80-9146-466f8b63fa99). Author: frack113. Licence: DRL-1.1.
