3 ms·
Literally how else is a remote login daemon supposed to work though?
by direwolf20 8mo ago
Literally how else is a remote login daemon supposed to work though?
- dragonfax 8mo ago1. Start with root to bind the port below 1024. 2. give up root because you don't need it any further. 3. Only accept non-root logins 4. when a user creates a session, if they need root within the session they can obtain it via sudo or su.
- deleted 8mo ago[deleted]
- deleted 8mo ago[deleted]
- acdha 8mo agoThat still needs a way to change users, and OpenSSH already has privilege separation. That hardens the process somewhat to reduce the amount of code running in the process which can change the uid for a session but fundamentally something needs permission to call setuid() or the equivalent.
- accrual 8mo agoYes, but changing users is a function of the shell (or maybe more specifically /usr/bin/login), not the SSH daemon.
- acdha 8mo agoYea, but then we’ve recreated this CVE which is caused by calling login(1) unsafely. The point was that the person I was replying to misunderstood the problem and largely seemed to be conflating telnetd with OpenSSH.
- Aloha 8mo agoI'm not sure that you need root because of the port - I think login itself needs to run as root, otherwise it cant login to anything other than the account its running under.
- wiml 8mo agoYou still need to have privileges to become the userid of the user logging in. Openssh does do privsep, but you still need a privileged daemon.
- klempner 8mo agoCongratulations, you've created a server that lets people have shells running as the user running telnetd. You presumably want them to run as any (non root) user. The capability you need for that, to impersonate arbitrary (non-root) users on the system, is pretty damn close to being root.
- samlinnfer 8mo agoWell obviously each user just needs to run their own telnet daemon, on their own port of course.
- deleted 8mo ago[deleted]
- charcircuit 8mo agoThe remote daemon has its own account and is given a privilege that allows it to connect a network socket to a pseudo terminal.
- esseph 8mo agoAny breach of the daemon will still give access to a system that can approve/deny user logins. Breaching the daemon therefore allows permission escalation, because you can simply jump to an account. Chain with any local vuln of your choice to completely own the box. It doesn't matter what user it is running as. If this was so easy to deal with, someone would have done it. Instead, we get endless HN comments about people that act like they can do better but never submit a PR.
- charcircuit 8mo agoBreaching the daemon only allows for the attacker to get access to the login. User accounts should still be secured requiring authentication. >If this was so easy to deal with, someone would have done it. Sadly this is not the case. There is a lot of inertia towards solutions like ssh or sudo. It may be easy to delete them, but actually getting such a changed accepted is no trivial task.
- esseph 8mo ago> Breaching the daemon only allows for the attacker to get access to the login Yes, but potentially any login. See the problem? If you compromise the gatekeeper, you are now the keymaster. Or whatever :)
- charcircuit 8mo agoI'll admit it is still problematic. But at least there is only 1 gatekeeper instead of 2.
- jmb99 8mo ago