Nervender Spammer soll auf ipfw-Basis geblockt werden

ww

Well-Known Member
Moin,

ich erhalte von einem *rsch etwa 500 Mails/Tag. Der Dreck kommt aus einem IP-Pool zwischen 206.82.177.* und 206.82.183.*

Gut, durch kommt er nicht, weil ein nichtexistierendes Mailkonto adressiert wird; das muß aber nicht so bleiben. Zwar habe ich also aktuell kein Problem mit durchkommenden Mails, möchte aber trotzdem postfix und /var/log/maillog nicht mit dem Dreck belästigen und den o.g. IP-Range auf Firewallebene (ipfw2) blockieren.

Leider bin ich nicht ganz syntaxfest, bekomme die Zeile nicht zusammen und möchte auf dem Produktivsystem nicht rumprobieren:
${fwcmd} 00500 deny log ip from *weissichleidernicht* to any in via ${ext}

Das "log" würde ich nach einer Kontrollphase später rausnehmen.

Danke,
WW
 
Das wird mittels masklen-Bits oder Adresslisten gelöst. Das Prinzip hier zu erklären, wäre den doch etwas viel, daher guckst du bitte einmal hier: http://www.freebsd.org/cgi/man.cgi?...ath=FreeBSD+5.4-RELEASE+and+Ports&format=html

Entscheident ist dieser Absatz:
Code:
  ip-addr:
	     A host or subnet address specified in one of the following ways:

	     numeric-ip | hostname
		     Matches a single IPv4 address, specified as dotted-quad
		     or a hostname.  Hostnames are resolved at the time the
		     rule is added to the firewall list.

	     addr/masklen
		     Matches all addresses with base addr (specified as a dot-
		     ted quad or a hostname) and mask width of masklen bits.
		     As an example, 1.2.3.4/25 will match all IP numbers from
		     1.2.3.0 to 1.2.3.127 .

	     addr:mask
		     Matches all addresses with base addr (specified as a dot-
		     ted quad or a hostname) and the mask of mask, specified
		     as a dotted quad.	As an example, 1.2.3.4:255.0.255.0
		     will match 1.*.3.*.  This form is advised only for non-
		     contiguous masks.	It is better to resort to the
		     addr/masklen format for contiguous masks, which is more
		     compact and less error-prone.

     addr-set: addr[/masklen]{list}

     list: {num | num-num}[,list]
	     Matches all addresses with base address addr (specified as a dot-
	     ted quad or a hostname) and whose last byte is in the list
	     between braces { } .  Note that there must be no spaces between
	     braces and numbers (spaces after commas are allowed).  Elements
	     of the list can be specified as single entries or ranges.	The
	     masklen field is used to limit the size of the set of addresses,
	     and can have any value between 24 and 32.	If not specified, it
	     will be assumed as 24.
	     This format is particularly useful to handle sparse address sets
	     within a single rule.  Because the matching occurs using a bit-
	     mask, it takes constant time and dramatically reduces the com-
	     plexity of rulesets.
	     As an example, an address specified as 1.2.3.4/24{128,35-55,89}
	     will match the following IP addresses:
	     1.2.3.128, 1.2.3.35 to 1.2.3.55, 1.2.3.89 .
 
Oh, wie finde ich das gut:

Oct 7 17:35:07 laura kernel: ipfw: 226 Deny TCP 206.82.182.114:34809 80.242.136.84:25 in via rl1
Oct 7 17:35:31 laura kernel: ipfw: 226 Deny TCP 206.82.182.114:34809 80.242.136.84:25 in via rl1
Oct 7 17:35:31 laura kernel: ipfw: 226 Deny TCP 206.82.182.114:34809 80.242.136.84:25 in via rl1
Oct 7 17:36:24 laura kernel: ipfw: 224 Deny TCP 206.82.180.35:37018 80.242.136.84:25 in via rl1
Oct 7 17:36:43 laura kernel: ipfw: 227 Deny TCP 206.82.183.219:32091 80.242.136.84:25 in via rl1
Oct 7 17:36:46 laura kernel: ipfw: 227 Deny TCP 206.82.183.219:32091 80.242.136.84:25 in via rl1
Oct 7 17:36:46 laura kernel: ipfw: 224 Deny TCP 206.82.180.35:37018 80.242.136.84:25 in via rl1

Weg mit dem *CENSORED*.

ww
 
@ solarix:
Das ist mir zu viel Akt. Ich habe keine Lust, mich mit diesen Ärschen zu beschäftigen und wertvolle Lebenszeit zu opfern. Sie kommen nicht mehr durch und das war´s.

Gruß,
Wolfgang
 
Zurück
Oben