Score:0

วิธีป้องกันการส่งต่อจดหมายโดยไม่ได้รับอนุญาตใน Postfix

ธง ru
adm

ดูเหมือนว่าเมลเซิร์ฟเวอร์ของเราถูกใช้เพื่อส่งสแปม

  • ผู้ส่งอีเมลเป็นบัญชีจริงปลอมบนเซิร์ฟเวอร์ของเรา
  • ไม่มีอีเมลในประวัติการส่งสำหรับบัญชีนั้น

อยากทราบว่ามีวิธีป้องกันไหมครับ คำแนะนำใด ๆ ยินดีต้อนรับ

บันทึกการแก้ไขภายหลัง:

9 พฤษภาคม 22:12:21 mx postfix/submission/smtpd[1885206]: คำเตือน: ชื่อโฮสต์ 201-91-101-26.customer.tdatabrasil.net.br ไม่สามารถแก้ไขที่อยู่ 201.91.101.26: ไม่ทราบชื่อหรือบริการ
9 พฤษภาคม 22:12:21 mx postfix/submission/smtpd[1885206]: เชื่อมต่อจากที่ไม่รู้จัก[201.91.101.26]
9 พฤษภาคม 22:12:27 mx postfix/submission/smtpd[1885206]: การเชื่อมต่อ TLS ที่ไม่ระบุตัวตนสร้างขึ้นจากที่ไม่รู้จัก [201.91.101.26]: TLSv1.3 พร้อมรหัส TLS_AES_256_GCM_SHA384 (256/256 บิต) การแลกเปลี่ยนคีย์ X25519 ลายเซ็นเซิร์ฟเวอร์ ECDSA ( P-256) SHA256 ที่ย่อยโดยเซิร์ฟเวอร์
9 พฤษภาคม 22:12:29 mx postfix/submission/smtpd[1885206]: 984BB13B35D: client=unknown[201.91.101.26], sasl_method=PLAIN, [email protected]
9 พฤษภาคม 22:12:31 mx postfix/sender-cleanup/cleanup[1892316]: 984BB13B35D: แทนที่: ส่วนหัว MIME-เวอร์ชัน: 1.0 จากที่ไม่รู้จัก[201.91.101.26]; from=<[email protected]> to=<****@yahoo.com.br> proto=ESMTP helo=<EHZDDZCUEY0FN7B75U0HKZOH1JP2P2UI>: Mime-Version: 1.0
9 พฤษภาคม 22:12:32 mx postfix/qmgr[944]: 984BB13B35D: from=<[email protected]>, size=18836, nrcpt=1 (คิวทำงานอยู่)
9 พฤษภาคม 22:12:32 mx postfix/smtp[1892491]: 984BB13B35D: to=<****@yahoo.com.br>, relay=smtp.****.****.com[192. ***.***.***]:587, ดีเลย์=3.9, ดีเลย์=3.6/0.01/0.13/0.13, dsn=2.0.0, สถานะ=ส่งแล้ว (250 ตกลง)
9 พฤษภาคม 22:12:32 mx postfix/qmgr[944]: 984BB13B35D: ลบออก
9 พฤษภาคม 22:12:35 mx postfix/submission/smtpd[1885206]: E344C13B35D: client=unknown[201.91.101.26], sasl_method=PLAIN, [email protected]
# postconf -n
alias_database = แฮช:/etc/aliases
alias_maps = แฮช:/etc/aliases
allow_min_user = ใช่
anvil_rate_time_unit = 60 วินาที
append_dot_mydomain = ไม่
บิฟ = ไม่
bounce_queue_lifetime = 7200 วินาที
ความเข้ากันได้_ระดับ = 2
default_process_limit = 5,000
ปิดการใช้งาน_vrfy_command = ใช่
header_checks = pcre:/etc/postfix/maps/header_checks.pcre
inet_interfaces = ทั้งหมด
inet_protocols = ipv4
mailbox_size_limit = 20000000000
maximal_backoff_time = 7200 วินาที
maximal_queue_lifetime = 7200 วินาที
message_size_limit = 52428800
milter_default_action = ยอมรับ
milter_mail_macros = ฉัน {mail_addr} {client_addr} {client_name} {auth_authen}
milter_protocol=6
minimal_backoff_time = 1600 วินาที
mydestination = $myhostname, localhost.$mydomain, localhost
มายโดเมน = my-domain.net
ชื่อโฮสต์ของฉัน = mx.my-domain.net
mynetworks = 127.0.0.0/8 [::1]/128 [fe80::]/64 192.168.18.0/24 10.102.0.0/16 172.18.0.0/16 10.102.0.0/16
non_smtpd_milters = ไอเน็ต:127.0.0.1:11332
นโยบาย spf_time_limit = 3600
postscreen_bare_newline_action = บังคับใช้
postscreen_dnsbl_action = บังคับใช้
postscreen_dnsbl_sites = zen.spamhaus.org*3 bl.mailspike.net b.barracudacentral.org*2 bl.spameatingmonkey.net dnsbl.sorbs.net psbl.surriel.com list.dnswl.org=127.0[0..255] .0*-2 list.dnswl.org=127.0.[0..255].1*-3 list.dnswl.org=127.0.[0..255].[2..3]*-4
postscreen_dnsbl_threshold = 3
postscreen_dnsbl_whitelist_threshold = -1
postscreen_greet_action = บังคับใช้
คิว_รัน_ดีเลย์ = 200 วินาที
readme_directory = ไม่
ผู้รับ_ตัวคั่น = +
รีเลย์โฮสต์ = [smtp.****.****.com]:587
sender_dependent_relayhost_maps = texthash:/etc/postfix/relayhost_map
smtp_destination_concurrency_limit = 10
smtp_discard_ehlo_keywords = ขนาด
smtp_header_checks = pcre:/etc/postfix/maps/sender_header_filter.pcre
smtp_initial_destination_concurrency = 2
smtp_sasl_auth_enable = ใช่
smtp_sasl_password_maps = texthash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = ไม่ระบุตัวตน
smtp_sender_dependent_authentication = ใช่
smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt
smtp_tls_CApath = /etc/ssl/certs
smtp_tls_loglevel = 1
smtp_tls_note_starttls_offer = ใช่
smtp_tls_protocols = !SSLv2, !SSLv3, !TLSv1, !TLSv1.1
smtp_tls_security_level = พฤษภาคม
smtp_use_tls = ใช่
smtpd_banner = $myhostname ESMTP
smtpd_client_message_rate_limit = 100
smtpd_client_restrictions = permit_mynetworks, permit_sasl_authenticated, check_client_access hash:/etc/postfix/client_access.map, cancel_unknown_reverse_client_hostname
smtpd_delay_reject = ใช่
smtpd_error_sleep_time = 1 วินาที
smtpd_hard_error_limit = 20
smtpd_helo_required = ใช่
smtpd_helo_restrictions = check_helo_access pcre:/etc/postfix/helo_access.map อนุญาต_mynetworks อนุญาต_sasl_authenticated ปฏิเสธ_invalid_helo_hostname ปฏิเสธ_non_fqdn_helo_hostname ปฏิเสธ_unknown_helo_hostname
smtpd_milters = inet:127.0.0.1:11332
smtpd_recipient_restrictions = permit_sasl_authenticated, permit_mynetworks,reject_unauth_destination,check_policy_service unix:private/policyd-spf, cancel_unauth_pipelining,reject_invalid_helo_hostname,reject_non_fqdn_helo_hostname,reject_unknown_recipient_domain,check_policy_service inet:zenr.blocalhost:65
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
smtpd_sasl_auth_enable = ใช่
smtpd_sasl_authenticated_header = ใช่
smtpd_sasl_path = /var/spool/postfix/private/auth
smtpd_sasl_type = นกพิราบ
smtpd_sender_login_maps = mysql:/etc/postfix/mysql-virtual-mailbox-maps.cf mysql:/etc/postfix/mysql-virtual-alias-maps.cf mysql:/etc/postfix/mysql-virtual-sender-maps.cf
smtpd_sender_restrictions =reject_authenticated_sender_login_mismatch, check_sender_access hash:/etc/postfix/sender_access.map, cancel_non_fqdn_sender, cancel_sender_login_mismatch
smtpd_soft_error_limit = 10
smtpd_tls_CApath = /etc/ssl/certs
smtpd_tls_auth_only = ใช่
smtpd_tls_chain_files = /etc/postfix/ssl/key /etc/postfix/ssl/cert
smtpd_tls_dh1024_param_file = /etc/postfix/dhparams.pem
smtpd_tls_exclude_ciphers = aNULL, SEED, CAMELLIA, RSA+AES
smtpd_tls_loglevel = 1
smtpd_tls_mandatory_ciphers = สูง
smtpd_tls_mandatory_protocols = !SSLv2, !SSLv3, !TLSv1, !TLSv1.1
smtpd_tls_protocols = !SSLv2, !SSLv3, !TLSv1, !TLSv1.1
smtpd_tls_security_level = พฤษภาคม
smtputf8_enable = ไม่
Strict_mailbox_ownership = ไม่
tls_high_cipherlist = ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305: ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384
tls_preempt_cipherlist = ใช่
tls_server_sni_maps = แฮช:/etc/postfix/vmail_ssl.map
tls_ssl_options = NO_COMPRESSION, NO_RENEGOTIATION
transport_maps = แฮช:/etc/postfix/transport
virtual_alias_maps = mysql:/etc/postfix/mysql-virtual-alias-maps.cf
virtual_mailbox_domains = mysql:/etc/postfix/mysql-virtual-mailbox-domains.cf
virtual_mailbox_limit = 20000000000
virtual_mailbox_maps = mysql:/etc/postfix/mysql-virtual-mailbox-maps.cf
virtual_transport = lmtp:inet:localhost:24
# postconf - ม
smtp inet n - n - 1 หน้าจอหลัง
smtpd ผ่าน - - n - - smtpd
tlsproxy ยูนิกซ์ - - n - 0 tlsproxy
dnsblog ยูนิกซ์ - - n - 0 dnsblog
submission inet  n       -       -       -       -       smtpd -o syslog_name=postfix/submission -o smtpd_tls_security_level=encrypt -o smtpd_sasl_auth_enable=yes -o smtpd_sasl_type=dovecot -o smtpd_sasl_path=private/auth -o smtpd_reject_unlisted_recipient=no -o smtpd_sasl_authenticated_header=yes -o smtpd_client_restrictions =permit_sasl_authenticated,reject_unknown_reverse_client_hostname,reject -o smtpd_relay_restrictions=permit_sasl_authenticated,reject -o milter_macro_daemon_name=ORIGINATING -o cleanup_service_name=sender-cleanup
smtps      inet  n       -       n       -       -       smtpd -o syslog_name=postfix/smtps -o smtpd_tls_wrappermode=yes -o smtpd_sasl_auth_enable=yes -o smtpd_sasl_type=dovecot -o smtpd_sasl_path=private/auth -o smtpd_reject_unlisted_recipient=no -o smtpd_sasl_authenticated_header=yes -o smtpd_client_restrictions =permit_sasl_authenticated,reject_unknown_reverse_client_hostname,reject -o smtpd_relay_restrictions=permit_sasl_authenticated,reject -o milter_macro_daemon_name=ORIGINATING -o cleanup_service_name=sender-cleanup
รถกระบะ fifo n - y 60 1 รถกระบะ -o content_filter= -o รับ_override_options=no_header_body_checks
การล้างข้อมูลยูนิกซ์ n - y - 0 การล้างข้อมูล
qmgr ยูนิกซ์ n - n 300 1 qmgr
tlsmgr ยูนิกซ์ - - y 1,000? 1 tlsmgr
เขียนซ้ำยูนิกซ์ - - y - - เขียนใหม่เล็กน้อย
เด้งยูนิกซ์ - - y - 0 เด้ง
เลื่อนยูนิกซ์ - - y - 0 เด้ง
ติดตามยูนิกซ์ - - y - 0 ตีกลับ
ตรวจสอบยูนิกซ์ - - y - 1 ตรวจสอบ
ล้างยูนิกซ์ n - y 1,000? 0 ล้าง
พร็อกซีแมปยูนิกซ์ - - n - - พร็อกซีแมป
proxywrite unix - - n - 1 พร็อกซีแมป
smtp ยูนิกซ์ - - y - - smtp
รีเลย์ยูนิกซ์ - - y - - smtp
showq ยูนิกซ์ n - y - - showq
ข้อผิดพลาดยูนิกซ์ - - y - - ข้อผิดพลาด
ลองใหม่ยูนิกซ์ - - y - - ข้อผิดพลาด
ทิ้งยูนิกซ์ - - y - - ทิ้ง
ยูนิกซ์ท้องถิ่น - n n - - ท้องถิ่น
ยูนิกซ์เสมือน - n n - - เสมือน
lmtp ยูนิกซ์ - - n - - lmtp
ทั่งยูนิกซ์ - - y - 1 ทั่ง
Scache ยูนิกซ์ - - y - 1 Scache
maildrop unix - n n - - ไปป์แฟล็ก=ผู้ใช้ DRhu=vmail argv=/usr/bin/maildrop -d ${ผู้รับ}
uucp unix - n n - - ไปป์แฟล็ก = Fqhu ผู้ใช้ = uucp argv = uux -r -n -z -a$sender - $nexthop!rmail (ผู้รับ $)
ifmail unix - n n - - ไปป์แฟล็ก=F ผู้ใช้=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop (ผู้รับ $)
bsmtp ยูนิกซ์ - n n - - ไปป์แฟล็ก=Fq ผู้ใช้=bsmtp argv=/usr/lib/bsmtp/bsmtp -t$nexthop -f$ผู้ส่ง $ผู้รับ
scalemail-backend unix - n n - 2 ไปป์แฟล็ก=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store ${nexthop} ${user} ${extension}
mailman unix - n n - - ไปป์แฟล็ก=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py ${nexthop} ${user}
ผู้ส่งล้าง unix n - - - 0 ล้าง -o syslog_name=postfix/sender-cleanup -o header_checks=pcre:/etc/postfix/maps/sender_header_filter.pcre
policyd-spf ยูนิกซ์ - n n - 0 วางไข่ ผู้ใช้=policyd-spf argv=/usr/bin/policyd-spf
smtp-amavis ยูนิกซ์ - - n - 2 smtp -o smtp_data_done_timeout=1200 -o smtp_send_xforward_command=yes -o enable_dns_lookups=yes -o max_use=20 -o smtp_tls_security_level=none
127.0.0.1:10025 inet n - n - - smtpd -o content_filter= -o local_recipient_maps= -o relay_recipient_maps= -o smtpd_restriction_classes= -o smtpd_delay_reject=no -o smtpd_client_restrictions=permit_mynetworks,reject -o smtpd_helo_retricions= -o smtpd_restrictions= -o smtpd_restrictdions= -o smtpd_restrictions= -o smtpd_restriction smtpd_recipient_restrictions=permit_mynetworks,reject -o smtpd_data_restrictions=reject_unauth_pipelining -o smtpd_end_of_data_restrictions= -o mynetworks=127.0.0.0/8 -o smtpd_error_sleep_time=0 -o smtpd_soft_error_limit=1001 -o smtpd_hard_error_limit=1000 -o smtpd_client_connection_count_limit=0 -o smtpd_client_connection_rate_limit=0 -o gets_override_options=no_header_body_checks,no_unknown_recipient_checks,no_milters -o smtp_tls_security_level=ไม่มี
ยูนิกซ์รีเลย์ช้า - - n - 2 smtp -o smtp_mx_session_limit=5
gmail-smtp ยูนิกซ์ - - n - 1 smtp -o syslog_name=postfix/gmail -o smtp_destination_concurrency_limit=1 -o smtp_destination_recipient_limit=1 -o anvil_rate_time_unit=60s -o smtpd_client_message_rate_limit=100
docomo-smtp ยูนิกซ์ - - n - 1 smtp -o smtp_destination_concurrency_limit=1 -o smtp_destination_recipient_limit=1 -o anvil_rate_time_unit=60s -o smtpd_client_message_rate_limit=100
au-smtp ยูนิกซ์ - - n - 1 smtp -o smtp_destination_concurrency_limit=1 -o smtp_destination_recipient_limit=1 -o anvil_rate_time_unit=60s -o smtpd_client_message_rate_limit=100
softbank-smtp ยูนิกซ์ - - n - 1 smtp -o smtp_destination_concurrency_limit=1 -o smtp_destination_recipient_limit=1 -o anvil_rate_time_unit=60s -o smtpd_client_message_rate_limit=100
ymobile-smtp ยูนิกซ์ - - n - 1 smtp -o smtp_destination_concurrency_limit=1 -o smtp_destination_recipient_limit=1 -o anvil_rate_time_unit=60s -o smtpd_client_message_rate_limit=100
icloud-smtp ยูนิกซ์ - - n - 1 smtp -o smtp_destination_concurrency_limit=1 -o smtp_destination_recipient_limit=1 -o anvil_rate_time_unit=30s -o smtpd_client_message_rate_limit=5
ms-smtp ยูนิกซ์ - - n - 1 smtp -o smtp_destination_concurrency_limit=1 -o smtp_destination_recipient_limit=1 -o anvil_rate_time_unit=30s -o smtpd_client_message_rate_limit=5
adm avatar
ru flag
adm
[แก้ไขแล้ว] ตามคำแนะนำ ฉันเปลี่ยนการตั้งค่า **mynetworks** เป็น 127.0.0.1 เท่านั้น และการส่งต่อที่ไม่ถูกต้องจะไม่เกิดขึ้นอีก ก่อนหน้าการตั้งค่านี้ IPTABLES ห้ามการเข้าถึงจากบางอาณาจักร และทันทีที่สิ่งนี้ผ่อนคลาย การส่งต่อที่ไม่ได้รับอนุญาตเป็นระยะๆ ก็เกิดขึ้นในหลายๆ บัญชี ตอนนี้ การส่งต่อจะไม่เกิดขึ้นอีกต่อไป แม้ว่าข้อจำกัดของ IPTABLES จะถูกลบไปแล้วก็ตาม
Score:2
ธง za

เนื่องจากคำตอบอื่นสรุปได้ถูกต้องแล้ว ผู้ไม่ประสงค์ดีได้รับรหัสผ่านของบางบัญชีบนเซิร์ฟเวอร์ของคุณ บางทีมันอาจจะอ่อนแอเกินไปหรือผู้ใช้บัญชีนั้นจับมัลแวร์ที่ขโมยรหัสผ่านที่บันทึกไว้จากที่เก็บข้อมูลอีเมลไคลเอ็นต์

ฉันขอแนะนำให้คุณทำสิ่งต่อไปนี้เพื่อป้องกัน:

  1. ใช้ ล้มเหลว 2 แบน เพื่อตรวจสอบบันทึกของ Postfix เพื่อหยุดผู้บังคับเดรัจฉาน ด้วยวิธีนี้คุณจะลดโอกาสในการถอดรหัสแม้แต่รหัสผ่านที่เหมือนพจนานุกรม

  2. ใช้ โพสต์fwd2 หรือดีมอนนโยบาย Postfix อื่นๆ ที่มีความสามารถเพื่อจำกัดจำนวนเมลที่ผู้ใช้แต่ละคนสามารถส่งได้ เช่น. หากปกติแล้วผู้ใช้ไม่ได้ส่งอีเมลมากกว่า 200 ฉบับต่อวันและมากกว่า 50 ฉบับต่อชั่วโมง ให้ตั้งค่านี้เป็นขีดจำกัด และความเป็นไปได้ที่จะใช้บริการของคุณในทางที่ผิดจะถูกจำกัด แม้ว่าบัญชีจะถูกแฮ็ก พวกเขาจะไม่สามารถผ่านขีดจำกัดเหล่านั้นได้ เป็นโบนัส คุณจะได้รับการแจ้งเตือนเกี่ยวกับปัญหาตั้งแต่เนิ่นๆ เนื่องจากผู้ใช้จะบ่นว่าพวกเขาถึงขีดจำกัดอย่างกระทันหันหรือเพราะคุณจะสามารถตรวจสอบไฟล์บันทึกของดีมอนนโยบายได้

