Pull to refresh

Telegram desktop + Tor

Я просто хотел приятный десктопный месенджер независящий от подключения к сети у смартфона. Я получил Telegram, радость была не особо долгой.
Пришло 20180417. Ну ок.
Подружим его с Tor. Вариант пустить его через Tor Browser, мне не доставляет удовольствия, просто нет желания держать в памяти ещё один браузер. Выбрал вариант Tor Expert Bundle — консольный клиент для Tor сети. Взять его можно с сайта полюбившегося всем проекта www.torproject.org.
Распаковав его в желаемую директорию, запустим tor.exe.

C:\service\torbundle\Tor>tor
Apr 18 13:10:26.855 [notice] Tor 0.3.2.10 running on Windows 8 with Libevent 2.0.22-stable, OpenSSL 1.0.2n, Zlib 1.2.8, Liblzma N/A, and Libzstd N/A.
Apr 18 13:10:26.871 [notice] Tor can't help you if you use it wrong! Learn how to be safe at https://www.torproject.org/download/download#warning
Apr 18 13:10:26.886 [notice] Configuration file "C:\Users\suser\AppData\Roaming\tor\torrc" not present, using reasonable defaults.
Apr 18 13:10:26.886 [warn] Path for GeoIPFile (<default>) is relative and will resolve to C:\service\torbundle\Tor\<default>. Is this what you wanted?
Apr 18 13:10:26.886 [warn] Path for GeoIPv6File (<default>) is relative and will resolve to C:\service\torbundle\Tor\<default>. Is this what you wanted?
Apr 18 13:10:26.886 [notice] Scheduler type KISTLite has been enabled.
Apr 18 13:10:26.886 [notice] Opening Socks listener on 127.0.0.1:9050
Apr 18 13:10:27.000 [notice] Bootstrapped 0%: Starting
Apr 18 13:10:29.000 [notice] Starting with guard context "default"
Apr 18 13:10:29.000 [notice] Bootstrapped 80%: Connecting to the Tor network
Apr 18 13:10:30.000 [notice] Bootstrapped 85%: Finishing handshake with first hop
Apr 18 13:10:30.000 [notice] Bootstrapped 90%: Establishing a Tor circuit
Apr 18 13:10:32.000 [notice] Tor has successfully opened a circuit. Looks like client functionality is working.
Apr 18 13:10:32.000 [notice] Bootstrapped 100%: Done


Видим появившегося сокс слушателя на порту 9050 (в отличие от Tor Browser по умолчанию открывающего порт 9150) и дожидаемся Bootstrapped 100%: Done.
Ну а далее пускаем на сокс прокси нужный софт, вот например...Telegram.
Settings->мотаем к Advanced Settings-> Connection type
Соответственно выбираем TCP with custom socks5-proxy, где и вписываем наш сервер (Hostname 127.0.0.1 Port 9050)

В корпоративной сети обычно используется свой прокси сервер, при таком варианте при запуске tor.exe добавим опцию HTTPSProxy с адресом и портом прокси:
tor.exe --HTTPSProxy 10.10.10.1:8080

Ну и конечно прокси сервер может быть с аутентификацией (и даже с NTLMv2), в таком случае мне кажется проще использовать cntlm выстраивая цепочку подключений:
Telegram->(127.0.0.1:9050)tor->(127.0.0.1:3128)cntlm->(10.10.10.1:8080)proxy.mydom.ru

Пример конфига cntlm
Username	ivan.ivanov
Domain		mydom
PassNTLMv2      F6B8A23D4AB70827AED2AD4C8A9E1D7E

Proxy		10.77.252.96:8080
NoProxy		localhost, 127.0.0.*, 10.*, 192.168.*
Listen		0.0.0.0:3128

Allow		10.10.200.100
Allow		127.0.0.1
Allow		172.16.1.0/24
Allow		10.12.64.0/24


Генерация хэш пароля пользователя для записи в cntlm.ini
cntlm.exe -v -a NTLMv2 -d mydom -I -l 3128 -u ivan.ivanov -H

Всё, как сделать человеку хорошо? Сначала сделать плохо, а потом как было…
P.S. И то и другое легко запустить в качестве службы, и то и другое можно выставить за localhost.
Tags:
Hubs:
You can’t comment this publication because its author is not yet a full member of the community. You will be able to contact the author only after he or she has been invited by someone in the community. Until then, author’s username will be hidden by an alias.