Skip to content
WETNav

Collection · Windows

xcopy.exe

Extended Copy

An older recursive file copy tool. Still used to stage and collect files and to copy across shares, so recursive or share-to-share copies are worth noting.

Legitimate use

Used in scripts to copy folder trees.

Worst caseMedium

Switches

/s

Copies folders and subfolders that are not empty.

Low
/e

Copies all subfolders, including empty ones.

Low
/h

Includes hidden and system files.

Low
/i

Treats the destination as a folder.

Info
/y

Overwrites without prompting.

Info
/c

Continues even if errors occur.

Info

Command lines to worry about

  • Medium

    Recursive copy from a share

    xcopy pulls a folder tree from a remote share. Check the source share and where the data lands.

    Detection regexxcopy(\.exe)?\s+.*\\\\[^\s\\]+\\[^\s]+.*\/[seh]

    T1039T1074.001

Where it is recorded

  • Security4688Process creation with the full command line, when command-line auditing is enabled.
  • Sysmon1Process creation with command line, hashes and parent process.
  • Security5145Detailed file share access on the source share.
  • Sysmon11Files created at the destination.

Community detections

5 SigmaHQ rules for xcopy.exe. The explainer checks every pasted command line against all of them.

  • High
    LOL-Binary Copied From System Directory

    Detects a suspicious copy operation that tries to copy a known LOLBIN from system (System32, SysWOW64, WinSxS) directories to another on disk in order to bypass detections based on locations.

    T1036.003by Nasreddine Bencherchali (Nextron Systems)

  • Medium
    Copy From Or To Admin Share Or Sysvol Folder

    Detects a copy command or a copy utility execution to or from an Admin share or remote

    T1039T1048T1021.002by Florian Roth (Nextron Systems), oscd.community, Teymur Kheirkhabarov @HeirhabarovT, Zach Stanford @svch0st, Nasreddine Bencherchali

  • Medium
    HackTool - Jlaive In-Memory Assembly Execution

    Detects the use of Jlaive to execute assemblies in a copied PowerShell

    T1059.003by Jose Luis Sanchez Martinez (@Joseliyo_Jstnk)

  • Medium
    Potential Browser Data Stealing

    Adversaries may acquire credentials from web browsers by reading files specific to the target browser. Web browsers commonly save credentials such as website usernames and passwords so that they do not need to be entered manually in the future. Web browsers typically store the credentials in an encrypted format within a credential store.

    T1555.003by Nasreddine Bencherchali (Nextron Systems)

  • Medium
    Suspicious Copy From or To System Directory

    Detects a suspicious copy operation that tries to copy a program from system (System32, SysWOW64, WinSxS) directories to another on disk. Often used to move LOLBINs such as 'certutil' or 'desktopimgdownldr' to a different location with a different name in order to bypass detections based on locations.

    T1036.003by Florian Roth (Nextron Systems), Markus Neis, Tim Shelton (HAWK.IO), Nasreddine Bencherchali (Nextron Systems)

Rules from SigmaHQ (rules/windows/process_creation), Detection Rule License (DRL) 1.1. Each rule links to its source and credits its authors.