Blame
Date:
Sun Jan 29 05:00:28 2023 UTC
Message:
Daily backup
01
2023-01-22
jrmu
version=pmwiki-2.2.130 ordered=1 urlencoded=1
02
2023-01-22
jrmu
agent=Mozilla/5.0 (X11; OpenBSD amd64; rv:82.0) Gecko/20100101 Firefox/82.0
03
2023-01-22
jrmu
author=jrmu
04
2023-01-22
jrmu
charset=UTF-8
05
2023-01-22
jrmu
csum=
06
2023-01-22
jrmu
ctime=1614871241
07
2023-01-22
jrmu
host=198.251.81.119
08
2023-01-22
jrmu
name=Mail.Openrelay
09
2023-01-22
jrmu
rev=1
10
2023-01-22
jrmu
targets=Openbsd.Dnsbl,Openbsd.Dkimproxy,Openbsd.Netcat,Openbsd.Opensmtpd
11
2023-01-22
jrmu
text=(:title Beware Mail Open Proxies!:)%0a%0aAn open proxy allows any Internet user to send or receive messages using that server to hide the sender. Sometimes it can be used to provide privacy for users and bypass censorship, but often times it is unintentional. Your server could be abused to send spam because of a misconfiguration of your server.%0a%0aAn open proxy for mail is referred to as an open mail relay. Chances are, if you're reading this, it's because your mail server has been banned for being an open mail relay.%0a%0a!! Why stop open proxies?%0a%0a# It could be used to send malware (viruses, trojans, or worms)%0a# It can be used to send spam%0a# Your IP will get blacklisted and put on a [[openbsd/dnsbl|DNS blacklist]]%0a%0a!! Sample Config%0a%0aHere is a sample '''misconfiguration''' (do '''NOT''' use these configs):%0a%0a[@%0amatch from any for any relay%0a@]%0a%0aIf you're using [[openbsd/dkimproxy|dkimproxy]]:%0a%0a[@%0amatch from any for any action "relay_dkim"%0a@]%0a%0aDon't use either of the above configurations, or your mail server will be used by spammers and crackers to flood the internet with trash mail.%0a%0a!! Testing for Open Mail Relays%0a%0aHere's how we test sending a letter using [[openbsd/netcat|netcat]]:%0a%0a[@%0a$ nc ircnow.org 25 %0a220 ircnow.org ESMTP OpenSMTPD%0a@]%0a%0aNext, we type HELO followed by our sending domain:%0a%0a[@%0aHELO example.com%0a250 ircnow.org Hello example.com [38.81.163.143], pleased to meet you%0a@]%0a%0aAfterwards, we type our sending mail address:%0a%0a[@%0aMAIL FROM: %3ctest@example.com>%0a250 2.0.0 Ok%0a@]%0a%0aAnd the destination mail address:%0a%0a[@%0aRCPT TO: %3cjrmu@ircnow.org>%0a250 2.1.5 Destination address valid: Recipient ok%0a@]%0a%0aThen we type DATA followed by our email:%0a%0a[@%0aDATA%0a354 Enter mail, end with "." on a line by itself%0aSubject: Alpha Bravo Charlie Delta%0a%0aEcho Foxtrot Golf Hotel%0a@]%0a%0aWe then type . to end the email, then QUIT:%0a%0a[@%0a.%0a250 2.0.0 e57f9a36 Message accepted for delivery%0aQUIT%0a221 2.0.0 Bye%0a@]%0a%0aHere's the complete process:%0a%0a[@%0a$ nc ircnow.org 25 %0a220 ircnow.org ESMTP OpenSMTPD%0aHELO example.com%0a250 ircnow.org Hello example.com [38.81.163.143], pleased to meet you%0aMAIL FROM: %3ctest@example.com>%0a250 2.0.0 Ok%0aRCPT TO: %3cjrmu@ircnow.org>%0a250 2.1.5 Destination address valid: Recipient ok%0aDATA%0a354 Enter mail, end with "." on a line by itself%0aSubject: Alpha Bravo Charlie Delta%0a%0aEcho Foxtrot Golf Hotel%0a.%0a250 2.0.0 e57f9a36 Message accepted for delivery%0aQUIT%0a221 2.0.0 Bye%0a@]%0a%0a!! Open Mail Relay%0a%0aHere's how a proper mail server (not an open relay) will do when you send from a spoofed domain to another external domain:%0a%0a[@%0a$ nc ircnow.org 25 %0a220 ircnow.org ESMTP OpenSMTPD%0aHELO example.com%0a250 ircnow.org Hello example.com [38.81.163.143], pleased to meet you%0aMAIL FROM: %3ctest@example.com>%0a250 2.0.0 Ok%0aRCPT TO: %3circnownetwork@gmail.com>%0a550 Invalid recipient: %3circnownetwork@gmail.com>%0a@]%0a%0aYou should get @@Invalid recipient@@ or some similar rejection message.%0a%0aHere's how it appears when the mail server is improperly configured:%0a%0a[@%0a$ nc bangcat.coconut.ircnow.org 25 %0a220 bangcat.coconut.ircnow.org ESMTP OpenSMTPD%0aHELO example.com%0a250 bangcat.coconut.ircnow.org Hello example.com [38.81.163.143], pleased to meet you%0aMAIL FROM: %3ctest@example.com>%0a250 2.0.0 Ok%0aRCPT TO: %3ctest@gmail.com>%0a250 2.1.5 Destination address valid: Recipient ok%0a@]%0a%0aNotice this time it says @@Recipient ok@@ even though it comes from a spoofed sender to an external domain. This will allow anyone to use @@your@@ server to spam external domains with forged addresses. If you don't fix this, you will get blacklisted for spam!%0a%0a!! How to Fix%0a%0aYou will want to check your [[openbsd/opensmtpd|smtpd.conf]] ruleset to make sure you '''never''' allow any domain to send to any domain. You should only allow local hosts to send to external domains, and for any host to send to your domains.%0a%0a!! See Also
12
2023-01-22
jrmu
time=1614871241
13
2023-01-22
jrmu
title=Beware Mail Open Proxies!
14
2023-01-22
jrmu
author:1614871241=jrmu
15
2023-01-22
jrmu
diff:1614871241:1614871241:=1,136d0%0a%3c (:title Beware Mail Open Proxies!:)%0a%3c %0a%3c An open proxy allows any Internet user to send or receive messages using that server to hide the sender. Sometimes it can be used to provide privacy for users and bypass censorship, but often times it is unintentional. Your server could be abused to send spam because of a misconfiguration of your server.%0a%3c %0a%3c An open proxy for mail is referred to as an open mail relay. Chances are, if you're reading this, it's because your mail server has been banned for being an open mail relay.%0a%3c %0a%3c !! Why stop open proxies?%0a%3c %0a%3c # It could be used to send malware (viruses, trojans, or worms)%0a%3c # It can be used to send spam%0a%3c # Your IP will get blacklisted and put on a [[openbsd/dnsbl|DNS blacklist]]%0a%3c %0a%3c !! Sample Config%0a%3c %0a%3c Here is a sample '''misconfiguration''' (do '''NOT''' use these configs):%0a%3c %0a%3c [@%0a%3c match from any for any relay%0a%3c @]%0a%3c %0a%3c If you're using [[openbsd/dkimproxy|dkimproxy]]:%0a%3c %0a%3c [@%0a%3c match from any for any action "relay_dkim"%0a%3c @]%0a%3c %0a%3c Don't use either of the above configurations, or your mail server will be used by spammers and crackers to flood the internet with trash mail.%0a%3c %0a%3c !! Testing for Open Mail Relays%0a%3c %0a%3c Here's how we test sending a letter using [[openbsd/netcat|netcat]]:%0a%3c %0a%3c [@%0a%3c $ nc ircnow.org 25 %0a%3c 220 ircnow.org ESMTP OpenSMTPD%0a%3c @]%0a%3c %0a%3c Next, we type HELO followed by our sending domain:%0a%3c %0a%3c [@%0a%3c HELO example.com%0a%3c 250 ircnow.org Hello example.com [38.81.163.143], pleased to meet you%0a%3c @]%0a%3c %0a%3c Afterwards, we type our sending mail address:%0a%3c %0a%3c [@%0a%3c MAIL FROM: %3ctest@example.com>%0a%3c 250 2.0.0 Ok%0a%3c @]%0a%3c %0a%3c And the destination mail address:%0a%3c %0a%3c [@%0a%3c RCPT TO: %3cjrmu@ircnow.org>%0a%3c 250 2.1.5 Destination address valid: Recipient ok%0a%3c @]%0a%3c %0a%3c Then we type DATA followed by our email:%0a%3c %0a%3c [@%0a%3c DATA%0a%3c 354 Enter mail, end with "." on a line by itself%0a%3c Subject: Alpha Bravo Charlie Delta%0a%3c %0a%3c Echo Foxtrot Golf Hotel%0a%3c @]%0a%3c %0a%3c We then type . to end the email, then QUIT:%0a%3c %0a%3c [@%0a%3c .%0a%3c 250 2.0.0 e57f9a36 Message accepted for delivery%0a%3c QUIT%0a%3c 221 2.0.0 Bye%0a%3c @]%0a%3c %0a%3c Here's the complete process:%0a%3c %0a%3c [@%0a%3c $ nc ircnow.org 25 %0a%3c 220 ircnow.org ESMTP OpenSMTPD%0a%3c HELO example.com%0a%3c 250 ircnow.org Hello example.com [38.81.163.143], pleased to meet you%0a%3c MAIL FROM: %3ctest@example.com>%0a%3c 250 2.0.0 Ok%0a%3c RCPT TO: %3cjrmu@ircnow.org>%0a%3c 250 2.1.5 Destination address valid: Recipient ok%0a%3c DATA%0a%3c 354 Enter mail, end with "." on a line by itself%0a%3c Subject: Alpha Bravo Charlie Delta%0a%3c %0a%3c Echo Foxtrot Golf Hotel%0a%3c .%0a%3c 250 2.0.0 e57f9a36 Message accepted for delivery%0a%3c QUIT%0a%3c 221 2.0.0 Bye%0a%3c @]%0a%3c %0a%3c !! Open Mail Relay%0a%3c %0a%3c Here's how a proper mail server (not an open relay) will do when you send from a spoofed domain to another external domain:%0a%3c %0a%3c [@%0a%3c $ nc ircnow.org 25 %0a%3c 220 ircnow.org ESMTP OpenSMTPD%0a%3c HELO example.com%0a%3c 250 ircnow.org Hello example.com [38.81.163.143], pleased to meet you%0a%3c MAIL FROM: %3ctest@example.com>%0a%3c 250 2.0.0 Ok%0a%3c RCPT TO: %3circnownetwork@gmail.com>%0a%3c 550 Invalid recipient: %3circnownetwork@gmail.com>%0a%3c @]%0a%3c %0a%3c You should get @@Invalid recipient@@ or some similar rejection message.%0a%3c %0a%3c Here's how it appears when the mail server is improperly configured:%0a%3c %0a%3c [@%0a%3c $ nc bangcat.coconut.ircnow.org 25 %0a%3c 220 bangcat.coconut.ircnow.org ESMTP OpenSMTPD%0a%3c HELO example.com%0a%3c 250 bangcat.coconut.ircnow.org Hello example.com [38.81.163.143], pleased to meet you%0a%3c MAIL FROM: %3ctest@example.com>%0a%3c 250 2.0.0 Ok%0a%3c RCPT TO: %3ctest@gmail.com>%0a%3c 250 2.1.5 Destination address valid: Recipient ok%0a%3c @]%0a%3c %0a%3c Notice this time it says @@Recipient ok@@ even though it comes from a spoofed sender to an external domain. This will allow anyone to use @@your@@ server to spam external domains with forged addresses. If you don't fix this, you will get blacklisted for spam!%0a%3c %0a%3c !! How to Fix%0a%3c %0a%3c You will want to check your [[openbsd/opensmtpd|smtpd.conf]] ruleset to make sure you '''never''' allow any domain to send to any domain. You should only allow local hosts to send to external domains, and for any host to send to your domains.%0a%3c %0a%3c !! See Also%0a\ No newline at end of file%0a
16
2023-01-22
jrmu
host:1614871241=198.251.81.119
IRCNow