LINUX.ORG.RU

Tor+Polipo

 , ,


0

2

openSUSE 12.2

Установил tor и polipo. Для polipo отредактировал конфиг так:

# Sample configuration file for Polipo. -*-sh-*-

# You should not need to use a configuration file; all configuration
# variables have reasonable defaults.  If you want to use one, you
# can copy this to /etc/polipo/config or to ~/.polipo and modify.

# This file only contains some of the configuration variables; see the
# list given by ``polipo -v'' and the manual for more.

### Configuration from RPM
### *****************************
forbiddenFile = /etc/polipo/forbidden
uncachableFile = /etc/polipo/dontcache
diskCacheFilePermissions = 0600
diskCacheDirectoryPermissions = 0700
disableLocalInterface = true

### Basic configuration
### *******************

# by default, polipo listens on port 8123
# Uncomment this and change the value to your needs 
# if you want to use another port for polipo
# proxyPort=8123

# Uncomment one of these if you want to allow remote clients to
# connect:

# proxyAddress = "::0"        # both IPv4 and IPv6
# proxyAddress = "0.0.0.0"    # IPv4 only

proxyAddress = "127.0.0.1"
proxyPort = 8118

# If you do that, you'll want to restrict the set of hosts allowed to
# connect:

# allowedClients = 127.0.0.1, 134.157.168.57
# allowedClients = 127.0.0.1, 134.157.168.0/24

allowedClients = 127.0.0.1
allowedPorts = 1-65535

# Uncomment this if you want your Polipo to identify itself by
# something else than the host name:

# proxyName = "polipo.example.org"

proxyName = "localhost"

# Uncomment this if there's only one user using this instance of Polipo:

cacheIsShared = false

# Uncomment this if you want to use a parent proxy:

# parentProxy = "squid.example.org:3128"

# Uncomment this if you want to use a parent SOCKS proxy:

socksParentProxy = "localhost:9050"
socksProxyType = socks5

# Uncomment this if you want to scrub private information from the log:

# scrubLogs = true


### Memory
### ******

# Uncomment this if you want Polipo to use a ridiculously small amount
# of memory (a hundred C-64 worth or so):

# chunkHighMark = 819200
# objectHighMark = 128

# Uncomment this if you've got plenty of memory:

# chunkHighMark = 50331648
# objectHighMark = 16384

chunkHighMark = 67108864

### On-disk data
### ************

# Uncomment this if you want to disable the on-disk cache:

diskCacheRoot = ""

# Uncomment this if you want to put the on-disk cache in a
# non-standard location:

# diskCacheRoot = "~/.polipo-cache/"

# Uncomment this if you want to disable the local web server:

localDocumentRoot = ""

# Uncomment this if you want to enable the pages under /polipo/index?
# and /polipo/servers?.  This is a serious privacy leak if your proxy
# is shared.

# disableIndexing = false
# disableServersList = false

disableLocalInterface = true
disableConfiguration = true

### Domain Name System
### ******************

# Uncomment this if you want to contact IPv4 hosts only (and make DNS
# queries somewhat faster):

# dnsQueryIPv6 = no

# Uncomment this if you want Polipo to prefer IPv4 to IPv6 for
# double-stack hosts:

# dnsQueryIPv6 = reluctantly

# Uncomment this to disable Polipo's DNS resolver and use the system's
# default resolver instead.  If you do that, Polipo will freeze during
# every DNS query:

dnsUseGethostbyname = yes
# dnsUseGethostbyname = reluctantly


### HTTP
### ****

# Uncomment this if you want to enable detection of proxy loops.
# This will cause your hostname (or whatever you put into proxyName
# above) to be included in every request:

# disableVia=false

disableVia = true

# Uncomment this if you want to slightly reduce the amount of
# information that you leak about yourself:

# censoredHeaders = from, accept-language
# censorReferer = maybe

censoredHeaders = from,accept-language,x-pad,link
censorReferer = maybe

