Live data from Hacker News

Run sudo -k, set your clock to 01.01.1970, run sudo su and boom you're root

twitter.com

11–20 of 74 posts

Re: Run sudo -k, set your clock to 01.01.1970, run sudo su and boom you're root

#11
post #4

Interesting! Does sudo somehow get confused about checking for a password at all when the current date is the UNIX epoch? I wonder, does this require the user to be listed in sudoers with any privileges or is it just straight to root?

This gives you only the privileges that a successful "sudo" would give you, and requires a previous successful "sudo". It's a nice hack, but hardly the end of the world.

Re: Run sudo -k, set your clock to 01.01.1970, run sudo su and boom you're root

#12
From the vulnerability announcement, it seems like this only allows a user to "set" NOPASSWD for that user's sudo regardless of what's in sudoers. It also doesn't seem to allow escalation beyond what's in sudoers. Am I missing something?

Re: Run sudo -k, set your clock to 01.01.1970, run sudo su and boom you're root

#13

From the vulnerability announcement, it seems like this only allows a user to "set" NOPASSWD for that user's sudo regardless of what's in sudoers. It also doesn't seem to allow escalation beyond what's in sudoers. Am I missing something?

It sounds like you're overlooking the fact that software could do this without your knowledge.

Re: Run sudo -k, set your clock to 01.01.1970, run sudo su and boom you're root

#14
From the FreeBSD man for date

  Only the superuser may set the date, and if the system securelevel (see
  securelevel(7)) is greater than 1, the time may not be changed by more
  than 1 second.

EDIT: so you need to be root anyway or have root access to change the date.

Re: Run sudo -k, set your clock to 01.01.1970, run sudo su and boom you're root

#16

From the FreeBSD man for date Only the superuser may set the date, and if the system securelevel (see securelevel(7)) is greater than 1, the time may not be changed by more than 1 second. EDIT: so you need to be root anyway or have root access to change the date.

Users on MacOS can change the time without root access.

Re: Run sudo -k, set your clock to 01.01.1970, run sudo su and boom you're root

#20

From the vulnerability announcement, it seems like this only allows a user to "set" NOPASSWD for that user's sudo regardless of what's in sudoers. It also doesn't seem to allow escalation beyond what's in sudoers. Am I missing something?

It looks like you can run `sudo -k` without authenticating via password, so I guess you could use this to bypass the password requirement even if the user had not previously entered their password (provided that the account is capable of changing the system time).

It's certainly worth mentioning (and patching), but I wouldn't describe it as "and boom you're root".

Post reply on HN