TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

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

139 pointsby tchapabout 12 years ago

18 comments

dazzawazzaabout 12 years ago
From the FreeBSD man for date<p><pre><code> 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. </code></pre> EDIT: so you need to be root anyway or have root access to change the date.
评论 #5304562 未加载
评论 #5306028 未加载
RossMabout 12 years ago
CVE-2013-1775 [0] in case you're wondering.<p>[0]: <a href="http://www.openwall.com/lists/oss-security/2013/02/27/22" rel="nofollow">http://www.openwall.com/lists/oss-security/2013/02/27/22</a><p><a href="http://www.ubuntu.com/usn/usn-1754-1/" rel="nofollow">http://www.ubuntu.com/usn/usn-1754-1/</a> <a href="http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2013-1775" rel="nofollow">http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2013-1775</a>
评论 #5304448 未加载
jrockwayabout 12 years ago
TL;DR: users in /etc/sudoers can run code as root with sudo.
评论 #5304699 未加载
评论 #5304586 未加载
trotskyabout 12 years ago
I see your wonky authentication bypass and raise you a local privilege escalation that is 100% reliable on every distro that's shipped a 3.3-3.8 kernel (last 18 months or so)<p><a href="http://thread.gmane.org/gmane.linux.network/260061" rel="nofollow">http://thread.gmane.org/gmane.linux.network/260061</a><p>bad times :/
评论 #5306383 未加载
评论 #5305044 未加载
mnarayan01about 12 years ago
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?
评论 #5304674 未加载
评论 #5304512 未加载
mpyneabout 12 years ago
Interesting! Does sudo somehow get confused about checking for a password at all when the current date is the UNIX epoch?<p>I wonder, does this require the user to be listed in sudoers with any privileges or is it just straight to root?
评论 #5304456 未加载
评论 #5304446 未加载
subwayabout 12 years ago
I wonder if it would be possible to walk back the date using an ntp mitm attack.
评论 #5304991 未加载
评论 #5306317 未加载
评论 #5306097 未加载
评论 #5306565 未加载
grimtriggerabout 12 years ago
Can someone explain this a little more?
评论 #5304426 未加载
评论 #5304440 未加载
评论 #5304437 未加载
评论 #5304434 未加载
Nuxabout 12 years ago
"Set your clock to 01.01.1970" BOOM, you can't! "date: cannot set date: Operation not permitted"
moeabout 12 years ago
It may be worth noting that local privilege escalation vulnerabilities have always been dime a dozen, this is just a more egregious one.<p>In your planning always keep in mind that anyone with shell-access to your server can become root in one way or another, if he really wants to. There is little "defense in depth" after that point.
thoughtsimpleabout 12 years ago
After using sudo from the command line, just remember to run sudo -K (note the capital-K) and you should be protected. The -K removes the timestamp which makes it impossible to reset it to 1/1/70 with -k.
huklabout 12 years ago
It works if you set your time through system preferences in OSX, Gnome and KDE on some distros. Changing it on those desktop guis does not require admin password. Also see:<p><a href="http://www.sudo.ws/sudo/alerts/epoch_ticket.html" rel="nofollow">http://www.sudo.ws/sudo/alerts/epoch_ticket.html</a>
评论 #5305994 未加载
rplacdabout 12 years ago
I'm surprised an issue that high-level's been able to lurk around for so long.
ohaziabout 12 years ago
Debian unstable got a fix for this last night:<p><a href="http://packages.debian.org/changelogs/pool/main/s/sudo/sudo_1.8.5p2-1+nmu1/changelog" rel="nofollow">http://packages.debian.org/changelogs/pool/main/s/sudo/sudo_...</a>
teknolustabout 12 years ago
Tried it on Debian Mint and it doesn't work. I can't set my clock without sudo.
StavrosKabout 12 years ago
It doesn't work on Ubuntu, the clock gets reset back to 2010, for some reason.
评论 #5304981 未加载
lurker14about 12 years ago
Why does "sudo -k" still exist, when it has obvious risks and is superseded by "sudo -K".<p>Why does 'sudo -k' not check to see if a timestamp exists, and avoid creating one if it doesn't yet exist?
p4bl0about 12 years ago
Previous discussion, with a better link than to a tweet: <a href="https://news.ycombinator.com/item?id=5299326" rel="nofollow">https://news.ycombinator.com/item?id=5299326</a>
评论 #5304685 未加载