# Uncomment this if you're paranoid.  This will break a lot of sites,
# though:

# censoredHeaders = set-cookie, cookie, cookie2, from, accept-language
# censorReferer = true

# Uncomment this if you want to use Poor Man's Multiplexing; increase
# the sizes if you're on a fast line.  They should each amount to a few
# seconds' worth of transfer; if pmmSize is small, you'll want
# pmmFirstSize to be larger.

# Note that PMM is somewhat unreliable.

# pmmFirstSize = 16384
# pmmSize = 8192

# Uncomment this if your user-agent does something reasonable with
# Warning headers (most don't):

# relaxTransparency = maybe

# Uncomment this if you never want to revalidate instances for which
# data is available (this is not a good idea):

# relaxTransparency = yes

# Uncomment this if you have no network:

# proxyOffline = yes

# Uncomment this if you want to avoid revalidating instances with a
# Vary header (this is not a good idea):

# mindlesslyCacheVary = true

# Suggestions from Incognito configuration
maxConnectionAge = 5m
maxConnectionRequests = 120
serverMaxSlots = 8
serverSlots = 2
tunnelAllowedPorts = 1-65535 

# Uncomment this if you want to add a no-transform directive to all
# outgoing requests.

# alwaysAddNoTransform = true

# Uncomment this if you want to allow use of certain
# ranges of outgoing ports (might be needed for use with tor)
# allowedPorts=1-65535

# Uncomment this if you want to allow use of certain
# ranges of outgoing tunneled ports (might be needed for use with tor)
# tunnelAllowedPorts=1-65535
Запускаю tor из консоли
valrav@Note:~> tor
Oct 05 02:31:07.413 [notice] Tor v0.2.4.3-alpha-dev running on Linux with Libevent 2.0.10-stable and OpenSSL 1.0.1c.
Oct 05 02:31:07.413 [notice] Tor can't help you if you use it wrong! Learn how to be safe at https://www.torproject.org/download/download#warning
Oct 05 02:31:07.413 [notice] This version is not a stable Tor release. Expect more bugs than usual.
Oct 05 02:31:07.413 [notice] Read configuration file "/etc/tor/torrc".
Oct 05 02:31:07.419 [notice] Opening Socks listener on 127.0.0.1:9050
Oct 05 02:31:07.000 [notice] Parsing GEOIP file /usr/share/tor/geoip.
Oct 05 02:31:07.000 [notice] We now have enough directory information to build circuits.
Oct 05 02:31:07.000 [notice] Bootstrapped 80%: Connecting to the Tor network.
Oct 05 02:31:09.000 [notice] Bootstrapped 85%: Finishing handshake with first hop.
Oct 05 02:31:12.000 [notice] Bootstrapped 90%: Establishing a Tor circuit.
Oct 05 02:31:15.000 [notice] Tor has successfully opened a circuit. Looks like client functionality is working.
Oct 05 02:31:15.000 [notice] Bootstrapped 100%: Done.
Запускаю polipo из консоли
valrav@Note:~> polipo
Established listening socket on port 8123.
Выставляю в браузере вручную настройки прокси, где для всех протоколов кроме SOCKS прописываю адрес localhost и указываем порт 8118, а для всех SOCKS порт 9050. В результате firefox выдает: http://storage6.static.itmages.ru/i/12/1005/h_1349389723_9183768_e72a9968dd.png

Логи tor и polipo не сохраняет. Куда копать?



Последнее исправление: cetjs2 (всего исправлений: 1)

Ответ на: комментарий от swarnk

Да, по инструкции так и надо, я на убунте так настроивал и все работало. Я, конечно, пробовал в настройках браузера прописывать порт 8123, но картина была та же самая.

Dnmt
() автор топика
Ответ на: комментарий от Dnmt

Valrav

Смотри внимательно видео

Cкачай архив: 32-bit или 64-bit

