CONTENTS


Lastmodified 2018-08-29 (水) 11:31:38


postfix body_check

/usr/local/etc/postfix/main.cf

header_checks = regexp:/usr/local/etc/postfix/header_checks
body_checks = regexp:/usr/local/etc/postfix/body_checks

/usr/local/etc/postfix/body_checks

#http://centos.server-manual.com/centos5_postfix_header_checks.html
#/^(|[^>].*)glsandoras@gmail/ REJECT
/glsandoras@gmail/ 		REJECT
/^glsandoras@gmail/ 	REJECT
/Blockbuster/			REJECT
/Biostem/				REJECT
/info@platina-1ine/		REJECT
# cat /var/log/maillog | grep reject

http://s25r.blogspot.jp/2009/02/blog-post_13.html

http://seikatub.xrea.jp/

Message-ID: 20130803.111404249483210239554.babaq@mail-pedmsvwlpk.biz
Date: Sat, 03 Aug 2013 11:16:11 +0900
From: =?x-sjis?B?g3aDiYNgg2mDiYNDg5Mg?=<mail@pedmsvwlpk.biz>
Subject: =?x-sjis?B?jqmR7orHl52Xv4LwlaWCpILMgsUylE6K1IF5gY8zMiw1MDAsMDAwLYF6gvCVpYKkgsyCxYxflvGCtYLEgq2C6oLcgrmC8YKpgUiU1I2GjdqCuYLEgumCzILFjGeR0YLWmEGXjYm6grOCooFC?=
MIME-Version: 1.0
X-Mail-Agent: BASP21 Pro  1.0.1006.21  B21Soft
Content-Type: text/plain; charset=x-sjis
Content-Transfer-Encoding: base64
X-UIDL: +)%!!mk&!!cp["!E\Q"!
X-EsetId: 5C523B3DCE813A34081565

W4N2g4mDYINpg4mDQ4OTXYLmgugNCoHhgeGB4ZBWkoVNYWlsgfSB4oHigeINCg0KgXeP
vJOIgt2C5oKxKDY0KYF4l2yC5oLoDQqQVpKFg4GBW4OLgvCO85BNgrWC3IK1gr2B9A0K
DQpbg16DQ4Nng4tdDQqOqZHuiseXnZe/gvCVpYKkgsyCxTKUTorUgXmBjzMyLDUwMCww
MDAtgXqC8JWlgqSCzILFjF+W8YK1gsSCrYLqgtyCuYLxgqmBSJTUjYaN2oK5gsSC6YLM
gsWMZ5HRgtaYQZeNibqCs4KigUINC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9wYy91c3IvaW5kZXguYXNw
P290aWQ9ZUp5bkZRdHZkRTIwMTMwNzMxMTIzMDMyJmltPUEwNyU1RjIwMTMwODAzMTEx
MDE1DQoNCoGgluKCoo2Hgu2CuQ0KaW5mb0BwbGF0aW5hLTFpbmUuY29tDQqEn4SfhJ+E
n4SfhJ+En4SfhJ+Enw0KgXkxOY3OiMiP44LMgt2XmJdwicKBeg0KgXyDdoOJg2CDaYOJ
g0ODk46WlrGLx4F8DQppbmZvQHBsYXRpbmEtMWluZS5jb20NCg0KW4GalHqQTYLJitaC
tYLEgZpdDQqWe4OBgVuDi4LNl5iXcItLlvGCyZOviNOCs4LqgrKTb5hegUWCspeYl3CC
s4LqgsSCooLpgqiLcZdsgsmRzoK1lHqQTYKzgrmCxJK4gqKCxIKoguiC3IK3gUKTb5he
grWCvYpvgqaCzILIgqKP6o2Hgs2R5ZXPgqiO6JCUgsWCzYKygrSCooLcgreCqo/ji0yD
QYNog4yDWILmguiCsphBl42SuIKvgtyCt4LmgqSCqIrogqKSdoK1gtyCt4FCDQoNCg0K
DQoNCg0KDQoNCg0KDQqWgIljk/GTZphGlqGQopRZlumJmA==


.
Line-ID.PNG
From mqwlljj80260641923253@ezweb.ne.jp  Wed Feb  5 19:30:02 2014
X-UIDL: cZ^"!FC]"!6na"!U%R!!
Return-Path: <mqwlljj80260641923253@ezweb.ne.jp>
X-Original-To: kuji@smb.net
Delivered-To: kuji@smb.net
Received: from hotshot (localhost [127.0.0.1])
        by hotshot.smb.net (Postfix) with ESMTP id F27911673ACF
        for <kuji@smb.net>; Wed,  5 Feb 2014 19:30:01 +0900 (JST)
X-Virus-Scanned: amavisd-new at smb.net
X-Spam-Flag: NO
X-Spam-Score: 11.339
X-Spam-Level: ***********
X-Spam-Status: No, score=11.339 tagged_above=5.31 required=13
        tests=[AM.WBL=-9, BAYES_99=3.5, FORGED_MUA_IMS=1.943,
        FROM_LOCAL_DIGITS=0.001, FROM_LOCAL_HEX=0.006, MISSING_MID=0.497,
        RAZOR2_CF_RANGE_51_100=0.5, RAZOR2_CF_RANGE_E8_51_100=1.886,
        RAZOR2_CHECK=0.922, RCVD_IN_BL_SPAMCOP_NET=1.347,
        RCVD_IN_BRBL_LASTEXT=1.449, RCVD_IN_RP_RNBL=1.31,
        RCVD_IN_SORBS_HTTP=0.001, RCVD_IN_SORBS_SOCKS=1.927,
        RCVD_IN_XBL=0.375, URIBL_BLACK=1.725, URIBL_DBL_SPAM=1.7,
        URIBL_JP_SURBL=1.25] autolearn=spam
Received: from hotshot.smb.net ([127.0.0.1])
        by hotshot (hotshot.smb.net [127.0.0.1]) (amavisd-new, port 10024)
        with ESMTP id owAK4op4BxPO for <kuji@smb.net>;
        Wed,  5 Feb 2014 19:29:44 +0900 (JST)
Received: from ssh.support-maintenance.com (ssh.support-maintenance.com [188.226.141.69])
        by hotshot.smb.net (Postfix) with SMTP id C819A16739F9
        for <kuji@smb.net>; Wed,  5 Feb 2014 19:29:38 +0900 (JST)
Received: from 32.56.111.192 by ssh.support-maintenance.com; Fri, 07 Feb 2014 07:20:13 -0300
From: "=?ISO-2022-JP?B?GyRCRExPQyUiJVclajQwQTRCUDF+ISobKEJMSU5FLUlEGyRCN0c8KEhEISEbKEI=?=ghabbfodjeywj@idbbs.co.jp" <vpeclwirqhur8574972503873@docomo.ne.jp>
To: kuji@smb.net
Subject: =?ISO-2022-JP?B?TElORS1JRBskQjdHPChIRCQrJGkkTiQqQ04kaSQ7JCxGTyQkJEYkJCReJDkhIyEhJCpDTiRpJDsbKEJJRDo=?=mhpfpq
Date:Fri, 07 Feb 2014 13:26:13 +0300
X-Mailer: Internet Mail Service (5.5.2650.21)
MIME-Version: 1.0
Content-Type: text/plain; charset="SHIFT_JIS"
Content-Transfer-Encoding: 7bit
Status: RO

\x82\xa8\x97F\x92B\x90\\x90\xbf\x82\xaa1\x8c\x8f\x93\xcd\x82\xab\x82\xdc\x82\xb5\x82\xbd\x81B
\x81@
\x81\xa5\x89\xba\x8bLURL\x82\xa9\x82\xe7\x82\xb2\x8am\x94F\x92\xb8\x82\xaf\x82\xdc\x82\xb7\x81\xa5
http://b2cxh42if9.asia
\x81@
\x81@
\x81\xa6LINE-ID\x8cf\x8e\xa6\x94\xc2\x82\xcc\x82\xb2\x97\x98\x97p\x82\xcd\x8a\xae\x91S\x96\xb3\x97\xbf\x82\xc6\x82\xc8\x82\xc1\x82\xc4\x82\xa8\x82\xe8\x82\xdc\x
82\xb7\x82\xcc\x82\xc5\x88\xc0\x90S\x82\xb5\x82\xc4\x82\xb2\x97\x98\x97p\x89\xba\x82\xb3\x82\xa2\x81B
Line-ID2.PNG
From trbdeeu86405758986@ezweb.ne.jp  Mon Feb 10 11:40:35 2014
X-UIDL: E!X!!EMi"!DeT"!G`["!
Return-Path: <trbdeeu86405758986@ezweb.ne.jp>
X-Original-To: kuji@smb.net
Delivered-To: kuji@smb.net
Received: from hotshot (localhost [127.0.0.1])
        by hotshot.smb.net (Postfix) with ESMTP id E53BE1673BA6
        for <kuji@smb.net>; Mon, 10 Feb 2014 11:40:34 +0900 (JST)
X-Virus-Scanned: amavisd-new at smb.net
X-Spam-Flag: NO
X-Spam-Score: 8.842
X-Spam-Level: ********
X-Spam-Status: No, score=8.842 tagged_above=5.31 required=13 tests=[AM.WBL=-9,
        BAYES_99=3.5, DATE_IN_FUTURE_24_48=2.048, FH_FAKE_RCVD_LINE=1.778,
        FORGED_MUA_OUTLOOK=1.927, MISSING_MID=0.497,
        RAZOR2_CF_RANGE_51_100=0.5, RAZOR2_CF_RANGE_E8_51_100=1.886,
        RAZOR2_CHECK=0.922, RCVD_DOUBLE_IP_SPAM=1.808, TO_NO_BRKTS_MSFT=0.001,
        URIBL_BLACK=1.725, URIBL_JP_SURBL=1.25] autolearn=spam
Received: from hotshot.smb.net ([127.0.0.1])
        by hotshot (hotshot.smb.net [127.0.0.1]) (amavisd-new, port 10024)
        with ESMTP id vGjnJlDx33FD for <kuji@smb.net>;
        Mon, 10 Feb 2014 11:40:16 +0900 (JST)
Received: from stiba.net (stiba.net [192.241.235.132])
        by hotshot.smb.net (Postfix) with SMTP id 284E31673AF4
        for <kuji@smb.net>; Mon, 10 Feb 2014 11:40:15 +0900 (JST)
Received: from 80.227.86.252 by 192.241.235.132; Wed, 12 Feb 2014 04:37:34 +0200
From: "=?ISO-2022-JP?B?GyRCIiE0MEE0TDVOQSEqGyhCTElORSgbJEIlaSUkJXMbKEIpSUQbJEI3RzwoSEQiISEhGyhC?=nilcwc@idbbs.ne.jp" <dwqbehbmuho732128@ezweb.ne.jp>
To: kuji@smb.net
Subject: =?ISO-2022-JP?B?TElORSgbJEIlaSUkJXMbKEIpSUQbJEI3RzwoSEQkKyRpPzckNyQkJCpDTiRpJDskRyQ5ISMhISQqQ04kaSQ7GyhCSUQ6?=qtstjvqtp
Date:Wed, 12 Feb 2014 01:37:34 -0100
X-Mailer: Microsoft Outlook, Build 10.0.2616
MIME-Version: 1.0
Content-Type: text/plain; charset="SHIFT_JIS"
Content-Transfer-Encoding: 7bit
Status: RO

\x8f\xb3\x94F\x91\xd2\x82\xbf\x82\xcc\x97F\x90l\x82\xaa2\x90l\x8b\x8f\x82\xdc\x82\xb7\x81B
\x81@
\x81\xa5\x8d\xa1\x82\xb7\x82\xae\x8f\xb3\x94F\x82\xb7\x82\xe9\x81\xa5
http://m2nwock12v.asia
\x81@
\x81@
\x81\xa6LINE(\x83\x89\x83C\x83\x93)ID\x8cf\x8e\xa6\x94\xc2\x82\xcc\x82\xb2\x97\x98\x97p\x82\xcd\x8a\xae\x91S\x96\xb3\x97\xbf\x82\xc6\x82\xc8\x82\xc1\x82\xc4\x82
\xa8\x82\xe8\x82\xdc\x82\xb7\x81B

本文(body)の共通部分

\x81\xa6LINE
-
ID\x8cf\x8e\xa6\x94\xc2\x82\xcc\x82\xb2\x97\x98\x97p\x82\xcd\x8a\xae\x91S\x96\xb3\x97\xbf\x82\xc6\x82\xc8\x82\xc1\x82\xc4\x82\xa8\x82\xe8\x82\xdc\x82\xb7
\x82\xcc\x82\xc5\x88\xc0\x90S\x82\xb5\x82\xc4\x82\xb2\x97\x98\x97p\x89\xba\x82\xb3\x82\xa2\x81B

\x81\xa6LINE
(\x83\x89\x83C\x83\x93)
ID\x8cf\x8e\xa6\x94\xc2\x82\xcc\x82\xb2\x97\x98\x97p\x82\xcd\x8a\xae\x91S\x96\xb3\x97\xbf\x82\xc6\x82\xc8\x82\xc1\x82\xc4\x82\xa8\x82\xe8\x82\xdc\x82\xb7
\x81B

body_checks

#/^\\x81\\xa6LINE/	REJECT
/ID\\x8cf\\x8e\\xa6\\x94\\xc2\\x82\\xcc\\x82\\xb2\\x97\\x98\\x97p\\x82\\xcd\\x8a/		REJECT
#.*2.*3.*|.*3.*2.*  2と3が両方使っているものを抜き出し
#/^\\x81\\xa6LINE|ID\\x8cf\\x8e\\xa6\\x94\\xc2\\x82\\xcc\\x82\\xb2\\x97\\x98\\x97p\\x82\\xcd\\x8a/		REJECT

header_checks に複数の拡張子を一行で記載する例

http://www.itmedia.co.jp/help/tips/linux/l0530.html

mailの生データを見る

mail の2バイト文字の生データを見る際、通常のテキストエディタで見ると、自動的に2バイト子コードが変換されて、ちゃんと読めてしまうデータになっちゃう。(^^ゞ

しかし、それではbody_checksなどのフィルターには使えないデータなので、生データを取る必要がある。

で、vi の登場である。

しかしながら、ファイルが大きい場合は、なにかと取り回しが悪いので、ファイルを分割して見てみることに。

ファイルの分割には、split コマンドをつかってみる。

split (option) [source file] (prefix)

オプション

オプション 機能

.-b 指定したバイト数で分割 .キロバイトは末尾に「k」、メガバイトは末尾に「m」を付ける .-l 指定した行数ごとに分割

コマンド例

# split -b 1000000 file
# split -b 100000  xcb

などを繰り返して、適当なファイルサイズになったところで、

# vi xah

とかすると、スパムメールの文字データが見えるようになる

メール本文の文字列は、

spam.PNG

こちらが生データ

Subject: =?ISO-2022-JP?B?TElORSgbJEIlaSUkJXMbKEIpGyRCJCskaSROPzckNyQkJCpDTiRpJDskLEZPJCQkRiQkJF4kOSEjISEkKkNOJGkkOxsoQk5vLg==?=76627605372273
Date:Sat, 22 Feb 2014 02:30:56 -0100
X-Mailer: Internet Mail Service (5.5.2650.21)
MIME-Version: 1.0
Content-Type: text/plain; charset="SHIFT_JIS"
Content-Transfer-Encoding: 7bit
Status: RO

^[$B$"$N^[(BID^[$B7G<(HD$,!*BgI}%j%K%e!<%"%k$7$F?k$KI|3h!*!*^[(B
^[$B:G?75!G=$,B??tDI2C$5$l!"99$K;H$$$d$9$/$J$j$^$7$?!*!*^[(B
^[$B!!^[(B
^[$B"'?7$7$/$J$C$?^[(BID^[$B7G<(HD$O%3%A%i!*"'^[(B
http://sa8xtrudxo.asia
^[$B!!^[(B
^[$B!!^[(B
ID^[$B7G<(HD$O!"9qFb:GBg5i!"=q$-9~$_?t^[(BNo.1^[$B$NM'C#Jg=87G<(HD$G$9!#^[(B
^[$B?7$7$/$J$C$?8!:w5!G=$r;H$C$FBt;3$NM'C#$H7R$,$m$&!*^[(B

Total access 5923:本日 1:昨日 1

Counter: 5923, today: 1, yesterday: 1

トップ   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS