Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fL15S-0000n9-Jp for pgsql-general@arkaria.postgresql.org; Tue, 22 May 2018 06:47:58 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fL15Q-0004BM-VN for pgsql-general@arkaria.postgresql.org; Tue, 22 May 2018 06:47:56 +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.89) (envelope-from ) id 1fL15Q-0004B8-GY for pgsql-general@lists.postgresql.org; Tue, 22 May 2018 06:47:56 +0000 Received: from mail-wr0-x242.google.com ([2a00:1450:400c:c0c::242]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1fL15J-0001Mz-Hg for pgsql-general@postgresql.org; Tue, 22 May 2018 06:47:55 +0000 Received: by mail-wr0-x242.google.com with SMTP id k5-v6so6159228wrn.3 for ; Mon, 21 May 2018 23:47:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:references:in-reply-to:subject:date:message-id :mime-version:content-transfer-encoding:thread-index :content-language; bh=qmHSr3gBNymQ6spcZjqRA/Fg0wHmGzE/84E7meDigcM=; b=LBAKp9L7F0sPHSwxV3gSH0QMKtURvce/5Q3OP8p/g/1OQA4Zen8ywsjFFUzV2fLRBt BrG0cd/PIN7QYWYSdDhcHaMFjOfA5u4A6FmGceFlBX4fAxHYQfgfto/gnGeVPDqCtHxY vq71c2xTg8/bQRnH81u+35+p7X1bZoowV9OK20Wb1/yLnt0+rFy/PGewNIEtFmcG7jOe AUe2jTaKnYsZbbYqtftkliI8ed7kcayk4niV0Z7YQzqDbxjfmj2qiulr0sIN1kDOZm7V J84sWRkfJqmTdUjyBZ+i9MX8ecG1aY5kjVOu0TB4O3ZSZX5qpu2N5ItMkdKuKthRESn+ kuIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:references:in-reply-to:subject:date :message-id:mime-version:content-transfer-encoding:thread-index :content-language; bh=qmHSr3gBNymQ6spcZjqRA/Fg0wHmGzE/84E7meDigcM=; b=GmXL36bRl68KPbXGOub27NWwEuIDvltoTAhjE5GOzLyF9gF09/fybGUnFyQFansquC y5n1UMRQCBlXH9fzhSPPKxh3iMwZbl6gijY42eZIxwX/Jsph9Nxg5QUq/GUMIdO8VUh2 /V2zDdlf7KRrjCF45jWJRivUMHALgKchqfcQR5uFMt5/OFgWv9DqeDf0xExWFGwvSsiu J2eoyEMYMsW+9BeRfXcYzGs3h44JecfE4kOyoZGQ8ZuPrUo0RthP5KBDB54WzBpFtBmO +O0auOH5mxGH7AzyjwGzBg33QfddecdORuHOlzmcADrobm+mPpqjlP5x/dk5dpgU0mRh lLAA== X-Gm-Message-State: ALKqPwdRBh2L6e+kKcuL5+oHNeUJNB4FJeSJT7AuB+ZQJJ7ULezMqmkd 8ONV4+9+tAWstMN0MzG/HXve5g== X-Google-Smtp-Source: AB8JxZoRQ8ZFL8wYgKZMu7Uo6Bt1IIV7alSp+v8B6EMqQJva8GwaU2QM1G2Ynt8kogh7z2l5U5NiaA== X-Received: by 2002:adf:8212:: with SMTP id 18-v6mr17185554wrb.144.1526971666449; Mon, 21 May 2018 23:47:46 -0700 (PDT) Received: from DESKTOPF2QEVGJ (193-192-185-103.static.ip.netia.com.pl. [193.192.185.103]) by smtp.gmail.com with ESMTPSA id v196-v6sm12317839wmf.36.2018.05.21.23.47.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 21 May 2018 23:47:45 -0700 (PDT) From: "Bartosz Dmytrak" To: "'Steve Atkins'" Cc: "'PG-General Mailing List'" References: <020901d3f14c$512a46d0$f37ed470$@gmail.com> <36FAFC91-E9C9-4732-83A3-9DD5B392FD7C@blighty.com> In-Reply-To: <36FAFC91-E9C9-4732-83A3-9DD5B392FD7C@blighty.com> Subject: RE: posgresql.log Date: Tue, 22 May 2018 08:47:50 +0200 Message-ID: <021d01d3f198$cdb153f0$6913fbd0$@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Outlook 15.0 Thread-Index: AQHFVJEXYjoV8D/4j52jJnMBjBQK0gOSiCDFAjEZ3DikKmhIIA== Content-Language: pl List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk -----Original Message----- From: Steve Atkins [mailto:steve@blighty.com]=20 Sent: Tuesday, May 22, 2018 12:44 AM To: PG-General Mailing List Cc: bdmytrak@gmail.com Subject: Re: posgresql.log > On May 21, 2018, at 3:21 PM, Steve Crawford = wrote: >=20 >=20 >=20 > If this is a test server and you can take it offline for forensics I = would do so, especially if it could provide a path to other internal or = critical resources. If you can image it for safekeeping and forensics, = even better. +1 It's compromised. Image it if possible; save the compromise payload you = know about if not. Treat it as compromised and unsafe to attach to a network until you = completely wipe and reinstall it. >=20 > That appears to be output from wget but the intrusion, if any, could = be through any number of vectors (web, ssh, local attack, etc.) not = directly related to PostgreSQL. Check in your other logs starting with a = search for anything related to that IP address. It's probably a compromise via postgresql open to the network with = insecure settings. I've seen several of those reported recently, and = this one is saving it's payload to the postgresql data directory - = somewhere no other user or app will have access to, but which a = compromised postgresql can easily write to. Check the pg_hba.conf and packet filter / firewall settings and see what = the issue may be. Do the same checks on all your other postgresql = servers, test and production. If there's a configuration mistake that = let one server be compromised it's may well be there on others too. >=20 > Verify the usual. Patches up to date, ports appropriately firewalled = off, no default passwords, etc. >=20 > IP comes back to vultr.com which is a cloud company (i.e. could be = anyone) but if it is an attack perhaps contact their abuse department. The C&C server there is already down; It can't hurt to notify them, but = I doubt Choopa would be particularly interested beyond that point unless = a subpoena or search warrant were involved. > Unless you are positive the server was not attacked, don't trust it = unless you can be absolutely certain it is clean. Best bet is to backup = any critical data (and check it for trustworthiness), wipe and rebuild. +1. >=20 > Only you (well, OK, maybe them, now) know what data was on this server = but depending on its importance, internal policies, legal requirements = and agreements with third-parties you may have notification requirements = and could need to engage forensics experts. Cheers, Steve Hi Steve, Thanks a lot. That=E2=80=99s virtual server, so I'll do the backup. I = suppose it was hacked, but fortunately there are no important data and I = can wipe it out with no hurt. According to your advice I'll check = firewall rules and block new IP ranges (many of them are blocked now). = There are no default passwords, but will work on more secure approach. = This server has to be accessible from internet, but not necessary for = every IP. Thanks again for your help and advice. Hope this case will let other = keep their servers more secure. Regards, Bartek