разархивируй и запусти файл (предварительно дав права на исполнение) start-tor-browser.

Всё, пользуйся.

anonymous
()

Valrav

Может после того, как ты отредактировал конфиг нужно произвести рестарт polipo

В консоли от рута выполнить

/etc/init.d/polipo restart

У суси в ясте есть даже для этого специальный модуль для управления запуском сервисов и служб (Yast -> Система -> Управление службами‎). Можешь туда зайти (там два режима: обычный и экспертный) и рестартануть polipo.

anonymous
()
Ответ на: комментарий от anonymous

Заодно рестартани таким же образом tor на всякий случай

anonymous
()
Ответ на: комментарий от anonymous

Рестартовал и то и другое и комп ребутил, все равно браузер не выходит в сеть через прокси.

Dnmt
() автор топика
Ответ на: комментарий от Dnmt

Torbutton для firefox установлен.

В консоли от рута:

/etc/init.d/polipo restart

/etc/init.d/tor restart

И выхлоп каждой команды сюда.

anonymous
()
Ответ на: комментарий от anonymous
# /etc/init.d/polipo restart
redirecting to systemctl
# /etc/init.d/tor restart
redirecting to systemctl
Job failed. See system journal and 'systemctl status' for details.

Torbutton не установлен, так как настройки можно в firefox можно менять и вручную.

Dnmt
() автор топика
Ответ на: комментарий от firestarter

Ну и мой конфиг такой же. В виндовой версии этот конфиг идет уже настроенным аналогичным образом.

Dnmt
() автор топика
Ответ на: комментарий от anonymous

Перед этой командой выполни сначала

systemctl start tor.service

А потом как написал

systemctl status tor.service

и выхлоп последней команды сюда

anonymous
()
Ответ на: комментарий от anonymous

И еще содержимое /lib/systemd/system/tor.service сюда тоже

anonymous
()
Ответ на: комментарий от anonymous
# systemctl start tor.service
Job failed. See system journal and 'systemctl status' for details.
# systemctl status tor.service
tor.service - LSB: Start the tor daemon
          Loaded: loaded (/etc/init.d/tor)
          Active: failed (Result: exit-code) since Fri, 05 Oct 2012 23:56:17 +0400; 22s ago
         Process: 5136 ExecStart=/etc/init.d/tor start (code=exited, status=7/NOTRUNNING)
          CGroup: name=systemd:/system/tor.service

Oct 05 23:56:17 Note tor[5136]: Oct 05 23:56:17.971 [notice] Tor v0.2.4.3-alpha-dev running....1c.
Oct 05 23:56:17 Note tor[5136]: Oct 05 23:56:17.971 [notice] Tor can't help you if you use ...ning
Oct 05 23:56:17 Note tor[5136]: Oct 05 23:56:17.971 [notice] This version is not a stable T...ual.
Oct 05 23:56:17 Note tor[5136]: Oct 05 23:56:17.971 [notice] Read configuration file "/etc/...rc".
Oct 05 23:56:17 Note tor[5136]: Oct 05 23:56:17.976 [notice] Opening Socks listener on 127....9050
Oct 05 23:56:17 Note tor[5136]: Oct 05 23:56:17.976 [warn] Could not bind to 127.0.0.1:9050...ing?
Oct 05 23:56:17 Note tor[5136]: Oct 05 23:56:17.976 [warn] Failed to parse/validate config:...rts.
Oct 05 23:56:17 Note tor[5136]: Oct 05 23:56:17.976 [err] Reading config failed--see warnin...ove.
Oct 05 23:56:17 Note tor[5136]: /usr/bin/torctl start: tor could not be started
Oct 05 23:56:17 Note startproc[5142]: startproc:  exit status of parent of /usr/bin/torctl: 3

И еще содержимое /lib/systemd/system/tor.service сюда тоже

а вот такого файла не нашел.

