Malicious Script That Gets Rid of ADS, (Wed, Apr 1st)
嗯,用户让我帮忙总结这篇文章,控制在100字以内,而且不需要用“文章内容总结”这样的开头。首先,我得仔细阅读文章内容,理解主要观点。 文章讲的是无文件恶意软件如何通过注册表和脚本实现持久化。它们会在启动时执行脚本,并复制自身到%APPDATA%目录下。然后,使用PowerShell删除:Zone.Identifier ADS,以避免被检测。最后,加载DonutLoader。 我需要把这些要点浓缩到100字以内。要注意关键词:无文件恶意软件、注册表、启动执行、复制脚本、删除ADS、避免检测、DonutLoader。 可能的结构是:无文件恶意软件利用注册表在启动时执行脚本,并复制自身到%APPDATA%,删除ADS以避免检测,最终加载DonutLoader。 检查一下字数,确保不超过限制。这样应该能满足用户的需求。 </think> 无文件恶意软件通过注册表实现启动执行,并将自身复制到%APPDATA%目录中。为避免检测,恶意脚本使用PowerShell删除:Zone.Identifier ADS。最终,该恶意软件加载DonutLoader以进一步感染目标系统。 2026-4-1 10:44:42 Author: isc.sans.edu(查看原文) 阅读量:4 收藏

Today, most malware are called “fileless” because they try to reduce their footprint on the infected computer filesystem to the bare minimum. But they need to write something… think about persistence. They can use the registry as an alternative storage location.

But some scripts still rely on files that are executed at boot time. For example, via a “Run” key:

reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Run" /v csgh4Pbzclmp /t REG_SZ /d "\"%APPDATA%\Microsoft\Windows\Templates\dwm.cmd\"" /f >nul 2>&1

The file located in %APPDATA% will be executed at boot time.

From the attacker’s point of view, there is a problem: The original script copies itself:

copy /Y "%~f0" "%APPDATA%\Microsoft\Windows\Templates\dwm.cmd" >nul 2>&1

Just after the copy operation, a PowerShell one-liner is executed:

powershell -w h -c "try{Remove-Item -Path '%APPDATA%\Microsoft\Windows\Templates\dwm.cmd:Zone.Identifier' -Force -ErrorAction SilentlyContinue}catch{}" >nul 2>&1

PowerShell will try to remove the alternate-data-stream (ADS) “:Zone.Identifier” that Windows adds during file operations. The :Zone.Identifier indicates the source of the file (1 = My Computer, 2 = Local intranet, 3 = Trusted sites, 4 = Internet, 5 = Restricted sites). It's not clear if a "copy" will drop or conserver the ADS. I did not find an official Microsoft documentation but, if you ask to a LLM, it will tell you that they are not preserved. They are wrong!

In my Windows 10 lab, I downloaded a copy of BinaryNinja. An ADS was added to the file. After a copy to "test.ext", the new file has still the ADS!

By removing the ADS, the malicious script makes the file look less suspicious if the system is scanned to search for "downloaded" files (a classic operation performed in DFIR investigations). 

For the story, the script will later invoke another PowerShell that will drop a DonutLoader on the victim's computer.

Xavier Mertens (@xme)
Xameco
Senior ISC Handler - Freelance Cyber Security Consultant
PGP Key


文章来源: https://isc.sans.edu/diary/rss/32854
如有侵权请联系:admin#unsafe.sh