Searching for Passwords in Files
Search for files containing the phrase "password"
findstr /SIM /C:"password" *.txt *ini *.cfg *.config *.xml
Search for passwords in Chrome dictionary files
gc 'C:\Users\htb-student\AppData\Local\Google\Chrome\User Data\Default\Custom Dictionary.txt' | Select-String password
Confirm PowerShell history save path
(Get-PSReadLineOption).HistorySavePath
Read PowerShell history file
gc (Get-PSReadLineOption).HistorySavePath
Decrypt stored PowerShell credentials
$credential = Import-Clixml -Path 'C:\scripts\pass.xml'
Search file contents for "password"
cd c:\Users\htb-student\Documents & findstr /SI /M "password" *.xml *.ini *.txt
Search file contents for "password" recursively
findstr /si password *.xml *.ini *.txt *.config
Search for specific strings in all files
findstr /spin "password" *.*
Search file contents with PowerShell
select-string -Path C:\Users\htb-student\Documents\*.txt -Pattern password
Search for files with specific extensions
dir /S /B *pass*.txt == *pass*.xml == *pass*.ini == *cred* == *vnc* == *.config*
Search for configuration files recursively
where /R C:\ *.config
Search for credential-related files using PowerShell
Get-ChildItem C:\ -Recurse -Include *.rdp, *.config, *.vnc, *.cred -ErrorAction Ignore
Last updated