Рабочее Зеркало 1Win

Самолетик 1вин

Вопросы, комментарии, багрепорты и запросы фич #4 #274

The text was updated successfully, but these errors were encountered:

Collaborator Author
z3APA3A commented Jun 4, 2018
awesome-enterprise commented Jun 8, 2018 •

Здравствуйте. Подскажите пожалуйста. Стоит задача реализовать прокси-сервер, который бы впускал по login:passwd и на каждый login:passwd был уникальный выходной ipv6 из заранее заданной подсети /64

Можно ли это реализовать при помощи 3proxy (на Ubuntu 18.04), при условии, что пользователей будет > 20к на один хост (канал позволяет)? Ничего фильтровать не надо. Просто вход-выход. Какие средства авторизации пользователей посоветуете использовать для такой задачи? Подойдёт ли RADIUS?

Если это возможно, то не могли бы вы подсказать соответствующий конфиг. Благодарю.

Collaborator Author
z3APA3A commented Jun 8, 2018 •

Большое количество соединений требует как минимум дополнительной настройки лимитов, подробности здесь: https://3proxy.ru/highload.asp
Настройка RADIUS в 3proxy описана здесь: #41
конфигурация в данном случае мнимальна, например

radius SECRET 192.168.0.1 192.168.0.2
auth radius
proxy -p3128
socks -p1080

внешний адрес должен прилетать от RADIUS-сервера в Framed-IPv6-Address

Но надо учитывать, что если активно будет использоваться http (не https) через proxy — будет очень много обращений к RADIUS, его так же придется оптимизировать чтобы устранить возможные задержки.

cruzy commented Jun 8, 2018

Здравствуйте, а когда зарелизите стабильную версию с поддержкой connlim?

awesome-enterprise commented Jun 8, 2018

Благодарю за информацию. Попробую настроить всё это

awesome-enterprise commented Jun 11, 2018

@z3APA3A Здравствуйте.
Подскажите, пожалуйста, по настройке прокси. Использую вот такой конфиг:

daemon nserver 8.8.8.8 nserver 8.8.4.4 nscache 65536 pidfile /var/run/3proxy/3proxy.pid users testuser:CL:bigsecret log /dev/null auth strong allow * * * 80-88,8080-8088 HTTP allow * * * 443,8443 HTTPS auth strong flush allow testuser maxconn 384 socks -n -a -i64.52.84.148 -e64.52.84.148 -p4001 -l/usr/local/3proxy/logs/socks.log proxy -n -a -i64.52.84.148 -e64.52.84.148 -p4002 -l/usr/local/3proxy/logs/proxy.log 

Когда пытаюсь подключиться к серверу через http, то всё окей:

curl.exe -v -x testuser:bigsecret@64.52.84.148:4002 http://check-host.net/ip * Trying 64.52.84.148. * TCP_NODELAY set * Connected to 64.52.84.148 (64.52.84.148) port 4002 (#0) * Proxy auth using Basic with user 'testuser' > GET http://check-host.net/ip HTTP/1.1 > Host: check-host.net > Proxy-Authorization: Basic dGVzdHVzZXI6Ymlnc2VjcmV0 > User-Agent: curl/7.60.0 > Accept: */* > Proxy-Connection: Keep-Alive > < HTTP/1.1 200 OK < Date: Mon, 11 Jun 2018 16:25:59 GMT < Content-Type: text/plain < Content-Length: 12 < Set-Cookie: __cfduid=dc205fd3c1e7113f8caeb684f486c0a1a1528734358; expires=Tue, 11-Jun-19 16:25:58 GMT; path=/; domain=.check-host.net; HttpOnly < X-Content-Type-Options: nosniff < Server: cloudflare < CF-RAY: 42956fcec3c898c5-LAX < Connection: keep-alive < 64.52.84.148* Connection #0 to host 64.52.84.148 left intact 

В логе появляется такая запись:
180611162559.133 4002 00000 testuser 178.218.202.62:60104 104.28.30.42:80 104 366 0 GET http://check-host.net/ip HTTP/1.1

Но когда пытаюсь достучатсья до https начинаются проблемы проблемы.

curl.exe -v -x https://testuser:bigsecret@64.52.84.148:4002 https://check-host.net/ip * Trying 64.52.84.148. * TCP_NODELAY set * Connected to 64.52.84.148 (64.52.84.148) port 4002 (#0) * ALPN, offering http/1.1 * TLSv1.2 (OUT), TLS handshake, Client hello (1): * error:1408F10B:SSL routines:ssl3_get_record:wrong version number * Closing connection 0 curl: (35) error:1408F10B:SSL routines:ssl3_get_record:wrong version number 

