Live data from Hacker News

Abusing Ubuntu 24.04 features for root privilege escalation

snyk.io

21–30 of 83 posts

Re: Abusing Ubuntu 24.04 features for root privilege escalation

#21

24.04 also ships with a footgun that keeps PasswordAuthentication enabled even if you edit /etc/ssh/sshd_config. It adds a /etc/ssh/sshd_config.d/50-cloud-init.conf that force overrides any PasswordAuthentication settings you have configured in /etc/ssh/sshd_config. See here: https://news.ycombinator.com/item?id=42133181

Now I definitely feel glad that I decided on moving back to Debian for servers.

Re: Abusing Ubuntu 24.04 features for root privilege escalation

#22

24.04 also ships with a footgun that keeps PasswordAuthentication enabled even if you edit /etc/ssh/sshd_config. It adds a /etc/ssh/sshd_config.d/50-cloud-init.conf that force overrides any PasswordAuthentication settings you have configured in /etc/ssh/sshd_config. See here: https://news.ycombinator.com/item?id=42133181

Now I definitely feel glad that I decided on moving back to Debian for servers.

Pretty sure this exists on Debian too

Re: Abusing Ubuntu 24.04 features for root privilege escalation

#23

Earlier quoted context omitted.

Now I definitely feel glad that I decided on moving back to Debian for servers.

Pretty sure this exists on Debian too

Nope, not on my system: https://i.imgur.com/1qCLXXZ.png

Re: Abusing Ubuntu 24.04 features for root privilege escalation

#24

24.04 also ships with a footgun that keeps PasswordAuthentication enabled even if you edit /etc/ssh/sshd_config. It adds a /etc/ssh/sshd_config.d/50-cloud-init.conf that force overrides any PasswordAuthentication settings you have configured in /etc/ssh/sshd_config. See here: https://news.ycombinator.com/item?id=42133181

Now I definitely feel glad that I decided on moving back to Debian for servers.

Does anyone know how to turn off auto updates on Ubuntu 22?

I thought I fixed it, but apparently not. It is driving me crazy.

Re: Abusing Ubuntu 24.04 features for root privilege escalation

#25
post #9

Earlier quoted context omitted.

> They can execute anything they like as root... by entering their password. If it has control of your user account, then it can just arrange to wrap your shell prompt and wait for you to sudo something else. The sudo password prompt in its default arrangement doesn't really provide much security there and isn't expected to.

On a server, you may be waiting months for that human to login and use sudo. Maybe even years.

On a properly configured server you'll be waiting forever, because the users actually running the applications on that server aren't the same users who have privileges to make changes to the system or have access to stuff like sudo. So if you take over the nginx/postgres/whatever user, you're not really going to get anywhere.

On the other hand you probably don't need to. Those users already expose all the juicy data on the server. You don't gain much from obtaining root anyways, except better persistence.

This attack might be more interesting when chained with some other exploit that gains access to a users system via their e-mail client or browser. In other words nice if you're NSO Group making exploits for targeting individuals, but not that useful if you're trying to make a botnet.

Re: Abusing Ubuntu 24.04 features for root privilege escalation

#26
The only feedback I get when installing d-spy is "Uses System Services", and "Uses Session Services", which means nothing to me as a user, and yet it allows program to enumerate all programs I use and as it turns out even hack my computer. Other platforms solved this with something like "developer mode", iOS, Android, Meta, etc. I shouldn't be able to install this app without confirming developer-mode-only permissions. As for this particular app it is offline, yes, but dbus allows for cross-app communication, so no more

Re: Abusing Ubuntu 24.04 features for root privilege escalation

#27

Earlier quoted context omitted.

Now I definitely feel glad that I decided on moving back to Debian for servers.

Pretty sure this exists on Debian too

I believe I've seen cloud vendors configure out that way, but I don't think it's an actual Debian default.

Re: Abusing Ubuntu 24.04 features for root privilege escalation

#28
post #18

Linux Local Privilege Escalation, but the attacker has to be in sudo group in the first place. Great read, but this feels like academic research. Technically correct, but impractical at best.

If that is your attitude, why bother with the sudo group at all? Just run as root. (For what it's worth, I think most people would not lose much security from running as root, and the obsession with sudo is so much security theater, for exactly this sort of reason.)

Honestly, sudo’s value is really sanity, not security.

The first time you use certain flavors of sudo, you get a nice little message which reminds you why sudo exists:

  We trust you have received the usual lecture from the local System
  Administrator. It usually boils down to these three things:
  
      #1) Respect the privacy of others.
      #2) Think before you type.
      #3) With great power comes great responsibility.

Realistically, sudo exists to remind a user of these points. That is: by needing to type “sudo” before a command, you’re being reminded to pay closer attention that you’re not violating another user’s privacy or doing something that’s going to break your system.

Re: Abusing Ubuntu 24.04 features for root privilege escalation

#29
post #5

Earlier quoted context omitted.

To expand on this: if the user is in the sudo group, they have explicit permission to execute anything they like as root. If someone wants a user to not be able to do this, they don't put that user in the sudo group. As far as I can tell from the write-up, if you remove a user from the sudo group because you don't want them to have that privilege then this "exploit" won't work. The bugs found look correct and have se…

They can execute anything they like as root... by entering their password. This post shows a way that clever code can execute anything it likes as root without knowing the user's password. That seems pretty significant to me.

Somewhat tangentially, I will say that Touch ID-based sudo is a real upgrade over password sudo. It still gives you that extra moment to reflect on whether you really want to run that command (unlike passwordless sudo), without being burdensome.

Re: Abusing Ubuntu 24.04 features for root privilege escalation

#30
post #18

Linux Local Privilege Escalation, but the attacker has to be in sudo group in the first place. Great read, but this feels like academic research. Technically correct, but impractical at best.

If that is your attitude, why bother with the sudo group at all? Just run as root. (For what it's worth, I think most people would not lose much security from running as root, and the obsession with sudo is so much security theater, for exactly this sort of reason.)

User accounts and sudo does auditing of who is doing what. They’re are other ways, sure, but checking auth.log is the simplest.

And while lpadmin users can escalate, I’m more interested in escalations from services like web servers or whatever, running as low priv users. I use sudo to allow scripts running as my web server to run specific limited privileged programs as a simple layer of defence.

Post reply on HN