← Learn
Dangerous
echo 'ALL ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers

linux · bash · Advanced

Appends a rule giving every account passwordless root. The redirection is the whole attack: there is no obviously dangerous command name, just an echo, and appending to sudoers bypasses the visudo syntax check that would normally catch a mistake.

Signals to notice

  • Grants NOPASSWD root to all users
  • Appends directly to /etc/sudoers without visudo
  • A malformed line here can lock out sudo entirely

Think you can spot these under time pressure?

Start Training

More Privilege Escalation