<?xml version="1.0" encoding="utf-8"?> 
<rss version="2.0"
  xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"
  xmlns:atom="http://www.w3.org/2005/Atom">

<channel>

<title>Заметки Александра Чернышева: заметки с тегом tor</title>
<link>https://aschernyshev.ru/tags/tor/</link>
<description>Keep in mind</description>
<author>Александр Чернышев</author>
<language>ru</language>
<generator>E2 (v3576; Aegea)</generator>

<itunes:owner>
<itunes:name>Александр Чернышев</itunes:name>
<itunes:email></itunes:email>
</itunes:owner>
<itunes:subtitle>Keep in mind</itunes:subtitle>
<itunes:image href="" />
<itunes:explicit></itunes:explicit>

<item>
<title>Прозрачное проксирование в I2P и TOR.</title>
<guid isPermaLink="true">https://aschernyshev.ru/all/prozrachnoe-proksirovanie-v-i2p-i-tor/</guid>
<link>https://aschernyshev.ru/all/prozrachnoe-proksirovanie-v-i2p-i-tor/</link>
<pubDate>Thu, 24 Nov 2016 14:47:40 +0300</pubDate>
<author>Александр Чернышев</author>
<comments>https://aschernyshev.ru/all/prozrachnoe-proksirovanie-v-i2p-i-tor/</comments>
<description>
&lt;div class="e2-text-picture"&gt;
&lt;img src="https://aschernyshev.ru/pictures/i2p_tor_logo.jpg" width="417" height="300" alt="" /&gt;
&lt;/div&gt;
&lt;p&gt;Заметка написана по мотивам статьи &lt;a href="https://habrahabr.ru/post/122835/" class="nu"&gt;«&lt;u&gt;Прозрачное проксирование в I2P и TOR&lt;/u&gt;»&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;_LANNET_&lt;/b&gt; — локальная подсеть&lt;br /&gt;
&lt;b&gt;_WANETH_&lt;/b&gt; — внешний интерфейс&lt;br /&gt;
&lt;b&gt;_LANETH_&lt;/b&gt;  — внутренний интерфейс&lt;/p&gt;
&lt;h2&gt;DNSMasq&lt;/h2&gt;
&lt;pre class="e2-text-code"&gt;&lt;code class=""&gt;vi /etc/dnsmasq.conf&lt;/code&gt;&lt;/pre&gt;&lt;hr /&gt;
&lt;pre class="e2-text-code"&gt;&lt;code class=""&gt;log-queries
log-facility=/var/log/dnsmasq.log
listen-address= 0.0.0.0
interface=_LANETH_
except-interface=_WANETH_
domain-needed 
bogus-priv  
strict-order 
no-resolv
server=77.88.8.88
server=8.8.8.8
address=/.onion/10.10.99.99
address=/.i2p/10.10.99.99&lt;/code&gt;&lt;/pre&gt;&lt;hr /&gt;
&lt;pre class="e2-text-code"&gt;&lt;code class=""&gt;systemctl enable dnsmasq.service
systemctl start dnsmasq.service&lt;/code&gt;&lt;/pre&gt;&lt;h2&gt;Tor&lt;/h2&gt;
&lt;pre class="e2-text-code"&gt;&lt;code class=""&gt;vi /etc/tor/torrc&lt;/code&gt;&lt;/pre&gt;&lt;hr /&gt;
&lt;pre class="e2-text-code"&gt;&lt;code class=""&gt;SocksPort 9050
SocksListenAddress 127.0.0.1
ExcludeNodes {ru}, {ua}, {by}
VirtualAddrNetworkIPv4 10.192.0.0/10
AutomapHostsOnResolve 1&lt;/code&gt;&lt;/pre&gt;&lt;hr /&gt;
&lt;pre class="e2-text-code"&gt;&lt;code class=""&gt;systemctl enable tor.service
systemctl start tor.service&lt;/code&gt;&lt;/pre&gt;&lt;h2&gt;i2pd&lt;/h2&gt;
&lt;pre class="e2-text-code"&gt;&lt;code class=""&gt;vi /etc/i2pd/subscriptions.txt&lt;/code&gt;&lt;/pre&gt;&lt;hr /&gt;
&lt;pre class="e2-text-code"&gt;&lt;code class=""&gt;http://inr.i2p/export/alive-hosts.txt
http://stats.i2p/cgi-bin/newhosts.txt
http://i2p-projekt.i2p/hosts.txt
http://i2host.i2p/cgi-bin/i2hostetag
http://no.i2p/export/alive-hosts.txt
http://rus.i2p/hosts.txt
http://udhdrtrcetjm5sxzskjyr5ztpeszydbh4dpl3pl4utgqqw2v4jna.b32.i2p/hosts.tx&lt;/code&gt;&lt;/pre&gt;&lt;hr /&gt;
&lt;pre class="e2-text-code"&gt;&lt;code class=""&gt;vi /etc/i2pd/&lt;/code&gt;&lt;/pre&gt;&lt;hr /&gt;
&lt;pre class="e2-text-code"&gt;&lt;code class=""&gt;[IRC]
type = client
address = 127.0.0.1
port = 6668
destination = irc.postman.i2p
destinationport = 6667
keys = irc-keys.dat&lt;/code&gt;&lt;/pre&gt;&lt;hr /&gt;
&lt;pre class="e2-text-code"&gt;&lt;code class=""&gt;systemctl enable i2pd.service
systemctl start i2pd.service&lt;/code&gt;&lt;/pre&gt;&lt;h2&gt;TinyProxy&lt;/h2&gt;
&lt;pre class="e2-text-code"&gt;&lt;code class=""&gt;vim /etc/tinyproxy.conf&lt;/code&gt;&lt;/pre&gt;&lt;hr /&gt;
&lt;pre class="e2-text-code"&gt;&lt;code class=""&gt;User nobody
Group nogroup
Port 8888
Listen _LANNET_
Timeout 200
ErrorFile 404 &amp;quot;/usr/share/tinyproxy/404.html&amp;quot;
ErrorFile 400 &amp;quot;/usr/share/tinyproxy/400.html&amp;quot;
ErrorFile 503 &amp;quot;/usr/share/tinyproxy/503.html&amp;quot;
ErrorFile 403 &amp;quot;/usr/share/tinyproxy/403.html&amp;quot;
ErrorFile 408 &amp;quot;/usr/share/tinyproxy/408.html&amp;quot;
DefaultErrorFile &amp;quot;/usr/share/tinyproxy/default.html&amp;quot;
StatFile &amp;quot;/usr/share/tinyproxy/stats.html&amp;quot;
Logfile &amp;quot;/var/log/tinyproxy/tinyproxy.log&amp;quot;
LogLevel Info
PidFile &amp;quot;/var/run/tinyproxy/tinyproxy.pid&amp;quot;
upstream 127.0.0.1:8123
upstream 127.0.0.1:4444 &amp;quot;.i2p&amp;quot;
upstream 127.0.0.1:8124 &amp;quot;.onion&amp;quot;
MaxClients 100
MinSpareServers 5
MaxSpareServers 20
StartServers 10
MaxRequestsPerChild 0
Allow 127.0.0.1
Allow 192.168.0.0/16
ViaProxyName &amp;quot;tinyproxy&amp;quot;
ConnectPort 443
ConnectPort 563&lt;/code&gt;&lt;/pre&gt;&lt;hr /&gt;
&lt;pre class="e2-text-code"&gt;&lt;code class=""&gt;systemctl enable tinyproxy.service
systemctl start tinyproxy.service&lt;/code&gt;&lt;/pre&gt;&lt;h2&gt;Polipo&lt;/h2&gt;
&lt;pre class="e2-text-code"&gt;&lt;code class=""&gt;vim /etc/polipo/wan.conf&lt;/code&gt;&lt;/pre&gt;&lt;hr /&gt;
&lt;pre class="e2-text-code"&gt;&lt;code class=""&gt;##################
# https://www.irif.fr/~jch/software/polipo/polipo.html#
##################

