From 4bca49f23969f0ba5ebe1dbf6757bb74c779298f Mon Sep 17 00:00:00 2001 From: Michael Haag <5632822+MHaggis@users.noreply.github.com> Date: Mon, 19 May 2025 12:08:58 -0600 Subject: [PATCH 1/9] CAPTCHA if you Can ## New Analytic Story - Fake CAPTCHA Campaigns ## New Analytics - Windows PowerShell FakeCAPTCHA Clipboard Execution Tagged others related --- .../detect_mshta_url_in_command_line.yml | 3 +- .../endpoint/lolbas_with_network_traffic.yml | 3 +- .../endpoint/powershell_4104_hunting.yml | 5 +- ...rshell_fakecaptcha_clipboard_execution.yml | 88 +++++++++++++++++++ .../windows_runmru_command_execution.yml | 5 +- stories/fake_captcha_campaigns.yml | 22 +++++ 6 files changed, 120 insertions(+), 6 deletions(-) create mode 100644 detections/endpoint/windows_powershell_fakecaptcha_clipboard_execution.yml create mode 100644 stories/fake_captcha_campaigns.yml diff --git a/detections/endpoint/detect_mshta_url_in_command_line.yml b/detections/endpoint/detect_mshta_url_in_command_line.yml index ac216b3b21..f0bf18ae04 100644 --- a/detections/endpoint/detect_mshta_url_in_command_line.yml +++ b/detections/endpoint/detect_mshta_url_in_command_line.yml @@ -1,7 +1,7 @@ name: Detect MSHTA Url in Command Line id: 9b3af1e6-5b68-11eb-ae93-0242ac130002 version: 12 -date: '2025-05-02' +date: '2025-05-19' author: Michael Haag, Splunk status: production type: TTP @@ -79,6 +79,7 @@ tags: - Lumma Stealer - Living Off The Land - Compromised Windows Host + - Fake CAPTCHA Campaigns asset_type: Endpoint mitre_attack_id: - T1218.005 diff --git a/detections/endpoint/lolbas_with_network_traffic.yml b/detections/endpoint/lolbas_with_network_traffic.yml index b143d573df..7ff70f5d87 100644 --- a/detections/endpoint/lolbas_with_network_traffic.yml +++ b/detections/endpoint/lolbas_with_network_traffic.yml @@ -1,7 +1,7 @@ name: LOLBAS With Network Traffic id: 2820f032-19eb-497e-8642-25b04a880359 version: 9 -date: '2025-05-02' +date: '2025-05-19' author: Steven Dick status: production type: TTP @@ -77,6 +77,7 @@ tags: analytic_story: - Living Off The Land - Water Gamayun + - Fake CAPTCHA Campaigns asset_type: Endpoint mitre_attack_id: - T1105 diff --git a/detections/endpoint/powershell_4104_hunting.yml b/detections/endpoint/powershell_4104_hunting.yml index 41d3966331..799e2d3a6d 100644 --- a/detections/endpoint/powershell_4104_hunting.yml +++ b/detections/endpoint/powershell_4104_hunting.yml @@ -1,7 +1,7 @@ name: PowerShell 4104 Hunting id: d6f2b006-0041-11ec-8885-acde48001122 -version: 16 -date: '2025-05-02' +version: 17 +date: '2025-05-14' author: Michael Haag, Splunk status: production type: Hunting @@ -80,6 +80,7 @@ tags: - SystemBC - PHP-CGI RCE Attack on Japanese Organizations - Water Gamayun + - Fake CAPTCHA Campaigns asset_type: Endpoint mitre_attack_id: - T1059.001 diff --git a/detections/endpoint/windows_powershell_fakecaptcha_clipboard_execution.yml b/detections/endpoint/windows_powershell_fakecaptcha_clipboard_execution.yml new file mode 100644 index 0000000000..1c30732599 --- /dev/null +++ b/detections/endpoint/windows_powershell_fakecaptcha_clipboard_execution.yml @@ -0,0 +1,88 @@ +name: Windows PowerShell FakeCAPTCHA Clipboard Execution +id: d81d4d3d-76b5-4f21-ab51-b17d5164c106 +version: 1 +date: '2025-05-14' +author: Michael Haag, Splunk +status: production +type: TTP +description: This detection identifies potential FakeCAPTCHA/ClickFix clipboard hijacking campaigns by looking for PowerShell execution with hidden window parameters and distinctive strings related to fake CAPTCHA verification. These campaigns use social engineering to trick users into pasting malicious PowerShell commands from their clipboard, typically delivering information stealers or remote access trojans. +data_source: +- Sysmon EventID 1 +search: '| tstats `security_content_summariesonly` count min(_time) as firstTime max(_time) + as lastTime FROM datamodel=Endpoint.Processes where `process_powershell` + AND ( + (Processes.process IN ("* -w hidden *", "* -window hidden *", "* -windowstyle hidden *", "*-w h*", "*-wind h*", "*-windowstyle h*") OR Processes.process="*-w h*") + AND + ( + (Processes.process IN ("*robot*", "*captcha-iogo*", "*Robot*", "*captcha-logo*", "*Captcha*", "*captcha-container*", "*captcha*", "*captcha-box*", "*CAPTCHA*", "*CaptchaListeners*")) + OR + ( + (Processes.process IN ("*iwr *", "*Invoke-WebRequest*", "*wget *", "*curl *", "*Net.WebClient*", "*DownloadString*", "*[Convert]::FromBase64String*")) + AND + (Processes.process IN ("*|iex*", "*|Invoke-Expression*", "* iex *", "* Invoke-Expression *")) + ) + OR + (Processes.process="*FromBase64String*" AND Processes.process="*iex*") + ) + ) + by Processes.action Processes.dest Processes.original_file_name Processes.parent_process + Processes.parent_process_exec Processes.parent_process_guid Processes.parent_process_id + Processes.parent_process_name Processes.parent_process_path Processes.process + Processes.process_exec Processes.process_guid Processes.process_hash Processes.process_id + Processes.process_integrity_level Processes.process_name Processes.process_path + Processes.user Processes.user_id Processes.vendor_product + | `drop_dm_object_name(Processes)` + | `security_content_ctime(firstTime)` + | `security_content_ctime(lastTime)` + | `windows_powershell_fakecaptcha_clipboard_execution_filter`' +how_to_implement: To successfully implement this search, you need to be ingesting logs with the process name, process path, and command-line executions from your endpoints. If you are using Sysmon, you must have at least Sysmon version 6.0.4 with EventID 1 configured. The full command line arguments are necessary for proper detection. +known_false_positives: Legitimate PowerShell commands that use hidden windows for automation tasks may trigger this detection. The search specifically looks for patterns typical of FakeCAPTCHA campaigns. You may need to add additional exclusions for legitimate administrative activities in your environment by modifying the lookup file or creating an exclusions list in the filter macro. +references: +- https://urlhaus.abuse.ch/ +- https://www.proofpoint.com/us/blog/threat-insight/security-brief-clickfix-social-engineering-technique-floods-threat-landscape +- https://reliaquest.com/blog/using-captcha-for-compromise/ +- https://attack.mitre.org/techniques/T1204/001/ +- https://github.com/MHaggis/ClickGrab +drilldown_searches: +- name: View the detection results for - "$dest$" + search: '%original_detection_search% | search dest = "$dest$"' + earliest_offset: $info_min_time$ + latest_offset: $info_max_time$ +- name: View risk events for the last 7 days for - "$dest$" + search: '| from datamodel Risk.All_Risk | search normalized_risk_object IN ("$dest$") + starthoursago=168 | stats count min(_time) as firstTime max(_time) as lastTime + values(search_name) as "Search Name" values(risk_message) as "Risk Message" + values(analyticstories) as "Analytic Stories" values(annotations._all) as "Annotations" + values(annotations.mitre_attack.mitre_tactic) as "ATT&CK Tactics" by normalized_risk_object + | `security_content_ctime(firstTime)` | `security_content_ctime(lastTime)`' + earliest_offset: $info_min_time$ + latest_offset: $info_max_time$ +rba: + message: A potential FakeCAPTCHA/ClickFix campaign execution was detected on $dest$ running a PowerShell command with hidden window and suspicious verification strings typical of social engineering attacks. + risk_objects: + - field: dest + type: system + score: 80 + threat_objects: + - field: process + type: process +tags: + analytic_story: + - Fake CAPTCHA Campaigns + asset_type: Endpoint + mitre_attack_id: + - T1059.001 + - T1204.001 + - T1059.003 + product: + - Splunk Enterprise + - Splunk Enterprise Security + - Splunk Cloud + security_domain: endpoint + cve: [] +tests: +- name: True Positive Test + attack_data: + - data: https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/attack_techniques/T1059.001/atomic_red_team/captcha_windows-sysmon.log + source: XmlWinEventLog:Microsoft-Windows-Sysmon/Operational + sourcetype: XmlWinEventLog diff --git a/detections/endpoint/windows_runmru_command_execution.yml b/detections/endpoint/windows_runmru_command_execution.yml index 9c537a7773..966e6ec234 100644 --- a/detections/endpoint/windows_runmru_command_execution.yml +++ b/detections/endpoint/windows_runmru_command_execution.yml @@ -1,7 +1,7 @@ name: Windows RunMRU Command Execution id: a15aa1ab-2b79-467f-8201-65e0f32d5b1a -version: 6 -date: '2025-05-02' +version: 7 +date: '2025-05-14' author: Nasreddine Bencherchali, Michael Haag, Splunk data_source: - Sysmon EventID 12 @@ -66,6 +66,7 @@ rba: tags: analytic_story: - Lumma Stealer + - Fake CAPTCHA Campaigns asset_type: Endpoint mitre_attack_id: - T1202 diff --git a/stories/fake_captcha_campaigns.yml b/stories/fake_captcha_campaigns.yml new file mode 100644 index 0000000000..ddaf94a05d --- /dev/null +++ b/stories/fake_captcha_campaigns.yml @@ -0,0 +1,22 @@ +name: Fake CAPTCHA Campaigns +id: b6578255-250a-4620-8e5e-7946e11ac2e9 +version: 1 +status: production +date: '2025-05-14' +author: Michael Haag, Splunk +description: This analytic story addresses the emerging threat of Fake CAPTCHA and ClickFix campaigns that exploit users' familiarity with verification systems to deliver malware through clipboard manipulation techniques. First observed in early 2024 and increasing through 2025, these campaigns use deceptive interfaces that mimic legitimate CAPTCHA systems to trick users into executing malicious commands. +narrative: Fake CAPTCHA campaigns represent a sophisticated evolution in social engineering attacks that rely entirely on manipulating user behavior rather than exploiting technical vulnerabilities. These attacks begin with victims landing on malicious websites through phishing emails, malvertising, or compromised legitimate sites. The site presents what appears to be a standard CAPTCHA verification interface with familiar branding from Google reCAPTCHA or Cloudflare. When users interact with the fake CAPTCHA, malicious JavaScript silently copies commands to their clipboard. Users are then instructed to perform additional verification steps such as pressing Windows+R followed by Ctrl+V, unknowingly pasting and executing malicious commands. These commands typically download and run additional malware using PowerShell scripts that operate in hidden windows. Common payloads include information stealers (Lumma, Redline, Vidar, PureLog), Remote Access Trojans (NetSupport, XWorm, AsyncRAT, Quasar), and multi-stage payloads that can deploy multiple malware families from a single infection. +references: +- https://urlhaus.abuse.ch/ +- https://www.proofpoint.com/us/blog/threat-insight/security-brief-clickfix-social-engineering-technique-floods-threat-landscape +- https://reliaquest.com/blog/using-captcha-for-compromise/ +- https://attack.mitre.org/techniques/T1204/001/ +- https://github.com/MHaggis/ClickGrab +tags: + category: + - Adversary Tactics + product: + - Splunk Enterprise + - Splunk Enterprise Security + - Splunk Cloud + usecase: Advanced Threat Detection \ No newline at end of file From dc3e7fd8c4ad38ccec0df85ac4e02aa2af31d1b4 Mon Sep 17 00:00:00 2001 From: Bhavin Patel Date: Mon, 19 May 2025 12:45:29 -0700 Subject: [PATCH 2/9] version --- detections/endpoint/lolbas_with_network_traffic.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/detections/endpoint/lolbas_with_network_traffic.yml b/detections/endpoint/lolbas_with_network_traffic.yml index 7ff70f5d87..196c4b5250 100644 --- a/detections/endpoint/lolbas_with_network_traffic.yml +++ b/detections/endpoint/lolbas_with_network_traffic.yml @@ -1,6 +1,6 @@ name: LOLBAS With Network Traffic id: 2820f032-19eb-497e-8642-25b04a880359 -version: 9 +version: 10 date: '2025-05-19' author: Steven Dick status: production From 3fb889d1a4f4814c8ef3f88b0ebcc0658feb2ecb Mon Sep 17 00:00:00 2001 From: Bhavin Patel Date: Mon, 19 May 2025 12:45:59 -0700 Subject: [PATCH 3/9] version --- detections/endpoint/powershell_4104_hunting.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/detections/endpoint/powershell_4104_hunting.yml b/detections/endpoint/powershell_4104_hunting.yml index cd59a429fc..5055866c6c 100644 --- a/detections/endpoint/powershell_4104_hunting.yml +++ b/detections/endpoint/powershell_4104_hunting.yml @@ -1,6 +1,6 @@ name: PowerShell 4104 Hunting id: d6f2b006-0041-11ec-8885-acde48001122 -version: 16 +version: 18 date: '2025-05-02' author: Michael Haag, Splunk status: production From 75dacb0f516e8ee684a9a42303645c04b50818fa Mon Sep 17 00:00:00 2001 From: Michael Haag <5632822+MHaggis@users.noreply.github.com> Date: Tue, 20 May 2025 10:41:33 -0600 Subject: [PATCH 4/9] Logic updates per comment --- ...rshell_fakecaptcha_clipboard_execution.yml | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/detections/endpoint/windows_powershell_fakecaptcha_clipboard_execution.yml b/detections/endpoint/windows_powershell_fakecaptcha_clipboard_execution.yml index 1c30732599..d5728e4d3f 100644 --- a/detections/endpoint/windows_powershell_fakecaptcha_clipboard_execution.yml +++ b/detections/endpoint/windows_powershell_fakecaptcha_clipboard_execution.yml @@ -1,6 +1,6 @@ name: Windows PowerShell FakeCAPTCHA Clipboard Execution id: d81d4d3d-76b5-4f21-ab51-b17d5164c106 -version: 1 +version: 2 date: '2025-05-14' author: Michael Haag, Splunk status: production @@ -10,20 +10,23 @@ data_source: - Sysmon EventID 1 search: '| tstats `security_content_summariesonly` count min(_time) as firstTime max(_time) as lastTime FROM datamodel=Endpoint.Processes where `process_powershell` + AND Processes.process="*-w*h*" AND ( - (Processes.process IN ("* -w hidden *", "* -window hidden *", "* -windowstyle hidden *", "*-w h*", "*-wind h*", "*-windowstyle h*") OR Processes.process="*-w h*") - AND - ( - (Processes.process IN ("*robot*", "*captcha-iogo*", "*Robot*", "*captcha-logo*", "*Captcha*", "*captcha-container*", "*captcha*", "*captcha-box*", "*CAPTCHA*", "*CaptchaListeners*")) + (Processes.process IN ("*robot*", "*captcha*", "*CAPTCHA*", "*verify*", "*security check*", "*complete verification*")) OR ( (Processes.process IN ("*iwr *", "*Invoke-WebRequest*", "*wget *", "*curl *", "*Net.WebClient*", "*DownloadString*", "*[Convert]::FromBase64String*")) AND - (Processes.process IN ("*|iex*", "*|Invoke-Expression*", "* iex *", "* Invoke-Expression *")) + (Processes.process IN ("*iex*", "*Invoke-Expression*")) + AND + (Processes.process IN ("*click*", "*verify*", "*check*", "*human*", "*bot*", "*token*", "*challenge*")) ) OR - (Processes.process="*FromBase64String*" AND Processes.process="*iex*") - ) + ( + Processes.process="*clipboard*" + AND Processes.process="*iex*" + AND (Processes.process="*FromBase64String*" OR Processes.process="*decode*") + ) ) by Processes.action Processes.dest Processes.original_file_name Processes.parent_process Processes.parent_process_exec Processes.parent_process_guid Processes.parent_process_id From d3d6e624df354047de33556abc720e8c7c945d61 Mon Sep 17 00:00:00 2001 From: Michael Haag <5632822+MHaggis@users.noreply.github.com> Date: Tue, 20 May 2025 10:43:06 -0600 Subject: [PATCH 5/9] fixed --- detections/endpoint/detect_mshta_url_in_command_line.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/detections/endpoint/detect_mshta_url_in_command_line.yml b/detections/endpoint/detect_mshta_url_in_command_line.yml index 6fff94725e..ceb2e3fd4d 100644 --- a/detections/endpoint/detect_mshta_url_in_command_line.yml +++ b/detections/endpoint/detect_mshta_url_in_command_line.yml @@ -78,7 +78,8 @@ tags: - Compromised Windows Host - Lumma Stealer - Living Off The Land - - Compromised Windows Host + - Suspicious MSHTA Activity + - Xworm asset_type: Endpoint mitre_attack_id: - T1218.005 From 0ae650a51eb2f8d4cf0820493b9c8c747a9ab468 Mon Sep 17 00:00:00 2001 From: Michael Haag Date: Tue, 20 May 2025 10:43:58 -0600 Subject: [PATCH 6/9] fix --- detections/endpoint/detect_mshta_url_in_command_line.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/detections/endpoint/detect_mshta_url_in_command_line.yml b/detections/endpoint/detect_mshta_url_in_command_line.yml index ceb2e3fd4d..4b4e95cd8c 100644 --- a/detections/endpoint/detect_mshta_url_in_command_line.yml +++ b/detections/endpoint/detect_mshta_url_in_command_line.yml @@ -79,7 +79,7 @@ tags: - Lumma Stealer - Living Off The Land - Suspicious MSHTA Activity - - Xworm + - XWorm asset_type: Endpoint mitre_attack_id: - T1218.005 From 55dfdddc4fa415f0e676af841eb08874bbbc8754 Mon Sep 17 00:00:00 2001 From: Michael Haag Date: Tue, 20 May 2025 10:48:07 -0600 Subject: [PATCH 7/9] xworm --- detections/endpoint/powershell_4104_hunting.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/detections/endpoint/powershell_4104_hunting.yml b/detections/endpoint/powershell_4104_hunting.yml index 5055866c6c..fe81470f71 100644 --- a/detections/endpoint/powershell_4104_hunting.yml +++ b/detections/endpoint/powershell_4104_hunting.yml @@ -77,6 +77,7 @@ tags: - SystemBC - PHP-CGI RCE Attack on Japanese Organizations - Water Gamayun + - XWorm asset_type: Endpoint mitre_attack_id: - T1059.001 From f623ca67ea540099aafcef0928bb50801546c941 Mon Sep 17 00:00:00 2001 From: Michael Haag Date: Tue, 20 May 2025 10:53:48 -0600 Subject: [PATCH 8/9] vers --- detections/endpoint/detect_mshta_url_in_command_line.yml | 2 +- detections/endpoint/powershell_4104_hunting.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/detections/endpoint/detect_mshta_url_in_command_line.yml b/detections/endpoint/detect_mshta_url_in_command_line.yml index 4b4e95cd8c..8699348b29 100644 --- a/detections/endpoint/detect_mshta_url_in_command_line.yml +++ b/detections/endpoint/detect_mshta_url_in_command_line.yml @@ -1,6 +1,6 @@ name: Detect MSHTA Url in Command Line id: 9b3af1e6-5b68-11eb-ae93-0242ac130002 -version: 14 +version: 13 date: '2025-05-19' author: Michael Haag, Splunk status: production diff --git a/detections/endpoint/powershell_4104_hunting.yml b/detections/endpoint/powershell_4104_hunting.yml index fe81470f71..ba7e904f42 100644 --- a/detections/endpoint/powershell_4104_hunting.yml +++ b/detections/endpoint/powershell_4104_hunting.yml @@ -1,6 +1,6 @@ name: PowerShell 4104 Hunting id: d6f2b006-0041-11ec-8885-acde48001122 -version: 18 +version: 17 date: '2025-05-02' author: Michael Haag, Splunk status: production From f6832c6822d9485b40d17dbbd36ae10a4acb9bde Mon Sep 17 00:00:00 2001 From: Nasreddine Bencherchali Date: Tue, 20 May 2025 19:28:26 +0200 Subject: [PATCH 9/9] Apply suggestions from code review --- .../windows_powershell_fakecaptcha_clipboard_execution.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/detections/endpoint/windows_powershell_fakecaptcha_clipboard_execution.yml b/detections/endpoint/windows_powershell_fakecaptcha_clipboard_execution.yml index d5728e4d3f..32be656d9a 100644 --- a/detections/endpoint/windows_powershell_fakecaptcha_clipboard_execution.yml +++ b/detections/endpoint/windows_powershell_fakecaptcha_clipboard_execution.yml @@ -1,6 +1,6 @@ name: Windows PowerShell FakeCAPTCHA Clipboard Execution id: d81d4d3d-76b5-4f21-ab51-b17d5164c106 -version: 2 +version: 1 date: '2025-05-14' author: Michael Haag, Splunk status: production @@ -12,7 +12,7 @@ search: '| tstats `security_content_summariesonly` count min(_time) as firstTime as lastTime FROM datamodel=Endpoint.Processes where `process_powershell` AND Processes.process="*-w*h*" AND ( - (Processes.process IN ("*robot*", "*captcha*", "*CAPTCHA*", "*verify*", "*security check*", "*complete verification*")) + (Processes.process IN ("*robot*", "*captcha*", "*verify*", "*security check*", "*complete verification*")) OR ( (Processes.process IN ("*iwr *", "*Invoke-WebRequest*", "*wget *", "*curl *", "*Net.WebClient*", "*DownloadString*", "*[Convert]::FromBase64String*")) @@ -39,7 +39,7 @@ search: '| tstats `security_content_summariesonly` count min(_time) as firstTime | `security_content_ctime(lastTime)` | `windows_powershell_fakecaptcha_clipboard_execution_filter`' how_to_implement: To successfully implement this search, you need to be ingesting logs with the process name, process path, and command-line executions from your endpoints. If you are using Sysmon, you must have at least Sysmon version 6.0.4 with EventID 1 configured. The full command line arguments are necessary for proper detection. -known_false_positives: Legitimate PowerShell commands that use hidden windows for automation tasks may trigger this detection. The search specifically looks for patterns typical of FakeCAPTCHA campaigns. You may need to add additional exclusions for legitimate administrative activities in your environment by modifying the lookup file or creating an exclusions list in the filter macro. +known_false_positives: Legitimate PowerShell commands that use hidden windows for automation tasks may trigger this detection. The search specifically looks for patterns typical of FakeCAPTCHA campaigns. You may need to add additional exclusions for legitimate administrative activities in your environment by modifying the filter macro. references: - https://urlhaus.abuse.ch/ - https://www.proofpoint.com/us/blog/threat-insight/security-brief-clickfix-social-engineering-technique-floods-threat-landscape