Topic: bypassed all security and checks /fake authenticated
==== Required information ====
- iRedMail version:
- Store mail accounts in which backend (LDAP/MySQL/PGSQL):
- Linux/BSD distribution name and version:
- Related log if you're reporting an issue:
======== Required information ====
- iRedMail version: 0.8.6
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): mysql pro
- Linux/BSD distribution name and version: debian
- Related log if you're reporting an issue:
====
One of our clients received a scam paypal email today, with a from email address as our mail server. This worried me because, you should need to authenticate to send emails from our mail servers domain name (its setup within iredmail).
After some digging I found in the mail log it says
cbpolicyd[4586]: module=Greylisting, action=pass, host=195.228.238.70, helo=mail.naturalmeat.hu, from=service@naturalmeat.hu, to=client@CLIENTS-DOMAIN.co.uk, reason=authenticated
So it does believe its authenticated (full log bellow). But they have not authenticated!
I then had the email forwarded to me from the client and I see in the headers they are spoofing from Received From headers before the email is sent from them to us.. basically they make it look like it was received from localhost on our server, and then sent to their server and then back to our server. See full headers bellow.
I believe the checks are blindly using these fake headers as a sign that the email came from localhost! and therefore authenticated?
mail.log:
-------------------------------
May 28 19:42:24 mx1 postfix/smtpd[22274]: connect from mail.naturalmeat.hu[195.228.238.70]
May 28 19:42:24 mx1 cbpolicyd[4586]: module=Greylisting, action=pass, host=195.228.238.70, helo=mail.naturalmeat.hu, from=service@naturalmeat.hu, to=client@CLIENTS-DOMAIN.co.uk, reason=authenticated
May 28 19:42:24 mx1 postfix/smtpd[22274]: DF7C81AB2001: client=mail.naturalmeat.hu[195.228.238.70]
May 28 19:42:25 mx1 postfix/cleanup[23207]: DF7C81AB2001: message-id=<01cf7aa3$Blat.v3.1.1$b6fb7d91$14d86a0cd947@naturalmeat.hu>
May 28 19:42:26 mx1 postfix/qmgr[2933]: DF7C81AB2001: from=<Service@naturalmeat.hu>, size=6360, nrcpt=1 (queue active)
May 28 19:42:26 mx1 postfix/smtpd[22274]: disconnect from mail.naturalmeat.hu[195.228.238.70]
May 28 19:42:29 mx1 postfix/smtpd[23212]: connect from mx1.OUR-MAIL-SERVER.co.uk[127.0.0.1]
May 28 19:42:29 mx1 postfix/smtpd[23212]: 216861AB2005: client=mx1.OUR-MAIL-SERVER.co.uk[127.0.0.1]
May 28 19:42:29 mx1 postfix/cleanup[23207]: 216861AB2005: message-id=<01cf7aa3$Blat.v3.1.1$b6fb7d91$14d86a0cd947@naturalmeat.hu>
May 28 19:42:29 mx1 postfix/qmgr[2933]: 216861AB2005: from=<Service@naturalmeat.hu>, size=6866, nrcpt=1 (queue active)
May 28 19:42:29 mx1 postfix/smtpd[23212]: disconnect from mx1.OUR-MAIL-SERVER.co.uk[127.0.0.1]
May 28 19:42:29 mx1 amavis[22638]: (22638-04) Passed CLEAN {RelayedOutbound}, LOCAL [195.228.238.70]:59269 [84.113.77.177] <Service@naturalmeat.hu> -> <client@CLIENTS-DOMAIN.co.uk>, Queue-ID: DF7C81AB2001, Message-ID: <01cf7aa3$Bla$
May 28 19:42:29 mx1 postfix/smtp[23209]: DF7C81AB2001: to=<client@CLIENTS-DOMAIN.co.uk>, relay=127.0.0.1[127.0.0.1]:10024, delay=4.3, delays=1.2/0/0/3.1, dsn=2.0.0, status=sent (250 2.0.0 from MTA(smtp:[127.0.0.1]:10025): 250 2.0.0$
May 28 19:42:29 mx1 postfix/qmgr[2933]: DF7C81AB2001: removed
May 28 19:42:29 mx1 postfix/pipe[23213]: 216861AB2005: to=<client@CLIENTS-DOMAIN.co.uk>, relay=dovecot, delay=0.22, delays=0/0.01/0/0.21, dsn=2.0.0, status=sent (delivered via dovecot service)
May 28 19:42:29 mx1 postfix/qmgr[2933]: 216861AB2005: removed
--------------------------------
Email headers:
Received: from mail.naturalmeat.hu (mail.naturalmeat.hu [195.228.238.70])
by mx1.OUR-MAIL-SERVER.co.uk (Postfix) with ESMTP id DF7C81AB2001
for <client@CLIENTS-DOMAIN.co.uk>; Wed, 28 May 2014 19:42:24 +0100 (BST)
Received: from mx1.OUR-MAIL-SERVER.co.uk ([127.0.0.1])
by localhost (mx1.OUR-MAIL-SERVER.co.uk [127.0.0.1]) (amavisd-new, port 10024)
with ESMTP id f_XvpZhCpmAg for <client@CLIENTS-DOMAIN.co.uk>;
Wed, 28 May 2014 19:42:26 +0100 (BST)
Received: from localhost (mx1.OUR-MAIL-SERVER.co.uk [127.0.0.1])
by mx1.OUR-MAIL-SERVER.co.uk (Postfix) with ESMTP id 216861AB2005
for <client@CLIENTS-DOMAIN.co.uk>; Wed, 28 May 2014 19:42:29 +0100 (BST)
Received: from n-tul-dru-4131 (84-113-77-177.dynamic.surfer.at [84.113.77.177])
(Authenticated sender: janos.seres)
by mail.naturalmeat.hu (Postfix) with ESMTPA id 8ADB429023
for <client@CLIENTS-DOMAIN.co.uk>; Wed, 28 May 2014 20:36:06 +0200 (CEST)
Received: from mail.naturalmeat.hu ([127.0.0.1])
by localhost (mail.naturalmeat.hu [127.0.0.1]) (amavisd-new, port 10024)
with ESMTP id LKxffa1OsLEI for <client@CLIENTS-DOMAIN.co.uk>;
Wed, 28 May 2014 20:36:06 +0200 (CEST)
Received: from localhost (localhost [127.0.0.1])
by mail.naturalmeat.hu (Postfix) with ESMTP id CD43829037
for <client@CLIENTS-DOMAIN.co.uk>; Wed, 28 May 2014 20:36:06 +0200 (CEST)
Return-Path: <Service@naturalmeat.hu>
From: "Service PayPal" <janos.seres@mx1.OUR-MAIL-SERVER.co.uk>
To: <client@CLIENTS-DOMAIN.co.uk>
Subject: View your settings online today
Date: Wed, 28 May 2014 19:36:16 +0100
Message-ID: <01cf7aa3$Blat.v3.1.1$b6fb7d91$14d86a0cd947@naturalmeat.hu>
MIME-Version: 1.0
Content-Type: multipart/alternative;
boundary="----=_NextPart_000_007C_01CF7B42.50D24810"
X-Priority: 1 (Highest)
X-MSMail-Priority: High
X-Mailer: Microsoft Office Outlook 12.0
Thread-Index: Ac96pJPN8UfGc+LgRpW4FIp36ADlbw==
Importance: High
----
Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.