Atexec.py Execution

This detection analytic identifies Impacket’s atexec.py script on a target host. atexec.py is remotely run on an adversary’s machine to execute commands on the victim via scheduled task. The command is commonly executed by a non-interactive cmd.exe with the output redirected to an eight-character TMP file. Part of the RedCanary 2024 Threat Detection Report.

Sigma rule (View on GitHub)

 1title: Atexec.py Execution
 2id: 317bdc3b-f4a6-4664-b810-6dffb18fc7f5
 3status: experimental
 4description: |
 5    This detection analytic identifies Impacket’s atexec.py script on a target host. atexec.py is remotely run 
 6    on an adversary’s machine to execute commands on the victim via scheduled task. The command is commonly 
 7    executed by a non-interactive cmd.exe with the output redirected to an eight-character TMP file. Part of 
 8    the RedCanary 2024 Threat Detection Report.    
 9references:
10    - https://redcanary.com/threat-detection-report/threats/impacket/
11author: RedCanary, Sigma formatting by Micah Babinski
12date: 2024/03/21
13tags:
14    - attack.s0357
15    - attack.execution
16    - attack.t1053
17    - attack.t1053.002
18logsource:
19    category: file_event
20    product: windows
21detection:
22    selection:
23        ParentImage|endswith:
24            - '\svchost.exe'
25            - '\taskeng.exe'
26        CommandLine|contains|all:
27            - 'cmd.exe'
28            - '/c'
29            - 'windows\temp'
30            - ' > '
31            - '2>&1'
32        TargetFilename|contains|all:
33            - 'windows\temp'
34            - '.tmp'
35    condition: selection
36falsepositives:
37    - Unknown
38level: low```

References

Related rules

to-top