displayName = WAN
proxyPort = 8123
allowedClients = 127.0.0.1, _LANNET_
dnsQueryIPv6 = false
pidFile = /var/run/polipo/polipo_wan.pid
#######
censoredHeaders = from, accept-language
censorReferer = maybe
disableVia = true
####### Cache #######
diskCacheRoot = &amp;quot;/var/cache/polipo/wan_cache/&amp;quot;
maxDiskCacheEntrySize = 524288
diskCacheDirectoryPermissions = 0700
diskCacheFilePermissions = 0600
relaxTransparency = maybe
dontCacheCookies = true
dontCacheRedirects = true
diskCacheUnlinkTime = 7d
diskCacheTruncateTime = 3d
diskCacheTruncateSize = 1MB
######## Memory ########
chunkHighMark = 50331648
objectHighMark = 16384
######## WEB Interface ########
disableLocalInterface = true
#disableConfiguration = false
#disableIndexing = false
#disableServersList = false
######## Log ########
logSyslog = true
logFile = &amp;quot;/var/log/polipo/wan.log&amp;quot;&lt;/code&gt;&lt;/pre&gt;&lt;hr /&gt;
&lt;pre class="e2-text-code"&gt;&lt;code class=""&gt;vim /etc/polipo/tor.conf&lt;/code&gt;&lt;/pre&gt;&lt;hr /&gt;
&lt;pre class="e2-text-code"&gt;&lt;code class=""&gt;##################
# https://www.irif.fr/~jch/software/polipo/polipo.html#
##################