в логе появляется вот такая запись
180611162747.563 4002 00512 - 178.218.202.62:60108 64.52.84.148:0 0 0 0

При попытке подключиться вот так

curl.exe -v -x testuser:bigsecret@64.52.84.148:4002 https://check-host.net/ip * Trying 64.52.84.148. * TCP_NODELAY set * Connected to 64.52.84.148 (64.52.84.148) port 4002 (#0) * allocate connect buffer! * Establish HTTP proxy tunnel to check-host.net:443 * Proxy auth using Basic with user 'testuser' > CONNECT check-host.net:443 HTTP/1.1 > Host: check-host.net:443 > Proxy-Authorization: Basic dGVzdHVzZXI6Ymlnc2VjcmV0 > User-Agent: curl/7.60.0 > Proxy-Connection: Keep-Alive > * Recv failure: Connection was reset * Received HTTP code 0 from proxy after CONNECT * CONNECT phase completed! * Closing connection 0 curl: (56) Recv failure: Connection was reset 

в лог не добавляется никаких записей.
При попытке использоваться socks5 прокси, curl вообще отказывается подключаться

curl.exe -v --socks5-hostname testuser:bigsecret@64.52.84.148 :4001 http://check-host.net/ip * Trying 64.52.84.148. * TCP_NODELAY set * SOCKS5 communication to check-host.net:80 * Unable to receive initial SOCKS5 response. * Closing connection 0 curl: (7) Unable to receive initial SOCKS5 response. 

и в логе socks.log появляется вот такая запись
180611165146.882 4001 00412 - 178.218.202.62:57537 64.52.84.148:0 0 0 0 UNKNOWN 0.0.0.0:0
Если прописать в браузере настройки http и https прокси вот так
ya ru_proxy
то получаю вот такую ошибку при попытке подключения
ya_ru

lsof -i показывает, что подключение есть:

3proxy 2775 root 3u IPv4 1393134343 0t0 TCP socks-test:4002->178.218.202.62.ip.turontelecom.uz:60180 (ESTABLISHED) 3proxy 2775 root 4u IPv4 1393134345 0t0 TCP socks-test:54495->ya.ru:http (ESTABLISHED) 3proxy 2775 root 5u IPv4 1393177794 0t0 TCP socks-test:4002->178.218.202.62.ip.turontelecom.uz:60203 (ESTABLISHED) 3proxy 2775 root 7u IPv4 1393177796 0t0 TCP socks-test:34109->74.125.197.102:https (ESTABLISHED) 3proxy 2775 root 9u IPv4 1393085042 0t0 TCP socks-test:4001 (LISTEN) 3proxy 2775 root 11u IPv4 1393085043 0t0 TCP socks-test:4002 (LISTEN) 3proxy 2775 root 15u IPv4 1393134530 0t0 TCP socks-test:4002->178.218.202.62.ip.turontelecom.uz:60202 (ESTABLISHED) 3proxy 2775 root 16u IPv4 1393134532 0t0 TCP socks-test:41199->72.21.91.29:http (ESTABLISHED) 

В чем может быть проблема с подключением к https серверам? Почему ни curl, ни браузер не может к ним подключиться?
Почему curl не может подключиться к socks5? Это проблемы настройки 3proxy или может быть это проблемы самого VPS, на котором этот 3proxy крутится? Может хостер что-то блокирует?
Пытаюсь подключиться с разными конфигурациями уже дня 2 или 3. Ничего не получается. HTTP работает нормально, а HTTPS и SOCKS5 никак не заведутся.

Collaborator Author
z3APA3A commented Jun 12, 2018

В -x надо использовать http://, даже если клиент делает https:// запросы.
В терминах данной строки https:// это тип соединения между клиентом и прокси, https:// здесь это нечтно нестандартное, дополнительный TLS между клиентом и прокси-сервером (т.е. фактически двойной TLS), чтобы был такой тип прокси надо перез 3proxy поставить stunnel. Такая конфигурация неэффективна, если необходимо дополнительно шифровать трафик между клиентом и прокси лучше использовать VPN или IPSec.

awesome-enterprise commented Jun 12, 2018

