Answer the question
In order to leave comments, you need to log in
How to find out what initiates postfix mail sending?
The server has been infected with a virus(s), video, Malware. There is E-mail spam from my server. It seems that he deleted all the left files and codes, but the outgoing queue is still filled.
Answer the question
In order to leave comments, you need to log in
I drank it in detail here
https://klondike-studio.ru/blog/kak-opredelit-kako...
don't forget to mark it as solved.
How to look for a spammer - told. Now one of the options for being proactive is to prevent spam as a result of a hack.
In iptables, we prohibit outgoing TCP connections to any external port 25 from accounts other than postfix, root, mail.
As a result, the web server cannot send mail directly.
We write all violators to the log before reject. We are constantly monitoring the log. The appearance of a mass of entries indicates an attempt to establish external connections on port 25.
-A OUTPUT -o br0 -p tcp -m state --state ESTABLISHED,RELATED -j ACCEPT
-A OUTPUT -o br0 -m state --state NEW -p tcp -m tcp --dport 25 -j SMTPOUT
-A SMTPOUT -d 127.0.0.1 -j ACCEPT
-A SMTPOUT -m owner --gid-owner mail -j ACCEPT
-A SMTPOUT -m owner --uid-owner root -j ACCEPT
-A SMTPOUT -m owner --uid-owner smfs -j ACCEPT
-A SMTPOUT -j LOG --log-uid --log-prefix "Reject outgoing SMTP " # Houston, we have a problem
-A SMTPOUT -j REJECT --reject-with icmp-admin-prohibited
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question