Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1szMbC-005ffR-9G for pgsql-admin@arkaria.postgresql.org; Fri, 11 Oct 2024 20:50:58 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1szMbA-00BGyk-2l for pgsql-admin@arkaria.postgresql.org; Fri, 11 Oct 2024 20:50:56 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1szMb9-00BGyY-Mb for pgsql-admin@lists.postgresql.org; Fri, 11 Oct 2024 20:50:56 +0000 Received: from mail-ua1-x92b.google.com ([2607:f8b0:4864:20::92b]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1szMb6-000ZQ6-Ca for pgsql-admin@postgresql.org; Fri, 11 Oct 2024 20:50:55 +0000 Received: by mail-ua1-x92b.google.com with SMTP id a1e0cc1a2514c-84fe454176bso361796241.1 for ; Fri, 11 Oct 2024 13:50:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1728679852; x=1729284652; darn=postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=homMfkk+Xf3CP8561G7YKdEfohB3nPGXMFOsIFhGSi8=; b=jI57LY5yF8urtXETjDysP2damHRDEnOtd9/0ou1lyf7p0MNusg0/rkRXYPiCKmdexh A9ZN6zvRCd/yYKWcTc40KbnbuD+XGSQzKPXRVe/rizSfcPlJe9B0FJcpDolIsnimoKkd b/vUGtRdYCYysciUKSkEDnJXvC7T+rBZn/RgqFwcm3xDjY1yG5hIN3X1l5b+5pOvC+WN 5eYIQFudBlFkZ+y1sfO0mL345c/zeIGp9j2y+EqVwAJ/mUiQxZnV3Pr3EDY0clnM/E+e L7M1/1vR1BC5CDvIYWSYQkuk5Hm+RYKjG19k8y0dLfOrHGKhVnRng90QovWPOZJ/cUpL jAAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728679852; x=1729284652; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=homMfkk+Xf3CP8561G7YKdEfohB3nPGXMFOsIFhGSi8=; b=kGNw+pMkhmwA2WLb8obkzVM9zEPvjRhvZ4t80VF+GCrV/VKs9518PVT95rv+a4gNqB ozTS3/CpOth7cWlfZEq6VQZFjg/5Mqkq7ZXOLPQxgZOh4QwAG5yN9oUrOK8MEtUn6/RK hDCvFC1Innk7el7DZCaXopmh9KhT9+ZEiLQLsUP7qT0M+FfiRA1xbBk6v9RJLP60sYdT 5pcFrVTPeZ/uq58xjvRLSyFWKDwokin9x8xX+w2NYD4kPK8KQ6G5lLbIGZdhHROxm8xy u6AXxpPdKkree9wPwZ7pzhMWjQ+N4ls2gSa+sXkaoT5Edf/HsPvbGLWAEYwtYObQeMXT +WBA== X-Forwarded-Encrypted: i=1; AJvYcCUpthb1wtiuMezZVzOZXjC/jb7l9g8DM/AEGXBmlGgAG4lh31gnMRvJHZ/azkdM8ELND3FaAGcVrXWsrg==@postgresql.org X-Gm-Message-State: AOJu0YxBaVUkOUJk8r6XOF4v6SDDpK+dIcLSeUbqOHewVnl27DK0hM3e i/YAndXOxAwtRdm+2VwaS3OfN1dnw6ejbW/GIz9UlX+MyPDlxkFSo1blhL6oy9eW2njudAFyJfY ZxstyaDeOOGOlxkb48WYtPBGiQQ== X-Google-Smtp-Source: AGHT+IEAzkOKWpbxbTI3hxv0sxMrca6nn9tyiq3b8wDv/dcGYEYEla7ql6MVePoLQLs4nLFmv1SMQgDQnwrTauXbL5w= X-Received: by 2002:a05:6102:6d5:b0:4a3:d2e5:f097 with SMTP id ada2fe7eead31-4a465a9d1b5mr4816990137.24.1728679851658; Fri, 11 Oct 2024 13:50:51 -0700 (PDT) MIME-Version: 1.0 References: <6b344a9d0ae654ca0bda0381a2f7f96df76ae3b2.camel@cybertec.at> <1eb200f88003972f2723967ddc95b70b3e61f5de.camel@cybertec.at> In-Reply-To: <1eb200f88003972f2723967ddc95b70b3e61f5de.camel@cybertec.at> From: Jeff Janes Date: Fri, 11 Oct 2024 16:50:39 -0400 Message-ID: Subject: Re: Unknown temp directories and library files To: Laurenz Albe Cc: Priancka Chatz , pgsql-admin Content-Type: multipart/alternative; boundary="0000000000007d144f062439a4d3" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000007d144f062439a4d3 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Oct 11, 2024 at 4:16=E2=80=AFPM Laurenz Albe wrote: > On Fri, 2024-10-11 at 15:47 +0200, Priancka Chatz wrote: > > On Fri, Oct 11, 2024 at 3:09=E2=80=AFPM Laurenz Albe > wrote: > > > On Thu, 2024-10-10 at 12:22 +0200, Priancka Chatz wrote: > > > > I am observing a new/unknown behavior on some of my instances. My > postgres Data > > > > directory path is /home/postgres/pgdata/pgroot/data. And I see a > temp directory > > > > present inside /home/postgres/pgdata which has 100s of directory > underneath it > > > > and inside each directory some library files related to Psycopg2. > Not sure what > > > > these files are and why it is getting created. I am attaching > screenshots for reference. > > > > Can anyone shed some light or direct me to any links to troubleshoo= t > this? > > > > > > I'd say somebody broke into your database and is abusing it for his > purposes. > > > > > > If that proves true, rescue what you can of the data and start with a > new > > > installation, preferably with better security. > > I have no conclusive proof for abuse, but a library has no business in > "pgsql_tmp". > That looks very much like somebody guessed your superuser password and is > hijacking > the operating system account. > But he didn't say they were in pgsql_tmp, just that they were in some temp directory apparently 3 or 4 levels higher in the directory tree than where I would expect pgsql_tmp to be. To me this looks like some cruft left over from some sysadmin running the python package manager, perhaps while logged in as the wrong user. (Although I suppose that running a package manager as the wrong user is also something a hacker might try to do...) Cheers, Jeff --0000000000007d144f062439a4d3 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Fri, Oct 11, 2024 at 4:16=E2=80=AF= PM Laurenz Albe <laurenz.alb= e@cybertec.at> wrote:
On Fri, 2024-10-11 at 15:47 +0200, Priancka Chatz wrote:
> On Fri, Oct 11, 2024 at 3:09=E2=80=AFPM Laurenz Albe <laurenz.albe@cybertec.at> wrote:
> > On Thu, 2024-10-10 at 12:22 +0200, Priancka Chatz wrote:
> > > I am observing a new/unknown behavior on some of my instance= s. My postgres Data
> > > directory path is /home/postgres/pgdata/pgroot/data. And I s= ee a temp directory
> > > present inside /home/postgres/pgdata which has 100s of direc= tory underneath it
> > > and inside each directory some library files related to Psyc= opg2. Not sure what
> > > these files are and why it is getting created. I am attachin= g screenshots for reference.
> > > Can anyone shed some light or direct me to any links to trou= bleshoot this?
> >
> > I'd say somebody broke into your database and is abusing it f= or his purposes.
> >
> > If that proves true, rescue what you can of the data and start wi= th a new
> > installation, preferably with better security.

I have no conclusive proof for abuse, but a library has no business in &quo= t;pgsql_tmp".
That looks very much like somebody guessed your superuser password and is h= ijacking
the operating system account.

--0000000000007d144f062439a4d3--