@z3APA3A
С параметром -x понятно. Дополнительное шифрование между клиентом и прокси мне действительно не нужно.

Но почему при данной конфигурации я не могу подключиться к целевым хостам по https через прокси? Это проблема настроек 3proxy или что-то внешнее скидывает соединения?

Пробую подключиться и через браузер, и через curl.
Пытаюсь подключиться при использовании вот такого конфига:

daemon nserver 8.8.8.8 nserver 8.8.4.4 nscache 65536 pidfile /var/run/3proxy/3proxy.pid users testuser:CL:bigsecret log /dev/null auth strong allow * * * 80-88,8080-8088 HTTP allow * * * 443,8443 HTTPS auth strong flush allow testuser maxconn 384 socks -n -a -i64.52.84.148 -e64.52.84.148 -p4001 -l/usr/local/3proxy/logs/socks.log proxy -n -a -i64.52.84.148 -e64.52.84.148 -p4002 -l/usr/local/3proxy/logs/proxy.log 

Если попробовать запросить страницу https://google.com то запрос проходит нормально

curl.exe -v -x http://testuser:bigsecret@64.52.84.148:4002 https://google.com * Rebuilt URL to: https://google.com/ * Trying 64.52.84.148. * TCP_NODELAY set * Connected to 64.52.84.148 (64.52.84.148) port 4002 (#0) * allocate connect buffer! * Establish HTTP proxy tunnel to google.com:443 * Proxy auth using Basic with user 'testuser' > CONNECT google.com:443 HTTP/1.1 > Host: google.com:443 > Proxy-Authorization: Basic dGVzdHVzZXI6Ymlnc2VjcmV0 > User-Agent: curl/7.60.0 > Proxy-Connection: Keep-Alive > < HTTP/1.0 200 Connection established < * Proxy replied 200 to CONNECT request * CONNECT phase completed! * ALPN, offering h2 * ALPN, offering http/1.1 * successfully set certificate verify locations: * CAfile: C:\Users\User\Downloads\curl-7.60.0-win32-mingw\bin\curl-ca-bundle.crt CApath: none * TLSv1.2 (OUT), TLS handshake, Client hello (1): * CONNECT phase completed! * CONNECT phase completed! * TLSv1.2 (IN), TLS handshake, Server hello (2): * TLSv1.2 (IN), TLS handshake, Certificate (11): * TLSv1.2 (IN), TLS handshake, Server key exchange (12): * TLSv1.2 (IN), TLS handshake, Server finished (14): * TLSv1.2 (OUT), TLS handshake, Client key exchange (16): * TLSv1.2 (OUT), TLS change cipher, Client hello (1): * TLSv1.2 (OUT), TLS handshake, Finished (20): * TLSv1.2 (IN), TLS handshake, Finished (20): * SSL connection using TLSv1.2 / ECDHE-ECDSA-CHACHA20-POLY1305 * ALPN, server accepted to use h2 * Server certificate: * subject: C=US; ST=California; L=Mountain View; O=Google LLC; CN=*.google.com * start date: May 23 09:58:17 2018 GMT * expire date: Aug 15 09:08:00 2018 GMT * subjectAltName: host "google.com" matched cert's "google.com" * issuer: C=US; O=Google Trust Services; CN=Google Internet Authority G3 * SSL certificate verify ok. * Using HTTP2, server supports multi-use * Connection state changed (HTTP/2 confirmed) * Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0 * Using Stream ID: 1 (easy handle 0x13ca058) >GET / HTTP/2 > Host: google.com > User-Agent: curl/7.60.0 > Accept: */* > * Connection state changed (MAX_CONCURRENT_STREAMS == 100)! < HTTP/2 301 < location: https://www.google.com/ < content-type: text/html; charset=UTF-8 < date: Tue, 12 Jun 2018 12:30:31 GMT < expires: Thu, 12 Jul 2018 12:30:31 GMT < cache-control: public, max-age=2592000 < server: gws < content-length: 220 < x-xss-protection: 1; mode=block < x-frame-options: SAMEORIGIN < alt-svc: quic=":443"; ma=2592000; v="43,42,41,39,35" <  301 Moved 

301 Moved

The document has moved here. * Connection #0 to host 64.52.84.148 left intact

В логах появляется такая запись

cat /usr/local/3proxy/logs/proxy.log . 180612123031.790 4002 00094 testuser 178.218.202.62:51540 74.125.197.139:443 535 4013 0 CONNECT google.com:443 HTTP/1.1 . 

