最近我们成了一次简单网络钓鱼的受害者。虽然简单,但对一些用户来说却很可怕,我不知道如何阻止这种行为。
入侵者通过 telnet 连接到我们的邮件服务器,并从本地地址向同一地址发送钓鱼邮件。似乎中继对本地连接开放,我找不到在哪里禁用它或至少要求身份验证。
他们这样做的方式很简单
telnet server 25
helo domain
MAIL FROM: <mail@domain>
RCPT TO: <mail@domain>
data
mail content
,
完成后,邮件内容将被发送到同一地址。
我尝试使用以下设置:
smtp_sender_restrictions = permit_mynetworks permit_sasl_authenticated check_sender_access
但我仍然可以重现此错误。服务器正在运行 postfix 并具有 DKIM、SPF 和 DMARC。
我没什么主意了,也看到了这篇文章,我也尝试了这些设置,但仍然没有成功。
编辑
在 Shunz 先生的评论之后。以下内容进行了更改
smtp_sender_restrictions
->smtpd_sender_restrictions
例如,我无法从 gmail 接收邮件,因此我恢复了这些更改。此外,正如 Shunz 先生所问,这是我的 main.cf
主文件:
smtpd_banner = reverseIP.
biff = no
append_dot_mydomain = no
alias_maps = hash:/etc/aliases, hash:/var/lib/mailman/data/aliases
alias_database = hash:/etc/aliases, hash:/var/lib/mailman/data/aliases
mydestination = mail.domain, localhost, localhost.localdomain
relayhost =
mynetworks = 127.0.0.0/8 [::1]/128
inet_interfaces = all
recipient_delimiter = +
strict_rfc821_envelopes = yes
smtpd_data_restrictions = reject_unauth_pipelining
smtpd_delay_reject = yes
policy-spf_time_limit = 3600s
postscreen_greet_action = enforce
readme_directory = /usr/share/doc/postfix
html_directory = /usr/share/doc/postfix/html
virtual_alias_domains =
virtual_alias_maps = hash:/var/lib/mailman/data/virtual-mailman, proxy:mysql:/etc/postfix/mysql-virtual_forwardings.cf, proxy:mysql:/etc/postfix/mysql-virtual_email2email.cf
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 = mysql:/etc/postfix/mysql-virtual_uids.cf
virtual_gid_maps = mysql:/etc/postfix/mysql-virtual_gids.cf
sender_bcc_maps = proxy:mysql:/etc/postfix/mysql-virtual_outgoing_bcc.cf
inet_protocols = all
smtpd_sasl_auth_enable = yes
broken_sasl_auth_clients = yes
smtpd_sasl_authenticated_header = yes
smtpd_restriction_classes = greylisting
greylisting = check_policy_service inet:127.0.0.1:10023
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unknown_recipient_domain, reject_unauth_destination, check_recipient_access mysql:/etc/postfix/mysql-virtual_recipient.cf, che$
smtpd_use_tls = yes
smtpd_tls_security_level = may
smtpd_tls_cert_file = /etc/postfix/smtpd.cert
smtpd_tls_key_file = /etc/postfix/smtpd.key
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
smtpd_sender_login_maps = proxy:mysql:/etc/postfix/mysql-virtual_sender_login_maps.cf
proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $sender_bcc_maps $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_$
smtpd_helo_required = yes
smtpd_helo_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_non_fqdn_helo_hostname, reject_invalid_helo_hostname
smtpd_sender_restrictions = check_sender_access regexp:/etc/postfix/tag_as_originating.re , permit_mynetworks ,inline:{ student@domain=reject_unauth_destination }, permit_sasl_authenticated, check_sende$
smtpd_client_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unknown_client_hostname, check_client_access mysql:/etc/postfix/mysql-virtual_client.cf, reject_rbl_client cbl.abuseat.org, rej$
smtpd_client_message_rate_limit = 100
maildrop_destination_concurrency_limit = 1
maildrop_destination_recipient_limit = 1
virtual_transport = dovecot
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
smtp_tls_security_level = may
smtpd_tls_mandatory_protocols = !SSLv2, !SSLv3
smtpd_tls_protocols = !SSLv2,!SSLv3
smtp_tls_protocols = !SSLv2,!SSLv3
smtpd_tls_exclude_ciphers = RC4, aNULL
smtp_tls_exclude_ciphers = RC4, aNULL
myhostname = mail.domain
dovecot_destination_recipient_limit = 1
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
content_filter = amavis:[127.0.0.1]:10024
receive_override_options = no_address_mappings
mailbox_size_limit = 0
message_size_limit = 0
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated reject_unauth_destination
答案1
在服务器故障网站上搜索一番后,答案解决了。使用的方法是此答案中的第三个方法: https://serverfault.com/a/689940/439892
现在,如果我通过 telnet 尝试相同的步骤,我会收到以下消息:
553 5.7.1 <mail@domain>: Sender address rejected: not logged in
这正是我所寻找的。如果我的问题不够具体,请见谅。