Dnmt
() автор топика
Ответ на: комментарий от Dnmt

Так теперь сделай следующее:

При загрузке, когда появляется окно груба нажми F5 и выбери пункт System V (он третий в списке после Default и Systemd), загрузись, а затем проверь еще раз. (если опять это ничего не даст, то выполни эти команды

/etc/init.d/polipo restart

/etc/init.d/tor restart

и выхлоп сюда)

anonymous
()
Ответ на: комментарий от anonymous

Если все заработает при выборе System V через f5 при загрузке grub2, то наверное это проблема сборки тора под сусю. Наверное лучший способ решить эту проблему это создать файл tor.service в /usr/lib/systemd/system/ (или в /lib/systemd/system/) c приблизительно таким содержимым (этот файл взял из пакета tor-systemd собранного для fedora 17)

[Unit]
Description = Anonymizing overlay network for TCP
After = syslog.target network.target nss-lookup.target

[Service]
Type = simple
ExecStart = /usr/bin/tor --runasdaemon 0 --quiet
ExecReload = /bin/kill -HUP ${MAINPID}
ExecStop = /bin/kill -INT ${MAINPID}
TimeoutSec = 30
Restart = on-failure
LimitNOFILE = 4096

[Install]
WantedBy = multi-user.target

Правда в багзилле есть такой баг и там предлагается изменить строчки

Type = simple
ExecStart = /usr/bin/tor --runasdaemon 0 --quiet

на

Type = forking
ExecStart = /usr/bin/tor -f /etc/tor/torrc

Я правда точно не уверен что этим файлом все ограничится... Так что, ты сначала проверь работу тора с System V (запускается ли тор, нет ли такой ошибки больше в браузере), а потом уже это

anonymous
()
Ответ на: комментарий от anonymous

Но у меня при выборе операционной системы в меню Grub2 при нажатии на F5 ничего не происходит. Насолько я знаю в grub можно лишь редактировать параметры загрузки нажатием на клавишу E.

Dnmt
() автор топика
Ответ на: комментарий от Dnmt

Valrav

Так сейчас загрузил live-cd opensuse с kde в виртуалке. Действительно по f5 ничего нету (видимо убрали эту возможность при чистой установки, при обновлении с opensuse 12.1 на 12.2 этот пункт есть).

Значит так

1 способ) Через яст установи пакет sysvinit-init и удали (яст сам предложит) пакет systemd-sysvinit

Перезагрузись (если вдруг появится возможность что-то выбрать по f5, то выбери тот пункт который написал выше, если - нет, то просто продолжай дальше загрузку)

Проверь теперь все ли работает (нет ошибки в браузере)

Если потребуется рестартануть tor или polipo в случае если что-то не заработает, то выполни в консоли

/etc/init.d/polipo restart

/etc/init.d/tor restart

2 способ) Если первый способ не сработает, то через яст установи пакет systemd-sysvinit и удали (яст сам предложит) пакет sysvinit-init

Перезагрузись

Создай файл tor.service (понадобится рут) в директории /lib/systemd/system/ со следующим содержимым

[Unit]
Description = Anonymizing overlay network for TCP
After = syslog.target network.target nss-lookup.target

[Service]
Type = simple
ExecStart = /usr/bin/tor --runasdaemon 0 --quiet
ExecReload = /bin/kill -HUP ${MAINPID}
ExecStop = /bin/kill -INT ${MAINPID}
TimeoutSec = 30
Restart = on-failure
LimitNOFILE = 4096

[Install]
WantedBy = multi-user.target 

Сохрани

Далее в консоли от рута

systemctl start polipo.service

systemctl start tor.service

Ошибок по-идеи не должно быть

Опять же проверяй все ли работает.

Если что-то непонятно пиши

anonymous
()
Ответ на: комментарий от anonymous

Ах да есть еще команды которые добавляют tor и polipo в автозагрузку

systemctl enable polipo.service

