Shell history credential hunting
Warning
Run these techniques only on systems you are explicitly authorized to test. SSH keys and agent material are high-impact credentials. Do not alter key files or agent state, avoid copying keys unless explicitly approved, and handle any exports per the engagement’s storage and deletion requirements.
Histories give you exact commands, internal hostnames, and one-off credentials that never made it into configs.
Common history files
Also check service client histories:
Interpretation:
Look for
ssh,scp,rsync,curl,wget, database clients, andsudousage.Commands often include full internal DNS names and ports. Capture those for later phases.
Grep histories for secrets and endpoints
What to do with results:
If you get a full connection string, test it directly against the local service first if applicable.
If it’s remote, keep the tuple and validate when you switch into lateral movement.
Other user artifacts that routinely contain creds
Check Docker client auth if present:
Interpretation:
.netrcand.git-credentialscan give you reusable HTTP credentials or tokens.Docker auth can map to private registries and service accounts.
References
-
History file behavior
-
History storage format
Was this helpful?
Your feedback helps improve this page.