Identifier / Programs / Windows
bcp.exe
BCP - SQL bulk copy tool file version info (xCyclopedia)
LOLBAS Download 1 Sigma rule name it 2 ATT&CK techniques 1 documented command 1 known copy with hashes
How bcp.exe is abused
Each abuse is LOLBAS's category and the options and words it uses; the full write-up is on LOLBAS's page for bcp.exe.
1 documented command
Download T1105 Ingress Tool Transfer User privileges
Export binary payload stored in SQL Server database to file system.
bcp "SELECT payload_data FROM database.dbo.payloads WHERE id=1" queryout "C:\Windows\Temp\payload.exe" -S localhost -T -cIdentifyTrips 1 Sigma rule: mediumData Export From MSSQL Table Via BCP.EXE by Omar Khaled (@beacon_exe), MahirAli Khan (in/mahiralikhan), Nasreddine Bencherchali (Nextron Systems)
The command the identifier reads trips a Sigma process-creation rule. These commands and their descriptions are from LOLBAS’s entry for bcp.exe, by Mahir Ali Khan, at commit 2056cb766250 of 2026-09-26, under the GPL-3.0 and LOLBAS’s notice, with no warranty. Changed: Markdown is shown formatted. The source is in lolbas-gtfobins-commands.json.gz, and the full entry is on LOLBAS’s page for bcp.exe. The identifier reads it with LOLBAS’s placeholders filled in: a URL as https://example.com/file, a share as \\192.0.2.10\share\file, a path as C:\Data\file and a command as calc.exe.
What detects it
Is it the real bcp.exe?
C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\1 known copy
2019.0150.2000.05 ((SQLServer).190924-2033) · C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\bcp.exe · signed by Microsoft Corporation
06df5c21a32b41279361f1e8e2809894dec403b3168e11959efeed734605afddFrom the file’s version info and the copies recorded by xCyclopedia (MIT). A copy in another folder, signed by someone else or with another hash is not necessarily malicious, but it is worth a closer look. In Ceplin, "<sha256>".whatis() says which known copy a hash is.