CatalogLOLBAS

LOL · OtherMSBinary

Bcp.exe

1 techniqueWindowsLOLBASGPL-3.0

Download

File DownloadWindows

Export binary payload stored in SQL Server database to file system.

Use Extract malicious executable from database storage to local file system for execution.

bcp "SELECT payload_data FROM database.dbo.payloads WHERE id=1" queryout "C:\Windows\Temp\payload.exe" -S localhost -T -c
Evidence
Upstream reference
Environment
Local host
Context
user
Native
Download
MITRE
T1105
Detection
IOC: Process creation of bcp.exe with queryout or Out parameter
IOC: bcp.exe writing executable files to temp or users directories
IOC: Network connections from bcp.exe to SQL Server followed by file creation
IOC: Event ID 4688 - Process creation for bcp.exe
IOC: Event ID 4663 - File system access by bcp.exe