From owner-freebsd-security@freebsd.org Sun Feb 28 00:12:30 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 1626D559400 for ; Sun, 28 Feb 2021 00:12:30 +0000 (UTC) (envelope-from jhellenthal@dataix.net) Received: from mail-qk1-x72b.google.com (mail-qk1-x72b.google.com [IPv6:2607:f8b0:4864:20::72b]) (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 4Dp3k46BLzz4ZLs for ; Sun, 28 Feb 2021 00:12:25 +0000 (UTC) (envelope-from jhellenthal@dataix.net) Received: by mail-qk1-x72b.google.com with SMTP id h8so13073179qkk.6 for ; Sat, 27 Feb 2021 16:12:25 -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=a4rXL9av+ksJ5Z4yMlur1VuhGb61nHswa6VmbfHIibo=; b=KmIss7og7SL86wKMm3725MGnrxVN0WkWV7uq/zol5mXPtgVf3+fjzp/QLvn+Q6SzQ5 g/djncnTKMUMJTDc3I42QEnMimjlMFrVx3oO6bPNP/5cblfky7xmQHgoCfAlq3NWpIbt 8AN1I5ku2Q3YHYTxEgV6lF0C/SNSDZq2b/Q24Uzy8HBwCRPUKZtZdQtBRUZ21pv1gB1Y 1KRS/80wxfrSakHo+Bn1hyz3I3VhyKw5k54BxyZKqLJ/5b+aNEl9J76ki15rNdynSgAP FnJGls0DlDhG/y1blujkX2D2sPcmwj3qxH2jAxvFiZ8jF3is3y9eJvhelcjYYMyfibLi Vgag== X-Gm-Message-State: AOAM533M07KNllTfuBT3g+yn1Aktm8lIvwiqXhKgfoKZKs33tdwBeK6t E6wLm53AZzEO25/pmW2eZQ6tlcUWNSlNbQ== X-Google-Smtp-Source: ABdhPJwi2fiNb0QSehnyVzISEYB9TuiYfYBtDTQwMWRrYZIrOWTctOYJAIRqst1izFENqOR6IFeeXg== X-Received: by 2002:a05:620a:16d9:: with SMTP id a25mr8828645qkn.141.1614471144492; Sat, 27 Feb 2021 16:12:24 -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 w20sm9582763qki.102.2021.02.27.16.12.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 27 Feb 2021 16:12:24 -0800 (PST) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: "J. Hellenthal" Mime-Version: 1.0 (1.0) Subject: Re: user account disappeared Date: Sat, 27 Feb 2021 18:12:06 -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: 4Dp3k46BLzz4ZLs X-Spamd-Bar: --- X-Spamd-Result: default: False [-3.50 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; 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)[-0.999]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RBL_DBL_DONT_QUERY_IPS(0.00)[2607:f8b0:4864:20::72b: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)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-security@freebsd.org]; SPAMHAUS_ZRD(0.00)[2607:f8b0:4864:20::72b:from:127.0.2.255]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::72b:from]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[FreeBSD-security] 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:12:30 -0000 Looks like your master passwd db is out of sync. Command is mkpwdb or something similar then run init q Personally it would seem someone got ahold of master.passwd and doesn=E2=80=99= t know how it works or a port upgrade failed to complete properly updating t= he db --=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 15:23, Gareth de Vaux wrote: >=20 > =EF=BB=BFHi all, one of my users in a jail has mysteriously half disappear= ed. I've renamed the user to 'lostuser', the password hash, and the process i= t'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/ba= sh >=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 fu= nctioning: >=20 > # ps aux | grep lostuser > 1012 56261 0.0 0.1 44952 21288 7 S+J 3Dec20 9:52.21 /usr= /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 lostuse= r xyz >=20 > 23 Jan 2021 was the last successful login, and later that day /etc/*passwd= 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 No= v 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.org= "