Uncommon Windows Processes Writing .txt/.xml in AppData\Roaming\Microsoft
Flags creation of .txt/.xml files in AppData\Roaming\Microsoft by schtasks.exe, wscript.exe, or mshta.exe.
- Product
- windows
- Category
- file_event
- Author
- Nasreddine Bencherchali (Nextron Systems) (SigmaHQ), DRL 1.1
- Published
- 2023-05-15
- Updated
- 2026-07-31
What it detects
This rule flags file creation where the target path is within \AppData\Roaming\Microsoft\ and the created filename ends with .txt or .xml. It specifically matches creations initiated by schtasks.exe, wscript.exe, or mshta.exe, which are often used to execute or stage content from user-writable locations. The detection relies on Windows file event telemetry capturing the creating process path and the target filename/path. Such activity can indicate stealthy staging of additional payloads or configuration data in a commonly abused directory.
Reporting behind it
Changelog
v5- v5Candidate ingested via manual entry.2026-07-31
- v4Candidate ingested via manual entry.2026-07-31
- v3Candidate ingested via manual entry.2026-07-31
- v2Candidate ingested via manual entry.2026-07-31
- v1No changelog recorded for this version.2026-07-30
Detection content is published as a reviewed draft. Tune thresholds and exclusions against your own telemetry before enabling this rule for alerting.
title: Uncommon Windows Processes Writing .txt/.xml in AppData\Roaming\Microsoft
id: 1875e1ae-c163-430d-ba3f-41a52fa48648
status: test
description: This rule flags file creation where the target path is within \AppData\Roaming\Microsoft\ and the created filename ends with .txt or .xml. It specifically matches creations initiated by schtasks.exe, wscript.exe, or mshta.exe, which are often used to execute or stage content from user-writable locations. The detection relies on Windows file event telemetry capturing the creating process path and the target filename/path. Such activity can indicate stealthy staging of additional payloads or configuration data in a commonly abused directory.
references:
- https://www.ncsc.gov.uk/static-assets/documents/malware-analysis-reports/devil-bait/NCSC-MAR-Devil-Bait.pdf
- https://github.com/SigmaHQ/sigma/blob/master/rules-emerging-threats/2021/Malware/Devil-Bait/file_event_win_malware_devil_bait_script_drop.yml
author: Nasreddine Bencherchali (Nextron Systems), Huntrule Team
date: 2023-05-15
tags:
- detection.emerging-threats
- attack.stealth
logsource:
product: windows
category: file_event
detection:
selection:
Image|endswith:
- \schtasks.exe
- \wscript.exe
- \mshta.exe
TargetFilename|contains: \AppData\Roaming\Microsoft\
TargetFilename|endswith:
- .txt
- .xml
condition: selection
falsepositives:
- Unlikely
level: high
license: DRL-1.1
related:
- id: 93d5f1b4-36df-45ed-8680-f66f242b8415
type: derived