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 1szMkk-005gQX-5l for pgsql-admin@arkaria.postgresql.org; Fri, 11 Oct 2024 21:00:50 +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 1szMkh-00BU3b-VH for pgsql-admin@arkaria.postgresql.org; Fri, 11 Oct 2024 21:00:48 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1szMkh-00BU3T-Fr for pgsql-admin@lists.postgresql.org; Fri, 11 Oct 2024 21:00:47 +0000 Received: from mail-pl1-x634.google.com ([2607:f8b0:4864:20::634]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1szMkf-000Q4q-6S for pgsql-admin@postgresql.org; Fri, 11 Oct 2024 21:00:46 +0000 Received: by mail-pl1-x634.google.com with SMTP id d9443c01a7336-20c714cd9c8so20098315ad.0 for ; Fri, 11 Oct 2024 14:00:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1728680444; x=1729285244; 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=Qvy4cJpnSs+5iJ+/dM1VK+fE+zKpy+pvuEIJSo9Ua90=; b=UzzCFcIxy3qVh5BEK7aRAUTSNCD+HtR1LrcFwjovrfRs1cgrTmsDn2PtWeHFosF9vX nH1lirq10ZX022T/cs68FRWj9cZsJzfeS7fiStSxKkdkFvxnxrfkiEaUpg4VKHfsu3VL 2zyh84YQsl1YYVGDJu9HwI2Y7r6vNqrih16tFnG66gh+/SwJUEJ1BIZ5uCWPPFTodp+D YedNJviQb9mCcSDN0axDqrGiZvX6l7STBltzASU1uOe/uIUUy2R0EFEqAfYCPXf03XVJ ww+KNYEJ/Xw1xbnApqRLweUusjEbw2KmDq1TBf9hvFGKd8nqyZisZbb4BUrQedGiUAmW gDpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728680444; x=1729285244; 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=Qvy4cJpnSs+5iJ+/dM1VK+fE+zKpy+pvuEIJSo9Ua90=; b=NXzvSqIi1N/HwoIScIfKKP4QSl7c4CZRHLdQsxmdxquQXxPxGhQgOUlXNcVq3ac6pZ PazhRPiel54dhgQjSHfvfa0jihhhFtExfecYb1D8Uy28O+kwUzYQkN8iaE/rQuecj+ab /EnPPIJUaDQakl3x2XE61/QAvBYS1UZ7NqAPw/OjYFdWJgWOkQXFH4hs2JgCQyXG+v9M EktRq7cI0yLoJjBX++Ruo8BYgZwmPgjidSa8RpeEubvX6XKS5ewxD4XQbTAqHP4Eoy7v dSZDfAl3F22cQ/EFKqlQmH7a7ZrtywFua56c4EPfanJcKDmUZH2HS+v7fUe/ns6lYCfO CtzQ== X-Forwarded-Encrypted: i=1; AJvYcCUGkU9d1RitTQ4OfUvvi9YItCHu8RGxv6vmCqudIDdLA13ePG3fMUI9bD9dAscOMQpAJStG/E0/YcLYSg==@postgresql.org X-Gm-Message-State: AOJu0Ywe7uvi5sDuejYYa9cCpJhaJAzm3n19Gl5gi5A8FcBj21e7ZCEW 8e23TFjKaa0hI77SmvvfmiLZF0+ZhqeQ0TrV7K+GpcyXrD8Yx9o9J1FEYcffGINpWYA82pz+N5/ GiqTK4gMLRXc6+3BT5YZeS5au67k= X-Google-Smtp-Source: AGHT+IESD00gfJZj3PfvlqKidNUlgmf1wLUCcINb3RgYOe49ll87CgDzPLTj6XyomxCoPdnr47ALCwpZm6GmEERweWA= X-Received: by 2002:a17:903:1c3:b0:20c:5508:b61 with SMTP id d9443c01a7336-20cbb2419cbmr15516155ad.49.1728680444138; Fri, 11 Oct 2024 14:00:44 -0700 (PDT) MIME-Version: 1.0 References: <6b344a9d0ae654ca0bda0381a2f7f96df76ae3b2.camel@cybertec.at> <1eb200f88003972f2723967ddc95b70b3e61f5de.camel@cybertec.at> In-Reply-To: From: Imran Khan Date: Sat, 12 Oct 2024 00:00:30 +0300 Message-ID: Subject: Re: Unknown temp directories and library files To: Jeff Janes Cc: Laurenz Albe , Priancka Chatz , pgsql-admin Content-Type: multipart/alternative; boundary="000000000000cda0be062439c755" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000cda0be062439c755 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable My apology for misunderstanding.. On Fri, Oct 11, 2024, 11:51=E2=80=AFPM Jeff Janes wr= ote: > > > 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 >> troubleshoot 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 i= s >> hijacking >> the operating system account. >> > > But he didn't say they were in pgsql_tmp, just that they were in some tem= p > directory apparently 3 or 4 levels higher in the directory tree than wher= e > I would expect pgsql_tmp to be. To me this looks like some cruft left ove= r > from some sysadmin running the python package manager, perhaps while logg= ed > 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 > --000000000000cda0be062439c755 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
My apology for misunderstanding..=C2=A0

On Fri, Oct 11, 20= 24, 11:51=E2=80=AFPM Jeff Janes <jeff.janes@gmail.com> wrote:


On Fri, Oct 11, 2024 at 4:16=E2=80= =AFPM Laurenz Albe <laurenz.albe@cybertec.at> wrote:
<= /div>
On Fri, 2024-10-11 a= t 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.

But he di= dn't say they were in pgsql_tmp, just that they were in some temp direc= tory apparently 3 or 4 levels higher in the directory tree than where I wou= ld 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 a= s 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
--000000000000cda0be062439c755--