Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eP615-0006xK-79 for pgsql-performance@arkaria.postgresql.org; Wed, 13 Dec 2017 12:20:03 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eP614-0003M7-Q7 for pgsql-performance@arkaria.postgresql.org; Wed, 13 Dec 2017 12:20:02 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1eP614-0003Ld-Ch for pgsql-performance@lists.postgresql.org; Wed, 13 Dec 2017 12:20:02 +0000 Received: from mail-it0-x233.google.com ([2607:f8b0:4001:c0b::233]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1eP60w-000663-Up for pgsql-performance@postgresql.org; Wed, 13 Dec 2017 12:20:01 +0000 Received: by mail-it0-x233.google.com with SMTP id d16so3396722itj.1 for ; Wed, 13 Dec 2017 04:19:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=5iwk9Xp87FjP1SWJPNDtDji0gpFW5+DTpeE2GD0zsLU=; b=MMQrCM42mYMZeJ1TeljVZ7vzyUC90g5qgtZq2h84xsUHBzsVpu1FHoZf5b3EV6wjXd mLcoYn2uK8QS210FbPUb3xm6XtTLLhhfG5KDUMcbykVrT89tCdbRrUiTRskrvwdSp+Tq J1U5CkE6U46PExReqB0qUtV975BCcRswPSUMXOwg1BcEs89NB6wZxc7J5AcehcbHffh0 5whEuQRHR6hW+uTWUnw3K5ZgzHkCo1vN1+SCccKbTLBZKMX11AbtCntjYkacsfSxAOKU LAwt4aXMrNTSHbQH3jG9Osl4xIGLxKjnB94x6n0CCaFQxvMMzdcicaHLBkiD3cVPZ17D HdwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=5iwk9Xp87FjP1SWJPNDtDji0gpFW5+DTpeE2GD0zsLU=; b=B1NmpRatuSeEm4QAc+TEylLyKScIap/Lyyp4tLy9Nel2HMXsBVdFRghPAUiyxLkzoW zSiXx6h+HNwr8Pp5ETFIjbi8qMoEi4FOK8whULgRmg78rpLNINP9lTeEKrDeR7r8mr92 UKieL9QX4v/NPMToSUw/k92yNfbfUnKI0Y3NeBt7hWYiaTluW4Izv593aBBNxB3MJFAa yiDpq0EDJwefRtDEHxrdc5lfAhFmoTCJNltdutuq2RJT/PlFZDKzJuF4JhCeh0kw3t8O tnAbsHAwM8NGgjA6vVs+UPN+6E/iOOJm4UQcUG1rc04eqIale7XVqM8z1By0ORBoA+C6 viIw== X-Gm-Message-State: AKGB3mKmk2QB99GQhhVgkYJi6oOy6s+0lKX6ZbTw66p4k04OV2a82QmL 7fJ3Dn0EcstFFWhpUdRrADCMqw== X-Google-Smtp-Source: ACJfBosVffHCXzmzN2NEb8CaNHskYL99SSJ17wiiFAa24jNEk6Or76wi2M8f98+SMyQgKQnip/6qmQ== X-Received: by 10.36.121.150 with SMTP id z144mr2780798itc.140.1513167593989; Wed, 13 Dec 2017 04:19:53 -0800 (PST) Received: from pryzbyj (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id m21sm1021710itb.43.2017.12.13.04.19.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 Dec 2017 04:19:53 -0800 (PST) Received: by pryzbyj (Postfix, from userid 1000) id 7EDE4801040; Wed, 13 Dec 2017 06:19:52 -0600 (CST) Date: Wed, 13 Dec 2017 06:19:52 -0600 From: Justin Pryzby To: Laurenz Albe Cc: Dinesh Chandra 12108 , "pgsql-performance@postgresql.org" Subject: Re: CPU 100% usage caused by unknown postgres process.. Message-ID: <20171213121952.GA16691@telsasoft.com> References: <68dd64b2a09f4fd8afe9582a4e23641e@cyient.com> <1513161371.5128.3.camel@cybertec.at> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1513161371.5128.3.camel@cybertec.at> User-Agent: Mutt/1.5.23 (2014-03-12) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Wed, Dec 13, 2017 at 11:36:11AM +0100, Laurenz Albe wrote: > Dinesh Chandra 12108 wrote: > > My CPU utilization is going to 100% in PostgreSQL because of one unknown process /x3303400001 is running from postgres user. > > > > PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND > > 19885 postgres 20 0 192684 3916 1420 S 99.3 0.1 5689:04 x3303400001 > > > > The same file is automatically created in Postgres Cluster also. I am using Postgresql-9.3. > > > > Kindly suggest how can I resolve this issue. > > I don't know, but the same problem has been reported on Stackoverflow: > https://stackoverflow.com/q/46617329/6464308 > > If your queries look similar, then you might indeed be the victim of an attack. > > Figure out where the function and the executable come from. > > In case of doubt, disconnect the server from the network. Looks suspicious; I would look at (and save) things like these: ls -l /proc/19885/exe ls -l /proc/19885/fd ls -l /proc/19885/cwd sudo lsof -n -p 19885 sudo netstat -anpe |grep 19885 Stacktrace with gcore/gdb is a good idea. Save a copy of your log/postgres logfiles and try to figure out where it came from. Since an attacker seems to control the postgres process, your data may have been compromized (leaked or tampered with). Justin