Windows Process Outbound Connection To Social Media Domain
Description
This analytic detects outbound network connections from a Python process running from suspicious or non-standard directories to social media related domains. It leverages Sysmon Event ID 3 to surface this anomalous behavior. Legitimate Python applications rarely originate from paths such as "C:\Users\Public\", Windows font or debug folders, or the Recycle Bin, making direct outbound calls to social media infrastructure from these locations a strong indicator of compromise. For example the Braodo Stealer, a Python-based credential-harvesting malware, abuses authenticated browser sessions to query the Meta Graph API and enumerate the victim's Facebook and Meta advertising infrastructure.
Query · spl
`sysmon`
EventCode=3
Image IN (
"*:\\$Recycle.Bin\\*",
"*:\\PerfLogs\\*",
"*:\\Users\\Administrator\\Music\\*",
"*:\\Users\\Public\\*",
"*:\\Windows\\Cursors\\*",
"*:\\Windows\\debug\\*",
"*:\\Windows\\fonts\\*",
"*:\\Windows\\INF\\*",
"*:\\Windows\\Media\\*",
"*:\\Windows\\Prefetch\\*",
"*\\Windows\\repair\\*"
)
process_name IN (
"py.exe",
"pypy.exe",
"python.exe",
"python2*.exe",
"python3*.exe",
"pythonw.exe"
)
dest IN (
"*.facebook.com",
"*.facebook.net",
"*.facebook.org",
"*.fb.com",
"*.fbcd.net",
"*.fbsbx.com",
"*.fbstatic-a.akamaihd.net",
"*.tfbw.net"
)
direction = outbound
| rename Image as process_path
| stats count min(_time) as firstTime
max(_time) as lastTime
by action app dest dest_ip dest_port direction dvc protocol protocol_version
process_path process_name process_guid process_id
src src_ip src_port transport user vendor_product
| `security_content_ctime(firstTime)`
| `security_content_ctime(lastTime)`
| `windows_process_outbound_connection_to_social_media_domain_filter`
Implementation guide
To successfully implement this search, you need to be ingesting logs with the process name and sysmon eventcode = 3 connection events from your endpoints. If you are using Sysmon, you must have at least version 6.0.4 of the Sysmon TA.
Known false positives
- No false positives have been identified at this time.
Analyst notes
Known false positives: No false positives have been identified at this time.