Where do I find information about how on a certain distro (Let's begin with Debian, Fedora, Ubuntu) what system users should exist and what is more likely to be some unwanted guest?
There's no easy answer to that, especially a cross-distribution answer. Compare with a minimal installation of the same version distribution with the same packages. Review the differences.
Note that if you upgraded from an earlier version, there may be extra system users and groups that are no longer used, but still present because the upgrader can't be sure that they're no longer used.
i saw that the system added a user with name "Debian" to a lot of groups
A legitimate user who's in a lot of groups would typically be a human account with privileges. This could be the initial user created during the installation or a user added later.
Debian does not create a user called Debian
, and I imagine other distributions wouldn't either. Debian does create users and groups called Debian-something
to run system services, but these would not be in “a lot of groups” (I'm not sure if there are any that are in anything but their default group).
I checked, that it has no passwd set in /etc/shadow, so i think it's benign.
Having no password in /etc/shadow
doesn't make an account unusable. Most commonly, the account could have an SSH public key. Check .ssh/authorized_keys
and .ssh/authorized_keys2
in the user's home directory as well as any other AuthorizedKeys…
directive in /etc/sshd_config
(or /etc/ssh/sshd_config
or wherever your distribution puts it).
adm: group
Depending on the distribution and on local sysadmin preferences, this could be a group that's given root access via sudo. Check /etc/sudoers
and /etc/sudoers.d/*
.
If you're looking for a badly hidden backdoor (having something suspicious in /etc/group
definitely counts as badly hidden), you need to check other things, like an alternative service listening to network logins, a setuid program somewhere, etc. Even if you don't find anything, keep in mind that the badly hidden part could be planted there by a competent attacker to give you a false sense of security when you find and fix it. If you're unsure whether your system has been breached, you need to nuke it from orbit.
But before you do that, check with your fellow admins to see if this is just a badly named manually created account.
/etc/shadow
for that user can give you an indication as to when the user was created (date -d "@$((thatnumber * 86400)" +%F
). Then, you can try and find what else happened on that day to see if that gives you any clue. – Stéphane Chazelas Dec 16 '21 at 19:55