Starkes Spam-Problem - Ursache ungeklärt, bitte dringend um Hilfe

techblaster

New Member
Hallo allerseits,

ich habe seit längerem einen Root-Server im Einsatz, auf dem virtuell einzelne Debian 6 mit ISP's drauf liegen.
Im großen und ganzen laufen die Maschinen rund, nur bei einem gibt es zur Zeit massive Ausreisser und sehr heftige Spam-Probleme.
Notgedrungen habe ich den Port 25 ausgehend erst einmal blockiert, da der Server als Zombi-Mailer fungiert. Die Mails sind angestiegen von vorher 20-30 am Tag auf jetzt fast 1000. Tendenz steigend.
Mehrere Varianten habe ich bereits durchgespielt, bspw. Einsatz eines Wrappers um ein mögliches Skript im web-Verzeichnis ausfindig zu machen. Sicherheitseinstellungen des Postfix kontrolliert, Logs gesichtet, alles ohne Erfolg. Auffällig ist, leider immer wieder auch Webseiten verseucht werden. Also Trojaner sich dort einnisten. Vielleicht gibt es ja hierzu einen Zusammenhang? Ich bin schon am Überlegen die Maschine komplett neu aufzusetzen. Bevor ich mir diese viele Arbeit jedoch mache möchte ich hier nochmal um Rat fragen. Vielleicht habt Ihr ja noch einen Ansatz den ich verfolgen könnte. Ich poste Euch nachfolgend ein paar Infos zur oben beschriebenen Problematik. IP's und Adressen mache ich bewusst nicht extra unkenntlich um die Vorgänge besser nachvollziehen zu können!

Beispielmail welche Eingehend zurück kommen (Antwort auf den Spamversand):
Code:
message_arrival_time: Mon Nov 11 02:59:27 2013
create_time: Mon Nov 11 02:59:27 2013
named_attribute: rewrite_context=local
named_attribute: [EMAIL="envelope_id=AM..20131111T015927Z@debian.local"]envelope_id=AM..20131111T015927Z@debian.local[/EMAIL]
sender:
named_attribute: log_client_name=localhost
named_attribute: log_client_address=127.0.0.1
named_attribute: log_client_port=51511
named_attribute: log_message_origin=localhost[127.0.0.1]
named_attribute: log_helo_name=localhost
named_attribute: log_protocol_name=ESMTP
named_attribute: client_name=localhost
named_attribute: reverse_client_name=localhost
named_attribute: client_address=127.0.0.1
named_attribute: client_port=51511
named_attribute: helo_name=localhost
named_attribute: protocol_name=ESMTP
named_attribute: client_address_type=2
named_attribute: dsn_orig_rcpt=rfc822;vibkikv@superemail.com
original_recipient: [EMAIL="vibkikv@superemail.com"]vibkikv@superemail.com[/EMAIL]
recipient: [EMAIL="vibkikv@superemail.com"]vibkikv@superemail.com[/EMAIL]
*** MESSAGE CONTENTS deferred/0/037EA14E4BD ***
Received: from localhost (localhost [127.0.0.1])
        by computer-internet.net (Postfix) with ESMTP id 037EA14E4BD
        for <[EMAIL="vibkikv@superemail.com"]vibkikv@superemail.com[/EMAIL]>; Mon, 11 Nov 2013 02:59:27 +0100 (CET)
Content-Type: multipart/report; report-type=delivery-status;
 boundary="----------=_1384135167-25652-16"
Content-Transfer-Encoding: 7bit
MIME-Version: 1.0
Subject: BANNED message from you (.exe,.exe-ms,mynicefoto.scr)
In-Reply-To: <09C216449797475D89FBBF8F5D685B39@snoh>
Message-ID: <[EMAIL="VS51SniPTtRM54@debian.local"]VS51SniPTtRM54@debian.local[/EMAIL]>
From: "Content-filter at debian.local" <[EMAIL="postmaster@debian.local"]postmaster@debian.local[/EMAIL]>
To: <[EMAIL="vibkikv@superemail.com"]vibkikv@superemail.com[/EMAIL]>
Date: Mon, 11 Nov 2013 02:59:26 +0100 (CET)
This is a multi-part message in MIME format...
------------=_1384135167-25652-16
Content-Type: text/plain; charset="iso-8859-1"
Content-Disposition: inline
Content-Transfer-Encoding: 7bit
BANNED CONTENTS ALERT
Our content checker found
    banned name: .exe,.exe-ms,mynicefoto.scr
in email presumably from you <[EMAIL="vibkikv@superemail.com"]vibkikv@superemail.com[/EMAIL]>
to the following recipient:
-> [EMAIL="misshunbun@hotmail.com"]misshunbun@hotmail.com[/EMAIL]
Our internal reference code for your message is 25652-17/51SniPTtRM54
First upstream SMTP client IP address: [46.230.30.20]
According to a 'Received:' trace, the message originated at: [46.230.30.20],
  Unknown unknown [46.230.30.20] Authenticated sender:
  [EMAIL="ebay@computer-internet.net"]ebay@computer-internet.net[/EMAIL]

Dazu im mail.log:
Code:
Nov 11 02:59:26 debian postfix/qmgr[20339]: DDF6214E4BD: removed
Nov 11 02:59:26 debian postfix/qmgr[20339]: 390B914E4BE: from=<[EMAIL="vibkikv@superemail.com"]vibkikv@superemail.com[/EMAIL]>, size=54459, nrcpt=1 (queue active)
Nov 11 02:59:27 debian postfix/smtpd[25109]: connect from localhost[127.0.0.1]
Nov 11 02:59:27 debian postfix/smtpd[25109]: 037EA14E4BD: client=localhost[127.0.0.1]
Nov 11 02:59:27 debian postfix/cleanup[24901]: 037EA14E4BD: message-id=<[EMAIL="VS51SniPTtRM54@debian.local"]VS51SniPTtRM54@debian.local[/EMAIL]>
Nov 11 02:59:27 debian postfix/qmgr[20339]: 037EA14E4BD: from=<>, size=4713, nrcpt=1 (queue active)
Nov 11 02:59:27 debian amavis[25652]: (25652-17) Blocked BANNED (.exe,.exe-ms,mynicefoto.scr), [46.230.30.20] [46.230.30.20] <[EMAIL="vibkikv@superemail.com"]vibkikv@superemail.com[/EMAIL]> -> <[EMAIL="misshunbun@hotmail.com"]misshunbun@hotmail.com[/EMAIL]>, quarantine: 5/banned-51SniPTtRM54, Message-ID: <09C216449797475D89FBBF8F5D685B39@snoh>, mail_id: 51SniPTtRM54, Hits: -, size: 54459, 314 ms