และข้อเสนอแนะเพิ่มเติม

mynetworks = 127.0.0.0/8 [::1]/128 [fe80::]/64 192.168.18.0/24 10.102.0.0/16 172.18.0.0/16 10.102.0.0/16

นี่คือ แย่. mynetworks ที่ดีที่สุดคือ localhost เท่านั้นและถึงแม้จะเป็นที่โต้แย้ง ดีกว่าลบทุกอย่าง เหลือเพียง 127.0.0.1 และ [::1] และบังคับให้ทุกคนตรวจสอบสิทธิ์ สิ่งนี้จะทำให้ควบคุมสิ่งต่าง ๆ ได้มากขึ้น

adm avatar
ru flag
adm
ฉันมีเมลเซิร์ฟเวอร์นี้ทำงานในฐานะไดเรกเตอร์ ดังนั้นฉันจึงคิดผิดว่าต้องใส่โฮสต์หลายชุดลงใน mynetworks ฉันทำตามคำแนะนำของคุณและวาง mynetworks บน localhost เท่านั้นและใช้งานได้ดี Fail2ban เปิดใช้งานแล้ว ฉันจะตั้งค่า postfwd2
Score:1
ธง in

กำหนดพารามิเตอร์ของคุณ smtpd_*_restrictions ในการกำหนดค่าของคุณเท่านั้น เครือข่ายของฉัน และ sasl_authenticated สามารถส่งอีเมลผ่านเซิร์ฟเวอร์ของคุณซึ่งก็โอเค

