Short anatomy of Spambot

ผมไปอ่านพบใน mailing list ของ qmail เมื่อสักหลายอาทิตย์ก่อน เห็นว่ามีประโยชน์
กับ mail admin ใหม่ๆ ไม่มากก็น้อย จึงอยากนำมาลงให้อ่านกันนิดครับ

(สำหรับคนที่อ่าน list ดังกล่าว ไม่ได้หมายความว่า ผมจะเห็นด้วยกับความเห็นของ
แกทั้งหมดนะครับ)

On Mar 15, Julian Haight (Spamcop Developer/Owner) wrote:

Seriously though - there are two types of spammer bots. Those that
harvest, but don’t deliver mail (they just RSET or QUIT instead of
DATA). And those that take big previously-generated lists and blast a
specific message to them.

ขยายความตรงนี้ให้นิดนึง คือ spam bot มี 2 แบบ คือ

1. แบบที่ smtp connect มายังฝั่งรับ รอให้ฝั่งรับตอบ ส่งคำสั่ง rcpt tp: email
และรอฝั่งรับตอบอีกที จากนั้น RSET หรือ QUIT คือไม่ทำให้ครบขั้นตอน เท่านี้
ก็เพียงพอจะทราบเบื้องต้น ว่า email addess ที่เขาลองส่งเข้ามานั้น ฝั่งรับมี
response ว่าอย่างไร

2. แบบที่ใช้ database และลุยส่งเข้ามา แล้วดู response การรับเมล์หรือการเด้ง
เมล์กลับ เพื่อหาว่าชื่อนั้นมีอยู่ไหม

ทั้ง 2 ชนิด สามารถดู response ได้ ทั้งระหว่าง SMTP หรือ ผลของการส่งเมล์
และวิเคราะห์ได้ (บ้าง) ว่าชื่อแต่ละชื่อ มีอยู่จริงหรือเปล่า

To combat the harvest bot, you give it no satisfaction. The first thing
these bots do is test to see if you do smtp-time rejection like so:

> rcpt to: postmaster@$domain
< 220 OK
> rcpt to: xyxyxyxyxyxxyxyxyxyxyxyxyxyxyxyxyxyxyxy@$domain
< 550 No such user

  • or -
    < 220 OK

If the bot sees 550 (default sendmail behavior), it knows it has a
target and it moves through it’s dictionary testing various accounts,
usually only a few per connection. If it sees 220 (default qmail
behavior), it hangs up and goes away for a long time.

Now the other sort - the spambot - is designed to take a big list and
spam it. This bot is run over and over with the same list by the same
spammers (but from all sorts of different ips/domains/content/etc…).

To combat the spam bot, you first want to try to filter the spam from
the real users. But that’s a topic for another day. Secondly, you want
to avoid the DoS. Since it uses the same recipient list every time, you
need to identify those recipients and disable them, so the bot just gets
a 550 refusal when it tries to send it’s spam. Grep your logs and look
for the recipient addresses - not the source IPs, or source email
addresses - those change. Then reject at smtp time (ideally) or
/dev/null (less rfc compliant) those specific recipient addresses. Or
forward them to spamcop.