<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Linux Forum &mdash; Опять про блэклисты]]></title>
	<link rel="self" href="https://linuxforum.ru/extern.php?action=feed&amp;tid=21737&amp;type=atom" />
	<updated>2012-04-19T19:42:57Z</updated>
	<generator>PunBB</generator>
	<id>https://linuxforum.ru/viewtopic.php?id=21737</id>
		<entry>
			<title type="html"><![CDATA[Re: Опять про блэклисты]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=269577#p269577" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Cruiser78 пишет:</cite><blockquote><div class="codebox"><pre><code>man sort 
man uniq</code></pre></div></blockquote></div><p>Немного опоздали, уже разобрались.</p>]]></content>
			<author>
				<name><![CDATA[yars]]></name>
				<uri>https://linuxforum.ru/profile.php?id=22799</uri>
			</author>
			<updated>2012-04-19T19:42:57Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=269577#p269577</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Опять про блэклисты]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=269576#p269576" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>yars пишет:</cite><blockquote><p>Но я так и не понял, как же убрать все повторяющиеся строки?</p></blockquote></div><p>man sort<br />man uniq</p>]]></content>
			<author>
				<name><![CDATA[Cruiser78]]></name>
				<uri>https://linuxforum.ru/profile.php?id=631</uri>
			</author>
			<updated>2012-04-19T19:35:50Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=269576#p269576</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Опять про блэклисты]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=269573#p269573" />
			<content type="html"><![CDATA[<div class="quotebox"><blockquote><p>Implement transparent HTTP proxy with block list or even simple firewall<br />rules are better. Protection on DNS level is very fragile and probably could<br />be easily circumvented if not implemented together with strict firewall<br />rules.</p></blockquote></div>]]></content>
			<author>
				<name><![CDATA[zenon]]></name>
				<uri>https://linuxforum.ru/profile.php?id=6867</uri>
			</author>
			<updated>2012-04-19T19:07:48Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=269573#p269573</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Опять про блэклисты]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=269570#p269570" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Macumazan пишет:</cite><blockquote><p>Статический список плёхо</p></blockquote></div><p>Да занем как-бэ. Это надо DNS-based blacklist (DNS-BL), но там опять бабка надвое наговорила.. <img src="https://linuxforum.ru/img/smilies/ab.gif" alt="ab" /></p>]]></content>
			<author>
				<name><![CDATA[zenon]]></name>
				<uri>https://linuxforum.ru/profile.php?id=6867</uri>
			</author>
			<updated>2012-04-19T18:57:09Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=269570#p269570</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Опять про блэклисты]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=269560#p269560" />
			<content type="html"><![CDATA[<p>Статический список плёхо. IP могут быть динамические, с вирусными компами, c одним ip может выходить в мир пол Китая через nat.</p>]]></content>
			<author>
				<name><![CDATA[Macumazan]]></name>
				<uri>https://linuxforum.ru/profile.php?id=952</uri>
			</author>
			<updated>2012-04-19T18:36:03Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=269560#p269560</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Опять про блэклисты]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=269545#p269545" />
			<content type="html"><![CDATA[<p>Ну вот и ладненько:<br /></p><div class="codebox"><pre><code>$ grep phpmyadmin /var/log/nginx/access_log | cut -d &quot; &quot; -f 1 | sort -u
109.106.160.75
115.69.211.20
116.126.127.217
118.219.232.205
143.106.21.199
176.53.16.10
176.61.137.158
189.17.80.184
193.110.72.242
194.149.154.11
195.54.60.60
200.142.102.88
203.91.121.71
204.9.201.211
213.86.4.51
219.76.235.221
221.132.36.24
59.124.64.229
60.31.123.54
61.218.36.21
62.110.122.20
64.52.145.3
76.164.167.234
76.164.186.222
77.48.63.206
83.103.91.91
85.237.228.171
87.118.103.208
88.190.23.29</code></pre></div><p>IP которые старались найти у меня phpmyadmin</p>]]></content>
			<author>
				<name><![CDATA[zenon]]></name>
				<uri>https://linuxforum.ru/profile.php?id=6867</uri>
			</author>
			<updated>2012-04-19T17:34:40Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=269545#p269545</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Опять про блэклисты]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=269541#p269541" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>grep _критерий_ /var/log/nginx/access_log | cut -d &quot; &quot; -f 1 | sort -u &gt; blacklist</code></pre></div>]]></content>
			<author>
				<name><![CDATA[-=Serj=-]]></name>
				<uri>https://linuxforum.ru/profile.php?id=16175</uri>
			</author>
			<updated>2012-04-19T17:25:09Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=269541#p269541</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Опять про блэклисты]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=269538#p269538" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>-=Serj=- пишет:</cite><blockquote><p>А так не лучше</p></blockquote></div><p>sort -u можно повторно натравить на blacklist, а _файло_ тут посредник,...<br />ы. - лучше однострок придумай</p>]]></content>
			<author>
				<name><![CDATA[zenon]]></name>
				<uri>https://linuxforum.ru/profile.php?id=6867</uri>
			</author>
			<updated>2012-04-19T17:19:21Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=269538#p269538</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Опять про блэклисты]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=269535#p269535" />
			<content type="html"><![CDATA[<p>А так не лучше<br /></p><div class="codebox"><pre><code>cat /var/log/nginx/access_log | grep _критерий_ &gt;&gt; _файло_
cut -d &quot; &quot; -f 1 _файло_ | sort -u &gt; blacklist</code></pre></div><p>Как мне кажется, так не будут дублироваться IP, которые уже есть в blacklist</p>]]></content>
			<author>
				<name><![CDATA[-=Serj=-]]></name>
				<uri>https://linuxforum.ru/profile.php?id=16175</uri>
			</author>
			<updated>2012-04-19T17:15:26Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=269535#p269535</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Опять про блэклисты]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=269519#p269519" />
			<content type="html"><![CDATA[<p><strong>-=Serj=-</strong> дак уже додумали<br /></p><div class="codebox"><pre><code>cat /var/log/nginx/access_log | grep _критерий_ &gt; _файло_
cut -d &quot; &quot; -f 1 _файло_ | sort -u &gt;&gt; blacklist</code></pre></div>]]></content>
			<author>
				<name><![CDATA[zenon]]></name>
				<uri>https://linuxforum.ru/profile.php?id=6867</uri>
			</author>
			<updated>2012-04-19T15:41:18Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=269519#p269519</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Опять про блэклисты]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=269517#p269517" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>newzenon пишет:</cite><blockquote><p>Таки надо думать парсер</p></blockquote></div><p>Так что нужно ? Выдернуть IP-шники из логов ?<br />Я могу потренироваться на Python вечером, если не занят буду .</p>]]></content>
			<author>
				<name><![CDATA[-=Serj=-]]></name>
				<uri>https://linuxforum.ru/profile.php?id=16175</uri>
			</author>
			<updated>2012-04-19T15:23:06Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=269517#p269517</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Опять про блэклисты]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=269483#p269483" />
			<content type="html"><![CDATA[<p>Еще бы критерии левых запросов .... а то только примерно как-то или вручную.</p>]]></content>
			<author>
				<name><![CDATA[zenon]]></name>
				<uri>https://linuxforum.ru/profile.php?id=6867</uri>
			</author>
			<updated>2012-04-19T12:05:25Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=269483#p269483</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Опять про блэклисты]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=269481#p269481" />
			<content type="html"><![CDATA[<p>Эть:<br /></p><div class="codebox"><pre><code>cut -d &quot; &quot; -f 1 /var/log/nginx/access_log | sort -u </code></pre></div>]]></content>
			<author>
				<name><![CDATA[zenon]]></name>
				<uri>https://linuxforum.ru/profile.php?id=6867</uri>
			</author>
			<updated>2012-04-19T11:47:01Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=269481#p269481</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Опять про блэклисты]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=269480#p269480" />
			<content type="html"><![CDATA[<p>Что я сделал - скопировал приведенные выше логи в файлы 1 и 2, прогнал их через <br /></p><div class="codebox"><pre><code>cut -d &quot; &quot; -f 1 file1.txt &gt; file1.new 
cut -d &quot; &quot; -f 1 file2.txt &gt; file2.new </code></pre></div><p>И в таком виде скормил diff&#039;у.</p>]]></content>
			<author>
				<name><![CDATA[yars]]></name>
				<uri>https://linuxforum.ru/profile.php?id=22799</uri>
			</author>
			<updated>2012-04-19T11:22:23Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=269480#p269480</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Опять про блэклисты]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=269479#p269479" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>newzenon пишет:</cite><blockquote><div class="quotebox"><cite>yars пишет:</cite><blockquote><p>diff. Кому потребуется, скопирут списочек себе, обработает...</p></blockquote></div><p>Подробней, плиз, а как обработать надо тут выложить, чтобы все могли это сделать.<br />Блокировка, примерно так:<br /></p><div class="codebox"><pre><code>BLOCKDB=”/root/ip.blocked”
IPS=$(grep -Ev &quot;^#&quot; $BLOCKDB)
for i in $IPS
do
 iptables -I 1 PREROUTING 1 -s $i -j DROP
done</code></pre></div></blockquote></div><p>Поиск различий diff&#039;ом:<br /></p><div class="codebox"><pre><code>diff -B -w --changed-group-format=&quot;%=&quot; --line-format=&quot;%L&quot; file1.new file2.new &gt; result.txt</code></pre></div><p>Но я так и не понял, как же убрать все повторяющиеся строки? <br />Убрал про ...<span style="color: red"> ХВАТИТ УЖЕ</span></p>]]></content>
			<author>
				<name><![CDATA[yars]]></name>
				<uri>https://linuxforum.ru/profile.php?id=22799</uri>
			</author>
			<updated>2012-04-19T11:19:59Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=269479#p269479</id>
		</entry>
</feed>