При попытке запросить данные у https://twitter.com, тоже всё окей

curl.exe -v -x http://testuser:bigsecret@64.52.84.148:4002 https://twitter.com * Rebuilt URL to: https://twitter.com/ * Trying 64.52.84.148. * TCP_NODELAY set * Connected to 64.52.84.148 (64.52.84.148) port 4002 (#0) * allocate connect buffer! * Establish HTTP proxy tunnel to twitter.com:443 * Proxy auth using Basic with user 'testuser' > CONNECT twitter.com:443 HTTP/1.1 > Host: twitter.com:443 > Proxy-Authorization: Basic dGVzdHVzZXI6Ymlnc2VjcmV0 > User-Agent: curl/7.60.0 > Proxy-Connection: Keep-Alive > < HTTP/1.0 200 Connection established < * Proxy replied 200 to CONNECT request * CONNECT phase completed! * ALPN, offering h2 * ALPN, offering http/1.1 * successfully set certificate verify locations: * CAfile: C:\Users\User\Downloads\curl-7.60.0-win32-mingw\bin\curl-ca-bundle.crt CApath: none * TLSv1.2 (OUT), TLS handshake, Client hello (1): * CONNECT phase completed! * CONNECT phase completed! * TLSv1.2 (IN), TLS handshake, Server hello (2): * TLSv1.2 (IN), TLS handshake, Certificate (11): * TLSv1.2 (IN), TLS handshake, Server key exchange (12): * TLSv1.2 (IN), TLS handshake, Server finished (14): * TLSv1.2 (OUT), TLS handshake, Client key exchange (16): * TLSv1.2 (OUT), TLS change cipher, Client hello (1): * TLSv1.2 (OUT), TLS handshake, Finished (20): * TLSv1.2 (IN), TLS handshake, Finished (20): * SSL connection using TLSv1.2 / ECDHE-RSA-AES128-GCM-SHA256 * ALPN, server accepted to use h2 * Server certificate: * subject: businessCategory=Private Organization; jurisdictionC=US; jurisdictionST=Delaware; serialNumber=4337446; C=US; ST=California; L=San Francisco; O=Twitter, Inc.; OU=Twitter Security; CN=twitter.com * start date: Feb 23 00:00:00 2018 GMT * expire date: Apr 8 12:00:00 2019 GMT * subjectAltName: host "twitter.com" matched cert's "twitter.com" * issuer: C=US; O=DigiCert Inc; OU=www.digicert.com; CN=DigiCert SHA2 Extended Validation Server CA * SSL certificate verify ok. * Using HTTP2, server supports multi-use * Connection state changed (HTTP/2 confirmed) * Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0 * Using Stream ID: 1 (easy handle 0x2c1a058) >GET / HTTP/2 > Host: twitter.com > User-Agent: curl/7.60.0 > Accept: */* > * Connection state changed (MAX_CONCURRENT_STREAMS == 100)! < HTTP/2 200 < cache-control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0 < content-length: 149134 < content-type: text/html;charset=utf-8 < date: Tue, 12 Jun 2018 12:33:58 GMT < expires: Tue, 31 Mar 1981 05:00:00 GMT < last-modified: Tue, 12 Jun 2018 12:33:58 GMT < pragma: no-cache < server: tsa_a < set-cookie: fm=0; Expires=Tue, 12 Jun 2018 12:33:49 GMT; Path=/; Domain=.twitter.com; Secure; HTTPOnly < set-cookie: _twitter_sess=BAh7CSIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo{4da25db54bad1085e3ef05183871d612d4c938830d232092782bccfd6d9ee3bd}250ASGFzaHsABjoKQHVzZWR7ADoPY3JlYXRlZF9hdGwrCGIS{4da25db54bad1085e3ef05183871d612d4c938830d232092782bccfd6d9ee3bd}252FfNjAToMY3NyZl9p{4da25db54bad1085e3ef05183871d612d4c938830d232092782bccfd6d9ee3bd}250AZCIlOWRjZDcyNTJlNmJkYmZhMDAwMmM5MDVjMzllNjBlZjU6B2lkIiVkMWNk{4da25db54bad1085e3ef05183871d612d4c938830d232092782bccfd6d9ee3bd}250AOTkwOTEzZTgyNjE1YTJjMDM4NDBkMWM0OGI5YQ{4da25db54bad1085e3ef05183871d612d4c938830d232092782bccfd6d9ee3bd}253D{4da25db54bad1085e3ef05183871d612d4c938830d232092782bccfd6d9ee3bd}253D--e50bad1c838150621e6c09b2e22e6eeb264c76e4; Path=/; Domain=.twitter.com; Secure; HTTPOnly < set-cookie: personalization_id="v1_rXBidBG37PKNJSZrix5vNg= auto">В логах появляется вот такая запись: 
cat /usr/local/3proxy/logs/proxy.log

