CTF Arsenal
Boot2Root / Command Mistakes & Recovery

sudo -l prompts for a password unexpectedly

1. Error or symptom

sudo -l asks for a password even though you expected NOPASSWD.

2. Likely cause

NOPASSWD only applies to specific commands/users in sudoers, not globally; you may be the wrong user.

3. How to verify

whoami; cat /etc/sudoers 2>/dev/null or /etc/sudoers.d/* if readable.

4. Correct command

sudo -l   # re-check as the exact intended user, with any password you've since obtained

5. Recovery procedure

Supply a cracked/found password if available; otherwise move to SUID/cron/capabilities checks.

6. How to avoid repeating it

Don't assume a sudo prompt is a dead end — confirm scope by reading sudoers if possible.