displayName = TOR
proxyPort = 8124
allowedClients = 127.0.0.1, _LANNET_
dnsQueryIPv6 = false
pidFile = /var/run/polipo/polipo_tor.pid
####### SOCKS #######
socksParentProxy = &amp;quot;127.0.0.1:9050&amp;quot;
socksProxyType=socks5
#######
censoredHeaders = from, accept-language
censorReferer = maybe
disableVia = true
####### Cache #######
diskCacheRoot = &amp;quot;/var/cache/polipo/tor_cache/&amp;quot;
diskCacheDirectoryPermissions = 0700
diskCacheFilePermissions = 0600
relaxTransparency = maybe
dontCacheCookies = true
dontCacheRedirects = true
diskCacheUnlinkTime = 7d
diskCacheTruncateTime = 3d
diskCacheTruncateSize = 1MB
######## Memory ########
chunkHighMark = 50331648
objectHighMark = 16384
######## WEB Interface ########
disableLocalInterface = true
#disableConfiguration = false
#disableIndexing = false
#disableServersList = false
######## Log ########
logSyslog = true
logFile = &amp;quot;/var/log/polipo/tor.log&amp;quot;&lt;/code&gt;&lt;/pre&gt;&lt;hr /&gt;
&lt;pre class="e2-text-code"&gt;&lt;code class=""&gt;vi /etc/systemd/system/polipo@.service&lt;/code&gt;&lt;/pre&gt;&lt;hr /&gt;
&lt;pre class="e2-text-code"&gt;&lt;code class=""&gt;[Unit]
Description=Polipo Proxy Server
After=network.target

[Service]
User=proxy
Group=proxy
Type=simple
Restart=always
PIDFile=/var/run/polipo/polipo_%i.pid
PermissionsStartOnly=true
ExecStartPre=/bin/mkdir -p /var/cache/polipo/%i_cache
ExecStartPre=/bin/chown proxy:proxy /var/cache/polipo/%i_cache -R
ExecStartPre=/bin/chmod 700 /var/cache/polipo/%i_cache -R
ExecStart=/usr/bin/polipo -c /etc/polipo/%i.conf
ExecReload=/bin/kill -USR1 $MAINPID


[Install]
WantedBy=multi-user.target&lt;/code&gt;&lt;/pre&gt;&lt;hr /&gt;
&lt;pre class="e2-text-code"&gt;&lt;code class=""&gt;vi /etc/tmpfiles.d/polipo.conf&lt;/code&gt;&lt;/pre&gt;&lt;hr /&gt;
&lt;pre class="e2-text-code"&gt;&lt;code class=""&gt;d /run/polipo 0755 proxy proxy -&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Скрипт для очистки кеша&lt;/p&gt;
&lt;pre class="e2-text-code"&gt;&lt;code class=""&gt;vi /usr/local/polipo/polipo_trimcache.sh&lt;/code&gt;&lt;/pre&gt;&lt;hr /&gt;
&lt;pre class="e2-text-code"&gt;&lt;code class=""&gt;#!/bin/bash

export PATH=&amp;quot;$PATH:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin&amp;quot;
SN=&amp;quot;$(basename &amp;quot;$0&amp;quot;)&amp;quot;

function print_help() {
    printf &amp;quot;\n&amp;quot;
    printf &amp;quot;Использование: %s options...\n&amp;quot; &amp;quot;$SN&amp;quot;
    printf &amp;quot;Параметры:\n&amp;quot;
    printf &amp;quot;  -n         Имя копии Polipo.\n&amp;quot;
    printf &amp;quot;  -h         Справка.\n&amp;quot;
    printf &amp;quot;\n&amp;quot;
}

# Если скрипт запущен без аргументов, открываем справку.
if [[ $# = 0 ]]; then
    print_help &amp;amp;&amp;amp; exit 1
fi
while getopts &amp;quot;:n:h&amp;quot; opt ;
do
    case $opt in
        n) NAME=$OPTARG;
            ;;
        h) print_help
            exit 1
            ;;
        *) printf &amp;quot;Неправильный параметр\n&amp;quot;;
           printf &amp;quot;Для вызова справки запустите %s -h\n&amp;quot; &amp;quot;$SN&amp;quot;;
            exit 1
            ;;
        esac
done