systemctl enable tor.service
anonymous
()
Ответ на: комментарий от anonymous

1 способ) Через яст установи пакет sysvinit-init и удали (яст сам предложит) пакет systemd-sysvinit

Перезагрузись (если вдруг появится возможность что-то выбрать по f5, то выбери тот пункт который написал выше, если - нет, то просто продолжай дальше загрузку)

Проверь теперь все ли работает (нет ошибки в браузере)

а вот после этого тор заработал. Но пропала анимация загрузки системы, вместо нее теперь список загружаемых компонентов отображается. И еще системное время сбилось на четыре часа вперед. Как же без анимации-то теперь?

Dnmt
() автор топика
Ответ на: комментарий от anonymous

В общем, после установки пакета sysvinit-init я пробовал запускать polipo от рута, в результате чего тор работал. После чего я вернул назад пакет systemd-sysvinit и у соответсвенно удалил sysvinit-init, после чего анимация загрузки системы вернулась на место и системные часы вернулись на место, и после чего при запуске polipo от рута, тор тоже заработал. Я не уверен, переустановка пакета помогла или просто я раньше по дурости не мог запустить polipo от рута. Дело в том что если запустить polipo от юзера, то он запускается с портом 8123, в результате чего не получается подключится к сети тора даже если выставить в браузере порт 8123. А если polipo запустить от рута, он запускается с правильным портом 8118 и все работает.

Добавил polipo в автозапуск, а тор автоматически запускается с оболочкой Vidalia и все работает) Еще бы в firefox какую кнопочку добавить для автоматического перехода на прокси, чтобы не лазить каждый раз в настройки. Может кто подскажет какое дополнение для этого?

Dnmt
() автор топика
Ответ на: комментарий от anonymous

На счет дополнения Torbutto слышал, конечно. Оно было для firefox 3.6, а новых версий не выходило, по крайней мере оно даже не ищется в центре дополнений.

Нет, второй способ не понадобился.

Может поможешь настроить самбу?

Dnmt
() автор топика
Ответ на: комментарий от anonymous

От дополнения Torbutton пришлось отказаться, в нем теперь нет функции включения и отключения, он по умолчанию настраивает браузер на работу через тор.

Dnmt
() автор топика
Ответ на: комментарий от Dnmt

Valrav

Ну просто супер...

1. Установил torbutton

2. Появился значок torbutton вверху (зеленый значок)

3. Правая клавишей мышки по значку torbutton - в контекстном меню опция «настройки».

4. В открывшемся окне в последняя строчке есть опция «Отключить „Кнопку“ и „Горячие клавиши“ для предотвращения случайного переключения режима»

http://rghost.ru/40772252.view

Снимаем с этой опции галку

http://rghost.ru/40772276.view

5. Правая клавишей мышки по значку torbutton - появилась в контекстном меню опция «Изменить состояния tor».

http://rghost.ru/40772315/image.png

Жмакаешь по ней и тор отключен (значок изменился),

http://rghost.ru/40772383/image.png

Если опять включить надо, то тоже самое: ПКМ по значку torbutton, далее «Изменить состояния tor»

Всё

anonymous
()
Ответ на: комментарий от anonymous

О, и правда работает) Меня просто сразу же смутило сообщение:

Torbutton works differently now: you can't turn it off any more.

We made this change because it isn't safe to use Torbutton in a browser that's also used for non-Tor browsing. There were too many bugs there that we couldn't fix any other way.

If you want to keep using Firefox normally, you should uninstall Torbutton and download Tor Browser Bundle. The privacy properties of Tor Browser are also superior to those of normal Firefox, even when Firefox is used with Torbutton.

To remove Torbutton, go to Tools->Addons->Extensions and then click the Remove button next to Torbutton.

Dnmt
() автор топика
23 января 2013 г.

авсевото надо было

mv /etc/tor/torrc.sample /etc/tor/torrc

anonymous
()
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.