. 180612123400.109 4002 00000 testuser 178.218.202.62:51547 104.244.42.129:443 626 155717 0 CONNECT twitter.com:443 HTTP/1.1 . 

Но при попытке подключиться к https://check-host.net или к https://ya.ru curl выдает следующее:

curl.exe -v -x http://testuser:bigsecret@64.52.84.148:4002 https://check-host.net/ip * Trying 64.52.84.148. * TCP_NODELAY set * Connected to 64.52.84.148 (64.52.84.148) port 4002 (#0) * allocate connect buffer! * Establish HTTP proxy tunnel to check-host.net:443 * Proxy auth using Basic with user 'testuser' > CONNECT check-host.net:443 HTTP/1.1 > Host: check-host.net:443 > Proxy-Authorization: Basic dGVzdHVzZXI6Ymlnc2VjcmV0 > User-Agent: curl/7.60.0 > Proxy-Connection: Keep-Alive > * Recv failure: Connection was reset * Received HTTP code 0 from proxy after CONNECT * CONNECT phase completed! * Closing connection 0 curl: (56) Recv failure: Connection was reset 
curl.exe -v -x http://testuser:bigsecret@64.52.84.148:4002 https://ya.ru * Rebuilt URL to: https://ya.ru/ * Trying 64.52.84.148. * TCP_NODELAY set * Connected to 64.52.84.148 (64.52.84.148) port 4002 (#0) * allocate connect buffer! * Establish HTTP proxy tunnel to ya.ru:443 * Proxy auth using Basic with user 'testuser' > CONNECT ya.ru:443 HTTP/1.1 > Host: ya.ru:443 > Proxy-Authorization: Basic dGVzdHVzZXI6Ymlnc2VjcmV0 > User-Agent: curl/7.60.0 > Proxy-Connection: Keep-Alive > * Recv failure: Connection was reset * Received HTTP code 0 from proxy after CONNECT * CONNECT phase completed! * Closing connection 0 curl: (56) Recv failure: Connection was reset 

В логах никаких записей не появляется

tcpdump выдает вот такую информацию при подключении

# tcpdump port 4002 -vv -i eth0 tcpdump: listening on eth0, link-type EN10MB (Ethernet), capture size 262144 bytes 12:27:24.099559 IP (tos 0x0, ttl 104, id 17984, offset 0, flags [DF], proto TCP (6), length 52) 178.218.202.62.ip.turontelecom.uz.51534 > socks-test.4002: Flags [S], cksum 0xb802 (correct), seq 214867821, win 8192, options [mss 1460,nop,wscale 8,nop,nop,sackOK], length 0 12:27:24.099606 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto TCP (6), length 52) socks-test.4002 > 178.218.202.62.ip.turontelecom.uz.51534: Flags [S.], cksum 0x1208 (incorrect -> 0x048f), seq 907081706, ack 214867822, win 42340, options [mss 1460,nop,nop,sackOK,nop,wscale 11], length 0 12:27:24.323006 IP (tos 0x0, ttl 104, id 17985, offset 0, flags [DF], proto TCP (6), length 40) 178.218.202.62.ip.turontelecom.uz.51534 > socks-test.4002: Flags [.], cksum 0xe9c9 (correct), seq 1, ack 1, win 256, length 0 12:27:24.336001 IP (tos 0x0, ttl 104, id 13330, offset 0, flags [none], proto TCP (6), length 40) 178.218.202.62.ip.turontelecom.uz.51534 > socks-test.4002: Flags [R.], cksum 0x6d4d (correct), seq 1, ack 1, win 32120, length 0 

В чем может быть проблема подключения к серверу по https? Это можно как-то исправить?

[d-parser.text.asis count="4-9"]

[d-parser.text.asis count="4-5"]:

  • 1win отыгрыш бонуса
  • 1win мобильная
  • 1win зеркало рабочее на сегодня прямо
  • букмекерская контора 1win ежедневный бонус
  • 1win ставки