Gentoo Archives: gentoo-user

From: mad.scientist.at.large@××××××××.com
To: Gentoo User <gentoo-user@l.g.o>
Subject: Re: [gentoo-user] [OT] Block multiple IP addresses; iptables or route...reject?
Date: Wed, 04 Oct 2017 22:49:40
Message-Id: KvdXzSx--3-0@tutanota.com
In Reply to: Re: [gentoo-user] [OT] Block multiple IP addresses; iptables or route...reject? by Mike Gilbert
1 I have to disagree with the last post.  You should most certainly block some inbound traffic.  you should block ports you aren't using.  If some ip addr. or particular provider have a  customer trying to break your' machine you want to block the whole isp unless you are serving pages etc.  you should block the router solicitation and block any other routers advertising them.  i usually also block ping both ways.  Every major program is full of bugs, you want to try to limit the access of others to the least amount possible consistent with the net software you are running. 
2
3 Long ago i had all of china blocked, because i wasn't visiting sites there and it was where most of the attacks came from.  When you have a "slow" or very busy connection to the net the incursion atempts. 
4
5 While not security related directly, i also like to ban the ip addr of ad bots, i suspect that when they change their' domain name or buy a new one, that the ad company doesn't get a new ip addr range.  this are the servers that are most overloaded and slowest, slowing down page loads.  You could even consider that this slowness from ad servers produces a DOS, assuming you don't want the information and didn't ask for it.  now i just try to block the obnoxious advertisers, the people who at 3 AM will shove audio to you that's louder than the music you were/are playing.  
6 --
7 "Informed delivery" is just an excuse for the post office to compile data basses for sale to marketing firms and those even less reputable, it is a gross abuse of the postal systems special access to our lives.
8
9
10 4. Oct 2017 10:13 by floppym@g.o:
11
12
13 > On Wed, Oct 4, 2017 at 1:28 AM, Walter Dnes <> waltdnes@××××××××.org> > wrote:
14 >> I have some doubts about massive "hosts" files for adblocking. I
15 >> downloaded one that listed 13,148 sites. I fed them through a script
16 >> that called "host" for each entry, and saved the output to a text file.
17 >> The result was 1,059 addresses. Note that some adservers have multiple
18 >> IP address entries for the same name. A back-of-the-envelope analysis
19 >> is that close to 95% of the entries in the large host file are invalid,
20 >> amd return "not found: 3(NXDOMAIN)".
21 >>
22 >> I'm not here to trash the people compiling the lists; the problem is
23 >> that hosts files are the wrong tool for the job. Advertisers know about
24 >> hosts files and deliberately generate random subdomain names with short
25 >> lifetimes to invalidate the hosts files. Every week the sites are
26 >> probably mostly renamed. Further analysis of the 1,059 addresses show
27 >> 810 unique entries, i.e. 249 duplicates. It gets even better. 44
28 >> addresses show up in 52.84.146.xxx; I should probably block the entire
29 >> /24 with one entry. There are multiple similar occurences, which could
30 >> be aggregated into small CIDRs. So the number of blocking rules is
31 >> greatly reduced.
32 >>
33 >> I'm not a deep networking expert. My question is whether I'm better
34 >> off adding iptables reject/drop rules or "reject routes", e.g...
35 >>
36 >> route add -net 10.0.0.0 netmask 255.0.0.0 metric 1024 reject
37 >>
38 >> (an example from the "route" man page). iptables rules have to be
39 >> duplicated coming and going to catch inbound and outbound traffic. A
40 >> reject route only needs to be entered once. This excercise is intended
41 >> to block web adservers, so another question is how web browsers react to
42 >> route versus iptables blocking.
43 >
44 > Using the routing table feels dirty.
45 >
46 > I don't see any reason to create "inbound" (INPUT) iptables rules. You
47 > really only care about rejecting the initial outbound request to the
48 > web server.
49 >
50 > If this is for a single host with iptables running locally, add rules
51 > to the OUTPUT chain. If this is on a router, add them to the FORWARD
52 > chain.

Replies

Subject Author
Re: [gentoo-user] [OT] Block multiple IP addresses; iptables or route...reject? Mick <michaelkintzios@×××××.com>