NTFS文件流概念和利用
ntfs系统中的文件是一系列属性的集合体。可以用来为文件做注释,也可以用来隐藏一些别的信息。使用这种方法会给系统安全带来什么风险?
Windows 家庭版 | Windows 11 | 升级和安装
-
莘莘 高 • 0 信誉分
2026-09-05T10:46:41.29+00:00 常用操作
查看所有流:
dir /r
Get-Item 文件.txt -Stream *
Get-Content 文件.txt -Stream Zone.Identifier
创建 / 删除:
echo 隐藏内容 > 文件.txt:secret
more < 文件.txt:secret
Set-Content 文件.txt -Stream secret -Value "内容"
Remove-Item 文件.txt -Stream secret
批量扫描推荐 Sysinternals 的 streams64 -s C:。
ADS 是经典的隐藏与免杀手段(MITRE T1564.004):可以把 exe、dll 整个塞进一个看似无害的 txt 或目录里,主流大小不变,肉眼完全看不出。执行时用
"wmic process call create"、
"forfiles"、
"rundll32" 等系统自带工具即可拉起。
-
莘莘 高 • 0 信誉分
2026-09-07T20:12:03.87+00:00 排查要点:
用
"dir /r" 或
"Get-Item -Stream *" 全盘扫,重点看流名带 .exe/.dll 或体积异常的
企业环境可采集 Sysmon Event ID 15(流创建事件)做告警
注意:把文件拷到 FAT32/exFAT 或打进不支持流的压缩包,所有 ADS 会被自动剥离
-
-
-
-
已删除
此评论已被删除,因为违反了我们的行为准则。 在采取措施之前,已通过自动检测手动报告或识别该评论。 有关详细信息,请参阅我们的行为准则。
-
-
莘莘 高 • 0 信誉分
2026-09-07T20:37:48.92+00:00 -
莘莘 高 • 0 信誉分
2026-09-08T11:32:35.8366667+00:00 - How to Create and Open an Alternate Data Streams File
There are 2 types of ADS files: one is the isolated ADS file and the other is the associated ADS file.
To create an isolated ADS file, the only way is to use command “echo content > :ads filename“. To open the isolated ADS file, you should use command “notepad :ads filename“. Please note that the content and ADS filename should be replaced accordingly.
In most cases, people will create associated ADS files. To create an associated ADS file, you can use echo command or type command. Please refer to the following guide:
Step 1: Open Command Prompt and run it as administrator. Go to the drive where you want to create the ADS file and use dir command to check what files are there. You can check the file type according to the file extension (dir means directory).
Step 2: Create an ADS file and open it.
- **Echo content > host filename:ads filename.**As the following picture shows, the content “partitionwizard.com” is written into the ADS file “ads2.txt“, which is associated with the host file “file.docx“.
- Type ads file > host file: ads file. There are two files in E drive: txt.txt and file.docx. Now I want to make the “txt.txt” file become an ADS file lodged in the host file “file.docx“. I will use the type command.
Tip: 1. If you want to create an ADS file in a subdirectory, you should first open the drive and then use “cd + directory name” to open the subdirectory. 2. The host file and ADS file can be various types, such as executable files, images, documents, folder, compressed file, etc. Please note that the host file can even be a drive (c:, e:, etc.). 3. To check whether the ADS file is crated successfully, you can use command “dir /r“. 4. The ADS file opening method should be changed according to the ADS file types. For example, if the ADS file is a text file, you can open it with notepad; if the ADS file is an image file, you should open it with mspaint. 5. After opening the ADS file, you can then edit it, change it and save it.
Tip: 1. You can run the executable ADS successfully only if it is a complete program file that can run alone (for example, a setup program). Otherwise, it won’t run, because the loss of important files (various .dll files). 2. When I use the first method, I have found a process named file.docx:setup.tmp. When I use the second method, I have found a process named xxads.tmp. This may be the difference between the two methods.
- How to Detect and Remove ADS Files
To detect ADS files, you can use dir /r command. But this command can only detect the ADS files under the current folder. If you want to detect ADS files under the subfolder, you should open it first (eg. dir ddd) and then use command (eg. dir ddd /r) to display ADS files. Some people may also suggest you use lads.exe tool to detect ADS files.
After finding ADS files, you can delete these NTFS Alternate Data Streams files through the following 3 ways:
- Delete the host file directly.
- Move the host file to a non-NTFS partition like FAT32, FAT, etc.
- Use Streams.exe offered by Microsoft to delete streams.
NTFS vs. FAT32 vs. exFAT – Differences and How to Format to
In this part, I will show you how to wipe Alternate Data Streams using streams.exe. Here is the guide:
- Make sure the Alternate Data Streams files have stopped running.
- Download Streams.exe tool from Microsoft and then unzip it.
- Open the streams folder and move streams app to the root directory of the partition where you want to delete the streams files.
- Run command “streams -d + host file path” This command will delete all ADS files lodged in the host file.After finding ADS files, you can delete these NTFS Alternate Data Streams files through the following 3 ways:
- Delete the host file directly.
- Move the host file to a non-NTFS partition like FAT32, FAT, etc.
- Use Streams.exe offered by Microsoft to delete streams.
- Make sure the Alternate Data Streams files have stopped running.
- Download Streams.exe tool from Microsoft and then unzip it.
- Open the streams folder and move streams app to the root directory of the partition where you want to delete the streams files.
- Run command “streams -d + host file path” This command will delete all ADS files lodged in the host file.
Tip: 1. The dir /r command won’t display isolated ADS files. 2. To delete the isolated ADS file, you need to delete its upper directory. But Streams.exe tool can help you delete the isolated ADA file more easily. In the above picture, I have created an isolated ADS file under E directory. You can see the command *streams -d e:* has deleted the isolated ADS file.
-
-
-
莘莘 高 • 0 信誉分
2026-09-10T07:15:26.0533333+00:00 订阅 Microsoft-Windows-Kernel-File(GUID {edd08927-9cc4-4e65-b970-c2560fb5c289}),keyword 0x1490(FileName | Create | DeletePath),事件 ID 10/12/19/27/30 的 FileName 字段里含 : 即流操作。需 SYSTEM 权限才能挂这个 provider,可用 Velociraptor 的 Windows.ETW.KernelFile、SilkETW 或 Filebeat 的 ETW input 直接收。粒度比 Sysmon 细,但需要自己做进程上下文富化和降噪。
登录以评论