{"id":"f53714ec-5077-420e-ad20-907ff9bb2958","title":"Forfiles.EXE Child Process Masquerading","description":"Detects the execution of \"forfiles\" from a non-default location, in order to potentially spawn a custom \"cmd.exe\" from the current working directory.\n","author":"Nasreddine Bencherchali (Nextron Systems), Anish Bogati","status":"test","level":"high","date":"2024-01-05","modified":"","tags":["attack.stealth","attack.t1036"],"technique_ids":["T1036"],"logsource":{"category":"process_creation","product":"windows"},"falsepositives":["Unknown"],"references":["https://www.hexacorn.com/blog/2023/12/31/1-little-known-secret-of-forfiles-exe/"],"source_path":"rules/windows/process_creation/proc_creation_win_forfiles_child_process_masquerading.yml","source_sha256":"ed5bdeed968237e53e1a7dbed423c3bcc5e6186d77a0147f2b4db8c5c48f222c","source_url":"https://github.com/anpa1200/sigma/blob/b249e9683190cffdcaf188ccbfb90bf4759844e1/rules/windows/process_creation/proc_creation_win_forfiles_child_process_masquerading.yml","license":"Detection Rule License 1.1","license_url":"https://github.com/SigmaHQ/Detection-Rule-License/blob/main/LICENSE.Detection.Rules.md","yaml":"title: Forfiles.EXE Child Process Masquerading\nid: f53714ec-5077-420e-ad20-907ff9bb2958\nstatus: test\ndescription: |\n    Detects the execution of \"forfiles\" from a non-default location, in order to potentially spawn a custom \"cmd.exe\" from the current working directory.\nreferences:\n    - https://www.hexacorn.com/blog/2023/12/31/1-little-known-secret-of-forfiles-exe/\nauthor: Nasreddine Bencherchali (Nextron Systems), Anish Bogati\ndate: 2024-01-05\ntags:\n    - attack.stealth\n    - attack.t1036\nlogsource:\n    category: process_creation\n    product: windows\ndetection:\n    selection:\n        # Notes:\n        #   - The parent must not have CLI options\n        #   - The Child Image must be named \"cmd\" as its hardcoded in the \"forfiles\" binary\n        #   - The Child CLI will always contains \"/c echo\" as its hardcoded in the original \"forfiles\" binary\n        ParentCommandLine|endswith:\n            - '.exe'\n            - '.exe\"'\n        Image|endswith: '\\cmd.exe'\n        CommandLine|startswith: '/c echo \"'\n    filter_main_parent_not_sys:\n        ParentImage|contains:\n            - ':\\Windows\\System32\\'\n            - ':\\Windows\\SysWOW64\\'\n        ParentImage|endswith: '\\forfiles.exe'\n        Image|contains:\n            - ':\\Windows\\System32\\'\n            - ':\\Windows\\SysWOW64\\'\n        Image|endswith: '\\cmd.exe'\n    condition: selection and not 1 of filter_main_*\nfalsepositives:\n    - Unknown\nlevel: high\n","validation":"yaml_parsed_not_backend_compiled_or_live_validated","techniques":[{"key":"enterprise/T1036","id":"T1036","name":"Masquerading","page":"techniques/enterprise/T1036/"}],"data_path":"data/detection-rules/f53714ec-5077-420e-ad20-907ff9bb2958.json","kind":"sigma"}
