From owner-freebsd-security@freebsd.org Sun Feb 28 00:16:19 2021 Return-Path: Delivered-To: freebsd-security@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 62FF7559724 for ; Sun, 28 Feb 2021 00:16:19 +0000 (UTC) (envelope-from jhellenthal@dataix.net) Received: from mail-qt1-x82a.google.com (mail-qt1-x82a.google.com [IPv6:2607:f8b0:4864:20::82a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Dp3pV40JWz4ZjX for ; Sun, 28 Feb 2021 00:16:18 +0000 (UTC) (envelope-from jhellenthal@dataix.net) Received: by mail-qt1-x82a.google.com with SMTP id o1so5050449qta.13 for ; Sat, 27 Feb 2021 16:16:18 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:content-transfer-encoding:from:mime-version :subject:date:message-id:references:cc:in-reply-to:to; bh=ETtaV3soDBY/KxTdmY370ymRKZrBvoNyUZUkYaZSPSQ=; b=GsDrsgRs1N8zlGD76jB2t3LCL3PtY7nNeTNqAGf/3N6pQTk00fKWrG23UUAgSmTUsH uVg5v1vdO8bi0MAyPsPU1YIImElxlr7hlkROO95OF1ERMeaob2/ydToVDzJI9e4GMjU1 yT5CV4n8XvkyqQcs9RP3AYJrcRj0/nNz4Yiuz9uf0dIX6songUvxDv7oAdU6d2bzRkzN jenzK3wSwu3bsjqREb/xhNJ39w0z8FMduoK2Pmd7r6CaJENdLcZGA92u328NLKLVwwTl 9OWOBJ5PY70JRF29t4UoIl4VllvFZ27w43Mci30E/00Daj6Mp9d4PEAmgNZhtrc1+Dou O1nQ== X-Gm-Message-State: AOAM531BcviBQB4csc0XED/gZpIiwmlkZGV+aKmx2fAKU6YYeYdE2ZmN 4x1VkSs5VHIFnaQ5WMOkXcHMHgjn7Ju/Jg== X-Google-Smtp-Source: ABdhPJwYYnc462xrc1X8mIJ2NTWlKuH24Dzj6vlMBHOxz73e3ksxCsRirFaAYCTkxe3oDhMJuFOsFg== X-Received: by 2002:a05:622a:3ca:: with SMTP id k10mr8286439qtx.270.1614471377602; Sat, 27 Feb 2021 16:16:17 -0800 (PST) Received: from ?IPv6:2607:fb90:c62:aac3:4d08:4ec3:ae16:94ae? ([2607:fb90:c62:aac3:4d08:4ec3:ae16:94ae]) by smtp.gmail.com with ESMTPSA id i6sm225468qkk.31.2021.02.27.16.16.12 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 27 Feb 2021 16:16:17 -0800 (PST) From: "J. Hellenthal" Mime-Version: 1.0 (1.0) Subject: Re: user account disappeared Date: Sat, 27 Feb 2021 18:16:11 -0600 Message-Id: References: Cc: FreeBSD-security@freebsd.org In-Reply-To: To: Gareth de Vaux X-Mailer: iPhone Mail (18D52) X-Rspamd-Queue-Id: 4Dp3pV40JWz4ZjX X-Spamd-Bar: -- X-Spamd-Result: default: False [-2.50 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; MV_CASE(0.50)[]; URI_COUNT_ODD(1.00)[5]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[dataix.net:+]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[dataix.net,reject]; NEURAL_HAM_SHORT(-1.00)[-1.000]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; RBL_DBL_DONT_QUERY_IPS(0.00)[2607:f8b0:4864:20::82a:from]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; MID_RHS_MATCH_FROM(0.00)[]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[dataix.net:s=net]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-security@freebsd.org]; SPAMHAUS_ZRD(0.00)[2607:f8b0:4864:20::82a:from:127.0.2.255]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::82a:from]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[FreeBSD-security] Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: freebsd-security@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Security issues \[members-only posting\]" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Feb 2021 00:16:19 -0000 https://www.unix.com/man-page/FreeBSD/8/pwd_mkdb/ --=20 J. Hellenthal The fact that there's a highway to Hell but only a stairway to Heaven says a= lot about anticipated traffic volume. > On Feb 27, 2021, at 18:12, J. Hellenthal wrote: >=20 > =EF=BB=BFLooks like your master passwd db is out of sync. >=20 > Command is mkpwdb or something similar then run init q >=20 > Personally it would seem someone got ahold of master.passwd and doesn=E2=80= =99t know how it works or a port upgrade failed to complete properly updatin= g the db >=20 > --=20 > J. Hellenthal >=20 > The fact that there's a highway to Hell but only a stairway to Heaven says= a lot about anticipated traffic volume. >=20 >> On Feb 27, 2021, at 15:23, Gareth de Vaux wrote: >>=20 >> =EF=BB=BFHi all, one of my users in a jail has mysteriously half disappea= red. I've renamed the user to 'lostuser', the password hash, and the process= it's running to protect privacy below: >>=20 >> I suddenly can't log in over ssh: >>=20 >> sshd[22485]: Invalid user lostuser from XYZ >>=20 >> # su - lostuser >> su: unknown login: lostuser >>=20 >> # ls -ld /home/lostuser >> drwx------ 8 1012 users 18 Jan 23 11:19 /home/lostuser >>=20 >> $HOME still exists but only showing the userid. >>=20 >> # egrep "1012|lostuser" /etc/passwd >> lostuser:*:1012:1000:User &:/home/lostuser:/usr/local/bin/bash >>=20 >> # egrep "1012|lostuser" /etc/master.passwd=20 >> lostuser:$6$9xxxxx/:1012:1000::0:0:User &:/home/lostuser:/usr/local/bin/b= ash >>=20 >> Entries are still in /etc/*passwd ? >>=20 >> # ls -l /etc/*passwd /etc/group >> -rw-r--r-- 1 root wheel 605 Nov 6 16:52 /etc/group >> -rw------- 1 root wheel 4092 Jan 23 12:22 /etc/master.passwd >> -rw-r--r-- 1 root wheel 2621 Jan 23 12:22 /etc/passwd >>=20 >> This process is still running, which is a network server which is still f= unctioning: >>=20 >> # ps aux | grep lostuser >> 1012 56261 0.0 0.1 44952 21288 7 S+J 3Dec20 9:52.21 /us= r/local/bin/python3.6 /home/lostuser/xyz >>=20 >> also obviously showing the userid and not the username. >>=20 >>=20 >> # grep lostuser /var/log/auth.log >> ... >> Dec 31 10:56:34 ns1 sshd[43798]: Accepted publickey for lostuser from xyz= >> Dec 31 10:56:57 ns1 sshd[44133]: Disconnected from user lostuser >> Jan 10 09:37:05 ns1 sshd[9679]: Accepted publickey for lostuser from xyz >> Jan 10 09:37:09 ns1 sshd[10241]: Disconnected from user lostuser >> Jan 23 11:19:11 ns1 sshd[45905]: Accepted publickey for lostuser from xyz= >> Jan 23 11:19:14 ns1 sshd[46228]: Disconnected from user lostuser >> Feb 27 18:06:49 ns1 sshd[93323]: Invalid user lostuser from xyz >> Feb 27 18:06:49 ns1 sshd[93323]: Connection closed by invalid user lostus= er xyz >>=20 >> 23 Jan 2021 was the last successful login, and later that day /etc/*passw= d was touched due to me changing the >> password of a different user, confirmed as the only change from diff'ing a= gainst backups. >>=20 >> Last buildworld upgrade on 3 Nov 2020 (host and jail): >>=20 >> $ uname -a >> FreeBSD ns1.lordcow.org 11.4-STABLE FreeBSD 11.4-STABLE #0 r367290: Tue N= ov 3 12:11:29 SAST 2020 root@lordcow.org:/usr/obj/usr/src/sys/GENERIC a= md64 >>=20 >> The last ports upgrade was 13 Feb 2021, before that I'm not sure. >>=20 >> The last entry in /var/log/userlog was 23 Jul 2020, and: >>=20 >> # ls -l /var/log/userlog=20 >> -rw------- 1 root wheel 4202 Jul 23 2020 /var/log/userlog >>=20 >>=20 >> ie. timeline: >>=20 >> 23 Jul 2020 Last userlog change >> 3 Nov 2020 buildkernel/buildworld and reboot >> 3 Dec 2020 lostuser network server process spawned and still functioning= >> 23 Jan 2021 Last successful login to lostuser >> 23 Jan 2021 Unrelated user's password intentionally changed with passwd >> 13 Feb 2021 ports upgrade >> 27 Feb 2021 Discover user doesn't exist anymore but still has entries in /= etc/*passwd and a process running >>=20 >> Any ideas? >> _______________________________________________ >> freebsd-security@freebsd.org mailing list >> https://lists.freebsd.org/mailman/listinfo/freebsd-security >> To unsubscribe, send any mail to "freebsd-security-unsubscribe@freebsd.or= g"