Log-Auszug messages:
Code:
Nov 11 10:20:01 debian pure-ftpd: ([EMAIL="?@127.0.0.1"]?@127.0.0.1[/EMAIL]) [INFO] New connection from 127.0.0.1
Nov 11 10:20:01 debian pure-ftpd: ([EMAIL="?@127.0.0.1"]?@127.0.0.1[/EMAIL]) [INFO] Logout.
Nov 11 10:25:03 debian pure-ftpd: ([EMAIL="?@127.0.0.1"]?@127.0.0.1[/EMAIL]) [INFO] New connection from 127.0.0.1
Nov 11 10:25:03 debian pure-ftpd: ([EMAIL="?@127.0.0.1"]?@127.0.0.1[/EMAIL]) [INFO] Logout.
Nov 11 10:30:02 debian pure-ftpd: ([EMAIL="?@127.0.0.1"]?@127.0.0.1[/EMAIL]) [INFO] New connection from 127.0.0.1
Nov 11 10:30:02 debian pure-ftpd: ([EMAIL="?@127.0.0.1"]?@127.0.0.1[/EMAIL]) [INFO] Logout.
Nov 11 10:35:04 debian pure-ftpd: ([EMAIL="?@127.0.0.1"]?@127.0.0.1[/EMAIL]) [INFO] New connection from 127.0.0.1
Nov 11 10:35:04 debian pure-ftpd: ([EMAIL="?@127.0.0.1"]?@127.0.0.1[/EMAIL]) [INFO] Logout.
Nov 11 10:40:02 debian pure-ftpd: ([EMAIL="?@127.0.0.1"]?@127.0.0.1[/EMAIL]) [INFO] New connection from 127.0.0.1
Nov 11 10:40:02 debian pure-ftpd: ([EMAIL="?@127.0.0.1"]?@127.0.0.1[/EMAIL]) [INFO] Logout.
Nov 11 10:45:03 debian pure-ftpd: ([EMAIL="?@127.0.0.1"]?@127.0.0.1[/EMAIL]) [INFO] New connection from 127.0.0.1
Nov 11 10:45:03 debian pure-ftpd: ([EMAIL="?@127.0.0.1"]?@127.0.0.1[/EMAIL]) [INFO] Logout.
Nov 11 10:50:02 debian pure-ftpd: ([EMAIL="?@127.0.0.1"]?@127.0.0.1[/EMAIL]) [INFO] New connection from 127.0.0.1
Nov 11 10:50:02 debian pure-ftpd: ([EMAIL="?@127.0.0.1"]?@127.0.0.1[/EMAIL]) [INFO] Logout.
Nov 11 10:55:02 debian pure-ftpd: ([EMAIL="?@127.0.0.1"]?@127.0.0.1[/EMAIL]) [INFO] New connection from 127.0.0.1
Nov 11 10:55:02 debian pure-ftpd: ([EMAIL="?@127.0.0.1"]?@127.0.0.1[/EMAIL]) [INFO] Logout.
Nov 11 11:00:03 debian pure-ftpd: ([EMAIL="?@127.0.0.1"]?@127.0.0.1[/EMAIL]) [INFO] New connection from 127.0.0.1
Nov 11 11:00:03 debian pure-ftpd: ([EMAIL="?@127.0.0.1"]?@127.0.0.1[/EMAIL]) [INFO] Logout.
Nov 11 11:05:02 debian pure-ftpd: ([EMAIL="?@127.0.0.1"]?@127.0.0.1[/EMAIL]) [INFO] New connection from 127.0.0.1
Nov 11 11:05:02 debian pure-ftpd: ([EMAIL="?@127.0.0.1"]?@127.0.0.1[/EMAIL]) [INFO] Logout.
Nov 11 11:10:02 debian pure-ftpd: ([EMAIL="?@127.0.0.1"]?@127.0.0.1[/EMAIL]) [INFO] New connection from 127.0.0.1
Nov 11 11:25:02 debian pure-ftpd: ([EMAIL="?@127.0.0.1"]?@127.0.0.1[/EMAIL]) [INFO] Logout.
Nov 11 11:30:05 debian pure-ftpd: ([EMAIL="?@127.0.0.1"]?@127.0.0.1[/EMAIL]) [INFO] New connection from 127.0.0.1
Nov 11 11:30:05 debian pure-ftpd: ([EMAIL="?@127.0.0.1"]?@127.0.0.1[/EMAIL]) [INFO] Logout.
Nov 11 11:35:03 debian pure-ftpd: ([EMAIL="?@127.0.0.1"]?@127.0.0.1[/EMAIL]) [INFO] New connection from 127.0.0.1
Nov 11 11:35:03 debian pure-ftpd: ([EMAIL="?@127.0.0.1"]?@127.0.0.1[/EMAIL]) [INFO] Logout.
Nov 11 11:40:03 debian pure-ftpd: ([EMAIL="?@127.0.0.1"]?@127.0.0.1[/EMAIL]) [INFO] New connection from 127.0.0.1
Nov 11 11:40:03 debian pure-ftpd: ([EMAIL="?@127.0.0.1"]?@127.0.0.1[/EMAIL]) [INFO] Logout.
Nov 11 11:45:11 debian pure-ftpd: ([EMAIL="?@127.0.0.1"]?@127.0.0.1[/EMAIL]) [INFO] New connection from 127.0.0.1
Nov 11 11:45:11 debian pure-ftpd: ([EMAIL="?@127.0.0.1"]?@127.0.0.1[/EMAIL]) [INFO] Logout.
Nov 11 11:50:07 debian pure-ftpd: ([EMAIL="?@127.0.0.1"]?@127.0.0.1[/EMAIL]) [INFO] New connection from 127.0.0.1
Nov 11 11:50:07 debian pure-ftpd: ([EMAIL="?@127.0.0.1"]?@127.0.0.1[/EMAIL]) [INFO] Logout.
Nov 11 11:55:11 debian pure-ftpd: ([EMAIL="?@127.0.0.1"]?@127.0.0.1[/EMAIL]) [INFO] New connection from 127.0.0.1
Nov 11 11:55:11 debian pure-ftpd: ([EMAIL="?@127.0.0.1"]?@127.0.0.1[/EMAIL]) [INFO] Logout.
Nov 11 12:00:15 debian pure-ftpd: ([EMAIL="?@127.0.0.1"]?@127.0.0.1[/EMAIL]) [INFO] New connection from 127.0.0.1
Nov 11 12:00:15 debian pure-ftpd: ([EMAIL="?@127.0.0.1"]?@127.0.0.1[/EMAIL]) [INFO] Logout.
Nov 11 12:05:22 debian pure-ftpd: ([EMAIL="?@127.0.0.1"]?@127.0.0.1[/EMAIL]) [INFO] New connection from 127.0.0.1
Nov 11 12:05:22 debian pure-ftpd: ([EMAIL="?@127.0.0.1"]?@127.0.0.1[/EMAIL]) [INFO] Logout.
Nov 11 12:10:04 debian pure-ftpd: ([EMAIL="?@127.0.0.1"]?@127.0.0.1[/EMAIL]) [INFO] New connection from 127.0.0.1
Nov 11 12:10:04 debian pure-ftpd: ([EMAIL="?@127.0.0.1"]?@127.0.0.1[/EMAIL]) [INFO] Logout.
Woher kommen diese merkwürdigen pure-ftpd Infomeldungen? Vor allem localhost?