ผู้ส่งอีเมลเป็นบัญชีจริงปลอมบนเซิร์ฟเวอร์ของเรา

ตามบันทึก ผู้ใช้สามารถยืนยันตัวตนได้สำเร็จ นี่ไม่ใช่บัญชีปลอม

ไม่มีอีเมลในประวัติการส่งสำหรับบัญชีนั้น

สรุป: บัญชีนี้ถูกแฮ็ค

โพสต์คำตอบ

คนส่วนใหญ่ไม่เข้าใจว่าการถามคำถามมากมายจะปลดล็อกการเรียนรู้และปรับปรุงความสัมพันธ์ระหว่างบุคคล ตัวอย่างเช่น ในการศึกษาของ Alison แม้ว่าผู้คนจะจำได้อย่างแม่นยำว่ามีคำถามกี่ข้อที่ถูกถามในการสนทนา แต่พวกเขาไม่เข้าใจความเชื่อมโยงระหว่างคำถามและความชอบ จากการศึกษาทั้ง 4 เรื่องที่ผู้เข้าร่วมมีส่วนร่วมในการสนทนาด้วยตนเองหรืออ่านบันทึกการสนทนาของผู้อื่น ผู้คนมักไม่ตระหนักว่าการถามคำถามจะมีอิทธิพลหรือมีอิทธิพลต่อระดับมิตรภาพระหว่างผู้สนทนา