Detection Engineering with Sigma: Custom Rules for Pakistani Threat Scenarios
Sigma in a Nutshell
Sigma is a generic, YAMLβbased language for describing detection rules that translate into query formats for SIEMs (ELK, Splunk, QRadar). By writing Sigma rules, Pakistani SOC analysts can share detections across tools and automate alert creation for locally relevant threats.
Mapping to MITRE ATT&CK
Every rule should reference the relevant ATT&CK tactic/technique ID. For example, a fake easypaisa SMS phishing campaign uses T1566.002 (Spearphishing Link).
Writing a Rule for Fake easypaisa SMS Phishing
- Identify the event: Windows Event ID 4688 (Process Creation) where
powershell.exelaunches with a URL. - Draft the Sigma rule:
title: Fake easypaisa SMS Phishing PowerShell Download id: b8c12a1e-7f9d-4e1b-9a3c-1234567890ab status: experimental description: Detects PowerShell downloading a payload from a known phishing URL pattern. author: Pakistani SOC Team references: - https://pisa.maahir.io/nccia tags: - attack.t1566.002 - attack.initial_access logsource: product: windows service: security definition: 4688 detection: selection: EventID: 4688 NewProcessName|contains: 'powershell.exe' CommandLine|contains: 'http' filter: CommandLine|contains: 'easypaisa.com' condition: selection and not filter level: high - Convert using
sigmac:sigmac -t elastalert -c elastalert -r rules/easypaisa_phish.yml
Detecting NADRA Phishing URLs
Use a similar rule focusing on URL patterns in proxy logs (source_url) that contain nadra.gov.pk but originate from unexpected TLDs (e.g., .xyz).
Detecting OLX/Daraz Marketplace Scams via Email
Create a rule on email gateway logs that flags messages with subject containing βOLXβ and body containing short URLs from free hosting services (bit.ly, goo.gl). Tag with attack.t1566.
Alerting and Tuning in ELK
- Import the generated ElastAlert rule into Kibana watcher.
- Set a threshold of 3 matches per hour to reduce false positives.
- Enrich alerts with MISP IOCs using a lookup processor.
Do / Don't
- Do keep rule titles concise and include ATT&CK IDs for quick triage.
- Donβt hardβcode IP addresses; use variables or external lookups to avoid stale detections.
Takeaway
Today you can write a Sigma rule for a fake easypaisa SMS scenario, translate it to an ELK query, and integrate it with your SIEM. This gives you a repeatable detection you can share on the pisa.maahir.io community portal and refine as new local scams emerge.