if [[ &amp;quot;$NAME&amp;quot; == &amp;quot;&amp;quot; ]] ;  then
 printf &amp;quot;\n&amp;quot;
 printf &amp;quot;Параметры запуска не указаны.\n&amp;quot;
 printf &amp;quot;Для справки наберите: %s -h\n&amp;quot; &amp;quot;$SN&amp;quot;
 printf &amp;quot;\n&amp;quot;
 exit 1
fi

CONFIG_FILE=/etc/polipo/$NAME.conf
FORBIDDEN_FILE=/etc/polipo/forbidden
PIDFILE=/var/run/polipo/polipo_$NAME.pid
RUNAS=proxy

if [ ! -x /usr/bin/polipo ]; then
  exit 0
fi

if [ ! -f &amp;quot;$FORBIDDEN_FILE&amp;quot; ]; then
  FORBIDDEN_FILE=/dev/null
fi

if [ -f &amp;quot;$PIDFILE&amp;quot; ]; then
  # Instruct polipo to to flush its in-memory cache to disk (signal USR1)
  kill -USR1 &amp;quot;$(cat &amp;quot;$PIDFILE&amp;quot;)&amp;quot;
  # Allow some time for polipo to perform the requested flush
  sleep 2
  # Since f17, the following su command prints &amp;quot;...killed.&amp;quot; to stdout ???
  runuser -s /bin/sh -c \
    &amp;quot;nice polipo -x -c $CONFIG_FILE forbiddenFile=$FORBIDDEN_FILE &amp;gt; /dev/null&amp;quot; \
    $RUNAS 2&amp;gt; /dev/null
  # Instruct polipo to to discard its in-memory cache (signal USR2)
  kill -USR2 &amp;quot;$(cat &amp;quot;$PIDFILE&amp;quot;)&amp;quot;
fi

exit 0&lt;/code&gt;&lt;/pre&gt;&lt;hr /&gt;
&lt;pre class="e2-text-code"&gt;&lt;code class=""&gt;vi /etc/systemd/system/polipo_trimcache@.service&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Создаем сервис для очистки кеша&lt;/p&gt;
&lt;hr /&gt;
&lt;pre class="e2-text-code"&gt;&lt;code class=""&gt;[Unit]
Description=Polipo trim cache on %I
After=network-online.target

[Service]
Type=oneshot
ExecStart=/usr/lib/polipo/polipo_trimcache.sh -n %i&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Создаем таймер&lt;/p&gt;
&lt;hr /&gt;
&lt;pre class="e2-text-code"&gt;&lt;code class=""&gt;vi /etc/systemd/system/polipo_trimcache@.timer&lt;/code&gt;&lt;/pre&gt;&lt;pre class="e2-text-code"&gt;&lt;code class=""&gt;[Unit]
Description=Polipo trim cache timer on %I

[Timer]
OnCalendar=*-*-* 00:00:00
Persistent=true

[Install]
WantedBy=timers.target&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Активируем и запускаем сервисы&lt;/p&gt;
&lt;pre class="e2-text-code"&gt;&lt;code class=""&gt;systemctl enable polipo@wan
systemctl enable polipo_trimcache@wan.timer
systemctl start polipo@wan
systemctl sart polipo_trimcache@wan.timer
systemctl enable polipo@tor
systemctl enable polipo_trimcache@tor.timer
systemctl start polipo@tor
systemctl sart polipo_trimcache@tor.timer&lt;/code&gt;&lt;/pre&gt;</description>
</item>

<item>
<title>Firefox не открывает сайты .onion</title>
<guid isPermaLink="true">https://aschernyshev.ru/all/firefox-ne-otkryvaet-sayty-onion/</guid>
<link>https://aschernyshev.ru/all/firefox-ne-otkryvaet-sayty-onion/</link>
<pubDate>Fri, 19 Aug 2016 10:24:59 +0300</pubDate>
<author>Александр Чернышев</author>
<comments>https://aschernyshev.ru/all/firefox-ne-otkryvaet-sayty-onion/</comments>
<description>
&lt;p&gt;Начиная с версии &lt;b&gt;Firefox 45&lt;/b&gt;  в настройках &lt;b&gt;about:config&lt;/b&gt; появилась новая опция &lt;b&gt;network.dns.blockDotOnion&lt;/b&gt; для блокировки на уровне DNS узлов в скрытой сети &lt;b&gt;.onion&lt;/b&gt;. По умолчанию указано значение &lt;b&gt;true&lt;/b&gt;. Для отключения этой опции необходимо изменить значение на &lt;b&gt;false&lt;/b&gt; и перезапустите браузер.&lt;/p&gt;
</description>
</item>


</channel>
</rss>