Credential Access · Term

What are unsecured credentials?

Some of the easiest credentials to steal are simply lying in plain sight, in config files, scripts, environment variables, and command history. Here is where attackers look and why it works so often.

Credential Access · TermAll services
TL;DR

Unsecured credentials are passwords, API keys, and tokens stored in plain, readable places rather than a secure vault: config files, scripts, environment variables, command history, CI/CD variables, cloud metadata, and infrastructure-as-code. After landing on a host, attackers simply search the filesystem for them, no dumping or cracking required. It is one of the most common and reliable ways to escalate or move laterally, which is why secrets management and scanning matter so much. It maps to MITRE T1552.

By John Dill, Red Team Lead, SecureLayer7Updated

What unsecured credentials are

Not every credential is locked in a hive or vault. Many sit in plaintext wherever a developer or admin found it convenient: a database password in a web app config file, an API key in a script or environment variable, a token in ~/.bash_history, secrets in CI/CD variables or IaC files, or cloud keys reachable from the instance metadata endpoint.

Unsecured credentials are exactly these, and finding them is just searching, not attacking cryptography.

Where attackers look and payload

On any foothold, the attacker greps for secrets:

  • Config and code: grep -rinE "password|secret|api[_-]?key|token" /var/www /opt /home
  • History and env: cat ~/.bash_history, env, cat ~/.aws/credentials, ~/.ssh/
  • Cloud metadata (from a server): query the instance metadata endpoint for temporary cloud keys.
  • CI/CD and IaC: pipeline variables, .env, Terraform state, Kubernetes manifests.

Whatever turns up is used directly, no cracking. Documented for defensive context.

How to defend

  • Use a secrets manager / vault and inject secrets at runtime, never hardcode them in code, configs, or images.
  • Scan repositories, images, and pipelines for secrets in CI and pre-commit.
  • Use short-lived, scoped credentials (cloud roles, workload identity) so any leaked secret expires fast.
  • Protect cloud metadata (enforce IMDSv2, restrict access) so server-side requests cannot harvest keys.
  • Rotate exposed secrets immediately and audit history/env for leftovers.

References

  1. [1]MITRE ATT&CK: Unsecured Credentials (T1552)(MITRE)
  2. [2]MITRE ATT&CK: Credential Access (TA0006)(MITRE)
  3. [3]NIST SP 800-63B Digital Identity Guidelines(NIST)
Related terms

Common questions

Credential access, asked often

Want your environment tested for exposed credentials?

Scope an engagement

Find the exposed credentials before an attacker does.

Our internal and network penetration tests hunt the credentials an intruder would, in memory, registry hives, config files, and on the wire, then show your team exactly where each one was exposed and how to close it. Free re-test included.

See all services30-min scoping call, fixed-price proposal in 48 hours.