ãããŠãããã§äžåœã®å åŒã®äººã ã¯ç§ãã¡ã«è±ªè¯ãªèŽãç©ãããŸããã 2012幎以æ¥ã圌ãã¯ç¡æã®ãªãŒãã³ãœãŒã¹Shadowsocksãããžã§ã¯ããèŠãŠããŸããã ããã¯ã次ã®ååã«åŸã£ãŠæ©èœãããµãŒããŒãšã¯ã©ã€ã¢ã³ãã®ããã°ã©ã ã®ãã¢ã§ããã¯ã©ã€ã¢ã³ãã¯SOCKS5ãããã·ãµãŒããŒã§ãããçä¿¡æ¥ç¶ãåä¿¡ããããããæå·åãããµãŒããŒã«ãããŒããã£ã¹ãããã€ã³ã¿ãŒãããäžã§ãããã解æŸããŸãã ã€ãŸããåäœåçã¯SSHãã³ãã«ã«äŒŒãŠããŸãããããã«æ¯ã¹ãŠå€ãã®é·æãšçæããããŸãã
Shadowsocksã®å©ç¹
- ãµãŒããŒæ§æã®å®¹æãïŒä»¥äžã§ã¯ãæšæºæ§æã5è¡ã®ã¿ã§ããã蚌ææžã«ç ©ããããå¿ èŠããªãããšã瀺ããŸãã ãŸããæ¬åœã«ãç§ãã¡ã¯éè¡ãããã¯ãŒã¯ãè¡ã£ãŠããŸããã
- ã¯ã©ã€ã¢ã³ãã®ã»ããã¢ãããç°¡åã ãã¹ãŠã®ããã®ã¯ã©ã€ã¢ã³ãããããŸã ãç§ã¯å€§ããªèšèãæããŠããŸããã ã¯ã©ã€ã¢ã³ãæ§æã¯åã5è¡ã§ãã
- ã¯ã©ã€ã¢ã³ãã¯æ©èœããããã«ç®¡çè æš©éãå¿ èŠãšããŸããã ããã ãã§ãªããpipããã€ã³ã¹ããŒã«ããããšãã§ããŸãã ã€ãŸããããã°ã©ããŒã¯ä»äºããæ¥ç¶ããããšãã§ããŸãã
- åã ã®ããã°ã©ã ã®ã¬ãã«ã§ã¢ã¯ã»ã¹ãç°¡åã«æ§æã§ããŸãã ãã©ãŠã¶ã§ã¯ãFoxyProxy / OmegaSwitchyãªã©ã®ã¢ããªã³ã®å©ããåããŠãäžè¬çã«è€éãªã«ãŒã«ã«åŸã£ãŠåã ã®ã¢ãã¬ã¹ã®ã¬ãã«ã«ãªããŸãã VPNã䜿çšããå Žåãããã¯åã¯ã©ã€ã¢ã³ãã§ããŒã«ã«ãããã·ãäžããããšã«ãã£ãŠã®ã¿éæã§ããŸãã
- ã»ãšãã©ã®ã·ã¹ãã ã§ä»®æ³ãããã¯ãŒã¯ã«ãŒããä»ããŠå®è£ ãããVPNãšã¯ç°ãªããShadowsocksã¯ã©ã€ã¢ã³ãã¯æ¥ç¶ãåæãããŠãæ¶ããŸããã ãã®ããããã©ãã£ãã¯ã¯ç¡é²åãªæ¹æ³ã§åç¬ã§éä¿¡ãããããšã¯ãããŸããã ããã«ãShadowsocksã¢ããªã±ãŒã·ã§ã³èªäœãã¯ã©ãã·ã¥ããå Žåã§ããããããããã«æ§æãããŠããªãéããããã°ã©ã ã¯çŽæ¥ã¢ã¯ã»ã¹ããŸããã VPNã䜿çšããå Žåããã«ã¹ã€ãããå®è£ ããå¿ èŠããããç¹ã«Windowsã§ã¯ããããã¯ä¿¡é Œæ§ãäœããå¯äœçšããããŸãã
- SSHãã³ãã«ãšæ¯èŒãããšãããã¯ãããããããå€æ°ã®æ¥ç¶ãæã€æ°åã®ã¯ã©ã€ã¢ã³ãããµããŒããã倧ããªåž¯åå¹ ã§ãã ããšãã°ãæ¥æµäžã®SSHãã³ãã«ãéåžžã«æ²ããã ããã«ãå°ããªãããã¯ãŒã¯ã®äžèŠåæ§ã«ãããé床ãå€§å¹ ã«äœäžããŸãã Shadowsocksã¯æ°ã«ããŸããã
- æ¥ç¶ã«é¢ããæè¡çãªæ å ±ãå°ãªããªããã¢ãã€ã«ããã€ã¹ã®ããããªãŒã«ãšã£ãŠæå©ã§ãã
- ããŸããŸãªèšèªã®ã©ã€ãã©ãªã®åœ¢åŒã§èšè¿°ããããµãŒããŒã®ãšããŸããã¯ãªããŒãžã§ã³ããããŸãã ã€ãŸãããµãŒããŒãããã°ã©ã ã«è¿œå ããŠãã¯ã©ã€ã¢ã³ããžã®ã¢ã¯ã»ã¹ãæå·åã§ããŸãã
- ã¯ã©ã€ã¢ã³ãã®ã°ã©ãã£ãã¯ã«ã¹ã¿ãã€ãºã æºåž¯é»è©±ãšWindowsã®ã©ã®ã¯ã©ã€ã¢ã³ããèªåã§èšå®ãããŠããããã¹ãã£ã³ãããšãã«ãQRã³ãŒããäœæã§ããŸãã 1ã€ã®ã¯ã©ã€ã¢ã³ããWindowsçšã«æ§æãããã³ãŒããçæããã1åã§20å°ã®æºåž¯é»è©±ã«æ£ãã°ã£ãŠããŸããã ãµã€ãã«çœ®ãããå£ã«æããããšãã§ããŸãã
ã·ã£ããŠãœãã¯ã¹ã®æ¬ ç¹
- OpenVPNãšã¯ç°ãªããå ¬åŒã®ç£æ»ã«ã¯åæ ŒããŸããã§ããã ã ããå€ãã®äººã圌ãèŠãŠãå©çã¯ãªãŒãã³ã§å°ããã§ãããå ¬åŒã«ã¯-ãããã
- ãŠãŒã¶ãŒãå ±æããŸããã ç°ãªããã¹ã¯ãŒãã䜿çšããŠè€æ°ã®ããŒãã§ãªãã¹ã³ããããšãæããããšãã§ããŸããã1ã€ã®ããŒãã§-1ã€ã®ãã¹ã¯ãŒãã䜿çšããŸãã ãã¹ã¯ãŒããç¥ã£ãŠããŠããïŒçè«çã«ã¯ïŒåãããŒãã®å¥ã®ãµãã¹ã¯ã©ã€ããèãããšã¯ã§ããŸããã
- ããŒããå察æ¹åã«è»¢éããæ¹æ³ãããããŸããã ã€ãŸãã誰ããNATã®èåŸã«åº§ã£ãŠããŸãã å¯èœã§ããã°ãSSHãã³ãã«ã䜿çšããå¿ èŠããããŸãã
- Androidã®ã¯ã©ã€ã¢ã³ãã¯ãæ倧2ã€ã®ïŒïŒïŒä¿®æ£ã¡ãã»ãŒãžãä¿æããŸãã ããããé衚瀺ã«ããªããšãéåžžã«éªéã«ãªããŸãã
- Shadowsocksã«é©åããªãããŒãã³ã¢ã®Winduããã°ã©ã ãããã€ããããŸãããããã¯èšå®ããªãããã§ãã æ²ããããªãããã°ã©ã ã®äœæè ã¯ãããã·èšå®ãç¡èŠããããã«æ¥ç¶ã®éå§ãèšè¿°ã§ããŸãããŸãããœãããŠã§ã¢ã©ã€ã»ã³ã¹ããã§ãã¯ãããšãã«ãããè¡ãããšããããŸãã 以äžã«ããããã®ããã°ã©ã ãèªèããæ¹æ³ã説æããŸãã
- æ¥ç¶ã®ã¬ã€ãã³ã·ã¯OpenVPNã®ã¬ã€ãã³ã·ãããé«ããªã£ãŠããŸãã ããã»ã©å€ãã¯ãããŸããããè²åã¯å€ããããŸãããããã§ãã§ãã
- ã¢ãŒã«ã€ãã§ãã©ãã£ãã¯ãå§çž®ããæ¹æ³ãããããŸããã HTTPSæ代ã§ã¯ãããã¯éèŠã§ã¯ãããŸããããããšãã°ãéå§çž®ããã¹ããã¡ã€ã«ãšå®éã®Ubuntaã€ã¡ãŒãžã§ã¯éãããããŸãã
- ãã®ããã¥ã¡ã³ãã¯ãäžåœäººã«ãã£ãŠäžåœèªã®è±èªã§æžãããŠãããå€ãã®æ¬ èœç¹ãšçžäºççŸããããŸãã
ShadowsocksãµãŒããŒã®ã»ããã¢ããã æ¹æ³1
æ§æãäœæããŠããŸãã 以äžã¯å®å šã«æ©èœããèšå®ã®äŸã§ãã
{ "server":"111.222.333.444", "server_port":8390, "local_port":1080, "password":"buratino.ty.sam.sebe.vragg", "timeout":60, "method":"aes-256-cfb", "fast_open": true }
ããã¯ããµãŒããŒãšã¯ã©ã€ã¢ã³ãã®äž¡æ¹ã®æ§æã§ãã ãµãŒããŒã®ã¢ãã¬ã¹ãšããŒããé çªã«ååŸããŸãïŒå°ãªããšã80çªç®ã¯å¯èœã§ãïŒã ã¯ã©ã€ã¢ã³ããæ¥ç¶ãåãå ¥ããããŒãïŒè§Šããªãã»ããããïŒã ãã¬ãŒã³ããã¹ãã®ãã¹ã¯ãŒãã ãµãŒããŒãäžèŠãªãã£ãã«ãéãããŸã§ã®ç§æ°ã æåŸã®2ã€ã«ã€ããŠè©³ãã説æããŸãã
Shadowsocksã«ã¯å€æ°ã®æå·åæ¹åŒããããŸãããé©çšã§ããã®ã¯2ã€ã ãã§ãã chacha20-ietf-poly1305ã¯ããããšã«J.ããŒã³ã¹ã¿ã€ã³ã«ãã£ãŠäœæãããã¢ã«ãŽãªãºã ã§ãGoogleãå éšã§äœ¿çšããããã«éçºããŸããã AESãããŒããŠã§ã¢åããæ¹æ³ãããããªãããã€ã¹ã«é©ããŠããŸãããããã¯éåžžã«å®äŸ¡ãªæºåž¯é»è©±ããã®ä»ã®ã¹ããŒãã¢ã€ãã³ã§ãã ããã»ããµå ã®ããã¯ããŒã¯ãæããåŠæ³çãªäººã ã®ããã«ã ä»ã®ãã¹ãŠã®äººã¯aes-256-cfbã䜿çšããŸãã ãã ããäž¡æ¹ã®æå·ã¯ä¿¡é Œæ§ãé«ããå®çžŸããããŸãã
fast_openãèšå®ãããšãæ¥ç¶ã®åŸ ã¡æéãççž®ãããŸãããå°ãªããšã3.7ã®ã«ãŒãã«ãå¿ èŠã§ãã ãŸããããã§ãåžžã«æ©èœãããšã¯éããŸãããç¹ã«ãä»®æ³ãã·ã³ãOpenVZã§äœæãããŠããå Žåã¯æ©èœããŸããã Scaleway-sky ARMã§ãèµ·åããŸããã§ããã äžè¬ã«ãæ©èœããå Žåã¯ãªã³ã«ããŸãã
æ§æã®æºåãã§ããã®ã§ãããã±ãŒãžãã€ã³ã¹ããŒã«ããŸãã ããã§ã¯ã2ã€ã®ããŒãžã§ã³ãããããšãæ確ã«ããå¿ èŠããããŸãã ãã shadowsocksã¯Pythonã§æžããããªãã¡ã¬ã³ã¹ã§ããã shadowsock-libevãåãã§ãããé床ã®ããã«çŽç²ãªCã§æžãçŽãããŠããŸãã ããã«å ¥ããŸãã ææ°ã®Linuxã§ã¯ã¡ã€ã³ã«ãã«ãããŸã ãå€ãã«ãã«ã€ããŠã¯ããã¡ããåç §ããŠãã ãã ã
ããŠãå®è¡ïŒss-server -c config.confã ãã¹ãŠãæ©èœããã¯ãã§ãã ãã¡ã€ã¢ãŠã©ãŒã«ãšèªåå®è¡ãå¿ããªãã§ãã ããã Linuxã®ç®¡çã«ã€ããŠã¯èª¬æããŸããã®ã§ãããŸããããªãå Žåã¯æ¹æ³2ã«é²ãã§ãã ããã
æ¹æ³2
dockerããã³docker-composeãã€ã³ã¹ããŒã«ããŸãã
apt install docker docker-compose
ããã«ã
docker-compose.yml
ãšããååã®ãã¡ã€ã«ã«ã次ã®ãããªæ§æãèšè¿°ããŸãã
version: '3' services: shadowsocks: image: shadowsocks/shadowsocks-libev:latest environment: - TZ=Europe/Moscow - PASSWORD=buratino.ty.sam.sebe.vragg - METHOD=aes-256-cfb - ARGS=--fast-open ports: - "8390:8390" - "8390:8390/udp" restart: unless-stopped
ã€ã³ãã³ãã«æ³šæããŠãã ããããããã¯éèŠã§ãã å¿ èŠã«å¿ããŠãç°ãªãããŒãã§ç°ãªããã¹ã¯ãŒãã§è€æ°ã®ãµãŒããŒãäžåºŠã«äžããããšãã§ããŸããããã«ã¯ãshadowsocksãããã¯å šäœãç°ãªãååã§è€è£œããã ãã§ãã æ§æã®æºåãã§ããããåããã©ã«ããŒã§å®è¡ããŸã
docker-compose up -d
ãããŠãã¹ãŠãå§ãŸããŸãã Dockerã¯ãããªãèªèº«ã§ãããå¿ èŠãªããåããŒãããšã«ãã¡ã€ã¢ãŠã©ãŒã«ã«ç©ŽãéããŸãã
顧客ã®æ§æ
ããã§ã¯ãã¹ãŠãç°¡åã§ãã ç§ãã¡ã¯ãµã€ãã«è¡ããç®çã®ã¯ã©ã€ã¢ã³ããããŠã³ããŒãããã€ã³ã¿ãŒãã§ãŒã¹ã§èšå®ããŸãã ãã¡ãããLinuxoidã«ã¯ãæ¹æ³1ã®èšå®ãåŠçããã³ã³ãœãŒã«ããŒã¢ã³ããããŸãã
ã¯ã©ã€ã¢ã³ããã»ããã¢ãããããšãSOCKS5ãããã·ãã·ã¹ãã ã®ããŒã1080ã«çœ®ãããŸããããã©ã«ãã§ã¯å€éšããã¢ã¯ã»ã¹ã§ããŸããã ãã ãã䜿ããããLANã«ããå Žåã¯éãããšãã§ããŸãã ããã°ã©ã èªäœãããã§äžæããªãããšãç解ããããšãéèŠã§ãã ã·ã¹ãã ãããã·ïŒãã¹ãŠã®ããã°ã©ã ãSocksãééããããã«ããå ŽåïŒãŸãã¯åããã°ã©ã ãåå¥ã«æ§æããå¿ èŠããããŸããããããåé¡ã«ãªããªãããšãæãŸããã§ãã Windows 10ã§ã¯ãã³ã³ãããŒã«ããã«ã«[ãããã¯ãŒã¯ãšã€ã³ã¿ãŒããã]â[ãããã·]é ç®ããããŸãã ããã§ããããã·ã¢ãã¬ã¹127.0.0.1ãèšå®ãããããŒãïŒ1080ïŒãå ¥åããããŒã«ã«ãããã¯ãŒã¯ïŒéåžžã¯192.168.0.1/24ãèªåã§ç¢ºèªããŸãïŒããã³ãµãŒããŒIPèªäœãç¡èŠããå¿ èŠããããŸãã 誰ããLinux Subsystemã䜿çšããå Žåããã®æ§æã¯é©çšãããŸããã ããã§socks5_proxyå€æ°ã宣èšããå¿ èŠããããŸãã æ¬æ ŒçãªLinuxã§ã¯ãéåžžãã³ã³ãããŒã«ããã«ã®èšå®ãåãã§ãã ãã©ãŠã¶ã®å ŽåãFoxyProxyïŒFFïŒãSwitchyOmegaïŒChromeïŒãªã©ã®ã¢ããªã³ã䜿çšããŠããããã·ãçµç±ãããµã€ããšçŽæ¥ã¢ã¯ã»ã¹ãããµã€ãã埮調æŽããããšããå§ãããŸãã ç¹ã«ããããã€ããŒã®ãªãœãŒã¹ãå Žåã«ãã£ãŠã¯éè¡ãžã®çŽæ¥ã¢ã¯ã»ã¹ãæ§æããå¿ èŠããããŸãã ãŸããæµ·å€ã®ã¢ã«ãŠã³ãã§Mosenergosbytãé©ãããªãããšããå§ãããŸã-圌ãã¯ãã§ã«ããçš®ã®å æ°ãªäººã§ãã å¥åŠãªããšã«ãPaypalã¯é»çã«æ¥ç¶ããŠããŸãã ããããã·çµç±ã®DNSãããã¯ã¹ããã§ãã¯ããããšãå¿ããªãã§ãã ããããŸãã¯ãããã©ã«ãã§ããã§ããããšã確èªããŠãã ããã
äœæ¥ç¢ºèª
ãã®æç¹ã§ããã¹ãŠãæ©èœããã¯ãã§ãã 2ã€ã®ãã¹ããè¡ãå¿ èŠããããŸãã ãŸãã httpsïŒ//duckduckgo.com/ã«ã¢ã¯ã»ã¹ããæ€çŽ¢ãã©ãŠã¶ãŒã«èªåã®IPãå ¥åããŸã ãã¡ã€ã³IPã¢ãã¬ã¹ã§ã¯ãªããããªããã£ããªãããã¯ã¹åãããã IP ã¢ãã¬ã¹ãå ¥åã㊠ãã ãã ã ã¢ãã¬ã¹ã¯ãµãŒããŒåŽã§ããå¿ èŠããããŸãã 次ã«ãã¯ã©ã€ã¢ã³ãèšå®ã§ééã£ããã¹ã¯ãŒããå ¥åãããã¹ãŠã®ããã°ã©ã ãæ©èœããªããªã£ãããšã確èªããŸãã ããã¯ãããã°ã©ã ããããã·ãå·¡åããªãããšã®ç¢ºèªã§ãã
è¿œå
Shadowsocksã«è¿œå ãããæ©èœã«ã€ããŠèª¬æããŸããããããã®æ§æã«ã€ããŠã¯è©³ãã説æããŸããã ã©ããèããŠãã ããã
ããªã ããã€ãã®å€ä»£ãŸãã¯ææ°ã®[er / oro]ããã°ã©ã ã¯SOCKS5ã®æ¹æ³ãç¥ããŸãããã HTTP_PROXYãå®è¡ã§ããŸã ã ç¹ã«ãAndroidã®å ¬åŒTwitterã¯ã©ã€ã¢ã³ãã¯ãShadowsocksãæºåž¯é»è©±ã§ã¯ãªãã«ãŒã¿ãŒãªã©ã«ã€ã³ã¹ããŒã«ãããŠããå ŽåãShadowsocksã®äœ¿çšæ¹æ³ããŸã èªèããŠããŸããã ãã®å ŽåãPolipo http_proxyãµãŒããŒãã€ã³ã¹ããŒã«ãããã®èšå®ã§Shadowsocksãžã®ãªãã€ã¬ã¯ããæå®ã§ããŸãã ãã¹ãŠã®httpãããã·ããã°ã©ã ã¯å¿ èŠæ§ãå°ããããæŸæ£ãããŠããŸããããããŸã§ã®ãšããPolipoã¯åé¡ãªãåäœããŠããŸãã
obfs-proxy ã Shadowsocksãã©ãã£ãã¯ãã¯ãªãŒã³ã§ç®ç«ããªãSSLã§ã©ããã§ããããã«ãããããããŒã443ã§èš±å¯ããŸããããã¯ããã§ã«ãããã³ã«ã®ãã¯ã€ããªã¹ããããå Žåã§ãã
KCPTUN KCPãããã³ã«ã¯ãUDPãä»ããã¢ããªã³ã§ãããåä¿¡ééã®ã»ã«ã©ãŒã¢ãã ã察æµåç¡ç·ãªã¬ãŒéä¿¡ãªã©ãæ倱ã®å€§ããéåžžã«å£æªãªãããã¯ãŒã¯ã§åäœããŸãã KCPã䜿çšãããšãçŽç²ãªUDPãããå°ãéãéä¿¡ã§ããŸããShadowsocksã¯ãKCPã§ãã©ãã£ãã¯ãã©ããããéåžžã«äŸ¿å©ãªæ¹æ³ã§ãã
Fail2banãèšå®ããŠãDDOSã®è©Šè¡ããµãŒããŒã«åçºãããã®ã¯ããããšã§ãã ããããããªããåŠç«¥ãæãããªããªãã誰ãããªããDDOSitããŸããïŒ ãã¹ã¯ãŒãã1åã§ãæºåž¯é»è©±ã«å ¥åããå¿ èŠããªãããããã¹ã¯ãŒãããã確å®ã«èšå®ããŠãã ãããå¿é ããå¿ èŠã¯ãããŸããã ç§ã®å®éã®ãã¹ã¯ãŒãã¯40ã®ã©ã³ãã ãªæåã§ãã
ããã ãã§ãïŒ