Weitere Logdateien und Configs reiche ich auf Anfrage gern nach. Interessanterweise finde ich auf die oben gepostete Beispielmail keine Einträge im mail.log dass an diese Adresse zuvor etwas heraus gesandt wurde. Allerdings tauchen einige SASL-Fehler auf, wonach jemand versucht sich zu athorisieren. Auch tauchen Mails auf, die angeblich mit authorisiertem Mailuser nach draussen schicken. Das Passwort habe ich vor 2 Tagen geändert, wie kann das sein?
 

techblaster

New Member
Nachtrag Logs

Log-Auszug syslog:
Code:
Nov 11 12:14:08 debian postfix/smtp[4495]: connect to mx.yandex.ru[77.88.21.89]:25: Connection refused
Nov 11 12:14:09 debian postfix/smtp[4533]: connect to mx.yandex.ru[77.88.21.89]:25: Connection refused
Nov 11 12:14:09 debian postfix/smtp[4540]: connect to mail.global.frontbridge.com[207.46.163.30]:25: Connection refused
Nov 11 12:14:10 debian postfix/smtp[4555]: connect to mx2.spaceweb.ru[77.222.41.41]:25: Connection refused
Nov 11 12:14:10 debian postfix/smtp[4555]: 040F114E141: to=<[EMAIL="tudevllu@gaz-opt.com"]tudevllu@gaz-opt.com[/EMAIL]>, relay=none, delay=50734, delays=50723/2.3/9.1/0, dsn=4.4.1, status=deferred (connect to mx2.spaceweb.ru[77.222.41.41]:25: Connection refused)
Nov 11 12:14:11 debian postfix/smtp[4495]: connect to mx.yandex.ru[87.250.250.89]:25: Connection refused
Nov 11 12:14:12 debian postfix/smtp[4533]: connect to mx.yandex.ru[93.158.134.89]:25: Connection refused
Nov 11 12:14:12 debian postfix/smtp[4540]: connect to mail.global.frontbridge.com[213.199.154.190]:25: Connection refused
Nov 11 12:14:14 debian postfix/smtp[4495]: connect to mx.yandex.ru[213.180.193.89]:25: Connection refused
Nov 11 12:14:14 debian postfix/smtp[4495]: E3C5214E4A2: to=<[EMAIL="ieull@yandex.com"]ieull@yandex.com[/EMAIL]>, relay=none, delay=34068, delays=34052/0.63/15/0, dsn=4.4.1, status=deferred (connect to mx.yandex.ru[213.180.193.89]:25: Connection refused)
Nov 11 12:14:15 debian postfix/smtp[4533]: connect to mx.yandex.ru[87.250.250.89]:25: Connection refused
Nov 11 12:14:15 debian postfix/smtp[4533]: 87F2C14E526: to=<[EMAIL="pgohio@yandex.com"]pgohio@yandex.com[/EMAIL]>, relay=none, delay=29813, delays=29796/1.7/15/0, dsn=4.4.1, status=deferred (connect to mx.yandex.ru[87.250.250.89]:25: Connection refused)
Nov 11 12:14:15 debian postfix/smtp[4540]: connect to mail.global.frontbridge.com[65.55.88.22]:25: Connection refused
Nov 11 12:14:15 debian postfix/smtp[4540]: C842614E122: to=<[EMAIL="otzxkpi@nextmail.com"]otzxkpi@nextmail.com[/EMAIL]>, relay=none, delay=50796, delays=50779/1.9/15/0, dsn=4.4.1, status=deferred (connect to mail.global.frontbridge.com[65.55.88.22]:25: Connection refused)
Nov 11 12:15:01 debian /USR/SBIN/CRON[4623]: (root) CMD (rm /var/www/clients/client1/web1/web/monitor/* -R && cp /tmp/munin/* -R /var/www/clients/client1/web1/web/monitor)
Nov 11 12:15:01 debian /USR/SBIN/CRON[4624]: (getmail) CMD (/usr/local/bin/run-getmail.sh > /dev/null 2>> /dev/null)
Nov 11 12:15:01 debian /USR/SBIN/CRON[4625]: (root) CMD (/usr/bin/php /var/www/clients/client1/web1/web/support/api/cron.php)
Nov 11 12:15:01 debian /USR/SBIN/CRON[4626]: (root) CMD (/usr/local/ispconfig/server/server.sh 2>&1 > /dev/null | while read line; do echo `/bin/date` "$line" >> /var/log/ispconfig/cron.log; done)
Nov 11 12:15:01 debian /USR/SBIN/CRON[4627]: (root) CMD (if [ -x /etc/munin/plugins/apt_all ]; then /etc/munin/plugins/apt_all update 7200 12 >/dev/null; elif [ -x /etc/munin/plugins/apt ]; then /etc/munin/plugins/apt update 7200 12 >/dev/null; fi)
Nov 11 12:15:01 debian /USR/SBIN/CRON[4621]: (CRON) error (grandchild #4623 failed with exit status 1)
Nov 11 12:15:04 debian postfix/pickup[3795]: 50BBB2FC001: uid=0 from=<root>
Nov 11 12:15:04 debian postfix/cleanup[4648]: 50BBB2FC001: message-id=<[EMAIL="20131111111504.50BBB2FC001@computer-internet.net"]20131111111504.50BBB2FC001@computer-internet.net[/EMAIL]>
Nov 11 12:15:04 debian postfix/qmgr[20339]: 50BBB2FC001: from=<[EMAIL="root@debian.local"]root@debian.local[/EMAIL]>, size=724, nrcpt=1 (queue active)
Nov 11 12:15:12 debian pure-ftpd: ([EMAIL="?@127.0.0.1"]?@127.0.0.1[/EMAIL]) [INFO] New connection from 127.0.0.1
Nov 11 12:15:13 debian pure-ftpd: ([EMAIL="?@127.0.0.1"]?@127.0.0.1[/EMAIL]) [INFO] Logout.
Nov 11 12:15:14 debian postfix/smtpd[4695]: connect from localhost[127.0.0.1]
Nov 11 12:15:14 debian postfix/smtpd[4695]: 67BD62FC002: client=localhost[127.0.0.1]
Nov 11 12:15:14 debian postfix/cleanup[4648]: 67BD62FC002: message-id=<[EMAIL="20131111111504.50BBB2FC001@computer-internet.net"]20131111111504.50BBB2FC001@computer-internet.net[/EMAIL]>
Nov 11 12:15:14 debian postfix/qmgr[20339]: 67BD62FC002: from=<[EMAIL="root@debian.local"]root@debian.local[/EMAIL]>, size=1169, nrcpt=1 (queue active)
Nov 11 12:15:14 debian amavis[4184]: (04184-01) Passed CLEAN, <[EMAIL="root@debian.local"]root@debian.local[/EMAIL]> -> <[EMAIL="root@debian.local"]root@debian.local[/EMAIL]>, Message-ID: <[EMAIL="20131111111504.50BBB2FC001@computer-internet.net"]20131111111504.50BBB2FC001@computer-internet.net[/EMAIL]>, mail_id: JtJRlo5hfqEl, Hits: -1, size: 723, queued_as: 67BD62FC002, 10255 ms
Nov 11 12:15:14 debian postfix/smtp[4650]: 50BBB2FC001: to=<[EMAIL="root@debian.local"]root@debian.local[/EMAIL]>, orig_to=<root>, relay=127.0.0.1[127.0.0.1]:10024, delay=13, delays=2.1/0.03/0.75/9.6, dsn=2.0.0, status=sent (250 2.0.0 Ok, id=04184-01, from MTA([127.0.0.1]:10025): 250 2.0.0 Ok: queued as 67BD62FC002)
Nov 11 12:15:14 debian postfix/qmgr[20339]: 50BBB2FC001: removed
Nov 11 12:15:14 debian postfix/local[4696]: 67BD62FC002: to=<[EMAIL="user@debian.local"]user@debian.local[/EMAIL]>, orig_to=<[EMAIL="root@debian.local"]root@debian.local[/EMAIL]>, relay=local, delay=0.38, delays=0.2/0.04/0/0.14, dsn=2.0.0, status=sent (delivered to command: procmail -a "$EXTENSION")
Nov 11 12:15:14 debian postfix/qmgr[20339]: 67BD62FC002: removed
Nov 11 12:15:15 debian pop3d: Connection, ip=[::ffff:127.0.0.1]
Nov 11 12:15:15 debian pop3d: Disconnected, ip=[::ffff:127.0.0.1]
Nov 11 12:15:15 debian imapd: Connection, ip=[::ffff:127.0.0.1]
Nov 11 12:15:15 debian imapd: Disconnected, ip=[::ffff:127.0.0.1], time=0
Nov 11 12:16:01 debian /USR/SBIN/CRON[4723]: (root) CMD (/usr/local/ispconfig/server/server.sh 2>&1 > /dev/null | while read line; do echo `/bin/date` "$line" >> /var/log/ispconfig/cron.log; done)

Log-Auszug mail.info:
Code:
Nov 11 12:09:01 debian postfix/smtp[4228]: connect to mx1.mailman.com[10.42.23.11]:25: Connection refused
Nov 11 12:09:01 debian postfix/smtp[4228]: D3F0D14E5B2: to=<[EMAIL="v@mailman.com"]v@mailman.com[/EMAIL]>, relay=none, delay=25610, delays=25607/0.11/3/0, dsn=4.4.1, status=deferred (connect to mx1.mailman.com[10.42.23.11]:25: Connect
ion refused)
Nov 11 12:09:02 debian postfix/smtp[4231]: connect to mail.kumir-restaurant.com[217.199.218.198]:25: Connection refused
Nov 11 12:09:02 debian postfix/smtp[4231]: 3A63A14E51C: to=<[EMAIL="ai@kumir-restaurant.com"]ai@kumir-restaurant.com[/EMAIL]>, relay=none, delay=29943, delays=29940/0.07/3/0, dsn=4.4.1, status=deferred (connect to mail.kumir-restaurant.com[217.
199.218.198]:25: Connection refused)
Nov 11 12:09:02 debian postfix/smtp[4230]: connect to mail2.namebrightmail.com[216.38.192.136]:25: Connection refused
Nov 11 12:09:02 debian postfix/smtp[4230]: DAE1514E5B4: to=<[EMAIL="d@raflondon.com"]d@raflondon.com[/EMAIL]>, relay=none, delay=25595, delays=25592/0.03/3.1/0, dsn=4.4.1, status=deferred (connect to mail2.namebrightmail.com[216.38.192.
136]:25: Connection refused)
Nov 11 12:09:02 debian postfix/smtp[4234]: connect to mx01.gmx.com[74.208.5.27]:25: Connection refused
Nov 11 12:09:02 debian postfix/smtp[4235]: connect to gmxmail.com[82.98.86.167]:25: Connection refused
Nov 11 12:09:02 debian postfix/smtp[4235]: 3B02114E64E: to=<[EMAIL="p@gmxmail.com"]p@gmxmail.com[/EMAIL]>, relay=none, delay=21327, delays=21324/0.14/3/0, dsn=4.4.1, status=deferred (connect to gmxmail.com[82.98.86.167]:25: Connection
 refused)
Nov 11 12:09:02 debian postfix/smtp[4236]: connect to mx00.gmx.com[74.208.5.4]:25: Connection refused
Nov 11 12:09:02 debian postfix/smtp[4232]: connect to mgromoboi.com[69.43.161.176]:25: Connection refused
Nov 11 12:09:02 debian postfix/smtp[4232]: 3A36D14E51D: to=<[EMAIL="sgf@mgromoboi.com"]sgf@mgromoboi.com[/EMAIL]>, relay=none, delay=29950, delays=29947/0.1/3.2/0, dsn=4.4.1, status=deferred (connect to mgromoboi.com[69.43.161.176]:25: Co
nnection refused)
Nov 11 12:09:02 debian postfix/smtp[4237]: connect to mailmail.com[208.87.35.103]:25: Connection refused
Nov 11 12:09:02 debian postfix/smtp[4238]: connect to malivermedmal.com[208.73.211.249]:25: Connection refused
Nov 11 12:09:02 debian postfix/smtp[4237]: 7CE9A14E63D: to=<[EMAIL="ixwfswnf@mailmail.com"]ixwfswnf@mailmail.com[/EMAIL]>, relay=none, delay=21587, delays=21584/0.07/3/0, dsn=4.4.1, status=deferred (connect to mailmail.com[208.87.35.103]:25:
Connection refused)
Nov 11 12:09:02 debian postfix/smtp[4238]: 7D2E214E650: to=<[EMAIL="dwrhyi@malivermedmal.com"]dwrhyi@malivermedmal.com[/EMAIL]>, relay=none, delay=21307, delays=21304/0.06/3/0, dsn=4.4.1, status=deferred (connect to malivermedmal.com[208.73.211.
249]:25: Connection refused)
Nov 11 12:09:02 debian postfix/smtp[4239]: connect to gopsoft.net[78.138.127.204]:25: Connection refused
Nov 11 12:09:02 debian postfix/smtp[4239]: 78DC414E5B0: to=<[EMAIL="mrulv@gopsoft.net"]mrulv@gopsoft.net[/EMAIL]>, relay=none, delay=25640, delays=25637/0.09/3/0, dsn=4.4.1, status=deferred (connect to gopsoft.net[78.138.127.204]:25: Conn
ection refused)
Nov 11 12:09:02 debian postfix/smtp[4240]: connect to gmxmail.com[82.98.86.167]:25: Connection refused
Nov 11 12:09:02 debian postfix/smtp[4241]: connect to p.nsm.ctmail.com[216.163.188.57]:25: Connection refused
Nov 11 12:09:02 debian postfix/smtp[4240]: 7C74614E63E: to=<[EMAIL="xtk@gmxmail.com"]xtk@gmxmail.com[/EMAIL]>, relay=none, delay=21588, delays=21585/0.08/3/0, dsn=4.4.1, status=deferred (connect to gmxmail.com[82.98.86.167]:25: Connecti
on refused)
 

techblaster

New Member
Postfix Konfig

/etc/postfix/main.cf
Code:
# See /usr/share/postfix/main.cf.dist for a commented, more complete version
# Debian specific: Specifying a file name will cause the first
# line of that file to be used as the name. The Debian default
# is /etc/mailname.
#myorigin = /etc/mailname
smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
biff = no
# appending .domain is the MUA's job.
append_dot_mydomain = no
# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h
readme_directory = /usr/share/doc/postfix
# TLS parameters
smtpd_tls_cert_file = /etc/postfix/smtpd.cert
smtpd_tls_key_file = /etc/postfix/smtpd.key
smtpd_use_tls = yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.
myhostname = computer-internet.net 
alias_maps = hash:/etc/aliases, hash:/var/lib/mailman/data/aliases
alias_database = hash:/etc/aliases, hash:/var/lib/mailman/data/aliases
myorigin = /etc/mailname
mydestination = debian.local, localhost, localhost.localdomain
relayhost = 
mynetworks = 127.0.0.0/8 [::1]/128
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
html_directory = /usr/share/doc/postfix/html
virtual_alias_domains = 
virtual_alias_maps = proxy:mysql:/etc/postfix/mysql-virtual_forwardings.cf, proxy:mysql:/etc/postfix/mysql-virtual_email2email.cf, hash:/var/lib/mailman/data/virtual-mailman
virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql-virtual_domains.cf
virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailboxes.cf
virtual_mailbox_base = /var/vmail
virtual_uid_maps = static:5000
virtual_gid_maps = static:5000
smtpd_sasl_auth_enable = yes
broken_sasl_auth_clients = yes
smtpd_sasl_authenticated_header = yes
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, check_recipient_access mysql:/etc/postfix/mysql-virtual_recipient.cf, reject_unauth_destination
smtpd_tls_security_level = may
transport_maps = hash:/var/lib/mailman/data/transport-mailman, proxy:mysql:/etc/postfix/mysql-virtual_transports.cf
relay_domains = mysql:/etc/postfix/mysql-virtual_relaydomains.cf
relay_recipient_maps = mysql:/etc/postfix/mysql-virtual_relayrecipientmaps.cf
proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks $virtual_mailbox_limit_maps
smtpd_sender_restrictions = check_sender_access mysql:/etc/postfix/mysql-virtual_sender.cf
smtpd_client_restrictions = check_client_access mysql:/etc/postfix/mysql-virtual_client.cf
smtpd_client_message_rate_limit = 100
maildrop_destination_concurrency_limit = 1
maildrop_destination_recipient_limit = 1
virtual_transport = maildrop
header_checks = regexp:/etc/postfix/header_checks
mime_header_checks = regexp:/etc/postfix/mime_header_checks
nested_header_checks = regexp:/etc/postfix/nested_header_checks
body_checks = regexp:/etc/postfix/body_checks
owner_request_special = no
content_filter = amavis:[127.0.0.1]:10024
receive_override_options = no_address_mappings
inet_protocols = all
message_size_limit = 0
#smtpd_sender_restrictions = permit_mynetworks, check_sender_access hash:/etc/postfix/sender_domains, reject_non_fqdn_sender, reject_unknown_sender_domain, reject

/etc/postfix/master.cf
Code:
#
# Postfix master process configuration file. For details on the format
# of the file, see the master(5) manual page (command: "man 5 master").
#
# Do not forget to execute "postfix reload" after editing this file.
#
# ==========================================================================
# service type private unpriv chroot wakeup maxproc command + args
# (yes) (yes) (yes) (never) (100)
# ==========================================================================
smtp inet n - - - - smtpd
#submission inet n - - - - smtpd
# -o smtpd_tls_security_level=encrypt
# -o smtpd_sasl_auth_enable=yes
# -o smtpd_client_restrictions=permit_sasl_authenticated,reject
# -o milter_macro_daemon_name=ORIGINATING
#smtps inet n - - - - smtpd
# -o smtpd_tls_wrappermode=yes
# -o smtpd_sasl_auth_enable=yes
# -o smtpd_client_restrictions=permit_sasl_authenticated,reject
# -o milter_macro_daemon_name=ORIGINATING
#628 inet n - - - - qmqpd
pickup fifo n - - 60 1 pickup
cleanup unix n - - - 0 cleanup
qmgr fifo n - n 300 1 qmgr
#qmgr fifo n - - 300 1 oqmgr
tlsmgr unix - - - 1000? 1 tlsmgr
rewrite unix - - - - - trivial-rewrite
bounce unix - - - - 0 bounce
defer unix - - - - 0 bounce
trace unix - - - - 0 bounce
verify unix - - - - 1 verify
flush unix n - - 1000? 0 flush
proxymap unix - - n - - proxymap
proxywrite unix - - n - 1 proxymap
smtp unix - - - - - smtp
# When relaying mail as backup MX, disable fallback_relay to avoid MX loops
relay unix - - - - - smtp
-o smtp_fallback_relay=
# -o smtp_helo_timeout=5 -o smtp_connect_timeout=5
showq unix n - - - - showq
error unix - - - - - error
retry unix - - - - - error
discard unix - - - - - discard
local unix - n n - - local
virtual unix - n n - - virtual
lmtp unix - - - - - lmtp
anvil unix - - - - 1 anvil
scache unix - - - - 1 scache
#
# ====================================================================
# Interfaces to non-Postfix software. Be sure to examine the manual
# pages of the non-Postfix software to find out what options it wants.
#
# Many of the following services use the Postfix pipe(8) delivery
# agent. See the pipe(8) man page for information about ${recipient}
# and other message envelope options.
# ====================================================================
#
# maildrop. See the Postfix MAILDROP_README file for details.
# Also specify in main.cf: maildrop_destination_recipient_limit=1
#
maildrop unix - n n - - pipe
flags=DRhu user=vmail argv=/usr/bin/maildrop -d vmail ${extension} ${recipient} ${user} ${nexthop} ${sender}
#
# ====================================================================
#
# Recent Cyrus versions can use the existing "lmtp" master.cf entry.
#
# Specify in cyrus.conf:
# lmtp cmd="lmtpd -a" listen="localhost:lmtp" proto=tcp4
#
# Specify in main.cf one or more of the following:
# mailbox_transport = lmtp:inet:localhost
# virtual_transport = lmtp:inet:localhost
#
# ====================================================================
#
# Cyrus 2.1.5 (Amos Gouaux)
# Also specify in main.cf: cyrus_destination_recipient_limit=1
#
#cyrus unix - n n - - pipe
# user=cyrus argv=/cyrus/bin/deliver -e -r ${sender} -m ${extension} ${user}
#
# ====================================================================
# Old example of delivery via Cyrus.
#
#old-cyrus unix - n n - - pipe
# flags=R user=cyrus argv=/cyrus/bin/deliver -e -m ${extension} ${user}
#
# ====================================================================
#
# See the Postfix UUCP_README file for configuration details.
#
uucp unix - n n - - pipe
flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)
#
# Other external delivery methods.
#
ifmail unix - n n - - pipe
flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient)
bsmtp unix - n n - - pipe
flags=Fq. user=bsmtp argv=/usr/lib/bsmtp/bsmtp -t$nexthop -f$sender $recipient
scalemail-backend unix - n n - 2 pipe
flags=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store ${nexthop} ${user} ${extension}
mailman unix - n n - - pipe
flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py
${nexthop} ${user}
 
amavis unix - - - - 2 smtp
-o smtp_data_done_timeout=1200
-o smtp_send_xforward_command=yes
127.0.0.1:10025 inet n - - - - smtpd
-o content_filter=
-o local_recipient_maps=
-o relay_recipient_maps=
-o smtpd_restriction_classes=
-o smtpd_client_restrictions=
-o smtpd_helo_restrictions=
-o smtpd_sender_restrictions=
-o smtpd_recipient_restrictions=permit_mynetworks,reject
-o mynetworks=127.0.0.0/8
-o strict_rfc821_envelopes=yes
-o receive_override_options=no_unknown_recipient_checks,no_header_body_checks
-o smtpd_bind_address=127.0.0.1
 

Für Ideen und Ratschläge bin ich dankbar und offen :)
 

Till

Administrator
Da scheint eine Deine Webseiten gehackt worden zu sein und die versendet jetzt spam, mit der mailconfig hat es nichts zu tun.

Stell sicher dass Du alle Debian updates für squeeze eingespielt hast. Außerdem müssen alle Updates für verwendete cms systeme regelmäßig eingespielt werden und php modus für alle webseiten sollte php-fcgi oder php-fpm mit aktiviertem suexec sein.

Wenn Du die cms updates nicht einspielen akknst bzw. Deine Kunden sich nicht drum kümmern, dann installier apache mod_security und maldetect um den Server zu schützen.
 

Till

Administrator
Achso, eine Sache hatte ich übersehen. Es war ja eine Mail die Du als reverse bekommen hast, such bitte mal in der mailqueue eine original mail raus die deferred ist und poste deren Inhalt. Wenn es stimmt was ganz am Ende der ersten email steht, dannw ar es nicht eine webseite wie ich anhand der localhost header vermutet habe sondern ein gehacket mail account:

Unknown unknown [46.230.30.20] Authenticated sender:
ebay@computer-internet.net
ändere mal das Passwort dieses accounts und starte postfix, saslsuthd, courier-authdaemon und dovecot neu (nur das was von den genannten Programmen installiert ist natürlich). Dann sollte das Loch gestopft sein.

Umd sowas in Zukunft zu verhindern kannst Du oft nicht viel machen, denn es kann sein dass sich der user mit dem Account einen Trojaner eingefangen hat.

Was Dir bleibt is:

- smpt und imap / pop3 über tls abwickeln (smts ist in deriner postfix config nicht aktiv im Moment).
- ggf. policyd installieren um die anzahl der emails die ein user pro stunde versenden kann zu begrenzen.
 

techblaster

New Member
Da scheint eine Deine Webseiten gehackt worden zu sein und die versendet jetzt spam, mit der mailconfig hat es nichts zu tun.

Stell sicher dass Du alle Debian updates für squeeze eingespielt hast. Außerdem müssen alle Updates für verwendete cms systeme regelmäßig eingespielt werden und php modus für alle webseiten sollte php-fcgi oder php-fpm mit aktiviertem suexec sein.

Wenn Du die cms updates nicht einspielen akknst bzw. Deine Kunden sich nicht drum kümmern, dann installier apache mod_security und maldetect um den Server zu schützen.

Hallo Till,

vielen Dank für die umfangreichen Antworten. Beim Update des Debian hab ich derzeit auf genau diesem Server leider ein Problem, aus mir nicht ganz erklärlichen Gründen zieht der ein paar Pakete nicht so rein wie er soll, vielleicht hast Du hierzu einen Tipp?
Code:
root@debian:~# apt-get upgrade
Paketlisten werden gelesen... Fertig
Abhängigkeitsbaum wird aufgebaut
Statusinformationen werden eingelesen... Fertig
Die folgenden Pakete sind zurückgehalten worden:
  libapache2-mod-php5 php-pear php5 php5-cgi php5-cli php5-common php5-gd
  php5-imagick php5-imap php5-mcrypt php5-mysql
0 aktualisiert, 0 neu installiert, 0 zu entfernen und 11 nicht aktualisiert.
Mir ist leider nicht ganz klar, warum er auf diesem VHost die Pakete zurück hält, diese aber auf dem anderen VHost ganz normal installiert. Die Hosts sind beide identisch installiert mit denselben Konfigurationen.
Hierdurch entstehen natürlich ungewollt auch zusätzliche Sicherheitslücken durch veraltete Versionsstände. :(
 

techblaster

New Member
Achso, eine Sache hatte ich übersehen. Es war ja eine Mail die Du als reverse bekommen hast, such bitte mal in der mailqueue eine original mail raus die deferred ist und poste deren Inhalt. Wenn es stimmt was ganz am Ende der ersten email steht, dannw ar es nicht eine webseite wie ich anhand der localhost header vermutet habe sondern ein gehacket mail account:

Unknown unknown [46.230.30.20] Authenticated sender:
ebay@computer-internet.net
ändere mal das Passwort dieses accounts und starte postfix, saslsuthd, courier-authdaemon und dovecot neu (nur das was von den genannten Programmen installiert ist natürlich). Dann sollte das Loch gestopft sein.

Umd sowas in Zukunft zu verhindern kannst Du oft nicht viel machen, denn es kann sein dass sich der user mit dem Account einen Trojaner eingefangen hat.

Was Dir bleibt is:

- smpt und imap / pop3 über tls abwickeln (smts ist in deriner postfix config nicht aktiv im Moment).
- ggf. policyd installieren um die anzahl der emails die ein user pro stunde versenden kann zu begrenzen.

In der Mailqueue befinden sich derzeit über 700 Mails, alle mit Status "Connection refused" was sicher damit zu tun hat, daß ich den Port 25 nach ausgehend bis zur Klärung der Ursache vorsorglich dicht gemacht habe, so dass hier nichts mehr raus geht. Mails mit Status "deferred" tauchen hier leider keine auf. Es ist nicht nur dieses Mailkonto hiervon betroffen, insgesamt waren es 3-4 Mailaccounts die kompromittiert sind/waren. Hier habe ich allesamt neue Passwörter vergeben, allerdings nicht alle von Dir genannten Dienste neu durchgestartet. Ich ging vermutlich fälschlicherweise davon aus, daß die im ISPConfig Panel gesetzten Passwörter direkt greifen?
Was ich auch schon bedacht und versucht habe ist eine Filterregel zu erstellen nach der ich nur Nachrichten versende, wo auch die passenden Absender-Domains im VHost existieren, bin dann jedoch auf das Problem gestossen, daß eingehende Mails von anderen Domains nicht mehr angenommen werden, da die Regel anscheinend sowohl intern als auch extern greift. (Postfix-Regel)
Hast Du hier vielleicht eine Idee oder findest Du den Ansatz umsetzbar?

Viele Grüße
 

techblaster

New Member
Ich hab mal mit pflogsumm einen Bericht generiert wie es im Moment ausschaut:
Code:
Grand Totals
------------
messages
8065 received
4864 delivered
0 forwarded
4139 deferred (61847 deferrals)
1484 bounced
0 rejected (0%)
0 reject warnings
0 held
0 discarded (0%)
202722k bytes received
188128k bytes delivered
3291 senders
77 sending hosts/domains
3509 recipients
381 recipient hosts/domains
 
Per-Day Traffic Summary
date received delivered deferred bounced rejected
--------------------------------------------------------------------
Nov 10 2013 5055 2930 38558 1149 
Nov 11 2013 2734 1658 15858 335 
Nov 12 2013 276 276 7431 
Per-Hour Traffic Daily Average
time received delivered deferred bounced rejected
--------------------------------------------------------------------
0000-0100 19 19 255 0 0 
0100-0200 55 36 262 7 0 
0200-0300 135 74 402 18 0 
0300-0400 123 70 437 17 0 
0400-0500 142 79 493 20 0 
0500-0600 141 79 523 21 0 
0600-0700 149 86 644 18 0 
0700-0800 90 57 1336 14 0 
0800-0900 24 25 1241 1 0 
0900-1000 24 25 1241 1 0 
1000-1100 25 25 1221 0 0 
1100-1200 18 18 846 0 0 
1200-1300 71 46 568 15 0 
1300-1400 77 52 1055 15 0 
1400-1500 214 123 1128 54 0 
1500-1600 287 161 1311 65 0 
1600-1700 156 92 1202 37 0 
1700-1800 172 100 1269 35 0 
1800-1900 187 109 1139 45 0 
1900-2000 174 100 854 35 0 
2000-2100 169 100 1345 37 0 
2100-2200 151 89 1276 30 0 
2200-2300 70 43 320 8 0 
2300-2400 16 16 249 0 0
 

Till

Administrator
Schau mal hier:

FS#1637 : Restrict MailFrom only from available mailboxes or aliases

Du kannst ansonsten auch sowas in der main.cf probieren:

smtpd_sender_restrictions =
check_sender_access hash:/etc/postfix/acl_unknown_permited
reject_unlisted_sender

Ich denke aber dass Du bei beiden Methoden probleme mit emails bekommen wirst die per php versendet werden, da es dafür keine absenderkonten gibt. Du müssstest also ggf. alles von localhost ausnehmen.
 

techblaster

New Member
700 Mails in der mailqueue ist noch überschaubar, ich hatte vor ein paar Tagen ein System bei einem Kunden mit über einer halben Million Spam Mails in der queue.

Schau mal hier für scripte zum löschend er mailqueue:

Manage the postfix mailqueue with postsuper, postqueue und mailq « FAQforge

Achtung, wordpress zerhaut die Anführungszeichen, also alle doppelten Anführungszeichen in den scripte kontrollieren und durch " ersetzen.

Was über eine halbe Million??? :eek:
Da hätte unser Provider im Rechenzentrum uns sicher schon den Hahn abgedreht... :D:p
Danke für die Info für das managen der mailqueue, das hab ich mir inzwischen schon angeeignet, quasi schon in Fleisch und Blut übergegangen ;)
 

techblaster

New Member
Schau mal hier:

FS#1637 : Restrict MailFrom only from available mailboxes or aliases

Du kannst ansonsten auch sowas in der main.cf probieren:

smtpd_sender_restrictions =
check_sender_access hash:/etc/postfix/acl_unknown_permited
reject_unlisted_sender

Ich denke aber dass Du bei beiden Methoden probleme mit emails bekommen wirst die per php versendet werden, da es dafür keine absenderkonten gibt. Du müssstest also ggf. alles von localhost ausnehmen.

Den Link schau ich mir nochmal genauer an, genau so etwas hab ich versucht umzusetzen Till. Die Idee war ja nämlich einfach sämtlichen Verkehr zu unterbinden der mit falscher, also gespoofter Absenderadresse raus mailt. Leider hatte ich dann immer das Problem, daß meine Regel auf den eingehenden Verkehr auch einwirkte und "sender" dann eben quasi der Absender der eingehenden Nachricht ist und diese infolge abgelehnt wurde. (ungewolltes Verhalten)
 

techblaster

New Member
Maldetect habe ich mal installiert und rennen lassen, leider keine Treffer, obwohl mich mein Browser anmeckert und mein Virenscanner sofort verschiedene Webseiten blockiert:
Code:
Linux Malware Detect v1.4.2
            (C) 2002-2013, R-fx Networks <[EMAIL="proj@r-fx.org"]proj@r-fx.org[/EMAIL]>
            (C) 2013, Ryan MacDonald <[EMAIL="ryan@r-fx.org"]ryan@r-fx.org[/EMAIL]>
inotifywait (C) 2007, Rohan McGovern <[EMAIL="rohan@mcgovern.id.au"]rohan@mcgovern.id.au[/EMAIL]>
This program may be freely redistributed under the terms of the GNU GPL v2
maldet(6029): {scan} signatures loaded: 11337 (9465 MD5 / 1872 HEX)
maldet(6029): {scan} building file list for /var/www, this might take awhile...
maldet(6029): {scan} file list completed, found 8009 files...
maldet(6029): {scan} found ClamAV clamscan binary, using as scanner engine...
maldet(6029): {scan} scan of /var/www (8009 files) in progress...
maldet(6029): {scan} scan completed on /var/www: files 8009, malware hits 0, cleaned hits 0
maldet(6029): {scan} scan report saved, to view run: maldet --report 111213-1206.6029
Schade, aber war natürlich ein guter Versuch. :)
 

Werbung

Top